Skip to content

[BUG][KOTLIN] ApiClient does not compile in Kotlin 2.3.0 #23486

@ffffionn

Description

@ffffionn
Description

Generating a Kotlin client using Kotlin 2.3.0 gives the following error:

[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:2.3.20:compile (compile) on project edi-gateway-api-client: Compilation failure
[ERROR] file:///home/fionn/code/edi-gateway-api/client/target/generated-sources/openapi/src/gen/java/main/com/ddpa/edi/client/infrastructure/ApiClient.kt:355:13 Type argument for reified type parameter 'T' was inferred to the intersection of ['Temporal' & 'TemporalAdjuster' & 'Comparable<OffsetDateTime! & OffsetTime! & ChronoLocalDateTime<*>! & ChronoLocalDate! & LocalTime!>' & 'Serializable']. Reification of an intersection type results in the common supertype being used. This may lead to subtle issues and an explicit type argument is encouraged.             
openapi-generator version

7.21.0

Generation Details

Kotlin Client generator.
I think this will happen under all configuration options.

Steps to reproduce

Generate a Kotlin client.

Suggest a fix

Explicit typing when calling the reified function.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions