[VISUALIZER] Render original symbols/descriptors in fir/psi

This commit is contained in:
Ivan Kylchik
2021-03-05 15:36:49 +03:00
committed by TeamCityServer
parent 869585870d
commit e19514f1dc
22 changed files with 243 additions and 156 deletions
@@ -4,7 +4,7 @@ abstract class A {
typealias TA = A
// fun TA.<init>(): TA /* = A */
// constructor A()
// │
class B : TA() {
// constructor A.Nested()
@@ -45,8 +45,9 @@ class SomeClass(multiplier: Int?) {
// Int
// │
get() contract [returnsNotNull()] = 1
// Int [ERROR: unknown type]
//
// EQ operator call
// Int [ERROR: unknown type]
// │ │ │
set(value) contract [returns() implies (value != null)] {
// SomeClass.<set-someInt>.value: Int
// │ [ERROR: not resolved]
@@ -1,7 +1,8 @@
// FIR_IGNORE
// new contracts syntax for simple functions
// [ERROR : MyClass]? [ERROR: unknown type] [ERROR: unknown type]
//
// EQ operator call
// [ERROR : MyClass]?[ERROR: unknown type] [ERROR: unknown type]
// │ │ │ │
fun test1(s: MyClass?) contract [returns() implies (s != null), returns() implies (s is MySubClass)] {
// [ERROR: not resolved]
// │
@@ -1,4 +1,4 @@
// T fun (() -> T).invoke(): T
// T fun (() -> R).invoke(): R
// │ │
fun <T> simpleRun(f: () -> T): T = f()
@@ -10,6 +10,6 @@ fun <T, R> List<T>.simpleMap(f: (T) -> R): R {
// Unit
// │ simpleWith.t: T
// │ │ fun T.invoke(): Unit
// │ │ fun P1.invoke(): R
// │ │ │
fun <T> simpleWith(t: T, f: T.() -> Unit): Unit = t.f()
@@ -2,6 +2,6 @@ interface B
typealias C = B
// C /* = B */
// B
// │
class D : C
@@ -4,6 +4,6 @@ interface B<S, T : A>
typealias C<T> = B<T, A>
// C<A> /* = B<A, A> */
// B<A, A>
// │
class D : C<A>
+2 -2
View File
@@ -40,7 +40,7 @@ fun fooLabeled() {
// │
fun bar(list: List<String>) {
// bar.list: collections/List<String>
// │ fun (collections/List<String>).subList(Int, Int): collections/List<String>
// │ fun (collections/List<E>).subList(Int, Int): collections/List<E>
// │ │ Int
// String │ │ │ Int
// │ │ │ │ │
@@ -51,7 +51,7 @@ fun bar(list: List<String>) {
println(element)
}
// bar.list: collections/List<String>
// │ fun (collections/List<String>).subList(Int, Int): collections/List<String>
// │ fun (collections/List<E>).subList(Int, Int): collections/List<E>
// │ │ fun io/println(Any?): Unit
// String │ │ Int Int │ val bar.element: String
// │ │ │ │ │ │ │
+2 -2
View File
@@ -4,10 +4,10 @@
// │ │
fun foo(x: Int, y: Int, c: Collection<Int>) =
// foo.x: Int
// │ fun (collections/Collection<Int>).contains(Int): Boolean
// │ fun (collections/Collection<E>).contains(E): Boolean
// │ │ foo.c: collections/Collection<Int>
// │ │ │ foo.y: Int
// │ │ │ │ fun (collections/Collection<Int>).contains(Int): Boolean
// │ │ │ │ fun (collections/Collection<E>).contains(E): Boolean
// │ │ │ │ │ foo.c: collections/Collection<Int>
// │ │ │ │ │ │
x in c && y !in c
@@ -2,12 +2,12 @@
fun test(e: Int.() -> String) {
// String
// │ Int
// │ │ fun Int.invoke(): String
// │ │ fun P1.invoke(): R
// │ │ │
val s = 3.e()
// String
// │ Int
// │ │ fun Int.invoke(): String
// │ │ fun P1.invoke(): R
// │ │ │test.e: Int.() -> String
// │ │ ││
val ss = 3.(e)()
@@ -3,7 +3,7 @@
data class Tuple(val x: Int, val y: Int)
// Int
// │ fun ((Tuple) -> Int).invoke(Tuple): Int
// │ fun ((P1) -> R).invoke(P1): R
// │ │ constructor Tuple(Int, Int)
// │ │ │ Int
// │ │ │ │ Int
@@ -1,5 +1,5 @@
// FIR_IGNORE
// T fun (() -> T).invoke(): T
// T fun (() -> R).invoke(): R
// │ │
fun <T> run(block: () -> T): T = block()
@@ -1,4 +1,3 @@
// FIR_IGNORE
fun withLocals(p: Int): Int {
class Local(val pp: Int) {
// Int
@@ -17,7 +16,7 @@ fun withLocals(p: Int): Int {
fun sum(y: Int, z: Int, f: (Int, Int) -> Int): Int {
// val withLocals.x: Int
// │ fun (Int).plus(Int): Int
// │ │ fun ((Int, Int) -> Int).invoke(Int, Int): Int
// │ │ fun ((P1, P2) -> R).invoke(P1, P2): R
// │ │ │ withLocals.sum.y: Int
// │ │ │ │ withLocals.sum.z: Int
// │ │ │ │ │
@@ -41,9 +40,9 @@ fun withLocals(p: Int): Int {
// │ │ │ Int
// │ │ │ │ fun (withLocals.Local).diff(): Int
// │ │ │ │ │ Int
// │ │ │ │ │ │ withLocals.<no name provided>.x: Int
// │ │ │ │ │ │ withLocals.<anonymous>.x: Int
// │ │ │ │ │ │ │ fun (Int).plus(Int): Int
// │ │ │ │ │ │ │ │ withLocals.<no name provided>.y: Int
// │ │ │ │ │ │ │ │ withLocals.<anonymous>.y: Int
// │ │ │ │ │ │ │ │ │
return sum(code, Local(1).diff(), fun(x: Int, y: Int) = x + y)
}
@@ -1,5 +1,5 @@
fun test() {
// class Array<T>: Any, Cloneable, java/io/Serializable
// class Array<T>: java/io/Serializable, Cloneable
// │
Array<String>::class
}
+2 -2
View File
@@ -4,13 +4,13 @@ fun some() {
// constructor KotlinNullPointerException()
// │
throw KotlinNullPointerException()
// RuntimeException /* = java/lang/RuntimeException */
// java/lang/RuntimeException
// │
} catch (e: RuntimeException) {
// fun io/println(Any?): Unit
// │
println("Runtime exception")
// Exception /* = java/lang/Exception */
// java/lang/Exception
// │
} catch (e: Exception) {
// fun io/println(Any?): Unit