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
Array access will return null on index not found, yet return type is T, not Null<T>:
null
T
Null<T>
@:nullSafety(Strict) class Test { static function main() { var s:String = foo(42); trace(s == null); // true // s = null; // Null safety: Cannot assign nullable value here. } static function foo(i:Int) { var arr:Array<String> = []; return arr[i]; } }
https://try.haxe.org/#1DeFA9FA
The text was updated successfully, but these errors were encountered:
There was a PR merged to address this issue: #6825 But it was reverted because of #6847
Sorry, something went wrong.
That's unfortunate 😕
Maybe now that null safety is in the compiler we could revive this but only when null safety is Strict? cc @ncannasse
Strict
From my understanding one of the main problems with that PR was that it introduced target differences.
@kLabz that sounds like a good compromise to me
No branches or pull requests
Array access will return
null
on index not found, yet return type isT
, notNull<T>
:https://try.haxe.org/#1DeFA9FA
The text was updated successfully, but these errors were encountered: