Open waneck opened 11 years ago
[comment from si...@haxe.org, published at 2013-05-23T10:15:13.000Z] Note that even without Context.getType this fails because the returned expression is "Test.SomeClass", which the resolution algorithm does not handle.
It's a bit too late to fix that for 3.0 sadly.
[Google Issue #1843 : http://code.google.com/haxe/issues/detail?id=1843] by domdelor...@gmail.com, at 2013-05-23T09:26:08.000Z What steps will reproduce the problem?
What is the expected output? What do you see instead?
The qualified name of the class expression is correctly identified from the expr, however the same class is not found within the Context.
Instead, throws compiler error:
Please complete the following class with minimal code reproducing the problem :
package;
if macro
import haxe.macro.Context; import haxe.macro.Expr; import haxe.macro.Type; using haxe.macro.Tools;
end
using Test.SomeMacro;
class Test { public static function main() { SomeMacro.test(SomeClass);//works SomeClass.test();//fails } }
class SomeClass { public function new() {
} }
class SomeMacro { macro public static function test<T>(expr:ExprOf<Class<T>>):Expr { var id = expr.toString(); trace(id); trace(Context.getType(id)); return expr; } }
Please provide any additional information below.
Haxe3 RC2, OSX 10.8