FIR IDE: add API to get super types of a KtType
This commit is contained in:
committed by
Ilya Kirillov
parent
09d16ce849
commit
8b44a4685f
@@ -0,0 +1,4 @@
|
||||
interface A
|
||||
interface B
|
||||
val o = object: A, B {}
|
||||
val o2 = <expr>o</expr>
|
||||
@@ -0,0 +1,17 @@
|
||||
[direct super types]
|
||||
A
|
||||
B
|
||||
|
||||
[approximated direct super types]
|
||||
A
|
||||
B
|
||||
|
||||
[all super types]
|
||||
A
|
||||
B
|
||||
kotlin.Any
|
||||
|
||||
[approximated all super types]
|
||||
A
|
||||
B
|
||||
kotlin.Any
|
||||
@@ -0,0 +1 @@
|
||||
val a = <expr>Any()</expr>
|
||||
@@ -0,0 +1,7 @@
|
||||
[direct super types]
|
||||
|
||||
[approximated direct super types]
|
||||
|
||||
[all super types]
|
||||
|
||||
[approximated all super types]
|
||||
@@ -0,0 +1,3 @@
|
||||
val s = <expr>get()</expr>
|
||||
|
||||
fun get() : MutableList<in String>
|
||||
@@ -0,0 +1,23 @@
|
||||
[direct super types]
|
||||
kotlin.collections.List<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.MutableCollection<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
|
||||
[approximated direct super types]
|
||||
kotlin.collections.List<kotlin.Any?>
|
||||
kotlin.collections.MutableCollection<in kotlin.String>
|
||||
|
||||
[all super types]
|
||||
kotlin.collections.List<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.MutableCollection<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.Collection<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.MutableIterable<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.Iterable<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.Any
|
||||
|
||||
[approximated all super types]
|
||||
kotlin.collections.List<kotlin.Any?>
|
||||
kotlin.collections.MutableCollection<in kotlin.String>
|
||||
kotlin.collections.Collection<kotlin.Any?>
|
||||
kotlin.collections.MutableIterable<kotlin.Any?>
|
||||
kotlin.collections.Iterable<kotlin.Any?>
|
||||
kotlin.Any
|
||||
@@ -0,0 +1,3 @@
|
||||
val s = <expr>get()</expr>
|
||||
|
||||
fun get() : MutableList<out String>
|
||||
@@ -0,0 +1,23 @@
|
||||
[direct super types]
|
||||
kotlin.collections.List<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.MutableCollection<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
|
||||
[approximated direct super types]
|
||||
kotlin.collections.List<kotlin.String>
|
||||
kotlin.collections.MutableCollection<out kotlin.String>
|
||||
|
||||
[all super types]
|
||||
kotlin.collections.List<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.MutableCollection<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.Collection<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.MutableIterable<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.Iterable<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.Any
|
||||
|
||||
[approximated all super types]
|
||||
kotlin.collections.List<kotlin.String>
|
||||
kotlin.collections.MutableCollection<out kotlin.String>
|
||||
kotlin.collections.Collection<kotlin.String>
|
||||
kotlin.collections.MutableIterable<kotlin.String>
|
||||
kotlin.collections.Iterable<kotlin.String>
|
||||
kotlin.Any
|
||||
@@ -0,0 +1,2 @@
|
||||
val i: UnresolvedType? = null
|
||||
val j = <expr>i</expr>
|
||||
@@ -0,0 +1,7 @@
|
||||
[direct super types]
|
||||
|
||||
[approximated direct super types]
|
||||
|
||||
[all super types]
|
||||
|
||||
[approximated all super types]
|
||||
@@ -0,0 +1,12 @@
|
||||
// FILE: Java.java
|
||||
import java.util.List
|
||||
|
||||
class Java {
|
||||
public static List<String> getNames() {
|
||||
throw Exception()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
val i = <expr>Java.getNames()</expr>
|
||||
@@ -0,0 +1,32 @@
|
||||
[direct super types]
|
||||
kotlin.collections.List<kotlin.String!>
|
||||
kotlin.collections.MutableCollection<kotlin.String!>
|
||||
kotlin.collections.Collection<kotlin.String!>?
|
||||
|
||||
[approximated direct super types]
|
||||
kotlin.collections.List<kotlin.String!>
|
||||
kotlin.collections.MutableCollection<kotlin.String!>
|
||||
kotlin.collections.Collection<kotlin.String!>?
|
||||
|
||||
[all super types]
|
||||
kotlin.collections.List<kotlin.String!>
|
||||
kotlin.collections.MutableCollection<kotlin.String!>
|
||||
kotlin.collections.Collection<kotlin.String!>?
|
||||
kotlin.collections.Collection<kotlin.String!>
|
||||
kotlin.collections.MutableIterable<kotlin.String!>
|
||||
kotlin.collections.Iterable<kotlin.String!>?
|
||||
kotlin.collections.Iterable<kotlin.String!>
|
||||
kotlin.Any?
|
||||
kotlin.Any
|
||||
|
||||
[approximated all super types]
|
||||
kotlin.collections.List<kotlin.String!>
|
||||
kotlin.collections.MutableCollection<kotlin.String!>
|
||||
kotlin.collections.Collection<kotlin.String!>?
|
||||
kotlin.collections.Collection<kotlin.String!>
|
||||
kotlin.collections.MutableIterable<kotlin.String!>
|
||||
kotlin.collections.Iterable<kotlin.String!>?
|
||||
kotlin.collections.Iterable<kotlin.String!>
|
||||
kotlin.Any?
|
||||
kotlin.Any
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
val i = <expr>1</expr>
|
||||
@@ -0,0 +1,21 @@
|
||||
[direct super types]
|
||||
kotlin.Number
|
||||
kotlin.Comparable<kotlin.Int>
|
||||
java.io.Serializable
|
||||
|
||||
[approximated direct super types]
|
||||
kotlin.Number
|
||||
kotlin.Comparable<kotlin.Int>
|
||||
java.io.Serializable
|
||||
|
||||
[all super types]
|
||||
kotlin.Number
|
||||
kotlin.Comparable<kotlin.Int>
|
||||
java.io.Serializable
|
||||
kotlin.Any
|
||||
|
||||
[approximated all super types]
|
||||
kotlin.Number
|
||||
kotlin.Comparable<kotlin.Int>
|
||||
java.io.Serializable
|
||||
kotlin.Any
|
||||
@@ -0,0 +1,3 @@
|
||||
val s = <expr>get()</expr>
|
||||
|
||||
fun get() : MutableList<String>
|
||||
@@ -0,0 +1,23 @@
|
||||
[direct super types]
|
||||
kotlin.collections.List<kotlin.String>
|
||||
kotlin.collections.MutableCollection<kotlin.String>
|
||||
|
||||
[approximated direct super types]
|
||||
kotlin.collections.List<kotlin.String>
|
||||
kotlin.collections.MutableCollection<kotlin.String>
|
||||
|
||||
[all super types]
|
||||
kotlin.collections.List<kotlin.String>
|
||||
kotlin.collections.MutableCollection<kotlin.String>
|
||||
kotlin.collections.Collection<kotlin.String>
|
||||
kotlin.collections.MutableIterable<kotlin.String>
|
||||
kotlin.collections.Iterable<kotlin.String>
|
||||
kotlin.Any
|
||||
|
||||
[approximated all super types]
|
||||
kotlin.collections.List<kotlin.String>
|
||||
kotlin.collections.MutableCollection<kotlin.String>
|
||||
kotlin.collections.Collection<kotlin.String>
|
||||
kotlin.collections.MutableIterable<kotlin.String>
|
||||
kotlin.collections.Iterable<kotlin.String>
|
||||
kotlin.Any
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class Foo<T : Foo<T>>(t: T) {
|
||||
val t2 = <expr>t</expr>
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
[direct super types]
|
||||
Foo<T>
|
||||
|
||||
[approximated direct super types]
|
||||
Foo<T>
|
||||
|
||||
[all super types]
|
||||
Foo<T>
|
||||
kotlin.Any
|
||||
|
||||
[approximated all super types]
|
||||
Foo<T>
|
||||
kotlin.Any
|
||||
@@ -0,0 +1,3 @@
|
||||
class A
|
||||
|
||||
val a = <expr>A()</expr>
|
||||
@@ -0,0 +1,11 @@
|
||||
[direct super types]
|
||||
kotlin.Any
|
||||
|
||||
[approximated direct super types]
|
||||
kotlin.Any
|
||||
|
||||
[all super types]
|
||||
kotlin.Any
|
||||
|
||||
[approximated all super types]
|
||||
kotlin.Any
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
interface I
|
||||
open class A
|
||||
class B: A(), I
|
||||
|
||||
val b = <expr>B()</expr>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
[direct super types]
|
||||
A
|
||||
I
|
||||
|
||||
[approximated direct super types]
|
||||
A
|
||||
I
|
||||
|
||||
[all super types]
|
||||
A
|
||||
I
|
||||
kotlin.Any
|
||||
|
||||
[approximated all super types]
|
||||
A
|
||||
I
|
||||
kotlin.Any
|
||||
@@ -0,0 +1,3 @@
|
||||
val s = <expr>get()</expr>
|
||||
|
||||
fun get() : MutableList<*>
|
||||
@@ -0,0 +1,23 @@
|
||||
[direct super types]
|
||||
kotlin.collections.List<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.MutableCollection<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
|
||||
[approximated direct super types]
|
||||
kotlin.collections.List<kotlin.Any?>
|
||||
kotlin.collections.MutableCollection<out kotlin.Any?>
|
||||
|
||||
[all super types]
|
||||
kotlin.collections.List<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.MutableCollection<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.Collection<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.MutableIterable<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.collections.Iterable<ERROR_TYPE <Unexpected cone type org.jetbrains.kotlin.fir.types.ConeCapturedType>>
|
||||
kotlin.Any
|
||||
|
||||
[approximated all super types]
|
||||
kotlin.collections.List<kotlin.Any?>
|
||||
kotlin.collections.MutableCollection<out kotlin.Any?>
|
||||
kotlin.collections.Collection<kotlin.Any?>
|
||||
kotlin.collections.MutableIterable<kotlin.Any?>
|
||||
kotlin.collections.Iterable<kotlin.Any?>
|
||||
kotlin.Any
|
||||
@@ -0,0 +1 @@
|
||||
val s = <expr>""</expr>
|
||||
@@ -0,0 +1,21 @@
|
||||
[direct super types]
|
||||
kotlin.Comparable<kotlin.String>
|
||||
kotlin.CharSequence
|
||||
java.io.Serializable
|
||||
|
||||
[approximated direct super types]
|
||||
kotlin.Comparable<kotlin.String>
|
||||
kotlin.CharSequence
|
||||
java.io.Serializable
|
||||
|
||||
[all super types]
|
||||
kotlin.Comparable<kotlin.String>
|
||||
kotlin.CharSequence
|
||||
java.io.Serializable
|
||||
kotlin.Any
|
||||
|
||||
[approximated all super types]
|
||||
kotlin.Comparable<kotlin.String>
|
||||
kotlin.CharSequence
|
||||
java.io.Serializable
|
||||
kotlin.Any
|
||||
@@ -0,0 +1,3 @@
|
||||
class Foo<T : List<String>>(t: T) {
|
||||
val t2 = <expr>t</expr>
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
[direct super types]
|
||||
kotlin.collections.List<kotlin.String>
|
||||
|
||||
[approximated direct super types]
|
||||
kotlin.collections.List<kotlin.String>
|
||||
|
||||
[all super types]
|
||||
kotlin.collections.List<kotlin.String>
|
||||
kotlin.collections.Collection<kotlin.String>
|
||||
kotlin.collections.Iterable<kotlin.String>
|
||||
kotlin.Any
|
||||
|
||||
[approximated all super types]
|
||||
kotlin.collections.List<kotlin.String>
|
||||
kotlin.collections.Collection<kotlin.String>
|
||||
kotlin.collections.Iterable<kotlin.String>
|
||||
kotlin.Any
|
||||
Reference in New Issue
Block a user