Skip to content

Commit

Permalink
Update check files
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Nov 15, 2023
1 parent 216da52 commit 52fa83d
Show file tree
Hide file tree
Showing 23 changed files with 220 additions and 220 deletions.
22 changes: 11 additions & 11 deletions tests/init-global/neg/global-cycle1.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
1 |object A { // error
| ^
| Cyclic initialization: object A -> object B -> object A. Calling trace:
| -> object A { // error [ global-cycle1.scala:1 ]
| ^
| -> val a: Int = B.b [ global-cycle1.scala:2 ]
| ^
| -> object B { [ global-cycle1.scala:5 ]
| ^
| -> val b: Int = A.a // error [ global-cycle1.scala:6 ]
| ├── object A { // error [ global-cycle1.scala:1 ]
| ^
| ├── val a: Int = B.b [ global-cycle1.scala:2 ]
| ^
| ├── object B { [ global-cycle1.scala:5 ]
| ^
| └── val b: Int = A.a // error [ global-cycle1.scala:6 ]
| ^
-- Error: tests/init-global/neg/global-cycle1.scala:6:17 ---------------------------------------------------------------
6 | val b: Int = A.a // error
| ^^^
| Access uninitialized field value a. Call trace:
| -> object B { [ global-cycle1.scala:5 ]
| ^
| -> val b: Int = A.a // error [ global-cycle1.scala:6 ]
| Access uninitialized field value a. Calling trace:
| ├── object B { [ global-cycle1.scala:5 ]
| ^
| └── val b: Int = A.a // error [ global-cycle1.scala:6 ]
| ^^^
16 changes: 8 additions & 8 deletions tests/init-global/neg/line-spacing.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
3 | B
4 | .s.length // error
| ^
| Access uninitialized field value s. Call trace:
| -> object B { [ line-spacing.scala:7 ]
| ^
| -> val s: String = s"${A.a}a" [ line-spacing.scala:8 ]
| ^^^
| -> def a: Int = [ line-spacing.scala:2 ]
| ^
| -> .s.length // error [ line-spacing.scala:4 ]
| Access uninitialized field value s. Calling trace:
| ├── object B { [ line-spacing.scala:7 ]
| ^
| ├── val s: String = s"${A.a}a" [ line-spacing.scala:8 ]
| ^^^
| ├── def a: Int = [ line-spacing.scala:2 ]
| ^
| └── .s.length // error [ line-spacing.scala:4 ]
| ^
12 changes: 6 additions & 6 deletions tests/init-global/neg/patmat-unapplySeq.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
8 | def apply(i: Int): Box = array(i) // error
| ^^^^^^^^
|Reading mutable state of object A during initialization of object B.
|Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace:
|-> object B: [ patmat-unapplySeq.scala:15 ]
| ^
|-> case A(b) => [ patmat-unapplySeq.scala:17 ]
| ^^^^
|-> def apply(i: Int): Box = array(i) // error [ patmat-unapplySeq.scala:8 ]
|Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace:Calling trace:
|├── object B: [ patmat-unapplySeq.scala:15 ]
| ^
|├── case A(b) => [ patmat-unapplySeq.scala:17 ]
| ^^^^
|└── def apply(i: Int): Box = array(i) // error [ patmat-unapplySeq.scala:8 ]
| ^^^^^^^^
8 changes: 4 additions & 4 deletions tests/init/neg/closureLeak.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
11 | l.foreach(a => a.addX(this)) // error
| ^^^^^^^^^^^^^^^^^
|Could not verify that the method argument is transitively initialized (Hot). It was found to be a function where "this" is (the original object of type (class Outer) where initialization checking started). Only transitively initialized arguments may be passed to methods (except constructors). Calling trace:
|-> class Outer { [ closureLeak.scala:1 ]
| ^
|-> l.foreach(a => a.addX(this)) // error [ closureLeak.scala:11 ]
|├── class Outer { [ closureLeak.scala:1 ]
| ^
|└── l.foreach(a => a.addX(this)) // error [ closureLeak.scala:11 ]
| ^^^^^^^^^^^^^^^^^
|
|Promoting the value to transitively initialized (Hot) failed due to the following problem:
|Could not verify that the method argument is transitively initialized (Hot). It was found to be the original object of type (class Outer) where initialization checking started. Only transitively initialized arguments may be passed to methods (except constructors).
|Non initialized field(s): value p. Promotion trace:
|-> l.foreach(a => a.addX(this)) // error [ closureLeak.scala:11 ]
|└── l.foreach(a => a.addX(this)) // error [ closureLeak.scala:11 ]
| ^^^^
24 changes: 12 additions & 12 deletions tests/init/neg/cycle-structure.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
3 | val x = B(this) // error
| ^^^^^^^
| Problematic object instantiation: arg 1 is not transitively initialized (Hot). Calling trace:
| -> case class A(b: B) { [ cycle-structure.scala:1 ]
| ^
| -> val x = B(this) // error [ cycle-structure.scala:3 ]
| ├── case class A(b: B) { [ cycle-structure.scala:1 ]
| ^
| └── val x = B(this) // error [ cycle-structure.scala:3 ]
| ^^^^^^^
|
| It leads to the following error during object initialization:
| Access field value x on an uninitialized (Cold) object. Calling trace:
| -> case class B(a: A) { [ cycle-structure.scala:7 ]
| ^
| -> val x1 = a.x [ cycle-structure.scala:8 ]
| ├── case class B(a: A) { [ cycle-structure.scala:7 ]
| ^
| └── val x1 = a.x [ cycle-structure.scala:8 ]
| ^^^
-- Error: tests/init/neg/cycle-structure.scala:9:13 --------------------------------------------------------------------
9 | val x = A(this) // error
| ^^^^^^^
| Problematic object instantiation: arg 1 is not transitively initialized (Hot). Calling trace:
| -> case class B(a: A) { [ cycle-structure.scala:7 ]
| ^
| -> val x = A(this) // error [ cycle-structure.scala:9 ]
| ├── case class B(a: A) { [ cycle-structure.scala:7 ]
| ^
| └── val x = A(this) // error [ cycle-structure.scala:9 ]
| ^^^^^^^
|
| It leads to the following error during object initialization:
| Access field value x on an uninitialized (Cold) object. Calling trace:
| -> case class A(b: B) { [ cycle-structure.scala:1 ]
| ^
| -> val x1 = b.x [ cycle-structure.scala:2 ]
| ├── case class A(b: B) { [ cycle-structure.scala:1 ]
| ^
| └── val x1 = b.x [ cycle-structure.scala:2 ]
| ^^^
14 changes: 7 additions & 7 deletions tests/init/neg/default-this.check
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
| ^^^^^^^
|Could not verify that the method argument is transitively initialized (Hot). It was found to be the original object of type (class B) where initialization checking started. Only transitively initialized arguments may be passed to methods (except constructors).
|Non initialized field(s): value result. Calling trace:
|-> class B extends A { [ default-this.scala:6 ]
| ^
|-> val result = updateThenCompare(5) [ default-this.scala:11 ]
| ^^^^^^^^^^^^^^^^^^^^
|-> def updateThenCompare(c: Int): Boolean = { [ default-this.scala:7 ]
| ^
|-> compare() // error [ default-this.scala:9 ]
|├── class B extends A { [ default-this.scala:6 ]
| ^
|├── val result = updateThenCompare(5) [ default-this.scala:11 ]
| ^^^^^^^^^^^^^^^^^^^^
|├── def updateThenCompare(c: Int): Boolean = { [ default-this.scala:7 ]
| ^
|└── compare() // error [ default-this.scala:9 ]
| ^^^^^^^
12 changes: 6 additions & 6 deletions tests/init/neg/i15363.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
3 | val b = new B(this) // error
| ^^^^^^^^^^^
| Problematic object instantiation: arg 1 is not transitively initialized (Hot). Calling trace:
| -> class A: [ i15363.scala:1 ]
| ^
| -> val b = new B(this) // error [ i15363.scala:3 ]
| ├── class A: [ i15363.scala:1 ]
| ^
| └── val b = new B(this) // error [ i15363.scala:3 ]
| ^^^^^^^^^^^
|
| It leads to the following error during object initialization:
| Access field value m on an uninitialized (Cold) object. Calling trace:
| -> class B(a: A): [ i15363.scala:7 ]
| ^
| -> val x = a.m [ i15363.scala:8 ]
| ├── class B(a: A): [ i15363.scala:7 ]
| ^
| └── val x = a.m [ i15363.scala:8 ]
| ^^^
10 changes: 5 additions & 5 deletions tests/init/neg/i15459.check
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
| ^^^^
|Could not verify that the method argument is transitively initialized (Hot). It was found to be the original object of type (class Sub) where initialization checking started. Only transitively initialized arguments may be passed to methods (except constructors).
|Non initialized field(s): value b. Calling trace:
|-> class Sub extends Sup: [ i15459.scala:5 ]
| ^
|-> class Sup: [ i15459.scala:1 ]
| ^
|-> println(this) // error [ i15459.scala:3 ]
|├── class Sub extends Sup: [ i15459.scala:5 ]
| ^
|├── class Sup: [ i15459.scala:1 ]
| ^
|└── println(this) // error [ i15459.scala:3 ]
| ^^^^
16 changes: 8 additions & 8 deletions tests/init/neg/inherit-non-hot.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
6 | if b == null then b = new B(this) // error
| ^^^^^^^^^^^^^^^
|The RHS of reassignment must be transitively initialized (Hot). It was found to be a non-transitively initialized (Warm) object of type (class B) { outer = a transitively initialized (Hot) object, args = (an uninitialized (Cold) object) }. Calling trace:
|-> class C extends A { [ inherit-non-hot.scala:15 ]
| ^
|-> val bAgain = toB.getBAgain [ inherit-non-hot.scala:16 ]
| ^^^
|-> def toB: B = [ inherit-non-hot.scala:5 ]
| ^
|-> if b == null then b = new B(this) // error [ inherit-non-hot.scala:6 ]
|├── class C extends A { [ inherit-non-hot.scala:15 ]
| ^
|├── val bAgain = toB.getBAgain [ inherit-non-hot.scala:16 ]
| ^^^
|├── def toB: B = [ inherit-non-hot.scala:5 ]
| ^
|└── if b == null then b = new B(this) // error [ inherit-non-hot.scala:6 ]
| ^^^^^^^^^^^^^^^
|
|Promoting the value to transitively initialized (Hot) failed due to the following problem:
|Could not verify that the field value a is transitively initialized (Hot). It was found to be an uninitialized (Cold) object. Promotion trace:
|-> class B(a: A) { [ inherit-non-hot.scala:10 ]
|└── class B(a: A) { [ inherit-non-hot.scala:10 ]
| ^^^^
10 changes: 5 additions & 5 deletions tests/init/neg/inlined-method.check
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
| ^^^^^^^
|Could not verify that the method argument is transitively initialized (Hot). It was found to be the original object of type (class InlineError) where initialization checking started. Only transitively initialized arguments may be passed to methods (except constructors).
|Non initialized field(s): value v. Calling trace:
|-> class InlineError { [ inlined-method.scala:1 ]
| ^
|-> Assertion.failAssert(this) [ inlined-method.scala:2 ]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|-> scala.runtime.Scala3RunTime.assertFailed(message) // error [ inlined-method.scala:8 ]
|├── class InlineError { [ inlined-method.scala:1 ]
| ^
|├── Assertion.failAssert(this) [ inlined-method.scala:2 ]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|└── scala.runtime.Scala3RunTime.assertFailed(message) // error [ inlined-method.scala:8 ]
| ^^^^^^^
6 changes: 3 additions & 3 deletions tests/init/neg/inner-first.check
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
| ^^^^
|Could not verify that the method argument is transitively initialized (Hot). It was found to be the original object of type (class B) where initialization checking started. Only transitively initialized arguments may be passed to methods (except constructors).
|Non initialized field(s): value n. Calling trace:
|-> class B: [ inner-first.scala:2 ]
| ^
|-> println(this) // error [ inner-first.scala:3 ]
|├── class B: [ inner-first.scala:2 ]
| ^
|└── println(this) // error [ inner-first.scala:3 ]
| ^^^^
6 changes: 3 additions & 3 deletions tests/init/neg/leak-warm.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
19 | val l2 = l.map(_.m()) // error
| ^^^^^^^^^^^^
| Call method method map on an uninitialized (Cold) object. Calling trace:
| -> object leakWarm { [ leak-warm.scala:1 ]
| ^
| -> val l2 = l.map(_.m()) // error [ leak-warm.scala:19 ]
| ├── object leakWarm { [ leak-warm.scala:1 ]
| ^
| └── val l2 = l.map(_.m()) // error [ leak-warm.scala:19 ]
| ^^^^^^^^^^^^
8 changes: 4 additions & 4 deletions tests/init/neg/promotion-loop.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
16 | println(b) // error
| ^
|Could not verify that the method argument is transitively initialized (Hot). It was found to be a non-transitively initialized (Warm) object of type (class B) { outer = the original object of type (class Test) where initialization checking started }. Only transitively initialized arguments may be passed to methods (except constructors). Calling trace:
|-> class Test { test => [ promotion-loop.scala:1 ]
| ^
|-> println(b) // error [ promotion-loop.scala:16 ]
|├── class Test { test => [ promotion-loop.scala:1 ]
| ^
|└── println(b) // error [ promotion-loop.scala:16 ]
| ^
|
|Promoting the value to transitively initialized (Hot) failed due to the following problem:
|Could not verify that the field value outer is transitively initialized (Hot). It was found to be the original object of type (class Test) where initialization checking started.
|Non initialized field(s): value n. Promotion trace:
|-> val outer = test [ promotion-loop.scala:12 ]
|└── val outer = test [ promotion-loop.scala:12 ]
| ^^^^^^^^^^^^^^^^
6 changes: 3 additions & 3 deletions tests/init/neg/promotion-segment3.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
9 | bar(new B) // error
| ^^^^^
|Could not verify that the method argument is transitively initialized (Hot). It was found to be a non-transitively initialized (Warm) object of type (class B) { outer = the original object of type (class A) where initialization checking started }. Only transitively initialized arguments may be passed to methods (except constructors). Calling trace:
|-> class A: [ promotion-segment3.scala:2 ]
| ^
|-> bar(new B) // error [ promotion-segment3.scala:9 ]
|├── class A: [ promotion-segment3.scala:2 ]
| ^
|└── bar(new B) // error [ promotion-segment3.scala:9 ]
| ^^^^^
|
|Promoting the value to transitively initialized (Hot) failed due to the following problem:
Expand Down
52 changes: 26 additions & 26 deletions tests/init/neg/secondary-ctor4.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,43 @@
54 | val c = new C(b, 5) // error
| ^^^^^^^^^^^
| Problematic object instantiation: arg 1 is not transitively initialized (Hot). Calling trace:
| -> class D { [ secondary-ctor4.scala:52 ]
| ^
| -> val c = new C(b, 5) // error [ secondary-ctor4.scala:54 ]
| ├── class D { [ secondary-ctor4.scala:52 ]
| ^
| └── val c = new C(b, 5) // error [ secondary-ctor4.scala:54 ]
| ^^^^^^^^^^^
|
| It leads to the following error during object initialization:
| Access field value n on an uninitialized (Cold) object. Calling trace:
| -> def this(b: B, x: Int) = this(b) [ secondary-ctor4.scala:49 ]
| ^^^^^^^
| -> class C(b: B) extends A(b) with T { [ secondary-ctor4.scala:48 ]
| ^
| -> def this(b: B) = { [ secondary-ctor4.scala:17 ]
| ^
| -> Inner().foo() [ secondary-ctor4.scala:26 ]
| ^^^^^^^
| -> class Inner() { [ secondary-ctor4.scala:21 ]
| ^
| -> println(b.n) [ secondary-ctor4.scala:23 ]
| ├── def this(b: B, x: Int) = this(b) [ secondary-ctor4.scala:49 ]
| ^^^^^^^
| ├── class C(b: B) extends A(b) with T { [ secondary-ctor4.scala:48 ]
| ^
| ├── def this(b: B) = { [ secondary-ctor4.scala:17 ]
| ^
| ├── Inner().foo() [ secondary-ctor4.scala:26 ]
| ^^^^^^^
| ├── class Inner() { [ secondary-ctor4.scala:21 ]
| ^
| └── println(b.n) [ secondary-ctor4.scala:23 ]
| ^^^
-- Error: tests/init/neg/secondary-ctor4.scala:42:4 --------------------------------------------------------------------
42 | new A(new B(new D)) // error
| ^^^^^^^^^^^^^^^^^^^
|Problematic object instantiation: the outer M.this and arg 1 are not transitively initialized (Hot). Calling trace:
|-> class N(d: D) extends M(d) { [ secondary-ctor4.scala:59 ]
| ^
|-> def this(d: D) = { [ secondary-ctor4.scala:7 ]
| ^
|-> new A(new B(new D)) // error [ secondary-ctor4.scala:42 ]
|├── class N(d: D) extends M(d) { [ secondary-ctor4.scala:59 ]
| ^
|├── def this(d: D) = { [ secondary-ctor4.scala:7 ]
| ^
|└── new A(new B(new D)) // error [ secondary-ctor4.scala:42 ]
| ^^^^^^^^^^^^^^^^^^^
|
|It leads to the following error during object initialization:
|Access field value n on an uninitialized (Cold) object. Calling trace:
|-> def this(b: B) = { [ secondary-ctor4.scala:17 ]
| ^
|-> Inner().foo() [ secondary-ctor4.scala:26 ]
| ^^^^^^^
|-> class Inner() { [ secondary-ctor4.scala:21 ]
| ^
|-> println(b.n) [ secondary-ctor4.scala:23 ]
|├── def this(b: B) = { [ secondary-ctor4.scala:17 ]
| ^
|├── Inner().foo() [ secondary-ctor4.scala:26 ]
| ^^^^^^^
|├── class Inner() { [ secondary-ctor4.scala:21 ]
| ^
|└── println(b.n) [ secondary-ctor4.scala:23 ]
| ^^^
Loading

0 comments on commit 52fa83d

Please sign in to comment.