-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
[typer] abstract constructors shouldn't be allowed to return a value #7809
Comments
I'm removing the 4.0 milestone from this because I don't find this clear cut. Why should class constructors be allowed to return early but abstract constructors not? I think the actual problem here is with the typing. |
I don't think anybody wanted to disallow returns, but it should probably be
|
I see, I misread that. Still not 4.0 priority though, and also not easy to fix because this becomes a very normal function to the typer... |
Agreed, doesn't seem urgent. |
Worryingly, a class Main {
public static function main() {
new Test(0);
}
}
abstract Test(Int) from Int {
public function new(i:Int):Void {
return i; // compiles!
}
} I'm not sure what the implicaitons of this are, but that might make it Haxe 4 priority after all? It at least seems to break with |
(extracted from #7751)
This compiles, despite the
:Void
type hint onnew
:The text was updated successfully, but these errors were encountered: