We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6886a96 commit 9b087ceCopy full SHA for 9b087ce
tests/neg/i5083.scala
@@ -0,0 +1,25 @@
1
+class A(a: Int) {
2
+ abstract class X {
3
+ def f: Int
4
+ val x = a + f // NPE: the outer for `Y` is not yet set
5
+ }
6
+
7
+ trait Y {
8
+ val y = a
9
+ def f: Int = A.this.a // NPE: the outer for `Y` is not yet set
10
11
12
+ trait Z(val o: A) extends o.Y { // error
13
+ val z = a
14
15
16
+ class B extends X with Z(new A(4))
17
+}
18
19
20
+object Test {
21
+ def main(args: Array[String]): Unit = {
22
+ val a = new A(3)
23
+ new a.B
24
25
tests/neg/i5083b.scala
@@ -0,0 +1,15 @@
+ class X {
+ val x = a
+ val z: Z = ???
+ trait Z(val o: A) extends z.o.Y // error: cyclic reference `z`
0 commit comments