HaxeFoundation / HaxeFoundation/haxe

Possible bug in @:autoBuild meta order

Open
#11,194 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Hej,

Idk if it's a bug or it is intentional, or none of these, maybe it's "just like that" ?
```haxe
class Macro {
public static function ab(n:Int) {
trace("ok"+n);
return null;
}
}
```
Traces :
```
Macro.hx:3: ok2
Macro.hx:3: ok1
```
With that :
```haxe
@:autoBuild(Macro.ab(1))
@:autoBuild(Macro.ab(2))
interface IFoo {}
class A implements IFoo {}
```
And traces :
```
Macro.hx:3: ok1
Macro.hx:3: ok2
```
With that :

```haxe
@:build(Macro.ab(1))
@:build(Macro.ab(2))
class A{}
```

I mean the order is not the same, and Idk if it's intentional. If not, could it be possible to "uniformize" (the same between `@:build` and `@:autoBuild` metas) please ?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the minimal Haxe examples in the issue and compare the observed ordering of repeated @:autoBuild and @:build metadata. Trace the compiler paths that process these metadata entries; done means the ordering is either made consistent or its intentional difference is documented and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.