Skip to content

Commit 3ef1c20

Browse files
committed
Use toList supported for JVM versions less than 16
1 parent dc3ce8b commit 3ef1c20

File tree

1 file changed

+2
-1
lines changed
  • codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/model

1 file changed

+2
-1
lines changed

codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/model/ShapeExt.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import software.amazon.smithy.rulesengine.language.EndpointRuleSet
2121
import software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait
2222
import software.amazon.smithy.rulesengine.traits.EndpointTestCase
2323
import software.amazon.smithy.rulesengine.traits.EndpointTestsTrait
24+
import kotlin.streams.toList as kotlinToList // Gave this import a unique name because the Java one was being preferred
2425

2526
/**
2627
* Get all shapes of a particular type from the model.
@@ -32,7 +33,7 @@ import software.amazon.smithy.rulesengine.traits.EndpointTestsTrait
3233
* shape's closure for example)
3334
*/
3435
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
35-
inline fun <reified T : Shape> Model.shapes(): List<T> = shapes(T::class.java).toList()
36+
inline fun <reified T : Shape> Model.shapes(): List<T> = shapes(T::class.java).kotlinToList()
3637

3738
/**
3839
* Extension function to return a shape of expected type.

0 commit comments

Comments
 (0)