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

Fix logic when comparing var/def bindings with val refinements #18049

Merged
merged 2 commits into from
Jun 24, 2023

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jun 23, 2023

We always widened def to val, which means it made no difference in a comparison

{ val/var/def x: T }  <:  { val/def x: T}

which kinds the bindings were. That clearly overlooks something important.

odersky added 2 commits June 23, 2023 20:37
We always widened def to val, which means it made no difference in a comparison

    { val/var/def x: T }  <:  { val/def x: T}

which kinds the bindings were. That clearly overlooks something important.
@odersky odersky requested a review from sjrd June 23, 2023 19:55
@sjrd sjrd merged commit ec3a321 into scala:main Jun 24, 2023
@sjrd sjrd deleted the fix-18047 branch June 24, 2023 10:39
@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 1, 2023
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.

Subtyping considers that a { def foo: T } refinement is valid for { val foo: T }
3 participants