FIR: Add separate local scopes for blocks
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
class B {
|
||||
fun append() {}
|
||||
}
|
||||
|
||||
class A {
|
||||
val message = B()
|
||||
|
||||
fun foo(w: Boolean) {
|
||||
if (w) {
|
||||
val message = ""
|
||||
message.toString()
|
||||
} else {
|
||||
message.append() // message here should relate to the class-level property
|
||||
}
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
FILE: blockLocalScopes.kt
|
||||
public final class B : R|kotlin/Any| {
|
||||
public constructor(): R|B| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun append(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public final class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val message: R|B| = R|/B.B|()
|
||||
public get(): R|B|
|
||||
|
||||
public final fun foo(w: R|kotlin/Boolean|): R|kotlin/Unit| {
|
||||
when () {
|
||||
R|<local>/w| -> {
|
||||
lval message: R|kotlin/String| = String()
|
||||
R|<local>/message|.R|kotlin/Any.toString|()
|
||||
}
|
||||
else -> {
|
||||
this@R|/A|.R|/A.message|.R|/B.append|()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user