Boy, this is subtle, but as far as I can tell it is completely Scala spec completely. I will quote from version 2.9 of the specification.
In the first example: as you say correctly, you see the eta extension through the special case of the method value (§6.7):
The expression e _ is well-formed if e is of method type or if e is a call-by-name parameter. If e is a method with parameters, e _ represents e converted to a function type by eta expansion.
The eta extension algorithm is given in 6.26.5, which you can use to get the following replacement for the expression new Foo().x1 _ :
{ val x1 = new Foo(); (y1: Int) => x1.(y1); }
This means that when the eta extension is used, all subexpressions are evaluated at the point where the transformation occurs (if I correctly understood the meaning of the phrase "maximum subexpression") and the final expression is to create an anonymous function.
In your second example, these additional parentheses mean that the compiler will consider §6.23 (in particular, “Column Syntax for Anonymous Functions”) and create the anonymous function directly.
An expression (of syntactic category Expr) may contain embedded underscore symbols _ at places where identifiers are legal. Such an expression represents an anonymous function where subsequent occurrences of underscores denote successive parameters.
In this case, following the algorithm in this section, your expression ends with the following:
(x1: Int) => new Foo().foo(x1)
The difference is subtle and, as @Antoras explains well, actually only shows if there is a side code.
Please note that for the case associated with blocks of code by name, there is a fix (see, for example, this question , this error and this error ).
Postscript In both cases, the anonymous function (x1:Int) => toto expands to
new scala.Function1[Int, Int] { def apply(x1: Int): Int = toto }