New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
existential type in patmat causes cast that breaks @tailrec #6145
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6145?orig=1 |
@VladUreche said (edited on Jul 26, 2012 12:47:03 PM UTC): |
@VladUreche said: |
@adriaanm said: object Test {
// the existential causes a cast and the cast makes searchClass not be in tail position
// can we get rid of the useless cast?
@annotation.tailrec
final def searchClass: Class[_] = {
"packageName" match {
case _ =>
searchClass
}
}
} |
@adriaanm said: |
@Atry said (edited on Aug 23, 2012 12:58:39 AM UTC): |
@adriaanm said: @annotation.tailrec
final def searchClass: String = {
"x" match {
case null =>
try {
""
} catch {
case e: ClassNotFoundException =>
searchClass
}
}
} |
@adriaanm said: |
This code works for Scala 2.10.0-M2, causes warning for 2.10.0-M3, and does not work for 2.10.0-M4, 2.10.0-M5, 2.10.0-M6, and 2.10.0-M7
The text was updated successfully, but these errors were encountered: