forked from HaxeFoundation/haxe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class Main { | ||
static function main() { | ||
Test.foo(); | ||
test(); | ||
} | ||
|
||
static macro function test() { | ||
haxe.macro.Context.defineModule("Test", [{ | ||
pos: (macro moduleField).pos, | ||
pack: [], | ||
name: 'moduleField', | ||
params: [], | ||
meta: [], | ||
kind: TDField(FVar(null, macro null), [AInline, AFinal]), | ||
fields: [] | ||
}]); | ||
|
||
return macro {}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
class Main2 { | ||
static function main() { | ||
// Works fine if Test wasn't loaded | ||
// Note that types/fields declared in Test.hx will become unusable | ||
test(); | ||
} | ||
|
||
static macro function test() { | ||
haxe.macro.Context.defineModule("Test", [{ | ||
pos: (macro moduleField).pos, | ||
pack: [], | ||
name: 'moduleField', | ||
params: [], | ||
meta: [], | ||
kind: TDField(FVar(null, macro null), [AInline, AFinal]), | ||
fields: [] | ||
}]); | ||
|
||
return macro {}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class Test {} | ||
|
||
function foo() {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-main Main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Main.hx:4: characters 3-9 : Cannot redefine module Test | ||
Test.hx:1: character 1 : Previously defined here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-main Main2 |