Skip to content

Commit 9dfcfa9

Browse files
committed
Fix #10549: Add test
1 parent 9e0dc21 commit 9dfcfa9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

tests/init/neg/i10549b.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Wrap {
2+
def qux[T](e: E[T]) = e.foo
3+
4+
abstract class E[+T] { def foo: T }
5+
object E {
6+
final val A: E[Nothing] = new E { def foo = ref }
7+
val ref = qux(A) // error
8+
}
9+
}

tests/init/pos/i10549a.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Wrap {
2+
class E
3+
object E {
4+
final val A = new E {}
5+
val $values = Array(A)
6+
}
7+
}

0 commit comments

Comments
 (0)