E178: Missing Argument List

This error occurs when a method with multiple parameter lists is called without providing all the required argument lists.

In Scala, methods can have multiple parameter lists (curried methods). When calling such methods, all parameter lists must be provided unless the partially applied method is explicitly expected as a function type.

Unapplied methods are only converted to functions when a function type is expected.


Example

object Test:
  def multiParam()()(x: Int): Int = x
  multiParam()  // missing argument lists

Error

-- [E178] Type Error: example.scala:3:12 ---------------------------------------
3 |  multiParam()  // missing argument lists
  |  ^^^^^^^^^^^^
  |  missing argument list for method multiParam in object Test
  |
  |    def multiParam()()(x: Int): Int
  |-----------------------------------------------------------------------------
  | Explanation (enabled by `-explain`)
  |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  | Unapplied methods are only converted to functions when a function type is expected.
   -----------------------------------------------------------------------------

Solution

Provide all required argument lists:

object Test:
  def multiParam()()(x: Int): Int = x
  val result = multiParam()()(42)  // provide all argument lists

Or explicitly convert to a function if partial application is intended:

object Test:
  def multiParam()()(x: Int): Int = x
  val partialFn: Int => Int = multiParam()()  // explicit function type