Closed
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
.