blob: 4788841f8d6fc483cc48066e8bc360792f01f9d8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
trait Sam { def apply(): Unit }
abstract class Test {
def foo(): Sam
// no parens, instantiateToMethodType would wrap in a `new Sam { def apply = foo }`
// rather than applying to an empty param list() */
val f: Sam = foo
}
object Test extends Test {
lazy val samIAm = new Sam { def apply() {} }
def foo() = samIAm
def main(args: Array[String]): Unit = {
assert(f eq samIAm, f)
}
}
|