Skip to content

[nullsafety] null safety errors in inlined code #7897

Description

@Gama11

#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:

class Main {
	@:nullSafety
	static function main() {
		~/foo/.match("bar");
	}
}
>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.

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions