blob: c84cb16366c9f32e8a6ed1b8c4031b78ffc3c98c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
object Test {
def contains(s: String, i: Int) = true
def test1 = {
val f = contains("", (_: Int))
val ff = contains("", ((_: Int)))
f.apply(0)
// sandbox/eta.scala:4: error: type mismatch:
// found : Int => Int
// required: Int
// val f = contains("", (_: Int))
// ^
// sandbox/eta.scala:5: error: apply is not a member of Boolean(f)
// f.apply(0)
// ^
}
def test2 = {
val f = "".contains("", (_: Int)) // dotc:
f.apply(0)
// sandbox/eta.scala:18: error: apply is not a member of Boolean(f)
// f.apply(0)
// ^
}
}
|