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

Comments

Projects
None yet
2 participants
@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@cbd0205
and
scala/scala@dfbaaa1

@scabug

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

scabug commented Feb 25, 2013

@scabug

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

scabug commented Feb 28, 2013

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

@scabug scabug closed this Mar 2, 2013

@scabug scabug added this to the 2.10.1 milestone Apr 7, 2017

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