gRPC methods named clone, finalize, notify, notifyAll, or wait currently cause grpcakkastream to generate invalid code:
Compilation output (click to expand)
[error] ./target/scala-2.11/src_managed/main/com/tubitv/rpc/TestServiceGrpcAkkaStream.scala:383
type mismatch;
[error] found : Unit
[error] required: akka.stream.Graph[akka.stream.FlowShape[com.tubitv.rpc.In,?],?]
[error] .via(serviceImpl.notify)
[error] ^
[error] ./target/scala-2.11/src_managed/main/com/tubitv/rpc/TestServiceGrpcAkkaStream.scala:384
missing argument list for method onNext in trait StreamObserver
[error] Unapplied methods are only converted to functions when a function type is expected.
[error] You can make this conversion explicit by writing `onNext _` or `onNext(_)` instead of `onNext`.
[error] .runForeach(responseObserver.onNext)
[error] ^
[error] two errors found
[error] (compile:compileIncremental) Compilation failed
This occurs because these five parameterless methods are marked final (or, in the case of clone, protected) in AnyRef. Generating a homonymous method leads the Scala compiler to think we’re trying to override these methods.
This PR fixes this issue by appending an underscore to these method names in the generated code.
gRPC methods named
clone
,finalize
,notify
,notifyAll
, orwait
currently causegrpcakkastream
to generate invalid code:Compilation output (click to expand)
This occurs because these five parameterless methods are marked
final
(or, in the case ofclone
,protected
) inAnyRef
. Generating a homonymous method leads the Scala compiler to think we’re trying to override these methods.This PR fixes this issue by appending an underscore to these method names in the generated code.