-
Notifications
You must be signed in to change notification settings - Fork 1.1k
conflicting instances with inheritance from case class #18552
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
Labels
area:desugar
Desugaring happens after parsing but before typing, see desugar.scala
itype:bug
Spree
Suitable for a future Spree
Milestone
Comments
Compiles successfully on 2.13 |
I accidentally rediscovered the bug while forgetting it was reported already. Does someone have an idea of a workaround other than implementing manually all the functions of case classes? |
@SimonGuilloud not sure if it would be suitable for your use case, but you can do: trait M:
type T
case class MA(id:Int) extends M:
type T <: A
class MB(id:Int) extends MA(id):
type T <: B |
EugeneFlesselle
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 10, 2024
Closes scala#18552 which was actually not an error, see: https://github.com/scala/scala3/blob/73882c5b62b8cd96031ad975f7677949433a9f21/compiler/src/dotty/tools/dotc/typer/RefChecks.scala#L889-L893 Co-authored-by: Anna Herlihy <[email protected]> Co-authored-by: Natsu Kagami <[email protected]>
EugeneFlesselle
added a commit
that referenced
this issue
Apr 10, 2024
Closes #18552 which was actually not an error, see: https://github.com/scala/scala3/blob/73882c5b62b8cd96031ad975f7677949433a9f21/compiler/src/dotty/tools/dotc/typer/RefChecks.scala#L889-L893 --------- Co-authored-by: Anna Herlihy <[email protected]> Co-authored-by: Natsu Kagami <[email protected]>
WojciechMazur
added a commit
that referenced
this issue
Jul 5, 2024
Closes #18552 which was actually not an error, see: https://github.com/scala/scala3/blob/73882c5b62b8cd96031ad975f7677949433a9f21/compiler/src/dotty/tools/dotc/typer/RefChecks.scala#L889-L893 --------- Co-authored-by: Anna Herlihy <[email protected]> Co-authored-by: Natsu Kagami <[email protected]> [Cherry-picked ed9fecc][modified]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:desugar
Desugaring happens after parsing but before typing, see desugar.scala
itype:bug
Spree
Suitable for a future Spree
Compiler version
Tested with 3.2.1 and 3.3.1
Minimized code
Output
Expectation
Compiles, or meaningful error message. If
MA
is not a case class, the code compiles. The base traitM
is not non-variant.The text was updated successfully, but these errors were encountered: