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
scala>objectTest { objectscala { reflect.runtime.currentMirror } }
<console>:7:error: value reflect is not a member of objectTest.scala
objectTest { objectscala { reflect.runtime.currentMirror } }
^
Here's the offending code:
// reflect/runtime/package.scaladefcurrentMirror(c: scala.reflect.macros.Context): c.Expr[universe.Mirror] = {
importc.universe._valruntimeClass= c.reifyEnclosingRuntimeClass
if (runtimeClass.isEmpty) c.abort(c.enclosingPosition, "call site does not have an enclosing class")
valruntimeUniverse=Select(Select(Select(Ident(newTermName("scala")), newTermName("reflect")), newTermName("runtime")), newTermName("universe"))
valcurrentMirror=Apply(Select(runtimeUniverse, newTermName("runtimeMirror")), List(Select(runtimeClass, newTermName("getClassLoader"))))
c.Expr[Nothing](currentMirror)(c.WeakTypeTag.Nothing)
}
I've seen the same problem in a few macros/compiler plugins.
The text was updated successfully, but these errors were encountered:
@paulp said:
This problem goes far beyond macros; you can break a hundred things with an identifier named "scala". In the distant past I tried to alleviate this somewhat, and for reasons I never figured out you can't universally use root.scala as a remedy. (And not because root is a valid identifier, though obviously that is a problem as well.)
Here's the offending code:
I've seen the same problem in a few macros/compiler plugins.
The text was updated successfully, but these errors were encountered: