Ok, without checking, what do you think happens? (List(0): Seq[Int]) match { case _: List[Int] => 1 case _ => 2 }
Yes, you would need to know the specific implementation of `Seq#apply`... which is somewhat arbitrarily a `List`.
-
-
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 :/
-
Judging from the split of the votes, you're not the only one confused! ;)
End of conversation
New conversation -
-
-
Honest question: why do people still use `Seq`? I thought it was on its way out, and it was a pretty big wart in 2018 that I always banned in my codebases for lack of clarity and how it obfuscates the complexity class of the program...
-
My guess is, because Java people have been taught to program to the interface, not the implementation. Did you realise the nastiest thing about Seq (as it was in 2.11, at least)? How everybody believes it's immutable but you get the mutable version by default?
- Show replies
New conversation -
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.