Skip to content

Commit 27a3f80

Browse files
authored
Fix error related to reaches when using scala2-library-cc-tasty (#20528)
Fix error introduced by a test of #20524. Due to limitation in expressiveness of current system, we are not able to map over lists of impure elements. See discussion in #20156.
2 parents 746b00b + 9ee8c5d commit 27a3f80

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: tests/neg/i20503.scala

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
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+
210
def runOps(ops: List[() => Unit]): Unit =
3-
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
414

515
def main(): Unit =
616
val f: List[() => Unit] -> Unit = runOps // error

0 commit comments

Comments
 (0)