Files
kotlin-fork/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt
T
Dmitriy Novozhilov 3d6ec0ec75 [FIR2IR] Automatically store IR declaration in its parent upon creation
Previously, creating a declaration with Fir2IrCallableDeclarationsGenerator/
  Fir2IrClassifiersGenerator didn't guarantee that this declaration will
  be actually added to the list of parent class/file declarations, which
  lead to situations when FIR2IR created some declarations in the air
  (mostly fake-overrides)
2023-10-17 12:46:27 +00:00

91 lines
1.8 KiB
Kotlin
Vendored

interface Visitor {
abstract fun visit()
fun visitArray(): Visitor? {
return null
}
fun visitAnnotation(): Visitor? {
return null
}
}
class AnnotationLoader {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
fun loadAnnotation(): Visitor? {
return { // BLOCK
local class <no name provided> : Visitor {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
override fun visit() {
}
override fun visitArray(): Visitor? {
return { // BLOCK
local class <no name provided> : Visitor {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
override fun visit() {
<this>.foo()
}
}
<no name provided>()
}
}
override fun visitAnnotation(): Visitor? {
val visitor: Visitor = CHECK_NOT_NULL<Visitor>(arg0 = <this>.loadAnnotation())
return { // BLOCK
local class <no name provided> : Visitor {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
private /* final field */ val $$delegate_0: Visitor = visitor
override fun visitArray(): Visitor? {
return <this>.#$$delegate_0.visitArray()
}
override fun visitAnnotation(): Visitor? {
return <this>.#$$delegate_0.visitAnnotation()
}
override fun visit() {
}
}
<no name provided>()
}
}
private fun foo() {
}
}
<no name provided>()
}
}
}