Skip to content

Fixes for transitive inlining #11911

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

Merged
merged 3 commits into from
Mar 29, 2021
Merged

Fixes for transitive inlining #11911

merged 3 commits into from
Mar 29, 2021

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 26, 2021

Fixes #11894

Two classes of problems:

  1. an Inlined node around a closure was forgotten since the closureDef is too general
  2. inlined type arguments were transformed again, which lead to the double Option application

(2) only appeared for normal inlines, not for transparent inlines. I believe this has to do with the fact that recursive inlines are invoked in different order in the Typer and Inlining phases. In the typer it's during adapt in the Inline typer itself whereas in the inlining phase it is in InliningTreeMap after the first inline has been fully expanded. That makes a difference in that we see already all parameter bindings as regular code.

odersky added 3 commits March 26, 2021 18:12
Inlined type arguments should be left alone in the inliner TreeTypeMap, analogous to inlined
term arguments.
Break out an `InlinerMap` that contains inliner-specific overrides. This avoids
a global mode in TreeTypeMap that had to deal with inliner-specific behavior.
@odersky odersky changed the title Don't drop Inlined nodes in beta reduce Fixes for transitive inlining Mar 27, 2021
@odersky odersky requested a review from nicolasstucki March 27, 2021 09:50
@odersky
Copy link
Contributor Author

odersky commented Mar 27, 2021

I think these are two important fixes that should still go into RC2

@odersky odersky added this to the 3.0.0-RC2 milestone Mar 27, 2021
@odersky
Copy link
Contributor Author

odersky commented Mar 29, 2021

We should merge this before noon, so that we can cut the release.

@odersky odersky merged commit 83bd356 into scala:master Mar 29, 2021
@odersky odersky deleted the fix-11894 branch March 29, 2021 10:59
@Kordyjan Kordyjan modified the milestones: 3.0.0-RC2, 3.0.0 Aug 2, 2023
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.

inline chain corrupts type along the way
3 participants