Question: Is this possible to reach? If yes, please correct my Foo declaration syntax.

```

class Foo (...) {
...
  def /* the nameless method name implied here */ (...) : Bar = new Bar (...)
...
}

class Bar (...) {
...
}

val foo : Foo = new Foo (...)

val fooBar : Bar = foo (...)

```

Answer: 
You should use the apply method:

```
class Foo (y: Int) {
  def apply(x: Int) : Int = x + y
}

val foo : Foo = new Foo (7)

val fooBar  = foo (5)

println(fooBar)

```

Then run the code:

```
bash$ scala foo.scala 
12

```
I think the using 'apply' for you method name should work like this.