Skip to content

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

@xuwei-k

Description

@xuwei-k

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions