Hi all,
I encountered a compiler crash with the following code. Sorry if this is an already known issue (i checked on the issue tracker first, it seemed to be new).
object Extract {
def unapply[A](a : A) : String = a.toString
}
object Extractor extends App {
val a = 5 match { case Extract(x) => x }
}
I am aware that String is not a valid return type for an extractor but it crashes in:
scala.reflect.internal.Types$TypeError: value get is not a member of String
at scala.tools.nsc.typechecker.Contexts$ThrowingReporter.handleError(Contexts.scala:1390)
at scala.tools.nsc.typechecker.Contexts$ContextReporter.issue(Contexts.scala:1242)
at scala.tools.nsc.typechecker.Contexts$Context.issue(Contexts.scala:573)
at scala.tools.nsc.typechecker.ContextErrors$ErrorUtils$.issueTypeError(ContextErrors.scala:106)
at scala.tools.nsc.typechecker.ContextErrors$ErrorUtils$.issueNormalTypeError(ContextErrors.scala:99)
at scala.tools.nsc.typechecker.ContextErrors$TyperContextErrors$TyperErrorGen$.NotAMemberError(ContextErrors.scala:376)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$lookupInQualifier$1(Typers.scala:4095)
at scala.tools.nsc.typechecker.Typers$Typer.handleMissing$1(Typers.scala:4744)
I tested it on a Linux (Ubuntu 15.04) amd64 machine running Scala version 2.11.7 and 2.11.6 with OpenJDK 64-Bit Server VM, Java 1.7.0_79. Both directly with scalac, in console and with sbt (0.13.8).
Best regards,
Christophe Calvès