JVM IR: do not generate certain special bridges as final
Special bridges which are generated as a replacement for a non-final fake override and use invokespecial to call the already existing implementation in the superclass, should not be final. Otherwise we can't generate an override for the original Kotlin function in a subclass with the same JVM signature.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
import java.util.AbstractMap
|
||||
|
||||
// Neither of getSize, getKeys, getEntries, getValues generated here should be final.
|
||||
abstract class AbstractMutableMap<K, V> : MutableMap<K, V>, AbstractMap<K, V>()
|
||||
|
||||
class MyMap<K, V> : AbstractMutableMap<K, V>() {
|
||||
override val size: Int
|
||||
get() = 1
|
||||
override val entries: MutableSet<MutableMap.MutableEntry<K, V>>
|
||||
get() = null!!
|
||||
}
|
||||
|
||||
fun box(): String =
|
||||
if (MyMap<String, String>().size == 1) "OK" else "Fail"
|
||||
Reference in New Issue
Block a user