HaxeFoundation / HaxeFoundation/haxe

"Field needed by Interface is missing" has unknown position when defining from Context.defineType and then using Context.typeof

Open
#11,754 3 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

Try haxe: https://try.haxe.org/#15BeB54A

```haxe
var pos = Context.currentPos();

var tfields = (macro class {
public var bit:Int;
}).fields;

var t:TypeDefinition = {
pos: pos,
pack: [],
meta: [{name: ":structInit", pos: pos}],
name: "TestType",
kind: TDClass([{pack: [], name: "Test", sub: "TestInterface"},]),
fields: tfields,
};
Context.defineType(t);
var complex:ComplexType = TPath({pack: [], name: "Macro", sub: "TestType"});

var type = Context.typeof(macro(null : $complex));
```

this yields
```
[ERROR] (unknown position)

| Field bit2 needed by TestInterface is missing
```

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.