Generate classes in MultifileClassCodegen exactly the same as in PackageCodegen
Two known issues with generateNonPartClassDeclarations that was here before were the fact that we didn't sort sealed classes and its subclasses which led to NoSuchMethodError (KT-27097), and the fact that we didn't skip expect classes which led to incorrect duplicate JVM class name diagnostic (KT-30843) #KT-27097 Fixed #KT-30843 Fixed
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
|
||||
@file:JvmMultifileClass
|
||||
@file:JvmName("Test")
|
||||
package test
|
||||
|
||||
sealed class Foo(val value: String)
|
||||
|
||||
class Bar : Foo("OK")
|
||||
|
||||
fun box(): String = Bar().value
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
// FILE: common.kt
|
||||
|
||||
@file:JvmMultifileClass
|
||||
@file:JvmName("Test")
|
||||
package test
|
||||
|
||||
expect class Foo {
|
||||
val value: String
|
||||
}
|
||||
|
||||
// FILE: jvm.kt
|
||||
|
||||
@file:JvmMultifileClass
|
||||
@file:JvmName("Test")
|
||||
package test
|
||||
|
||||
actual class Foo(actual val value: String)
|
||||
|
||||
fun box(): String {
|
||||
return Foo("OK").value
|
||||
}
|
||||
Reference in New Issue
Block a user