You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is related to the idea of an "inliner-optimizer" (quoted in this thread about for loops) that would perform scalar replacement (replacing the fields by local variables and inlining the constructor). I'm actually playing with the idea by implementing a new compiler phase in dotty.
ckipp01
transferred this issue from lampepfl/dotty-feature-requests
May 31, 2023
Dotty has method inlining but it is incomplete without constructor inlining.
Motivation
Problem
Compiles to:
which is wasted allocation.
Therefore when inlining method referencing constructor parameters only, there is no need to create object instance.
Possible solutions
The text was updated successfully, but these errors were encountered: