Skip to content

Backport "Also call avoidingType when using the custom unpackProxiesFromResultType during inlining" to 3.10.1 - #27283

Merged
WojciechMazur merged 1 commit into
release-3.10.1from
release-3.10.1_backport-26893
Oct 11, 2026
Merged

WojciechMazur merged 1 commit into
release-3.10.1from
release-3.10.1_backport-26893

Conversation

@WojciechMazur

Copy link
Copy Markdown
Contributor

Backports #26893 to the 3.10.1-RC1.

PR submitted by the release tooling.
[skip ci]

…ype during inlining (#26893)

In #23792, when in
`unpackProxiesFromResultType` I used inlined.expansion.tpe instead of
Inlined.tpe, I didn't realize that when creating the inlined Inlined
node and assigning type to it, avoidingType is also called:

```scala
  def assignType(tree: untpd.Inlined, bindings: List[Tree], expansion: Tree)(using Context): Inlined =
    tree.withType(avoidingType(expansion, bindings))
```
Without this avoidingType here, the skolem type from the minimization
does not get replaced early enough, and subsequent cavoidingType calls
can't see it as by that point the skolem is replaced with a term ref,
causing it to effectively leak.
So as a fix, we read the avoiding type after unpacking the inlined node
with inlined.epression.tpe.

Fixes #26785 

## Have you relied on LLM-based tools in this contribution?

<!-- Pick one; "running tests" is not enough; refer to
https://github.com/scala/scala3/blob/main/LLM_POLICY.md for details -->

Yes, and I manually checked the logic and output.

## How was the solution tested?

<!-- Pick one; exceptions must have a very good reason -->

New automated tests (including the issue's reproducer, if applicable)
[Cherry-picked c202f34]
Base automatically changed from release-3.10.1_backport-27129 to release-3.10.1 October 11, 2026 11:24
@WojciechMazur
WojciechMazur merged commit bd8a429 into release-3.10.1 Oct 11, 2026
61 checks passed
@WojciechMazur
WojciechMazur deleted the release-3.10.1_backport-26893 branch October 11, 2026 11:24
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.

1 participant