Last active
December 27, 2015 03:59
-
-
Save RealyUniqueName/7263182 to your computer and use it in GitHub Desktop.
haxe.macro.MacroType issue
This file contains hidden or 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
package ; | |
/** | |
* Base class | |
* | |
*/ | |
class Base{ | |
}//class Base |
This file contains hidden or 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
package; | |
/** | |
* Extends via MacroType | |
* | |
*/ | |
class BaseExt extends haxe.macro.MacroType<[Build.baseType()]> { | |
/** | |
* Macro method | |
* | |
*/ | |
macro static public function macroExt () : haxe.macro.Expr { | |
return macro Sys.println('macroExt method'); | |
}//function macroExt() | |
}//class BaseExt |
This file contains hidden or 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
package; | |
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
/** | |
* Build macro | |
* | |
*/ | |
class Build { | |
/** | |
* Returns type of `Base` class | |
* | |
*/ | |
static public function baseType () : haxe.macro.Type { | |
return Context.getType('Base'); | |
}//function baseType() | |
}//class Build |
This file contains hidden or 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
-main Main | |
-neko test.n | |
-cmd neko test.n |
This file contains hidden or 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
package; | |
/** | |
* Entry point | |
* | |
*/ | |
class Main { | |
/** | |
* Entry point | |
* | |
*/ | |
static public function main () : Void { | |
BaseExt.macroExt(); | |
}//function main() | |
}//class Main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment