mscheong01 / krotoDC

Protobuf Kotlin Dataclass, Converter & Custom Kotlin Coroutine gRPC Generator
Apache License 2.0
91 stars 8 forks source link

Enum argument can be null in Java, but exhaustive when contains no null branch #2

Closed pambrose closed 1 year ago

pambrose commented 1 year ago

First, thanks so much for this project. It should be part of the Kotlin/gRPC distro.

The generated .toDataClass() methods are generating this compiler warning

Enum argument can be null in Java, but exhaustive when contains no null branch

for the when argument. Adding

null -> null

would get rid of the warning.

Again, thanks for your efforts with this project.

mscheong01 commented 1 year ago

Hi, thanks a lot for filing this issue 🙂 I was actually aware of this warning, but missed handling it before releasing. I agree that we should avoid having warnings in the generated code if possible. I'll add the null -> clause to genereated when statements and have the warnings removed in the next patch.

mscheong01 commented 1 year ago

This was released as 1.0.1 thanks again!

pambrose commented 1 year ago

Looks good! Thanks.