HaxeFoundation / HaxeFoundation/haxe

Context.defineType types TDStructure fields too eagerly

Open
#9,657 6 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

```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

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.