Skip to content

Spurious "Early definitions are not supported" in Class Def #14326

Closed
@godenji

Description

@godenji

Compiler version

3.1.1-RC2

Minimized code

case class Year(value: Int) extends AnyVal
  with Id { type Value = Int }
  with Ordered[Year] {
  ...
}

Output

Early definitions are not supported; use trait parameters instead

Expectation

Compiles without error.

Workaround:

trait WrappedId extends Id { type Value = Int }
case class Year(value: Int) extends AnyVal
  with WrappedId
  with Ordered[Year] {
  ... 
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions