X Tutup
Skip to content

Macro static local var not working #11096

@filt3rek

Description

@filt3rek

Hej,

Idk if I've understood well the new local static var feature but in this example it seems not working in macro context : https://try.haxe.org/#bf1DB874
null twice whereas with the uncommented line null first time, then 5

class Test {
    static function main() {
        Macro.foo(5);
        Macro.foo(2);
    }
}

class Macro {
  //static var i:Int;
    public macro static function foo(_i:Int) {
        static var i:Int;
        trace(i);
        i = _i;
        return macro null;
    }
}
```

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup