No, though the mistake is in one (or maybe both) of the assumptions... It's very subtle, though.
-
-
This Tweet is unavailable.
-
Why would the underscore suppress the erasure warning though?
1 reply 0 retweets 0 likes -
-
Replying to @propensive @gabro27
Interesting: if I change the `0` into an `"a"` I get a fruitless type test compilation warning and `1` as output (using Scala 2.12.10). This is the expected result (due to erasure), but in both the original and the new case I would have expected a type erasure warning.
1 reply 0 retweets 0 likes -
So I guess the compiler has enough information in this specific case to know that checking for a `List[Int]` makes sense and does not then issue the type erasure warning. Not sure if this is the subtlety you were talking about.
1 reply 0 retweets 2 likes -
-
Replying to @propensive @gabro27
Nice, is this a (relatively) new thing? I'm quite sure I've seen type erasure warnings on similar checks years ago and avoided them since then.
1 reply 0 retweets 0 likes -
Replying to @stefanobaghino @gabro27
No, it was there in Scala 2.10, and maybe earlier.
1 reply 0 retweets 0 likes -
The type erasure warnings still appear... but only when they ought to!
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.