FIR: Fix processOverriddenFunctions implementations

This commit is contained in:
Denis Zharkov
2020-06-09 19:23:25 +03:00
parent 28627e9754
commit bea37569e6
6 changed files with 98 additions and 4 deletions
@@ -0,0 +1,38 @@
// FILE: JA.java
public interface JA<E> {
public E getFoo();
}
// FILE: main.kt
interface KB<F> {
override fun getFoo(): F
override fun getBar(): F
}
interface D1 : JA<String>, KB<String>
interface E1 : D1 {
override fun getFoo(): String
override fun getBar(): String
}
interface D2 : KB<String>, JA<String>
interface E2 : D2 {
override fun getFoo(): String
override fun getBar(): String
}
fun main(
d1: D1, e1: E1,
d2: D2, e2: E2,
) {
d1.foo
d1.<!UNRESOLVED_REFERENCE!>bar<!>
e1.foo
e1.<!UNRESOLVED_REFERENCE!>bar<!>
d2.foo
d2.<!UNRESOLVED_REFERENCE!>bar<!>
e2.foo
e2.<!UNRESOLVED_REFERENCE!>bar<!>
}
@@ -0,0 +1,33 @@
FILE: main.kt
public abstract interface KB<F> : R|kotlin/Any| {
public abstract override fun getFoo(): R|F|
public abstract override fun getBar(): R|F|
}
public abstract interface D1 : R|JA<kotlin/String>|, R|KB<kotlin/String>| {
}
public abstract interface E1 : R|D1| {
public abstract override fun getFoo(): R|kotlin/String|
public abstract override fun getBar(): R|kotlin/String|
}
public abstract interface D2 : R|KB<kotlin/String>|, R|JA<kotlin/String>| {
}
public abstract interface E2 : R|D2| {
public abstract override fun getFoo(): R|kotlin/String|
public abstract override fun getBar(): R|kotlin/String|
}
public final fun main(d1: R|D1|, e1: R|E1|, d2: R|D2|, e2: R|E2|): R|kotlin/Unit| {
R|<local>/d1|.R|/D1.foo|
R|<local>/d1|.<Unresolved name: bar>#
R|<local>/e1|.R|/E1.foo|
R|<local>/e1|.<Unresolved name: bar>#
R|<local>/d2|.R|/D2.foo|
R|<local>/d2|.<Unresolved name: bar>#
R|<local>/e2|.R|/E2.foo|
R|<local>/e2|.<Unresolved name: bar>#
}