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 incorrect caching with dependent method parameters #21699

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smarter
Copy link
Member

@smarter smarter commented Oct 3, 2024

The added test case used to fail Ycheck:typer with the seemingly identicals:

Found:    (a: (aa : A{type B = Int}), b: a.B): CCPoly[(aa : A{type B = Int})]
Required: (a: (aa : A{type B = Int}), b: a.B): CCPoly[(aa : A{type B = Int})]

In fact one of the aa is a a TypeVar instantiated to A {type B = Int }. The MethodType comparison failed the signature check because the a.B where a is backed by a type variable had a stale signature cached.

Fixed by changing isProvisional to traverse ParamRefs.

@smarter smarter added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Oct 3, 2024
@smarter smarter changed the title Fix incorrect caching with path-dependent types Fix incorrect caching with path-dependent types in methods Oct 3, 2024
@smarter smarter changed the title Fix incorrect caching with path-dependent types in methods Fix incorrect caching with dependent method parameters Oct 3, 2024
@smarter smarter self-assigned this Oct 3, 2024
The added test case used to fail Ycheck:typer with the seemingly identicals:

    Found:    (a: (aa : A{type B = Int}), b: a.B): CCPoly[(aa : A{type B = Int})]
    Required: (a: (aa : A{type B = Int}), b: a.B): CCPoly[(aa : A{type B = Int})]

In fact one of the `aa` is a a TypeVar instantiated to `A {type B = Int }`. The
MethodType comparison failed the signature check because the `a.B` where `a` is
backed by a type variable had a stale signature cached.

Fixed by changing `isProvisional` to traverse ParamRefs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant