Wrong type inference in Kotlin while overriding RequestMappingHandlerMapping#getMappingForMethod #25657
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Hi!
Im trying override method
org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping#getMappingForMethod
in Kotlin:And kotlin compiler inference return type as non-nullable, but base abstract method in
org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping#getMappingForMethod
declared as nullable:So if I try change return type as nullable:
compiler fails with error:
It seems like Kotlin applies nullability rules from package-info file in this case:
and it is bug.
How can I fixed that?
Thank you.
The text was updated successfully, but these errors were encountered: