-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcgood first issuePerfect for someone who wants to get started contributingPerfect for someone who wants to get started contributingitype:bug
Milestone
Description
Compiler version
3.2.1 and before
Minimized code
new concurrent.ExecutionContext
Output
-- [E042] Type Error: ----------------------------------------------------------
1 |new concurrent.ExecutionContext
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Unit is abstract; it cannot be instantiated
|
| longer explanation available when compiling with `-explain`
With -explain
enabled:
-- [E042] Type Error: ----------------------------------------------------------
1 |new concurrent.ExecutionContext
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Unit is abstract; it cannot be instantiated
|-----------------------------------------------------------------------------
| Explanation (enabled by `-explain`)
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| Abstract classes and traits need to be extended by a concrete class or object
| to make their functionality accessible.
|
| You may want to create an anonymous class extending Unit with
| class Unit { }
|
| or add a companion object with
| object Unit extends Unit
|
| You need to implement any abstract members in both cases.
-----------------------------------------------------------------------------
Expectation
The actual name of the instantiated trait (e.g. ExecutionContext
in the example above) should be displayed instead of Unit
.
Metadata
Metadata
Assignees
Labels
area:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcgood first issuePerfect for someone who wants to get started contributingPerfect for someone who wants to get started contributingitype:bug