From e9af62579b7af3a65c41960744983db1b884a8a4 Mon Sep 17 00:00:00 2001 From: traceyyoshima Date: Tue, 10 Oct 2023 17:20:31 -0600 Subject: [PATCH] Fixed GTV name of kotlin intersection type. --- src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt | 3 +++ .../java/org/openrewrite/kotlin/KotlinTypeMappingTest.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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);