HaxeFoundation / HaxeFoundation/haxe
@:native strips global namespace qualifier
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
We have cpp source code that includes generated cpp haxe code and noticed the compiler will strip global qualifiers off the native annotations for types, which can lead to compiler issues when it assumes the namespace is relative.
`@:native("::cpp::Foo") class Foo {}`
In the above, where Foo is referenced and replaced with the native name, it uses cpp::Foo instead of ::cpp::Foo. As a temporary workaround, if we qualify it as "::::cpp::Foo" it only strips the first pair.
Unsure if this is a bug, as designed, or unintended behavior, but I would expect @:native to replace verbatim without assumptions, or at the least, live fully qualified namespaces alone.
Contributor guide
Assessment
This issue has not been assessed yet.