You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related, but maybe a different issue, in the following code:
traitFoo[A]
caseclassOne() extendsFoo[String]
objectTest {
deftest(x: Foo[Int]) = x match {
caseOne() =>
}
}
We get an error with scalac but nothing in Dotty:
try/pattern-no-instance.scala:6:error: constructor cannot be instantiated to expected type;
found : Onerequired: Foo[Int]
caseOne() =>^
one error found
1. ApproximatingTypeMap produces Nothing, which is not what is needed.
2. Avoid blind erasure which lose information about the pattern, see tests/patmat/i4314b.scala
1. ApproximatingTypeMap produces Nothing, which is not what is needed.
2. Avoid blind erasure which lose information about the pattern, see tests/patmat/i4314b.scala
Uh oh!
There was an error while loading. Please reload this page.
Given the following code:
The exhaustiveness checker is smart enough to not warn, because no instance of
Bar
is a subtype ofFoo[Int]
.However, if we add a case for
Bar()
like this:We should get an unreachable code warning (and indeed, scalac produces one), but we don't.
The text was updated successfully, but these errors were encountered: