So, most people were wrong about this, and it also split opinion rather evenly... I suspect even that some of the people who were right were right for the wrong reasons! But the Scala compiler is actually being safe and correct, here. Explanation below...https://twitter.com/propensive/status/1284952925727580165 …
-
Show this thread
-
Replying to @propensive
tl;dr Poll answer "Compiles, no warning → 1" is correct. Right?
1 reply 0 retweets 1 like -
This Tweet is unavailable.
-
Replying to @jeremyrsmith @jimofl
No, sealedness isn't required to solve it. Any as-yet-unknown subtype can still be checked at runtime as a `List[_]` and the `Int` is still known statically.
1 reply 0 retweets 1 like -
This Tweet is unavailable.
-
This Tweet is unavailable.
-
This Tweet is unavailable.
-
This Tweet is unavailable.
Replying to @jeremyrsmith @jimofl
Anyhow, I like that the compiler is correct here, no matter how complex the logic, and I think it should be sufficient for us humans to suspend full understanding, and just let Scalac do its thing. But unfortunately most of us learned the hard way not to be quite so trusting...
2:17 PM - 20 Jul 2020
1 reply
0 retweets
1 like
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.