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
non-exhaustiveness warning is too specific and too general #7746
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7746?orig=1 |
@retronym said: This counter example is rendered from the model:
V1 represents the scrutinee; V3 the contents of the nested Some. This comes from the |
@retronym said:
|
@paulp said: scala> def f[T](x: Option[T]) = x match { case Some(Some(5)) => true }
<console>:7: warning: match may not be exhaustive.
It would fail on the following inputs: None, Option(), Some((x: T forSome x not in Some[?])), Some(Some((x: Any forSome x not in 5))), Some(_)
def f[T](x: Option[T]) = x match { case Some(Some(5)) => true }
^
f: [T](x: Option[T])Boolean |
@retronym said (edited on Mar 21, 2014 11:15:03 AM UTC):
$ scalac Test.scala |
After mentioning None, the next example lets a wildcard escape, the next is too specific, and the last is too broad. The things not covered should be some variation on: None, Some(x forSome x not in Some(5))
The text was updated successfully, but these errors were encountered: