File tree Expand file tree Collapse file tree 9 files changed +80
-10
lines changed Expand file tree Collapse file tree 9 files changed +80
-10
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ -- Error: tests/init/neg/local-warm6.scala:6:32 ------------------------------------------------------------------------
2
+ 6 | def greater() = x > aDouble // error
3
+ | ^^^^^^^
4
+ | Access field aDouble on a value with an unknown initialization status. Calling trace:
5
+ | -> class C(x: Int) extends A { [ local-warm6.scala:5 ]
6
+ | -> class A { [ local-warm6.scala:1 ]
7
+ | -> val b = m(25) [ local-warm6.scala:11 ]
8
+ | -> val c = new C(target) [ local-warm6.scala:8 ]
9
+ | -> class C(x: Int) extends A { [ local-warm6.scala:5 ]
10
+ | -> class A { [ local-warm6.scala:1 ]
11
+ | -> val b = m(25) [ local-warm6.scala:11 ]
12
+ | -> val c = new C(target) [ local-warm6.scala:8 ]
13
+ | -> class C(x: Int) extends A { [ local-warm6.scala:5 ]
14
+ | -> class A { [ local-warm6.scala:1 ]
15
+ | -> val b = m(25) [ local-warm6.scala:11 ]
16
+ | -> val c = new C(target) [ local-warm6.scala:8 ]
17
+ | -> class C(x: Int) extends A { [ local-warm6.scala:5 ]
18
+ | -> class A { [ local-warm6.scala:1 ]
19
+ | -> val b = m(25) [ local-warm6.scala:11 ]
20
+ | -> val c = new C(target) [ local-warm6.scala:8 ]
21
+ | -> class C(x: Int) extends A { [ local-warm6.scala:5 ]
22
+ | -> class A { [ local-warm6.scala:1 ]
23
+ | -> val b = m(25) [ local-warm6.scala:11 ]
24
+ | -> if c.greater() then c.m(target - 1) else target [ local-warm6.scala:9 ]
Original file line number Diff line number Diff line change
1
+ class A {
2
+ val a = 10
3
+ def m (target : Int ): Int = {
4
+ val aDouble = a * 2
5
+ class C (x : Int ) extends A {
6
+ def greater () = x > aDouble // error
7
+ }
8
+ val c = new C (target)
9
+ if c.greater() then c.m(target - 1 ) else target
10
+ }
11
+ val b = m(25 )
12
+ }
Original file line number Diff line number Diff line change
1
+ -- Error: tests/init/neg/local-warm7.scala:10:23 -----------------------------------------------------------------------
2
+ 10 | finalA.getX() // error
3
+ | ^^^^^^^^^^^^^
4
+ | Call method finalA.getX() on a value with an unknown initialization. Calling trace:
5
+ | -> val x = b.getX() [ local-warm7.scala:15 ]
Original file line number Diff line number Diff line change
1
+ class Foo {
2
+ class A (x : Int ) {
3
+ def getX () = x
4
+ }
5
+
6
+ class B (a : => A ) {
7
+ def this (x : Int ) = this (new A (x))
8
+ def getX () = {
9
+ val finalA = a
10
+ finalA.getX() // error
11
+ }
12
+ }
13
+
14
+ val b = new B (5 )
15
+ val x = b.getX()
16
+ }
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ object localWarm {
2
+ class A (val x : Int ) {
3
+ def getX () = x
4
+ }
5
+
6
+ class B (val x : Int ) {
7
+ def getX () = {
8
+ def produceA (x : Int ) = new A (x)
9
+ class C (val x : Int ) {
10
+ def getX () = {
11
+ val a = produceA(x)
12
+ a.getX()
13
+ }
14
+ }
15
+ val c = new C (x)
16
+ c.getX()
17
+ }
18
+ val xAgain = getX()
19
+ }
20
+
21
+ val b = new B (5 )
22
+ val x = b.getX()
23
+ }
You can’t perform that action at this time.
0 commit comments