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
False positive exhaustivity warning on parameterised prefix #8068
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8068?orig=1 |
@paulp said: trait Foo1 {
sealed trait T
object O extends T
def f(t: T) = t match { case O => 1 }
}
trait Foo2[UnusedTypeParameter] {
sealed trait T
object O extends T
def f(t: T) = t match { case O => 1 }
} |
balefrost said: class Foo3[UnusedTypeParameter] {
sealed trait T
object O extends T
def f(t: T) = t match { case O => 1 }
} It also occurs if the type parameter is referenced class Foo4[A] {
sealed trait T
object O extends T
def f[A](t: T, v: A) = t match { case O => v }
} |
balefrost said: |
In 2.13.0, only the original code still warns. |
Doesn't warn on 2.13.8. |
This code prints false warning "match may not be exhaustive. It would fail on the following input: O"
The text was updated successfully, but these errors were encountered: