Fix API break in Konsist 0.15.1

This commit is contained in:
Benoit Marty
2024-05-29 17:57:47 +02:00
committed by Benoit Marty
parent 61b1e5dfed
commit 8d3fe2daa5

View File

@@ -87,7 +87,13 @@ class KonsistArchitectureTest {
.withAnnotationOf(Composable::class)
.assertTrue(additionalMessage = "Consider adding the @Immutable or @Stable annotation to the sealed interface") {
it.parameters.all { param ->
param.type.fullyQualifiedName !in forbiddenInterfacesForComposableParameter
val type = param.type.text
return@all if (type.startsWith("@") || type.startsWith("(") || type.startsWith("suspend")) {
true
} else {
val fullyQualifiedName = param.type.declaration.packagee?.fullyQualifiedName + "." + type
fullyQualifiedName !in forbiddenInterfacesForComposableParameter
}
}
}
}