Skip to content

misleading error message when constructor parameter list is missing #7101

@scabug

Description

@scabug
scala> class C(x: Int = 1)(y: Int)

scala> new C()
<console>:9: error: missing arguments for constructor C in class C
Error occurred in an application involving default arguments.

This does not tell you that an entire parameter list is missing. You might be tempted to think that there's a problem with the default.

For methods we're good:

scala> def foo(x: Int = 1)(y: Int) = 1

scala> foo()
<console>:9: error: missing arguments for method foo;
follow this method with `_' if you want to treat it as a partially applied function

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions