Skip to content

Add a compiler quick fix for "Implicit parameters should be provided with a using clause" #23071

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

Open
unkarjedy opened this issue Apr 30, 2025 · 0 comments · May be fixed by #23079
Open

Add a compiler quick fix for "Implicit parameters should be provided with a using clause" #23071

unkarjedy opened this issue Apr 30, 2025 · 0 comments · May be fixed by #23079

Comments

@unkarjedy
Copy link
Contributor

Scala 3.7.0-RC4

This code:

def foo()(implicit x: Int): String = ???

def main(): Unit = {
  foo()(42)
  foo()(42)
  foo()(42)
}

Generates warning:

Implicit parameters should be provided with a `using` clause.
This code can be rewritten automatically under -rewrite -source 3.7-migration.
To disable the warning, please use the following option:
"-Wconf:msg=Implicit parameters should be provided with a `using` clause:s"
Image

It would be nice if the compiler could provide the compiler fix for the warning.

@tgodzik tgodzik self-assigned this Apr 30, 2025
tgodzik added a commit to tgodzik/scala3 that referenced this issue Apr 30, 2025
This should add the code action to both Metals and Intellij.

I will try to go over the existing rewrites to see if we can add more actions easily.

Fixes scala#23071
@tgodzik tgodzik linked a pull request Apr 30, 2025 that will close this issue
tgodzik added a commit to tgodzik/scala3 that referenced this issue Apr 30, 2025
This should add the code action to both Metals and Intellij.

I will try to go over the existing rewrites to see if we can add more actions easily.

Fixes scala#23071
tgodzik added a commit to tgodzik/scala3 that referenced this issue May 1, 2025
This should add the code action to both Metals and Intellij.

I will try to go over the existing rewrites to see if we can add more actions easily.

Fixes scala#23071
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants