smithy-rs fails to compile with Kotlin 2.3.20 (released 2026-03-16). Two files are affected:
1. codegen-server — ServerProtocolBasedTransformationFactory.kt
The removeTraitIfPresent extension function has a phantom type parameter B that is only used in a where clause and an unchecked cast. Kotlin 2.3.20's stricter type inference rejects the call sites because it cannot verify B is within its bounds.
e: ServerProtocolBasedTransformationFactory.kt:50:44 Type argument is not within its bounds: must be subtype of 'AbstractShapeBuilder<SmithyBuilder<OperationShape!>, OperationShape!>'
2. codegen-aws-sdk — MakeS3BoolsAndNumbersOptional.kt
AbstractShapeBuilder<*, *> is used as an explicit type annotation, but AbstractShapeBuilder has a recursive self-referential bound (<B extends AbstractShapeBuilder<B, S>, S extends Shape>). Kotlin 2.3.20 now enforces that * satisfies this bound.
e: MakeS3BoolsAndNumbersOptional.kt:31:69 Type argument is not within its bounds:
must be subtype of 'AbstractShapeBuilder<AbstractShapeBuilder<...>!, SimpleShape!>!'
Both issues compile fine on Kotlin 2.1.0 (the current version)
smithy-rs fails to compile with Kotlin 2.3.20 (released 2026-03-16). Two files are affected:
1.
codegen-server—ServerProtocolBasedTransformationFactory.ktThe
removeTraitIfPresentextension function has a phantom type parameterBthat is only used in awhereclause and an unchecked cast. Kotlin 2.3.20's stricter type inference rejects the call sites because it cannot verifyBis within its bounds.2.
codegen-aws-sdk—MakeS3BoolsAndNumbersOptional.ktAbstractShapeBuilder<*, *>is used as an explicit type annotation, butAbstractShapeBuilderhas a recursive self-referential bound (<B extends AbstractShapeBuilder<B, S>, S extends Shape>). Kotlin 2.3.20 now enforces that*satisfies this bound.Both issues compile fine on Kotlin 2.1.0 (the current version)