From 8d3fe2daa55579339169437d44f93f2bd00df662 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 29 May 2024 17:57:47 +0200 Subject: [PATCH] Fix API break in Konsist 0.15.1 --- .../android/tests/konsist/KonsistArchitectureTest.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistArchitectureTest.kt b/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistArchitectureTest.kt index 21625d50a5..43123deac0 100644 --- a/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistArchitectureTest.kt +++ b/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistArchitectureTest.kt @@ -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 + } } } }