You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When looking at a macro implementation, the compiler looks at parameters to recognize, among other less semantic sanity-checks, that the only implicit parameter is a WeakTypeTag.
This is done in scala.reflect.macros.compiler's Validators, through the building of macroImplSig. The exact place of comparison is in scala.reflect.macros.util.Helpers' transformTypeTagEvidenceParams.
If it fails you get a MacroImplNonTagImplicitParameters.
But from what I understand, the WeakTypeTagClass being compared against is (scala-)version-specific, so that when the 2.11 compiler works in -Xsource:2.10 mode, against a macro implementation coming from a 2.10 classfile, the WeakTypeTagClass it should try to find an instance of is not the one it has loaded, but the one in the 2.10 scala-reflect jar it (hopefully has on classpath).
So the symptom is, when compiling the play framework on 2.10 with -Xsource:2.10 and -Ymacro-expand:none:
/home/huitseeker/Scala/playframework/framework/src/play-json/src/main/scala/play/api/libs/json/Json.scala:194:error: macro implementations cannot have implicit parameters other than WeakTypeTag evidences
defreads[A] = macro JsMacroImpl.readsImpl[A]
^
/home/huitseeker/Scala/playframework/framework/src/play-json/src/main/scala/play/api/libs/json/Json.scala:214:error: macro implementations cannot have implicit parameters other than WeakTypeTag evidences
defwrites[A] = macro JsMacroImpl.writesImpl[A]
^
/home/huitseeker/Scala/playframework/framework/src/play-json/src/main/scala/play/api/libs/json/Json.scala:234:error: macro implementations cannot have implicit parameters other than WeakTypeTag evidences
defformat[A] = macro JsMacroImpl.formatImpl[A]
^
three errors found
The relevant signatures from JsMacroImpl are fine:
@huitseeker said:
The resources to reproduce the play framework failure: https://github.com/huitseeker/Xsource-nightlies contains a single script, building.sh, tailored to succeed despite the above limitation. To witness it, comment line 74 (the line that contains the string Json.scala), and run it from the framework directory of a playframework checkout.
When looking at a macro implementation, the compiler looks at parameters to recognize, among other less semantic sanity-checks, that the only implicit parameter is a
WeakTypeTag
.This is done in
scala.reflect.macros.compiler
'sValidators
, through the building ofmacroImplSig
. The exact place of comparison is inscala.reflect.macros.util.Helpers
'transformTypeTagEvidenceParams
.If it fails you get a
MacroImplNonTagImplicitParameters
.But from what I understand, the
WeakTypeTagClass
being compared against is (scala-)version-specific, so that when the 2.11 compiler works in-Xsource:2.10
mode, against a macro implementation coming from a 2.10 classfile, theWeakTypeTagClass
it should try to find an instance of is not the one it has loaded, but the one in the 2.10 scala-reflect jar it (hopefully has on classpath).So the symptom is, when compiling the play framework on 2.10 with -Xsource:2.10 and -Ymacro-expand:none:
The relevant signatures from
JsMacroImpl
are fine:Is there a way for
transformTag
to dereference the class and manually fetch that 2.10WeakTypeTagClass
from classpath to compare against ?The text was updated successfully, but these errors were encountered: