Ok, without checking, what do you think happens? (List(0): Seq[Int]) match { case _: List[Int] => 1 case _ => 2 }
-
-
Replying to @propensive
Dotty actually checks that the element type is matched correctly while Scala 2 takes a lucky guess and comes to the same conclusion?
1 reply 0 retweets 2 likes -
Replying to @StefanZeiger
I'm not sure Scala 2's guess is lucky... and as far as I can tell, Dotty does not do anything any differently.
1 reply 0 retweets 1 like -
Replying to @propensive
The new GADT checking in Dotty will give you more precise types in pattern matches, but there are various non-GADT issues, e.g. https://github.com/scala/bug/issues/9188 … is fixed in Dotty while https://github.com/scala/bug/issues/6890 … is still unsound
1 reply 0 retweets 2 likes
Replying to @StefanZeiger
That was an interesting read into things I never usually attempt with pattern matching! Thank you!
4:14 AM - 20 Jul 2020
from Krakow, Poland
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.