Fixes #15798 expand transparent inline givens inside inline method bodies#25906
Draft
soronpo wants to merge 1 commit intoscala:mainfrom
Draft
Fixes #15798 expand transparent inline givens inside inline method bodies#25906soronpo wants to merge 1 commit intoscala:mainfrom
soronpo wants to merge 1 commit intoscala:mainfrom
Conversation
d8d7106 to
586dbf3
Compare
…d bodies An implicit argument resolved from a transparent inline given was left as a bare, non-stable TermRef when typing the body of an inline def. When that reference was substituted into a dependent result type, `TypeAssigner` skolemized it (because it is not `isStable`), so type members such as `tc.Out` became opaque "unknown value" projections and subsequent type checks like `get[T <: Int]` failed. `Inlines.needsInlining` now permits expansion of transparent inline **givens** during the typer phase even when we are inside an enclosing inline method, with two important exclusions: - Transparent inline *methods* (e.g. `summonInline`) remain delayed: they are typically expanded later at outer call sites with concrete type info. - *Macro-based* transparent inline givens (bodies containing a splice) are also excluded, since running their macro at the def site with abstract types causes cyclic-macro-dependency errors (see tests/neg-macros/i18695). https://claude.ai/code/session_01LBtsQb6hXekva2zhouidnb
586dbf3 to
744624d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An implicit argument resolved from a transparent inline given was left as a bare, non-stable TermRef when typing the body of an inline def. When that reference was substituted into a dependent result type,
TypeAssignerskolemized it (because it is notisStable), so type members such astc.Outbecame opaque "unknown value" projections and subsequent type checks likeget[T <: Int]failed.Inlines.needsInliningnow permits expansion of transparent inline givens during the typer phase even when we are inside an enclosing inline method. Transparent inline methods (e.g.summonInline) remain delayed, since they are typically expanded later with concrete type info.Fixes #15798
How much have you relied on LLM-based tools in this contribution?
Extensively, but the change is pretty small.
How was the solution tested?
New automated tests (including the issue's reproducer, if applicable)