FIR: Rename FirSuperTypeScope and reuse it for type parameter type

It would allow ConeKotlinType.scope return FirTypeScope
and thus pulling down org.jetbrains.kotlin.fir.scopes.FirScope#processOverriddenFunctions
(See the following commits)
This commit is contained in:
Denis Zharkov
2020-06-09 16:04:02 +03:00
parent 0bd2a74542
commit 72b09ff323
18 changed files with 83 additions and 121 deletions
@@ -9,5 +9,5 @@ interface B {
}
fun <T> test(x: T) where T : B, T : A {
x.<!AMBIGUITY!>foo<!>()
x.foo()
}
@@ -1,19 +0,0 @@
// !CHECK_TYPE
// FILE: A.java
public interface A {
String foo();
}
// FILE: main.kt
interface B {
fun foo(): String?
}
interface C {
fun foo(): String
}
fun <T> test(x: T) where T : B, T : A, T : C {
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
// FILE: A.java
public interface A {
@@ -1,13 +0,0 @@
// !CHECK_TYPE
interface A {
fun foo(): CharSequence?
}
interface B {
fun foo(): String
}
fun <T> test(x: T) where T : B, T : A {
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
interface A {
@@ -12,8 +12,8 @@ interface B: A {
}
fun <T> test(a: T) where T : B, T : C {
a.<!AMBIGUITY!>foo<!> = ""
a.<!AMBIGUITY!>foo<!> = null
a.foo = ""
a.foo = null
a.<!AMBIGUITY!>foo<!>.<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a.foo.checkType { _<String>() }
}
@@ -12,8 +12,8 @@ interface B: A {
}
fun <T> test(a: T) where T : B, T : C {
a.<!AMBIGUITY!>foo<!> = ""
a.<!AMBIGUITY!>foo<!> = null
a.foo = ""
a.foo = null
a.<!AMBIGUITY!>foo<!>.<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a.foo.checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String>() }
}
@@ -1,13 +0,0 @@
// !CHECK_TYPE
interface A {
fun <T, E> foo(): E
}
interface B {
fun <Q, W> foo(): W
}
fun <T> test(x: T) where T : B, T : A {
x.<!AMBIGUITY!>foo<!><String, Int>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
interface A {