JVM KT-49613 use adapter for indy reference to protected constructor
This commit is contained in:
committed by
TeamCityServer
parent
76bdf4ff1a
commit
916379c0e7
+28
@@ -0,0 +1,28 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
// FILE: kt49613.kt
|
||||
|
||||
interface GetStep {
|
||||
fun get(): Any
|
||||
}
|
||||
|
||||
class Outer protected constructor(val ok: Any) {
|
||||
constructor(): this("xxx")
|
||||
|
||||
val obj = object : GetStep {
|
||||
override fun get() = Step(::Outer)
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val s = Outer().obj.get() as Step
|
||||
val t = s.step("OK") as Outer
|
||||
return t.ok as String
|
||||
}
|
||||
|
||||
// FILE: Step.java
|
||||
|
||||
public interface Step {
|
||||
Object step(String string);
|
||||
}
|
||||
Reference in New Issue
Block a user