FIR: set anonymous initializers' parents

This commit is contained in:
pyos
2019-11-21 13:25:16 +01:00
committed by Dmitriy Novozhilov
parent b38153e402
commit 57760e5873
7 changed files with 1 additions and 6 deletions
@@ -411,6 +411,7 @@ class Fir2IrVisitor(
symbolTable.declareAnonymousInitializer( symbolTable.declareAnonymousInitializer(
startOffset, endOffset, origin, parent.descriptor startOffset, endOffset, origin, parent.descriptor
).apply { ).apply {
setParentByParentStack()
declarationStorage.enterScope(descriptor) declarationStorage.enterScope(descriptor)
body = anonymousInitializer.body!!.convertToIrBlockBody() body = anonymousInitializer.body!!.convertToIrBlockBody()
declarationStorage.leaveScope(descriptor) declarationStorage.leaveScope(descriptor)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM // TARGET_BACKEND: JVM
// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm // KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm
// WITH_RUNTIME // WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: NATIVE // IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR
var global = 0; var global = 0;
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class C() { class C() {
public var f: Int public var f: Int
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class Reluctant() { class Reluctant() {
init { init {
throw Exception("I'm not coming out") throw Exception("I'm not coming out")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun foo(x: Int = 42) = x fun foo(x: Int = 42) = x
class C { class C {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
object Foo { object Foo {
val bar: String val bar: String