Add a test

This commit is contained in:
Georgy Bronnikov
2018-12-24 12:00:29 +03:00
parent cb757f1cbc
commit 68f9f4b3b5
6 changed files with 46 additions and 0 deletions
@@ -0,0 +1,21 @@
// KT-4145
interface A {
fun foo(): Any
}
interface B {
fun foo(): String = "A"
}
open class D: B
open class C: D(), A
fun box(): String {
val a: A = C()
if (a.foo() != "A") return "Fail 1"
if ((a as B).foo() != "A") return "Fail 2"
if ((a as C).foo() != "A") return "Fail 3"
return "OK"
}