Re: Strange type error

Toby <[email protected]>
Newsgroups gmane.comp.lang.scala
Message-ID <[email protected]>
Thank you Janusz and Phillips for your answers.

However, you have told me what happens but not why it happens. I am hence a 
little wiser but no more enlightened. 

Why does the compiler decide that the presence of brackets requires nested 
functions, rather than one function with multiple parameters and 
precedence? The unique type that would satisfy the requirements of the 
function being called is a function of three Double parameters. This makes 
no sense to me. 

On Thursday, 7 May 2015 13:10:28 UTC+2, Andrew Phillips wrote:
>
> > but with additional brackets to change precedence, (_ + _) * _ fails
>
> Just for completeness: as you probably also discovered, it also fails if 
> you *don't* affect the precedence, and simply add brackets for e.g. 
> clarity:
>
> scala> execute( _ + (_ * _) )
> <console>:9: error: missing parameter type for expanded function ((x$1) => 
> x$1.$
> plus(((x$2, x$3) => x$2.$times(x$3))))
>               execute( _ + (_ * _) )
>                        ^
>
> Regards
>
> ap
>

-- 
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.