Skip to content

Inherited class constructor with 2 params #516

@mtshiba

Description

@mtshiba

Describe the bug?

@Inheritable
C = Class { .x = Int; .y = Int }
C.
    new x: Int, y: Int = C { .x; .y }

D = Inherit C

d = D.new(1, 2)
assert d.y == 2

Reproducible code

No response

Expected result

OK

Actual result

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "test.er", line -1, in <module>
TypeError: new() takes 1 positional argument but 2 were given

Additional context

No response

Erg version

0.6.40

Python version

Python3.11

OS

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions