When checking overrides, compare methods structurally

Because they may come from different copies of the same class from different modules
This commit is contained in:
Andrey Breslav
2014-05-29 17:41:46 +04:00
parent 5a864dbc62
commit 204fa76691
27 changed files with 1158 additions and 5 deletions
@@ -0,0 +1,40 @@
// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL
// MODULE: m1
// FILE: a.kt
package p
public trait B {
public fun <T> foo(a: T): B?
}
// MODULE: m2(m1)
// FILE: b.kt
package p
public trait C : B {
override fun <T> foo(a: T): B?
}
// MODULE: m3
// FILE: b.kt
package p
public trait B {
public fun <T> foo(a: T): B?
}
// MODULE: m4(m3, m2)
// FILE: c.kt
import p.*
fun test(b: B?) {
if (b !is C) return
<!DEBUG_INFO_AUTOCAST!>b<!>?.foo("")
}
fun test1(b: B?) {
if (b !is C) return
<!DEBUG_INFO_AUTOCAST!>b<!>?.foo<String>("")
}