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

Backport "Map over refs of ImportTypes in TypeMap" to 3.5.1 #20957

Merged

Commits on Jul 2, 2024

  1. Map over ImportTypes in inliner tree type map

    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
    EugeneFlesselle authored and WojciechMazur committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    581ad05 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    54819b0 View commit details
    Browse the repository at this point in the history
  3. Also handle imports on parameters of lambdas returned from inline defs

    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
    EugeneFlesselle authored and WojciechMazur committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    a16ed38 View commit details
    Browse the repository at this point in the history