Skip to content

Commit e0a9fbe

Browse files
committed
Konsist: fix compilation issue and implement workaround.
1 parent 4bce7af commit e0a9fbe

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistArchitectureTest.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,15 @@ class KonsistArchitectureTest {
8282
return@all if (type.startsWith("@") || type.startsWith("(") || type.startsWith("suspend")) {
8383
true
8484
} else {
85-
val fullyQualifiedName = param.type.declaration.packagee?.fullyQualifiedName + "." + type
85+
var typePackage = param.type.declaration.packagee?.name
86+
if (typePackage == type) {
87+
// Workaround, now that packagee.fullyQualifiedName is not available anymore
88+
// It seems that when the type in in the same package as the function,
89+
// the package is equal to the type (which is wrong).
90+
// So in this case, use the package of the function
91+
typePackage = it.packagee?.name
92+
}
93+
val fullyQualifiedName = "$typePackage.$type"
8694
fullyQualifiedName !in forbiddenInterfacesForComposableParameter
8795
}
8896
}

0 commit comments

Comments
 (0)