We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Putting @:structInit on a child class auto-generates a constructor that doesn't initialize the final fields of the base class, which seems unsound:
@:structInit
final
function main() { final child:Child = {s: ""}; trace(child.i); // undefined } class Base { public final i:Int; public function new(i:Int) { this.i = i; } } @:structInit class Child extends Base { public final s:String; }
If Base is itself a @:structInit class without an explicitly declared constructor, you get the compile-time error you would probably expect:
Base
source/Main.hx:3: characters 23-30 : Object requires field i
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Putting
@:structInit
on a child class auto-generates a constructor that doesn't initialize thefinal
fields of the base class, which seems unsound:If
Base
is itself a@:structInit
class without an explicitly declared constructor, you get the compile-time error you would probably expect:The text was updated successfully, but these errors were encountered: