From 3ef1c205ad64abe83c268713e1a90d2ab7f2a34c Mon Sep 17 00:00:00 2001 From: 0marperez Date: Thu, 19 Dec 2024 12:41:48 -0500 Subject: [PATCH] Use toList supported for JVM versions less than 16 --- .../software/amazon/smithy/kotlin/codegen/model/ShapeExt.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/model/ShapeExt.kt b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/model/ShapeExt.kt index 8c6907faf..a822b6618 100644 --- a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/model/ShapeExt.kt +++ b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/model/ShapeExt.kt @@ -21,6 +21,7 @@ import software.amazon.smithy.rulesengine.language.EndpointRuleSet import software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait import software.amazon.smithy.rulesengine.traits.EndpointTestCase import software.amazon.smithy.rulesengine.traits.EndpointTestsTrait +import kotlin.streams.toList as kotlinToList // Gave this import a unique name because the Java one was being preferred /** * Get all shapes of a particular type from the model. @@ -32,7 +33,7 @@ import software.amazon.smithy.rulesengine.traits.EndpointTestsTrait * shape's closure for example) */ @Suppress("EXTENSION_SHADOWED_BY_MEMBER") -inline fun Model.shapes(): List = shapes(T::class.java).toList() +inline fun Model.shapes(): List = shapes(T::class.java).kotlinToList() /** * Extension function to return a shape of expected type.