Drew Hamilton
01/11/2025, 5:28 PMdmitriy.novozhilov
01/13/2025, 8:18 AMFirRegularClass.declarations
after it was initially created)
abstract class A {
final override fun toString() = "hello"
}
data class B(val x: Int) : A() {
// `toString` is not generated
}
dmitriy.novozhilov
01/13/2025, 8:20 AM// MODULE: common
expect abstract class A
data class B(val x: Int) : A()
fun testCommon(b: B) {
b.toString() // resolved to "generated" B.toString
}
// MODULE: platform()()(common)
actual abstract class A {
final override fun toString() = "hello"
}
fun testPlatform(b: B) {
b.toString() // resolved to A.toString
}
dmitriy.novozhilov
01/13/2025, 8:21 AMFirRegularClass
directly (which is the same across all modules)Drew Hamilton
01/13/2025, 3:04 PMDrew Hamilton
01/17/2025, 9:22 PMUnless the warning I’m seeing is the mistaken warning that that ticket mentionsCopy codefunction 'toString': the modality of this member must be the same in the expect class and the actual class. This error happens because the expect class 'A' is non-final. This warning will become an error in future releases. Also see <https://youtrack.jetbrains.com/issue/KT-22841> for more details
dmitriy.novozhilov
01/17/2025, 10:04 PM