Skip to content

Commit

Permalink
Use toList supported for JVM versions less than 16
Browse files Browse the repository at this point in the history
  • Loading branch information
0marperez committed Dec 19, 2024
1 parent dc3ce8b commit 3ef1c20
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -32,7 +33,7 @@ import software.amazon.smithy.rulesengine.traits.EndpointTestsTrait
* shape's closure for example)
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
inline fun <reified T : Shape> Model.shapes(): List<T> = shapes(T::class.java).toList()
inline fun <reified T : Shape> Model.shapes(): List<T> = shapes(T::class.java).kotlinToList()

/**
* Extension function to return a shape of expected type.
Expand Down

0 comments on commit 3ef1c20

Please sign in to comment.