-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unification check in deriving is incorrect #13487
Comments
I'm not sure I understand what you mean.
This part is especially is not clear to me. Could you provide a sample that should compile with some explanation? I'm still convinced that in the case you described compilation should fail. |
Of course compilation should fail, only for a correct reason. Currently, it wrongly passes preliminary checks for the same-kindness of overlapping type parameters, generates a member with a nonsensical type
This example fails to compile, even though it should, because kinds of |
Oh, I see it now! Thanks for the explanation. Both of these behaviors are indeed the result of an underlying bug. |
Fix #13487: Unification check in deriving is incorrect
Compiler version
3.0.1
Minimized code
Output
Expectation
Foo cannot be unified with the type argument of TC
as kinds ofA
and_[_]
are different.Note, that if we change
TC
toTC[_[_], _]
, we will now getFoo cannot be unified with the type argument of TC
, even though it should compile. Perhaps https://github.com/lampepfl/dotty/blob/b7d2a122555a6aa44cc7590852a80f12512c535e/compiler/src/dotty/tools/dotc/typer/Deriving.scala#L163 was meant to usetakeRight
instead oftake
?The text was updated successfully, but these errors were encountered: