From ffb797e46166b2997e570371cebf04d8a920aece Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Tue, 11 Apr 2023 14:48:38 +0200 Subject: [PATCH] [orx-parameters] Clean up warnings --- orx-parameters/src/jvmMain/kotlin/Annotations.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/orx-parameters/src/jvmMain/kotlin/Annotations.kt b/orx-parameters/src/jvmMain/kotlin/Annotations.kt index b3f48c3d..b64f908e 100644 --- a/orx-parameters/src/jvmMain/kotlin/Annotations.kt +++ b/orx-parameters/src/jvmMain/kotlin/Annotations.kt @@ -18,7 +18,7 @@ fun Any.listParameters(): List { !property.isConst && property is KMutableProperty1<*, *> && property.visibility == KVisibility.PUBLIC && - property.annotations.map { it.annotationClass }.intersect(ParameterType.parameterAnnotationClasses).isNotEmpty() + property.annotations.map { it.annotationClass }.intersect(ParameterType.parameterAnnotationClasses.toSet()).isNotEmpty() }.map { property -> val annotations = property.annotations.filter { it.annotationClass in ParameterType.parameterAnnotationClasses } var intRange: IntRange? = null @@ -108,6 +108,7 @@ fun Any.listParameters(): List { } } } + @Suppress("UNCHECKED_CAST") Parameter( parameterType = type ?: error("no type"), property = property as KMutableProperty1, @@ -134,6 +135,7 @@ fun Any.listParameters(): List { val label = annotation.label val order = annotation.order val type = ParameterType.Action + @Suppress("UNCHECKED_CAST") Parameter( type, property = null,