Ok, without checking, what do you think happens? (List(0): Seq[Int]) match { case _: List[Int] => 1 case _ => 2 }
-
-
Replying to @propensive
Even more fun, what do you think happens: (Seq(0): Seq[Int]) match { case _: List[Int] => 1 case _ => 2 }
2 replies 0 retweets 1 like -
-
Replying to @propensive
It does, but your answer makes me feel I've missed something obvious - it seemed less intuitive to me that the runtime type of Seq(1) was List than that of List(1)...
1 reply 0 retweets 0 likes -
Replying to @NicolasRinaudo
Yes, you would need to know the specific implementation of `Seq#apply`... which is somewhat arbitrarily a `List`.
2 replies 0 retweets 0 likes -
Replying to @propensive
I must have missed the point of your poll, sorry - thought you wanted to show ways in which Scala could behave confusingly, but my attempt at one-upping you seems to have confused exactly one person, myself :/
1 reply 0 retweets 1 like
Judging from the split of the votes, you're not the only one confused! ;)
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.