Skip to content

Commit 56dac81

Browse files
committed
Update test
1 parent d244cc9 commit 56dac81

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
class F1 extends (Int => Unit) {
2+
def apply(x: Int): Unit = ()
3+
}
4+
5+
class F2 extends (Int -> Unit) {
6+
def apply(x: Int): Unit = ()
7+
}
8+
9+
def test =
10+
val x1 = new (Int => Unit) {
11+
def apply(x: Int): Unit = ()
12+
}
13+
14+
val x2: Int -> Unit = new (Int => Unit) { // error
15+
def apply(x: Int): Unit = ()
16+
}
17+
18+
val x3: Int -> Unit = new (Int -> Unit) {
19+
def apply(x: Int): Unit = ()
20+
}
21+
22+
val y1: Int => Unit = new F1
23+
val y2: Int -> Unit = new F1 // error
24+
val y3: Int => Unit = new F2
25+
val y4: Int -> Unit = new F2
26+
27+
val z1 = () => ()
28+
val z2: () -> Unit = () => ()
29+
val z3: () -> Unit = z1
30+
val z4: () => Unit = () => ()

tests/neg-custom-args/captures/extending-impure-function.scala.scala

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)