You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#7821 is related to this, but it deserves its own issue.
Inlined code currently breaks the package filters of --macro nullSafety() / @:nullSafety, which is a real problem if the inlined code isn't controlled by you. Especially considering that the std lib isn't null safe yet. For instance, this prevents you from using regexes together with null safety on the Python target:
>haxe -main Main -python foo.py
Main.hx:4: characters 3-22 : Null safety: Cannot assign nullable value here.
Of course Python's EReg should be updated, but that's just a band-aid and I expect there's many more such cases, a lot of them in libraries rather than the std lib.
The text was updated successfully, but these errors were encountered:
The only workaround I can suggest right now is using @:nullSafety(Off) at expression level:
@:nullSafety(Off) ~/foo/.match("bar");
The way compiler assigns position info to inlined expressions is also a problem with debuggers:
classTools {
staticpublicinlinefunctiontraverse(collection:Array<Int>, callback:Int->Void) {
for(iincollection) {
doSomething(i);
callback(i);
doAnotherThing(i);
}
}
}
classCompletelyDifferentModule {
staticfunctiondebugMe() {
// upon reaching this line you cannot step into `traverse`.// you just keep smashing "step over" button // in debugger at this line for `4 * (amount of lines in traverse)` timesTools.traverse([1, 2, 3, 4], i->trace(i));
trace('done');
}
}
#7821 is related to this, but it deserves its own issue.
Inlined code currently breaks the package filters of
--macro nullSafety()
/@:nullSafety
, which is a real problem if the inlined code isn't controlled by you. Especially considering that the std lib isn't null safe yet. For instance, this prevents you from using regexes together with null safety on the Python target:Of course Python's
EReg
should be updated, but that's just a band-aid and I expect there's many more such cases, a lot of them in libraries rather than the std lib.The text was updated successfully, but these errors were encountered: