Skip to content

Drop spurious applies in unpickler and inliner#25195

Closed
odersky wants to merge 1 commit intoscala:mainfrom
dotty-staging:fix-25135
Closed

Drop spurious applies in unpickler and inliner#25195
odersky wants to merge 1 commit intoscala:mainfrom
dotty-staging:fix-25135

Conversation

@odersky
Copy link
Copy Markdown
Contributor

@odersky odersky commented Feb 4, 2026

Fixes #25133 (hopefully) by dropping spurious Apply nodes of parameterless methods that override some Java method.

@odersky
Copy link
Copy Markdown
Contributor Author

odersky commented Feb 5, 2026

I originally wanted to change TypeAssigner so that it drops spurious Apply nodes but that did not work since the relevant method has type

def assignType(tree: untpd.Apply, fn: Tree, args: List[Tree])(using Context): Apply

and the Apply return type proved too hard to change. So now I am changing code specifically in Inliner and TreeUnpickler to drop these applications. It turns out the inliner problem was already there, and could not have been fixed by a change to the stdlib. ‎tests/pos/i25133.scala‎ failed before the changes in this PR.

I did not write a test for the original problem which involved compilation with different Scala versions. Not sure our test framework can support that easily. @hamzaremmal, do you think you can add that test?

@hamzaremmal
Copy link
Copy Markdown
Member

I did not write a test for the original problem which involved compilation with different Scala versions. Not sure our test framework can support that easily. @hamzaremmal, do you think you can add that test?

Yes, I'll do that.

@odersky
Copy link
Copy Markdown
Contributor Author

odersky commented Feb 6, 2026

Superseded by #25201. Closing since the branch name had the wrong issue number.

@odersky odersky closed this Feb 6, 2026
WojciechMazur added a commit that referenced this pull request Feb 10, 2026
Fixes #25133 (hopefully) by
dropping spurious Apply nodes of parameterless methods that override
some Java method.

Supersedes #25195

---------

Co-authored-by: Lukas Rytz <lukas.rytz@gmail.com>
Co-authored-by: Wojciech Mazur <wmazur@virtuslab.com>
WojciechMazur added a commit that referenced this pull request Feb 10, 2026
Fixes #25133 (hopefully) by
dropping spurious Apply nodes of parameterless methods that override
some Java method.

Supersedes #25195

---------

Co-authored-by: Lukas Rytz <lukas.rytz@gmail.com>
Co-authored-by: Wojciech Mazur <wmazur@virtuslab.com>
[Cherry-picked 7a02032]
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.

Scala 3.3.7 compiles parameterless call to Apply in Tasty

2 participants