Skip to content

Instantly share code, notes, and snippets.

@dpeek
Created January 24, 2013 12:51
Show Gist options
  • Save dpeek/4621204 to your computer and use it in GitHub Desktop.
Save dpeek/4621204 to your computer and use it in GitHub Desktop.
haxe.macro.ExprTools.toString bug
#if macro
using haxe.macro.Tools;
using haxe.macro.Expr;
#end
enum Foo
{
bar;
}
class Test
{
public static function main()
{
test(bar);
}
macro static function test(e:Expr):Expr
{
var type = haxe.macro.Context.typeof(e);
var string = type.toString();
trace(string);
trace(string == "Foo");
trace(Std.string(string) == "Foo");
try
{
trace(Type.resolveEnum(type.toString()));
}
catch (e:Dynamic) trace(e);
return e;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment