E054: Parameterized Type Lacks Arguments
Note This error was replaced in Scala 3.2.2 by a more specific error message E171: Missing Argument.
Error was triggered when extending a parameterized type without providing the required constructor arguments.
Example
trait Foo(x: Int)
val foo = new Foo {}
Error
-- [E054] Type Error: example.scala:3:14 ---------------------------------------
3 |val foo = new Foo {}
| ^^^
| Parameterized trait Foo lacks argument list
|-----------------------------------------------------------------------------
| Explanation (enabled by `-explain`)
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| The trait Foo is declared with non-implicit parameters, you may not leave
| out the parameter list when extending it.
-----------------------------------------------------------------------------
Explanation
When a class or trait declares constructor parameters, you must provide values for those parameters when extending it. The error occurred because Foo requires an Int argument but none was provided.
The fix was to provide the required arguments:
trait Foo(x: Int)
val foo = new Foo(42) {}
In this article