JVM_IR KT-46408 properly map fake overrides in method handles
This commit is contained in:
committed by
TeamCityServer
parent
ef2c2c2c9e
commit
83e3a702c5
+43
@@ -0,0 +1,43 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
|
||||
// FILE: kt46408.kt
|
||||
|
||||
open class User<IT : Identity> {
|
||||
protected fun processIdentity(identity: IT) {
|
||||
identity.ok = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
class UserAc : User<AcIdentity>() {
|
||||
fun doStuff(data: Container) {
|
||||
data.processEachWith(this::processIdentity)
|
||||
}
|
||||
}
|
||||
|
||||
interface Identity {
|
||||
var ok: String
|
||||
}
|
||||
|
||||
class AcIdentity(override var ok: String) : Identity
|
||||
|
||||
class Container {
|
||||
var id = AcIdentity("xxx")
|
||||
|
||||
fun processEachWith(action: Action<AcIdentity>) {
|
||||
action.execute(id)
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val c = Container()
|
||||
UserAc().doStuff(c)
|
||||
return c.id.ok
|
||||
}
|
||||
|
||||
// FILE: Action.java
|
||||
|
||||
public interface Action<T> {
|
||||
void execute(T var1);
|
||||
}
|
||||
Reference in New Issue
Block a user