Skip to content
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

spurious dead code warning with an irrefutable extractor in withFilter #7183

Closed
scabug opened this issue Feb 25, 2013 · 4 comments
Closed

spurious dead code warning with an irrefutable extractor in withFilter #7183

scabug opened this issue Feb 25, 2013 · 4 comments

Comments

@scabug
Copy link

scabug commented Feb 25, 2013

class A
object A {
  def unapply(a: A): Some[A] = Some(a) // Change return type to Option[A] and the warning is gone
}

object Test {
  for (A(a) <- List(new A)) yield a // spurious dead code warning.
}

// List(new A()).withFilter(((check$ifrefutable$2) => check$ifrefutable$2: @scala.unchecked match {
//  case A((a @ _)) => true
//  case _ => false // this is dead code, but it's compiler generated.
// }))

I'm pretty sure the regression is explained by the combination of:

scala/scala@cbd02059
and
scala/scala@dfbaaa17

@scabug
Copy link
Author

scabug commented Feb 25, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7183?orig=1
Reporter: @retronym
Affected Versions: 2.10.1-RC1

@scabug
Copy link
Author

scabug commented Feb 25, 2013

@retronym said:
scala/scala#2168

@scabug
Copy link
Author

scabug commented Feb 25, 2013

@retronym said:
If you want to defer this change, we must at least revert cbd02059 in 2.10.1 IMO.

@scabug
Copy link
Author

scabug commented Feb 28, 2013

@gkossakowski said:
Elevated to blocker as it blocks 2.10.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants