HaxeFoundation / HaxeFoundation/haxe

[nullsafety] null safety errors in inlined code

Open
#7,897 2 comments 0 reactions 1 assignee Claimed by @RealyUniqueName View on GitHub
bug feature-null-safety
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.