Re: Seq :+ repeat parameter

Rich Oliver <[email protected]> Thu, 7 Apr 2016 15:44:01 -0700 (PDT)
Newsgroups gmane.comp.lang.scala
Message-ID <[email protected]>
On Thursday, 7 April 2016 21:56:05 UTC+1, nafg wrote:
>
>
> What is insane or hyperactive about this, and what does it have to do with 
> type inference? You wrote the append operator and a tuple, dunno why you 
> didn't see that, but no need to blame Scala.
>
> Why not use the ++ operator?
>
> I was aware that I could use ++ "Seq"  ........ but I thought there was 
repeat parameter operator, allowing me to save the "Seq" characters, so I 
tried it. The inferred type was:

Seq[Product with Serializable with Object {..}]

I am quite happy to admit to many non trivial flaws as a developer, but I 
would ask when the above type or similar is inferred, what percentage of 
the time is their an error as opposed to the compiler inferring the 
programmers intention? Maybe my knowledge is incomplete but how often do 
people intentionally create a Seq[Product with Serializable]? Its not the 
end of the world for me, the pros of Scala far out weight the flaws. 
However when trying to persuade new people of the benefits of Scala these 
sorts of surprises can potentially be a deal breaker. One of our prime 
selling points with Scala is the early detection of type errors.

Perhaps part of the problem is that "If" and "match" expressions can not be 
explicitly type parametised.

-- 
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.