Skip to content

Instantly share code, notes, and snippets.

@RealyUniqueName
Last active December 27, 2015 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RealyUniqueName/7263182 to your computer and use it in GitHub Desktop.
Save RealyUniqueName/7263182 to your computer and use it in GitHub Desktop.
haxe.macro.MacroType issue
package ;
/**
* Base class
*
*/
class Base{
}//class Base
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
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
-main Main
-neko test.n
-cmd neko test.n
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