Skip to content

Commit 870977a

Browse files
committed
Adding checkfiles for enum
1 parent e7f6a81 commit 870977a

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

tests/init/neg/enum-desugared.check

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-- Error: tests/init/neg/enum-desugared.scala:17:15 --------------------------------------------------------------------
2+
17 | Array(this.LazyErrorId, this.NoExplanationID) // error // error
3+
| ^^^^^^^^^^^^^^^^
4+
| Promoting the value to fully-initialized is unsafe. May only use initialized value as method arguments
5+
|
6+
| The unsafe promotion may cause the following problem(s):
7+
|
8+
| 1. Calling the external method method name may cause initialization errors. Calling trace:
9+
| -> override def productPrefix: String = this.name() [ enum-desugared.scala:29 ]
10+
| -> Array(this.LazyErrorId, this.NoExplanationID) // error // error [ enum-desugared.scala:17 ]
11+
-- Error: tests/init/neg/enum-desugared.scala:17:33 --------------------------------------------------------------------
12+
17 | Array(this.LazyErrorId, this.NoExplanationID) // error // error
13+
| ^^^^^^^^^^^^^^^^^^^^
14+
| Promoting the value to fully-initialized is unsafe. May only use initialized value as method arguments
15+
|
16+
| The unsafe promotion may cause the following problem(s):
17+
|
18+
| 1. Calling the external method method ordinal may cause initialization errors. Calling trace:
19+
| -> def errorNumber: Int = this.ordinal() - 2 [ enum-desugared.scala:8 ]
20+
| -> Array(this.LazyErrorId, this.NoExplanationID) // error // error [ enum-desugared.scala:17 ]

tests/init/neg/enum.check

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-- Error: tests/init/neg/enum.scala:4:8 --------------------------------------------------------------------------------
2+
4 | NoExplanationID // error
3+
| ^
4+
| Promoting the value to fully-initialized is unsafe. May only use initialized value as method arguments
5+
|
6+
| The unsafe promotion may cause the following problem(s):
7+
|
8+
| 1. Calling the external method method name may cause initialization errors. Calling trace:
9+
| -> NoExplanationID // error [ enum.scala:4 ]

0 commit comments

Comments
 (0)