HaxeFoundation / HaxeFoundation/haxe

"Can only extend structures" typing order issue with `--macro include`

Open
#8,177 7 comments 0 reactions 0 assignees View on GitHub
test-needed
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

This is what I got when isolating the weird OS-dependent `language-server-protocol-haxe` CI failure I was debugging with @nadako yesterday.

`source/A.hx`:

```haxe
import B;

typedef A = {}
```

`source/B.hx`:

```haxe
import A;

typedef B = A & {}

typedef C = {
var ?b:B;
}
```

`build.hxml`

```hxml
-cp source
--macro include("", true, null, ["source"])
```

```
>haxe build.hxml
source/B.hx:3: characters 13-19 : Can only extend structures
```

---

Some very strange effects here:

- doesn't reproduce if the `?` is removed from `typedef C` (?!)
- if `A` is renamed to `B` and `B` to `A`, it also doesn't reproduce

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.