HaxeFoundation / HaxeFoundation/haxe
Context.defineType types TDStructure fields too eagerly
Open
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
```haxe
class Macro {
public static function run() {
var def1 = macro class Def1 {
var def2:Def2;
}
var def2 = macro class Def2 {}
def1.kind = TDStructure; // comment this line to "fix"
haxe.macro.Context.defineType(def1);
trace('defined def1');
haxe.macro.Context.defineType(def2);
trace('defined def2');
}
}
```
Run it as init macro:
```hxml
--macro Macro.run()
```
Expect to trace "defined def1" and "defined def2" but actually prints "Type not found : Def2"
Contributor guide
Assessment
This issue has not been assessed yet.