Generate bridges for fake overrides when needed

#KT-3985 Fixed
 #KT-4145 Fixed
This commit is contained in:
Alexander Udalov
2014-03-27 19:33:42 +04:00
parent 2c2c918447
commit 04c237cc22
17 changed files with 300 additions and 97 deletions
@@ -0,0 +1,20 @@
open class A<T> {
open fun <U> foo(t: T, u: U) = "A"
}
open class B : A<String>()
class Z : B() {
override fun <U> foo(t: String, u: U) = "Z"
}
fun box(): String {
val z = Z()
return when {
z.foo("", 0) != "Z" -> "Fail #1"
(z : B).foo("", 0) != "Z" -> "Fail #2"
(z : A<String>).foo("", 0) != "Z" -> "Fail #3"
else -> "OK"
}
}