Подтвердить что ты не робот

Принудительный доступ

Учитывая

object A {
  def m(i: Int) = i
  val m = (i: Int) => i * 2
}

получает

scala> A.m(2)
<console>: error: ambiguous reference to overloaded definition,
both value m in object A of type => (Int) => Int
and  method m in object A of type (i: Int)Int
match argument types (Int)
       A.m(2)
         ^

Доступ к val можно выполнить с помощью

scala> val fun = A.m
fun: (Int) => Int = <function1>

scala> fun(2)
res: Int = 4

или

scala> A.m.apply(2)
res: Int = 4

но как получить доступ к def?

4b9b3361