We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 746b00b commit 9ee8c5dCopy full SHA for 9ee8c5d
tests/neg/i20503.scala
@@ -1,6 +1,16 @@
1
import language.experimental.captureChecking
2
+
3
+class List[+A]:
4
+ def head: A = ???
5
+ def tail: List[A] = ???
6
+ def map[B](f: A => B): List[B] = ???
7
+ def foreach[U](f: A => U): Unit = ???
8
+ def nonEmpty: Boolean = ???
9
10
def runOps(ops: List[() => Unit]): Unit =
- ops.foreach(op => op())
11
+ // See i20156, due to limitation in expressiveness of current system,
12
+ // we cannot map over the list of impure elements.
13
+ ops.foreach(op => op()) // error
14
15
def main(): Unit =
16
val f: List[() => Unit] -> Unit = runOps // error
0 commit comments