Skip to content

Implicit parameters should be provided with a using clause warning since Scala 3.7 #1819

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

Closed
xuwei-k opened this issue Feb 17, 2025 · 2 comments · Fixed by #1854
Closed

Implicit parameters should be provided with a using clause warning since Scala 3.7 #1819

xuwei-k opened this issue Feb 17, 2025 · 2 comments · Fixed by #1854

Comments

@xuwei-k
Copy link
Contributor

xuwei-k commented Feb 17, 2025

compile with latest Scala 3.7 NIGHTLY

3.7.0-RC1-bin-20250215-43f8cdb-NIGHTLY

e2e-grpc/target/jvm-3/src_managed/main/com/thesamet/proto/e2e/service/Service1Grpc.scala:271:12 
[warn] 271 |            executionContext)
[warn]     |            ^^^^^^^^^^^^^^^^
[warn]     |Implicit parameters should be provided with a `using` clause.
[warn]     |This code can be rewritten automatically under -rewrite -source 3.7-migration.
[warn]     |To disable the warning, please use the following option: 
[warn]     |  "-Wconf:msg=Implicit parameters should be provided with a `using` clause:s"

I think we should add using in GrpcServicePrinter if scala3_sources

               s"""$call((request: ${method.inputType.scalaType}, observer: $streamObserver[${method.outputType.scalaType}]) => {
-                 |  $serviceImpl.${method.name}(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))(
+                 |  $serviceImpl.${method.name}(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))(using
                  |    $executionContext)

s"""$call((request: ${method.inputType.scalaType}, observer: $streamObserver[${method.outputType.scalaType}]) => {
| $serviceImpl.${method.name}(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))(
| $executionContext)
|}))""".stripMargin

@ghostdogpr
Copy link
Contributor

Now that Scala 3.7.0 is released, this becomes really needed.

@ghostdogpr
Copy link
Contributor

Opened #1854 for this

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 a pull request may close this issue.

2 participants