Skip to content

Commit 8da0691

Browse files
ghostdogprthesamet
authored andcommitted
Add required using keyword under Scala 3 (#1854)
1 parent 4eb3b5c commit 8da0691

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler-plugin/src/main/scala/scalapb/compiler/GrpcServicePrinter.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,11 @@ final class GrpcServicePrinter(service: ServiceDescriptor, implicits: Descriptor
229229

230230
method.streamType match {
231231
case StreamType.Unary =>
232+
val addUsing = if (method.getFile.emitScala3Sources) "using " else ""
232233
p.add(
233234
s"""$call((request: ${method.inputType.scalaType}, observer: $streamObserver[${method.outputType.scalaType}]) => {
234235
| $serviceImpl.${method.name}(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))(
235-
| $executionContext)
236+
| $addUsing$executionContext)
236237
|}))""".stripMargin
237238
)
238239
case StreamType.ServerStreaming =>

0 commit comments

Comments
 (0)