JS: serialize type of local anonymous class as its denotable supertype. See KT-14888
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
// MODULE: lib
|
||||
// FILE: lib.kt
|
||||
|
||||
interface I {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
abstract class A {
|
||||
abstract fun bar(): String
|
||||
}
|
||||
|
||||
abstract class G<T> {
|
||||
abstract fun baz(): T
|
||||
}
|
||||
|
||||
class C {
|
||||
private val propA = object : A() {
|
||||
override fun bar() = "propA.bar"
|
||||
|
||||
fun x() = "OK"
|
||||
}
|
||||
|
||||
private val propI = object : I {
|
||||
override fun foo() = "propI.foo"
|
||||
|
||||
fun x() = "OK"
|
||||
}
|
||||
|
||||
private val propAI = object : A(), I {
|
||||
override fun foo() = "propAI.foo"
|
||||
|
||||
override fun bar() = "propAI.bar"
|
||||
|
||||
fun x() = "OK"
|
||||
}
|
||||
|
||||
private val propG = object : G<String>() {
|
||||
override fun baz() = "propG.baz"
|
||||
|
||||
fun x() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
fun test() {
|
||||
println(C().<!INVISIBLE_MEMBER!>propA<!>.x())
|
||||
println(C().<!INVISIBLE_MEMBER!>propI<!>.x())
|
||||
println(C().<!INVISIBLE_MEMBER!>propAI<!>.x())
|
||||
println(C().<!INVISIBLE_MEMBER!>propG<!>.x())
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// -- Module: <lib> --
|
||||
package
|
||||
|
||||
public abstract class A {
|
||||
public constructor A()
|
||||
public abstract fun bar(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class C {
|
||||
public constructor C()
|
||||
private final val propA: C.propA.<no name provided>
|
||||
private final val propAI: C.propAI.<no name provided>
|
||||
private final val propG: C.propG.<no name provided>
|
||||
private final val propI: C.propI.<no name provided>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public abstract class G</*0*/ T> {
|
||||
public constructor G</*0*/ T>()
|
||||
public abstract fun baz(): T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract fun foo(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <main> --
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
Reference in New Issue
Block a user