-
Notifications
You must be signed in to change notification settings - Fork 238
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
classname:_init is inherited exactly one level and that is confusing #288
Comments
Looking at the Is there some reason _init could not be "fat inherited" into the class object the same way methods are? |
Is there any progress on including this? I just spent quite a while bashing my head against an issue that turns out to have it's root in my expectation of this exact things being fixed. |
I am a longtime user of Penlight, I make especially heavy use of the class module.
I found something today. I check out a copy of Penlight 1.6.0. I run
lua5.1
and run the following:B inherits from A, C inherits from B. Only A has an explicit constructor. B inherits A's constructor, but C does not inherit a constructor.
This feels like a bug, it's not in the documentation. In my testing, methods other than _init can be implicitly inherited multiple levels deep without problems.
My expected behavior is that if I don't override the constructor, it should be inherited as many levels deep as the hierarchy goes.
The text was updated successfully, but these errors were encountered: