Skip to content

incorrect error when class with parameters follows trait in parents #6778

Closed
@anatoliykmetyuk

Description

@anatoliykmetyuk

minimized code

scala> trait Bar
// defined trait Bar
scala> enum B(x: Int) {
     |   case Foo extends Bar with B(10)
     | }
2 |  case Foo extends Bar with B(10)
  |                            ^^^^^
  |                            class B is not a trait
2 |  case Foo extends Bar with B(10)
  |                   ^
  |            missing argument for parameter x of constructor B: (x: Int): B

expectation

The second error message is wrong as we are definitely not missing an argument for B's constructor.

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