HaxeFoundation / HaxeFoundation/haxe
Returning anything from build macro interferes with field type completion.
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
Minimal example:
```haxe
#if !macro
@:build(Main.build())
#end
class Main {
#if !macro
var name:|
static function main() {}
#else
static function build() {
var ret = haxe.macro.Context.getBuildFields();
return ret;// return null works
}
#end
}
```
The compiler seems a little confused:

Without returning any changes (i.e. `return null` as suggested in the comment), it works:

Also, if you type at least one letter and force completion (or type two letters), you get type completion:

Contributor guide
Assessment
This issue has not been assessed yet.