Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix #5980 #6023
This is a fix for #5980.
I have not found a proof anywhere that
Also, it seems that the bug originates not really because of the distribution itself but because of inconsistent treatment of how subtyping relationship is inferred for traits and type params. Even if the
Consider that we need to compute
The difference between how traits and type params are treated originates at the match inside compareAppliedType2 of
In case of ClassInfo, the branch will ultimately lead us to this line which computes the
To summarise, when inferring
This PR adds such a check to the corresponding inference logic.
dotty-bot left a comment
Hello, and thank you for opening this PR!
All contributors have signed the CLA, thank you!
We want to keep history, but for that to actually be useful we have
Please stick to these guidelines for commit messages:
Have an awesome day!
More thoughts on why
If used on types which cannot be simplified,
So basically in all cases, in case of type parameters, the semantics of
However, I'm not completely sure whether it makes for the consistent subtyping behaviour between type params and traits since there's a lot going on there. Would appreciate some feedback on the above logic regarding whether