Skip to content

Fixes #15798 expand transparent inline givens inside inline method bodies#25906

Draft
soronpo wants to merge 1 commit intoscala:mainfrom
soronpo:claude/fix-scala3-15798-bvIRa
Draft

Fixes #15798 expand transparent inline givens inside inline method bodies#25906
soronpo wants to merge 1 commit intoscala:mainfrom
soronpo:claude/fix-scala3-15798-bvIRa

Conversation

@soronpo
Copy link
Copy Markdown
Contributor

@soronpo soronpo commented Apr 22, 2026

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. 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)

@soronpo soronpo changed the title Fixes #15798 Fixes #15798 expand transparent inline givens inside inline method bodies Apr 22, 2026
@soronpo soronpo force-pushed the claude/fix-scala3-15798-bvIRa branch from d8d7106 to 586dbf3 Compare April 22, 2026 18:13
…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
@soronpo soronpo force-pushed the claude/fix-scala3-15798-bvIRa branch from 586dbf3 to 744624d Compare April 22, 2026 18:58
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.

Compiletime ops bounds fail inside of inlined def

2 participants