JS: serialize type of local anonymous class as its denotable supertype. See KT-14888

This commit is contained in:
Alexey Andreev
2016-12-13 12:54:08 +03:00
parent b08afb0e93
commit e6501591fa
9 changed files with 204 additions and 3 deletions
@@ -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())
}