Description
KT-52469 introduced a compiler warning in Kotlin 2.1 in case a reified type parameter is inferred to an intersection type. In future Kotlin releases, this will lead to an error.
The generated Kotlin code for the library jvm-okhttp4
contains a section that generates this warning: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache#L483-L490
protected fun parameterToString(value: Any?): String = when (value) {
/* ... */
is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime ->
parseDateToQueryString(value)
/* ... */
}
This issue can simply be reproduced by generating Kotlin code for any OpenAPI specification using the library jvm-okhttp4
and compiling it with Kotlin 2.1 or above.
This is not an urgent issue, but something that will need to be fixed in order to ensure compatibility with future Kotlin releases.