diff --git a/src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt b/src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt index 7839439ce..8931795f5 100644 --- a/src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt +++ b/src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt @@ -1020,6 +1020,9 @@ class KotlinTypeMapping(typeCache: JavaTypeCache, firSession: FirSession, firFil "*" } + is ConeIntersectionType -> { + "" + } else -> { type.toString() } diff --git a/src/test/java/org/openrewrite/kotlin/KotlinTypeMappingTest.java b/src/test/java/org/openrewrite/kotlin/KotlinTypeMappingTest.java index f9efb4742..09da9ace6 100644 --- a/src/test/java/org/openrewrite/kotlin/KotlinTypeMappingTest.java +++ b/src/test/java/org/openrewrite/kotlin/KotlinTypeMappingTest.java @@ -383,7 +383,7 @@ void genericIntersectionType() { public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, AtomicBoolean atomicBoolean) { if (methodMatcher.matches(method)) { assertThat(method.getMethodType().toString()) - .isEqualTo("kotlin.collections.CollectionsKt{name=listOf,return=kotlin.collections.List & java/io/Serializable)kotlin.Comparable & java.io.Serializable}>>,parameters=[kotlin.Array]}"); + .isEqualTo("kotlin.collections.CollectionsKt{name=listOf,return=kotlin.collections.List & java.io.Serializable}>>,parameters=[kotlin.Array]}"); found.set(true); } return super.visitMethodInvocation(method, atomicBoolean);