Re: Seq :+ repeat parameter
Rich Oliver <[email protected]> Thu, 7 Apr 2016 06:29:07 -0700 (PDT)
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <[email protected]> |
On Thursday, 7 April 2016 13:49:18 UTC+1, Oliver Ruebenacker wrote: > > > Hello, > > Is it possible that your code does not do what one might think it does? > > scala> val seq = Seq(1, 2, 3) > seq: Seq[Int] = List(1, 2, 3) > > scala> val seq2 = seq :+ (4, 5, 6) > seq2: Seq[Any] = List(1, 2, 3, (4,5,6)) > > Best, Oliver > Hi yes you're right. I was forgetting Scala's insanely hyperactive type inference. Well at least I'm not alone, it drove Paul Phillips to despair. Will this madness get worse with type unions? -- You received this message because you are subscribed to the Google Groups "scala-language" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.