Skip to content

Fix isSubType(A#X, B#X) not checking if A <: B #179

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

Merged
merged 1 commit into from
Oct 5, 2014

Conversation

smarter
Copy link
Member

@smarter smarter commented Oct 5, 2014

Review by @odersky @namin

@smarter
Copy link
Member Author

smarter commented Oct 5, 2014

On a related not, the following typechecks with scalac but not dotc, I don't know if this is intentional:
https://gist.github.com/anonymous/bce9371ffaa2e7edaaa9

@odersky
Copy link
Contributor

odersky commented Oct 5, 2014

The status of A#X wrt subtpying is unclear. "A <: B implies A # X <: B # X "is not supported by DOT. Do without further study we should not add it, because it might well be unsound.

@samuelgruetter
Copy link
Contributor

The DOT calculus does not even have types of the form A#X (yet), but only of the form p.X, where p is a stable path.
But as far as I understand, this PR adds more checks to isSubType, I think it's "safer" to merge it than not to merge it.

@namin
Copy link
Contributor

namin commented Oct 5, 2014

In any case, we ought to document those tricky cases that we should investigate outside the pure calculus.

@smarter
Copy link
Member Author

smarter commented Oct 5, 2014

@odersky
Copy link
Contributor

odersky commented Oct 5, 2014

The particular PR is good, I think. We need to come back to the status of # projection in DOT. I'd prefer to do completely without # at the moment, but unfortunately the higher-kinded types encoding requires unrestricted #, so our choice is either no higher-kinded types or an operator which we do not know that well. But that's an aside. The PR itself is good.

odersky added a commit that referenced this pull request Oct 5, 2014
Fix isSubType(A#X, B#X) not checking if A <: B
@odersky odersky merged commit e0b290c into scala:master Oct 5, 2014
@odersky
Copy link
Contributor

odersky commented Oct 5, 2014

Thanks for the contribution, Guillaume!

WojciechMazur pushed a commit to WojciechMazur/dotty that referenced this pull request Mar 19, 2025
Backport "Normalise the types for Type Mismatch Error (E007)" to 3.3 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants