aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/run/t6070.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pending/run/t6070.scala')
-rw-r--r--tests/pending/run/t6070.scala36
1 files changed, 0 insertions, 36 deletions
diff --git a/tests/pending/run/t6070.scala b/tests/pending/run/t6070.scala
deleted file mode 100644
index 828386d13..000000000
--- a/tests/pending/run/t6070.scala
+++ /dev/null
@@ -1,36 +0,0 @@
-abstract class Bomb {
- type T
- val x: T
-
- def size(that: T): Int
-}
-
-class StringBomb extends Bomb {
- type T = String
- val x = "abc"
- def size(that: String): Int = that.length
-}
-
-class IntBomb extends Bomb {
- type T = Int
- val x = 10
-
- def size(that: Int) = x + that
-}
-
-case class Mean(var bomb: Bomb)
-
-object Test extends dotty.runtime.LegacyApp {
- def foo(x: Mean) = x match {
- case Mean(b) =>
- // BUG: b is assumed to be a stable identifier, but it can actually be mutated
- println(b.size({ mutate(); b.x }))
- }
-
- def mutate(): Unit = {
- m.bomb = new IntBomb
- }
-
- val m = Mean(new StringBomb)
- foo(m) // should print 3
-}