-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
null is not properly handled in generic static extensions #4434
Comments
This is working as designed because |
but then why it compiles? |
Because currently, the following compiles: class Test {
static function main():Void {
null.whatever();
}
} It is not related to static extension. Think of |
IMO that doesn't make sense, |
I remember that was experimentally forbidden recently. But that caused problems since it is often to pass null to inline functions resulting in compilation error. |
I agree with @kevinresol. Field access to |
Are we talking about |
For me, just |
It would break all of Nicolas' code so... ;) I've already tried disallowing explicit |
field access does not depend on the value but of the type. and null is |
I understand that the type vs value argument... but it does happen in real world code |
Fixes #28 See HaxeFoundation/haxe#4434 for discussion about this.
The real world code was my fault... I did know about this limitation of static extension, but forgot it in the moment and the compiler let it pass. That particular line wasn't caught by the unit tests either (though I've fixed it and made sure it is covered now). So 👍 to some kind of warning if it is possible. |
generated:
note that
null.f()
is expected to beTest.f(null)
The text was updated successfully, but these errors were encountered: