Skip to content

Commit

Permalink
Revert "Fix a type mapping bug"
Browse files Browse the repository at this point in the history
This reverts commit 314267f.
  • Loading branch information
traceyyoshima committed Nov 10, 2023
1 parent d8bb8b0 commit 4f67c21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
9 changes: 3 additions & 6 deletions src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,10 @@ class KotlinTypeMapping(
return Unknown.getInstance()
}
val signature = signatureBuilder.signature(type, parent)
if (signature.isNotEmpty()) {
val existing = typeCache.get<JavaType>(signature)
if (existing != null) {
return existing
}
val existing = typeCache.get<JavaType>(signature)
if (existing != null) {
return existing
}

return type(type, parent, signature)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,4 @@ interface B
)
);
}

@Issue("https://github.com/openrewrite/rewrite-kotlin/issues/373")
@Test
void anonymousObject2() {
rewriteRun(
kotlin(
"""
open class Object<T>
class Test(name: String, any: Any)
fun <T> foo(name: String) =
Test(name, object : Object<T>() {
})
"""
)
);
}
}

0 comments on commit 4f67c21

Please sign in to comment.