1

when I try to create a curried constructor, like

class MyClass(a: Int, b: Int)(c: String) {
  // Some Implementation
}

why does partial application like

val partialConstructor = new MyClass(x, y) 

result in the error message

missing argument list for constructor MyClass in class MyClass
josiah
  • 1,314
  • 1
  • 13
  • 33

1 Answers1

4

You confuse curried functions with functions of multiple argument lists. Take a look at this answer why there are function with multiple argument lists.

For your example you should explicitly say that you want a curried function

val partialConstructor = new MyClass(x, y)(_)
Nazarii Bardiuk
  • 4,272
  • 1
  • 19
  • 22