Skip to content

Commit

Permalink
[tests] add failing test demonstrating the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Jul 31, 2024
1 parent b537e99 commit 1b58076
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/misc/projects/Issue11740/Baz.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import foo.Foo;

class Baz {
function baz(data:foo.FooData) {}
}

17 changes: 17 additions & 0 deletions tests/misc/projects/Issue11740/Macro.macro.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import haxe.macro.Context;

class Macro {
public static function build() {
trace("build FooData");

Context.defineType({
pos : Context.currentPos(),
name : "FooData",
pack : ["foo"],
kind : TDClass(),
fields : [],
});

return null;
}
}
5 changes: 5 additions & 0 deletions tests/misc/projects/Issue11740/Main.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import foo.Foo;

function main() {
trace(Baz);
}
2 changes: 2 additions & 0 deletions tests/misc/projects/Issue11740/compile1.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-main Main
--interp
2 changes: 2 additions & 0 deletions tests/misc/projects/Issue11740/compile1.hxml.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Macro.macro.hx:5: build FooData
Main.hx:4: Class<Baz>
3 changes: 3 additions & 0 deletions tests/misc/projects/Issue11740/compile2.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-main Main
Baz
--interp
4 changes: 4 additions & 0 deletions tests/misc/projects/Issue11740/foo/Foo.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package foo;

@:build(Macro.build())
class Foo {}

0 comments on commit 1b58076

Please sign in to comment.