[Raw FIR] Synchronize enum entry building in PSI / light AST modes

This commit is contained in:
Mikhail Glukhikh
2020-01-09 12:44:39 +03:00
parent 65a44e2e20
commit 2b05320ae9
19 changed files with 353 additions and 44 deletions
@@ -0,0 +1,57 @@
//constructor annotation/Target(vararg annotation/AnnotationTarget)
//│ enum class annotation/AnnotationTarget: Enum<annotation/AnnotationTarget>
//│ │ enum entry annotation/AnnotationTarget.ANNOTATION_CLASS
//│ │ │
@Target(AnnotationTarget.ANNOTATION_CLASS) annotation class base
//constructor base()
//│
@base annotation class derived
//constructor base() constructor base()
//│ │
@base class correct(@base val x: Int) {
// constructor base() Int
// │ │
@base constructor(): this(0)
}
//constructor base()
//│
@base enum class My {
// constructor base()
// │
@base FIRST,
// constructor base()
// │
@base SECOND
}
//constructor base()
//│ constructor base()
//│ │ constructor base()
//│ │ │
@base fun foo(@base y: @base Int): Int {
// constructor base()
// │ constructor base()
// │ │ constructor base()
// │ │ │ Int
// │ │ │ │ foo.bar.z: Int
// │ │ │ │ │ fun (Int).plus(Int): Int
// │ │ │ │ │ │ Int
// │ │ │ │ │ │ │
@base fun bar(@base z: @base Int) = z + 1
// constructor base()
// │ fun foo.bar(Int): Int
// │ Int │ foo.y: Int
// │ │ │ │
@base val local = bar(y)
// val foo.local: Int
// │
return local
}
//constructor base()
//│ Int Int
//│ │ │
@base val z = 0
@@ -0,0 +1,24 @@
object A {
constructor()
init {}
}
enum class B {
// constructor B()
// │
X() {
constructor()
}
}
class C {
companion object {
constructor()
}
}
// Any
// │
val anonObject = object {
constructor()
}
@@ -0,0 +1,19 @@
// T fun (() -> T).invoke(): T
// │ │
fun <T> run(block: () -> T): T = block()
fun test_1() {
// fun <T> run<Unit>(() -> Unit): Unit
// │
run { return@run }
// fun <T> run<???>(() -> ???): ???
// │
run { return }
}
fun test_2() {
// fun <T> run<Int>(() -> Int): Int
// │ Int
// │ │
run(fun (): Int { return 1 })
}
@@ -0,0 +1,5 @@
fun test() {
// class Array<T>: Any, Cloneable, java/io/Serializable
// │
Array<String>::class
}