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

Drop phase.isTyper use in isLegalPrefix/asf #21954

Conversation

dwijnand
Copy link
Member

Note that "asSeenFrom" (aka asf) is used by SymDenotation#findMember,
which is used by TypeComparer's "hasMatchingMember", as a part of
"compareRefinedSlow".

Previously (using the minimisation in i17222.8.scala) summonOne is
inlined during the "inlining" phase, while "summonInline" is inlined
during typing. The result is that during inlining we fail to find
Reader[BC, Int] because we incorrectly consider A{type F = Int} as
stable.

Fixes #17222

Note that "asSeenFrom" (aka asf) is used by SymDenotation#findMember,
which is used by TypeComparer's "hasMatchingMember", as a part of
"compareRefinedSlow".

Previously (using the minimisation in i17222.8.scala) `summonOne` is
inlined during the "inlining" phase, while "summonInline" is inlined
during typing.  The result is that during inlining we fail to find
`Reader[BC, Int]` because we incorrectly consider `A{type F = Int}` as
stable.
@dwijnand dwijnand requested a review from odersky November 18, 2024 19:23
@dwijnand dwijnand marked this pull request as ready for review November 18, 2024 19:23
@Gedochao Gedochao requested a review from jchyb November 20, 2024 12:05
@Gedochao Gedochao added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Nov 20, 2024
@Gedochao Gedochao added this to the 3.6.3 milestone Nov 20, 2024
@Gedochao Gedochao requested review from sjrd and noti0na1 and removed request for jchyb November 20, 2024 12:28
Copy link
Member

@noti0na1 noti0na1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@noti0na1 noti0na1 merged commit 912b6f2 into scala:main Nov 22, 2024
29 checks passed
@dwijnand dwijnand deleted the i17222-anon-mixin-inline-match-erasedValue-summonInline branch November 22, 2024 12:44
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.

Anonymous trait mixin breaks inline match + erasedValue + summonInline
4 participants