FIR2IR: set parent correctly (~) for anonymous functions
This commit is contained in:
+3
-3
@@ -237,8 +237,8 @@ class Fir2IrDeclarationStorage(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun findIrParent(callableMemberDeclaration: FirCallableMemberDeclaration<*>): IrDeclarationParent? {
|
internal fun findIrParent(callableDeclaration: FirCallableDeclaration<*>): IrDeclarationParent? {
|
||||||
val firBasedSymbol = callableMemberDeclaration.symbol
|
val firBasedSymbol = callableDeclaration.symbol
|
||||||
val callableId = firBasedSymbol.callableId
|
val callableId = firBasedSymbol.callableId
|
||||||
val parentClassId = callableId.classId
|
val parentClassId = callableId.classId
|
||||||
return if (parentClassId != null) {
|
return if (parentClassId != null) {
|
||||||
@@ -675,7 +675,7 @@ class Fir2IrDeclarationStorage(
|
|||||||
|
|
||||||
fun getIrFunctionSymbol(firFunctionSymbol: FirFunctionSymbol<*>): IrFunctionSymbol {
|
fun getIrFunctionSymbol(firFunctionSymbol: FirFunctionSymbol<*>): IrFunctionSymbol {
|
||||||
val firDeclaration = firFunctionSymbol.fir
|
val firDeclaration = firFunctionSymbol.fir
|
||||||
val irParent = (firDeclaration as? FirCallableMemberDeclaration<*>)?.let { findIrParent(it) }
|
val irParent = (firDeclaration as? FirCallableDeclaration<*>)?.let { findIrParent(it) }
|
||||||
return when (firDeclaration) {
|
return when (firDeclaration) {
|
||||||
is FirSimpleFunction -> {
|
is FirSimpleFunction -> {
|
||||||
val irDeclaration = getIrFunction(firDeclaration, irParent, shouldLeaveScope = true).apply {
|
val irDeclaration = getIrFunction(firDeclaration, irParent, shouldLeaveScope = true).apply {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
fun IntArray.swap(i:Int, j:Int) {
|
fun IntArray.swap(i:Int, j:Int) {
|
||||||
val temp = this[i]
|
val temp = this[i]
|
||||||
this[i] = this[j]
|
this[i] = this[j]
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ FILE fqName:<root> fileName:/extensionLambda.kt
|
|||||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
|
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null
|
CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null
|
||||||
$this: GET_VAR '<this>: kotlin.String declared in <no parent>.<anonymous>' type=kotlin.String origin=null
|
$this: GET_VAR '<this>: kotlin.String declared in special.<anonymous>' type=kotlin.String origin=null
|
||||||
|
|||||||
@@ -109,4 +109,4 @@ FILE fqName:<root> fileName:/multipleImplicitReceivers.kt
|
|||||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.IInvoke
|
$receiver: VALUE_PARAMETER name:<this> type:<root>.IInvoke
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'public open fun invoke (): kotlin.Int [operator] declared in <root>.IInvoke' type=kotlin.Int origin=null
|
CALL 'public open fun invoke (): kotlin.Int [operator] declared in <root>.IInvoke' type=kotlin.Int origin=null
|
||||||
$this: GET_VAR '<this>: <root>.IInvoke declared in <no parent>.<anonymous>' type=<root>.IInvoke origin=null
|
$this: GET_VAR '<this>: <root>.IInvoke declared in special.<anonymous>' type=<root>.IInvoke origin=null
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ FILE fqName:<root> fileName:/builtinMap.kt
|
|||||||
$receiver: VALUE_PARAMETER name:<this> type:java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus>
|
$receiver: VALUE_PARAMETER name:<this> type:java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'public open fun put (p0: K1 of <root>.plus, p1: V1 of <root>.plus): V1 of <root>.plus? [operator] declared in java.util.HashMap' type=V1 of <root>.plus? origin=null
|
CALL 'public open fun put (p0: K1 of <root>.plus, p1: V1 of <root>.plus): V1 of <root>.plus? [operator] declared in java.util.HashMap' type=V1 of <root>.plus? origin=null
|
||||||
$this: GET_VAR '<this>: java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus> declared in <no parent>.<anonymous>' type=java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus> origin=null
|
$this: GET_VAR '<this>: java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus> declared in special.<anonymous>' type=java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus> origin=null
|
||||||
p0: CALL 'public final fun <get-first> (): K1 of <root>.plus declared in kotlin.Pair' type=K1 of <root>.plus origin=null
|
p0: CALL 'public final fun <get-first> (): K1 of <root>.plus declared in kotlin.Pair' type=K1 of <root>.plus origin=null
|
||||||
$this: GET_VAR 'pair: kotlin.Pair<K1 of <root>.plus, V1 of <root>.plus> declared in <root>.plus' type=kotlin.Pair<K1 of <root>.plus, V1 of <root>.plus> origin=null
|
$this: GET_VAR 'pair: kotlin.Pair<K1 of <root>.plus, V1 of <root>.plus> declared in <root>.plus' type=kotlin.Pair<K1 of <root>.plus, V1 of <root>.plus> origin=null
|
||||||
p1: CALL 'public final fun <get-second> (): V1 of <root>.plus declared in kotlin.Pair' type=V1 of <root>.plus origin=null
|
p1: CALL 'public final fun <get-second> (): V1 of <root>.plus declared in kotlin.Pair' type=V1 of <root>.plus origin=null
|
||||||
|
|||||||
Reference in New Issue
Block a user