Drop traits with required classes

#KT-4771 Rejected
This commit is contained in:
Alexander Udalov
2015-06-16 23:40:25 +03:00
parent dc909ba1d4
commit 1a3209e1dc
63 changed files with 49 additions and 1109 deletions
@@ -2,8 +2,6 @@ open class A {
open fun foo(): Any = "A"
}
interface B : A
open class C : A() {
override fun foo(): Int = 222
}
@@ -12,14 +10,13 @@ interface D {
fun foo(): Number
}
class E : B, C(), D
class E : C(), D
fun box(): String {
val e = E()
if (e.foo() != 222) return "Fail 1"
if ((e : D).foo() != 222) return "Fail 2"
if ((e : C).foo() != 222) return "Fail 3"
if ((e : B).foo() != 222) return "Fail 4"
if ((e : A).foo() != 222) return "Fail 5"
if ((e : A).foo() != 222) return "Fail 4"
return "OK"
}