We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following code compiles and runs with 2.7.7 but fails to compile with 2.8.0.Beta1-RC1:
abstract class Base object Test { def run(c: Class[_ <: Base]): Unit = { } def main(args: Array[String]): Unit = { val sc: Option[Class[_ <: Base]] = Some(classOf[Base]) sc match { case Some(c) => run(c) case None => } } }
t.scala:12: error: type mismatch; found : java.lang.Class[_0] where type _0 required: Class[_ <: Base] case Some(c) => run(c)
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-2635?orig=1 Reporter: @blair
Sorry, something went wrong.
@adriaanm said: I think this is a bug in the pattern matcher, because of which c's type is not propagated properly
changing the line to
case Some((c: Class[_ <: Base])) => run(c)
results in:
/Users/adriaan/git/scala/test/pending/pos/t2635.scala:12: error: not found: type _$$3 case Some((c: Class[_ <: Base])) => run(c)
this was probably an existing bug that was unmasked by the fix for #513
@odersky said: (In r19769) Closed #2635
odersky
No branches or pull requests
The following code compiles and runs with 2.7.7 but fails to compile
with 2.8.0.Beta1-RC1:
The text was updated successfully, but these errors were encountered: