diff --git a/protoc-gen-kroto-plus/src/main/kotlin/com/github/marcoferrer/krotoplus/generators/GrpcCoroutinesGenerator.kt b/protoc-gen-kroto-plus/src/main/kotlin/com/github/marcoferrer/krotoplus/generators/GrpcCoroutinesGenerator.kt index dd7059a..84001fd 100644 --- a/protoc-gen-kroto-plus/src/main/kotlin/com/github/marcoferrer/krotoplus/generators/GrpcCoroutinesGenerator.kt +++ b/protoc-gen-kroto-plus/src/main/kotlin/com/github/marcoferrer/krotoplus/generators/GrpcCoroutinesGenerator.kt @@ -103,7 +103,7 @@ object GrpcCoroutinesGenerator : Generator { .addModifiers(KModifier.OVERRIDE) .getter( FunSpec.getterBuilder() - .addCode("return %T.Default", CommonClassNames.dispatchers) + .addCode("return %T", CommonClassNames.emptyCoroutineContext) .build() ) .build() diff --git a/protoc-gen-kroto-plus/src/main/kotlin/com/github/marcoferrer/krotoplus/utils/CommonNames.kt b/protoc-gen-kroto-plus/src/main/kotlin/com/github/marcoferrer/krotoplus/utils/CommonNames.kt index 34ad3f1..9008e05 100644 --- a/protoc-gen-kroto-plus/src/main/kotlin/com/github/marcoferrer/krotoplus/utils/CommonNames.kt +++ b/protoc-gen-kroto-plus/src/main/kotlin/com/github/marcoferrer/krotoplus/utils/CommonNames.kt @@ -11,6 +11,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.ReceiveChannel import kotlinx.coroutines.channels.SendChannel import kotlin.coroutines.CoroutineContext +import kotlin.coroutines.EmptyCoroutineContext object CommonClassNames{ @@ -18,6 +19,7 @@ object CommonClassNames{ val bindableService: ClassName = BindableService::class.asClassName() val coroutineScope: ClassName = CoroutineScope::class.asClassName() val coroutineContext: ClassName = CoroutineContext::class.asClassName() + val emptyCoroutineContext: ClassName = EmptyCoroutineContext::class.asClassName() val receiveChannel: ClassName = ReceiveChannel::class.asClassName() val sendChannel: ClassName = SendChannel::class.asClassName() val dispatchers: ClassName = Dispatchers::class.asClassName()