Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 30ca28d

Browse files
committedNov 7, 2023
Avoid pure expression warning with Scala2 library TASTy
The extra information on trait initialization causes an extra warning. The warning/errors in the check files should be the same. The test now do not desugar the erroneous code into a statement anymore to avoid this warning.
1 parent f61026d commit 30ca28d

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed
 

‎tests/neg/i16601.check

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
-- [E042] Type Error: tests/neg/i16601.scala:1:27 ----------------------------------------------------------------------
2-
1 |@main def Test: Unit = new concurrent.ExecutionContext // error
3-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
4-
| ExecutionContext is a trait; it cannot be instantiated
1+
-- [E042] Type Error: tests/neg/i16601.scala:1:26 ----------------------------------------------------------------------
2+
1 |@main def Test: Any = new concurrent.ExecutionContext // error
3+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
| ExecutionContext is a trait; it cannot be instantiated
55
|
66
| longer explanation available when compiling with `-explain`

‎tests/neg/i16601.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@main def Test: Unit = new concurrent.ExecutionContext // error
1+
@main def Test: Any = new concurrent.ExecutionContext // error

‎tests/neg/i16601a.check

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
-- [E042] Type Error: tests/neg/i16601a.scala:3:27 ---------------------------------------------------------------------
2-
3 |@main def Test: Unit = new concurrent.ExecutionContext // error
3-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
4-
| ExecutionContext is a trait; it cannot be instantiated
1+
-- [E042] Type Error: tests/neg/i16601a.scala:3:26 ---------------------------------------------------------------------
2+
3 |@main def Test: Any = new concurrent.ExecutionContext // error
3+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
| ExecutionContext is a trait; it cannot be instantiated
55
|---------------------------------------------------------------------------------------------------------------------
66
| Explanation (enabled by `-explain`)
77
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

‎tests/neg/i16601a.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
//> using options -explain
22

3-
@main def Test: Unit = new concurrent.ExecutionContext // error
3+
@main def Test: Any = new concurrent.ExecutionContext // error

0 commit comments

Comments
 (0)
Please sign in to comment.