Skip to content

Constructor parameters: (a: Int = 0)(b: Int = 0) is not equivalent to ()() #18006

Closed as not planned
@Sporarum

Description

@Sporarum

Compiler version

Scala 3.3.0

Minimized code & Output

trait Obj1(a: Int = 0)(b: Int = 0)

trait Obj2()()

// Expected:
new Obj1()(){}
new Obj2()(){}

// Unexpected:
new Obj1{}      // missing arguments for constructor Obj1 in trait Obj1
new Obj2{}

https://scastie.scala-lang.org/SRf7kAOKQWuUAm8yegbFtg

Expectation

No error, or a similar error for Obj2{} (or better)

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