[orx-parameters] Clean up warnings

This commit is contained in:
Edwin Jakobs
2023-04-11 14:48:38 +02:00
parent aa8b5b8643
commit ffb797e461

View File

@@ -18,7 +18,7 @@ fun Any.listParameters(): List<Parameter> {
!property.isConst && !property.isConst &&
property is KMutableProperty1<*, *> && property is KMutableProperty1<*, *> &&
property.visibility == KVisibility.PUBLIC && 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 -> }.map { property ->
val annotations = property.annotations.filter { it.annotationClass in ParameterType.parameterAnnotationClasses } val annotations = property.annotations.filter { it.annotationClass in ParameterType.parameterAnnotationClasses }
var intRange: IntRange? = null var intRange: IntRange? = null
@@ -108,6 +108,7 @@ fun Any.listParameters(): List<Parameter> {
} }
} }
} }
@Suppress("UNCHECKED_CAST")
Parameter( Parameter(
parameterType = type ?: error("no type"), parameterType = type ?: error("no type"),
property = property as KMutableProperty1<out Any, Any?>, property = property as KMutableProperty1<out Any, Any?>,
@@ -134,6 +135,7 @@ fun Any.listParameters(): List<Parameter> {
val label = annotation.label val label = annotation.label
val order = annotation.order val order = annotation.order
val type = ParameterType.Action val type = ParameterType.Action
@Suppress("UNCHECKED_CAST")
Parameter( Parameter(
type, type,
property = null, property = null,