Skip to content

Conversation

@WojciechMazur
Copy link
Contributor

Backports #20837 to 3.5.1-RC1

The inliner replaces references to parameters by
their corresponding proxys, including in singleton types.
It did not, however, handle the mapping over import types,
the symbols of which way have depended on parameters.

Mapping imports correctly was necessary for i19493
since the `summonInline` resolves post inlining to
a given imported within the inline definition.

Fix scala#19493
Both i19493 and i19436 require mapping the type of
the expr in an `ImportType` which is itself the info of a `TermRef`.
In the first issue, for the substitution of an inline def parameter proxy.
In the second issue, for the parameter of a lambda returned from an inline def.

Both can be handled in `TypeMap` by mapping over references to `ImportType`s.
The second case also requires modifying `TreeTypeMap#mapType` such that
the logic mapping over imports is done within a `TypeMap` doing the symbol substitutions.

Fixes scala#19436
@WojciechMazur WojciechMazur merged commit 2eb77ff into scala:release-3.5.1 Jul 3, 2024
@WojciechMazur WojciechMazur deleted the backport-3.5.1/20837 branch July 3, 2024 08:43
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.

2 participants