Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
godenji opened this issue Jan 22, 2022 · 0 comments · Fixed by #14331
Closed

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

godenji opened this issue Jan 22, 2022 · 0 comments · Fixed by #14331
Assignees
Milestone

Comments

@godenji
Copy link

godenji commented Jan 22, 2022

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] {
  ... 
}
odersky added a commit to dotty-staging/dotty that referenced this issue Jan 23, 2022
The error message falsely referred to missing support for early definitions
in the example, but none were present.

Fixes scala#14326
odersky added a commit to dotty-staging/dotty that referenced this issue Jan 23, 2022
The error message falsely referred to missing support for early definitions
in the example, but none were present.

Fixes scala#14326
olsdavis pushed a commit to olsdavis/dotty that referenced this issue Apr 4, 2022
The error message falsely referred to missing support for early definitions
in the example, but none were present.

Fixes scala#14326
@Kordyjan Kordyjan added this to the 3.1.2 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants