Skip to content

Commit

Permalink
[tests] Add test for @:using added by build macro
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Apr 3, 2024
1 parent e018399 commit 039d87f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/misc/projects/Issue11625/Macro.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function build() {
var cls = haxe.macro.Context.getLocalClass().get();
cls.meta.add(":using", [macro Main.Extensions], cls.pos);
return null;
}
10 changes: 10 additions & 0 deletions tests/misc/projects/Issue11625/Main.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function main() {
Foo.test();
}

class Extensions {
public static function test<T>(c:Class<T>) trace("ok");
}

@:build(Macro.build())
class Foo {}
1 change: 1 addition & 0 deletions tests/misc/projects/Issue11625/compile.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-main Main

0 comments on commit 039d87f

Please sign in to comment.