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

"super" in constructor class does not works fine #166

Open
CriztianiX opened this issue Nov 17, 2014 · 2 comments
Open

"super" in constructor class does not works fine #166

CriztianiX opened this issue Nov 17, 2014 · 2 comments

Comments

@CriztianiX
Copy link

I have this schema

Class A <- Class B <- Class C

In "Class C" I overwrite the constructor "new" method, then I call super!, but constructor of ClassA is not executed, then I have to do a "new" method in ClassB and call "super!!"

@leafo
Copy link
Owner

leafo commented Nov 17, 2014

Is this what you're doing? Seems to work for me.

class A
  new: =>
    print "hello from a"

class B extends A

class C extends B
  new: =>
    print "hello from c"
    super!

C!

Output

hello from c
hello from a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants