HaxeFoundation / HaxeFoundation/haxe

@:native strips global namespace qualifier

Open
#10,977 0 comments 0 reactions 0 assignees View on GitHub
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

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.