Skip to content

Commit f052bcb

Browse files
committed
Add another neg test for promotion of ThisRef
1 parent 8237d68 commit f052bcb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/init/neg/early-promote3.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
abstract class A {
2+
bar()
3+
private val a = 5
4+
def foo() = a
5+
def bar(): Unit
6+
}
7+
8+
class M extends A {
9+
def bar() = promote(this) // error
10+
def promote(m: M) = m.foo()
11+
}

0 commit comments

Comments
 (0)