Skip to content

Commit 460d01e

Browse files
committed
Additional checks
1 parent 643ff4d commit 460d01e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/neg-custom-args/i16601a.check

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-- [E042] Type Error: tests/neg-custom-args/i16601a.scala:1:27 ---------------------------------------------------------
2+
1 |@main def Test: Unit = new concurrent.ExecutionContext // error
3+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
| ExecutionContext is a trait; it cannot be instantiated
5+
|---------------------------------------------------------------------------------------------------------------------
6+
| Explanation (enabled by `-explain`)
7+
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
8+
| Abstract classes and traits need to be extended by a concrete class or object
9+
| to make their functionality accessible.
10+
|
11+
| You may want to create an anonymous class extending ExecutionContext with
12+
| class ExecutionContext { }
13+
|
14+
| or add a companion object with
15+
| object ExecutionContext extends ExecutionContext
16+
|
17+
| You need to implement any abstract members in both cases.
18+
---------------------------------------------------------------------------------------------------------------------

tests/neg-custom-args/i16601a.scala

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

0 commit comments

Comments
 (0)