add more tests for bridge methods (fake override)

This commit is contained in:
Michael Nedzelsky
2014-10-04 11:44:21 +04:00
parent 2db1d128a0
commit 0c3a7a9d99
6 changed files with 129 additions and 6 deletions
@@ -0,0 +1,26 @@
trait A<T> {
fun foo(t: T): String
}
trait B {
fun foo(t: Int) = "B"
}
class Z1 : A<Int>, B
class Z2 : B, A<Int>
fun box(): String {
val z1 = Z1()
val z2 = Z2()
return when {
z1.foo( 0) != "B" -> "Fail #1"
(z1 : A<Int>).foo( 0) != "B" -> "Fail #2"
(z1 : B).foo( 0) != "B" -> "Fail #3"
z2.foo( 0) != "B" -> "Fail #4"
(z2 : A<Int>).foo( 0) != "B" -> "Fail #5"
(z2 : B).foo( 0) != "B" -> "Fail #6"
else -> "OK"
}
}