Skip to content

Create extension method in infer method action#24721

Merged
tgodzik merged 2 commits intoscala:mainfrom
zielinsky:metals_i7998
Dec 22, 2025
Merged

Create extension method in infer method action#24721
tgodzik merged 2 commits intoscala:mainfrom
zielinsky:metals_i7998

Conversation

@zielinsky
Copy link
Copy Markdown
Member

When trying to infer a method on a type that cannot be modified, instead of returning empty edits, create an extension method in the current scope.

Fixes scalameta/metals#7998

@zielinsky zielinsky marked this pull request as ready for review December 19, 2025 09:45
@zielinsky zielinsky requested a review from tgodzik December 19, 2025 09:45
@zielinsky zielinsky requested a review from tgodzik December 19, 2025 15:30
Copy link
Copy Markdown
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tgodzik tgodzik merged commit 95b6844 into scala:main Dec 22, 2025
56 checks passed
@WojciechMazur WojciechMazur added this to the 3.8.1 milestone Jan 13, 2026
tgodzik pushed a commit to scala/scala3-lts that referenced this pull request Jan 22, 2026
When trying to infer a method on a type that cannot be modified, instead
of returning empty edits, create an extension method in the current
scope.

Fixes scalameta/metals#7998
[Cherry-picked 95b6844]
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.

Don't infer method in select position

4 participants