Fix local anonymous class name error in K2MetadataCompiler

Extract the logic of approximating to denotable class supertype
from JS/KLIB and use it in metadata compiler.

^KT-20996 In Progress
This commit is contained in:
Pavel Kirpichenkov
2021-01-14 18:53:18 +03:00
parent b82a44fa63
commit 2f3f75b512
9 changed files with 200 additions and 114 deletions
@@ -725,6 +725,18 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
loadClassFile("SourceKt", tmpdir, library)
}
fun testAnonymousObjectTypeMetadata() {
val library = compileCommonLibrary(
libraryName = "library",
)
compileKotlin(
"anonymousObjectTypeMetadata.kt",
tmpdir,
listOf(library),
K2MetadataCompiler(),
)
}
private fun loadClassFile(className: String, dir: File, library: File) {
val classLoader = URLClassLoader(arrayOf(dir.toURI().toURL(), library.toURI().toURL()))
val mainClass = classLoader.loadClass(className)