diff --git a/src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt b/src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt index d68b0ad69..878c2f872 100644 --- a/src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt +++ b/src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt @@ -84,13 +84,10 @@ class KotlinTypeMapping( return Unknown.getInstance() } val signature = signatureBuilder.signature(type, parent) - if (signature.isNotEmpty()) { - val existing = typeCache.get(signature) - if (existing != null) { - return existing - } + val existing = typeCache.get(signature) + if (existing != null) { + return existing } - return type(type, parent, signature) } diff --git a/src/test/java/org/openrewrite/kotlin/tree/ObjectExpressionTest.java b/src/test/java/org/openrewrite/kotlin/tree/ObjectExpressionTest.java index c1b93ec05..28150d248 100644 --- a/src/test/java/org/openrewrite/kotlin/tree/ObjectExpressionTest.java +++ b/src/test/java/org/openrewrite/kotlin/tree/ObjectExpressionTest.java @@ -69,21 +69,4 @@ interface B ) ); } - - @Issue("https://github.com/openrewrite/rewrite-kotlin/issues/373") - @Test - void anonymousObject2() { - rewriteRun( - kotlin( - """ - open class Object - class Test(name: String, any: Any) - - fun foo(name: String) = - Test(name, object : Object() { - }) - """ - ) - ); - } }