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
I don't think the following code should produce a compiler error:
scala> (Vector():Seq[_]) match { caseList() =>true; caseNil=>false }}}
<console>:8:error: unreachable code
(Vector():Seq[_]) match { caseList() =>true; caseNil=>false }
^
The following slightly modified version seems to show that the false can be reached:
scala> (Vector():Seq[_]) match { caseList() =>true; case x if x ==Nil=>false }
warning: there were 1 unchecked warnings; re-run with-unchecked for details
res1:Boolean=false
I don't think the following code should produce a compiler error:
The following slightly modified version seems to show that the
false
can be reached:See also this Stack Overflow question.
The text was updated successfully, but these errors were encountered: