Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inherited class constructor with 2 params #516

Open
mtshiba opened this issue Jul 24, 2024 · 0 comments
Open

Inherited class constructor with 2 params #516

mtshiba opened this issue Jul 24, 2024 · 0 comments
Labels
bug Something isn't working bug-codegen

Comments

@mtshiba
Copy link
Member

mtshiba commented Jul 24, 2024

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

@mtshiba mtshiba added bug Something isn't working bug-codegen labels Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bug-codegen
Projects
None yet
Development

No branches or pull requests

1 participant