Toolbox typecheck throws MatchError for higher-kinded path-dependent type
Daniel Armak <[email protected]>
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I encountered this error trying to compile code that uses the shapeless ~?>
typeclass with the toolbox, and simplified it to this:
import scala.reflect.runtime.currentMirror
import scala.tools.reflect.ToolBox
val tb = ToolBox(currentMirror).mkToolBox()
val source = """{
import scala.language.higherKinds
class Outer[X] {
class Inner[Y]
}
class Other[T[_]]
new Other[Outer[Int]#Inner]()
}"""
val tree = tb.parse(source)
tb.typecheck(tree).tpe
This fails with:
Exception in thread "main" scala.MatchError: <tree with deferred refcheck> (of class scala.tools.nsc.ast.Trees$TypeTreeWithDeferredRefCheck)
at scala.reflect.internal.Importers$StandardImporter.recreateTree(Importers.scala:309)
(Full stack trace here
<https://gist.github.com/danarmak/c917b4f35e5d4d6ccbc7>)
I’m using scala 2.11.7.
Thanks,
Daniel Armak
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.