|
If one tries to compile the following code with the parent of this commit:
ru.reify(new Object().getClass)
then the following error will occur:
Test.scala:2: error: type mismatch;
found : $u.Expr[Class[_ <: Object]]
required: reflect.runtime.universe.Expr[Class[?0(in value <local Test>)]]
where type ?0(in value <local Test>) <: Object
ru.reify(new Object().getClass)
^
This happens because macro expansions are always typechecked against the
return type of their macro definitions instantiated in the context of expandee.
In this case the expected type contains skolems which are incompatible
with wildcards in the type of the expansion.
I tried all the incantations I could think of - without any success.
Luckily I met Martin who pointed me at the same problem solved in adapt
(see the diff w.r.t Typers.scala).
|