blob: 5afb6e53010c9eed7d139e524d218b74724958d6 (
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
25
26
|
object Test {
def contains(s: String, i: Int) = true
def test1 = {
val f = contains("", (_: Int))
val ff = contains("", ((_: Int)))
val g: Int => Boolean = contains("", (_))
val gg: Int => Boolean = contains("", ((_)))
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)
// ^
}
}
|