FIR2IR: select return target inside accessor properly
This commit is contained in:
@@ -59,10 +59,10 @@ class Fir2IrConversionScope {
|
|||||||
return function
|
return function
|
||||||
}
|
}
|
||||||
|
|
||||||
private val propertyStack = mutableListOf<IrProperty>()
|
private val propertyStack = mutableListOf<Pair<IrProperty, FirProperty?>>()
|
||||||
|
|
||||||
fun withProperty(property: IrProperty, f: IrProperty.() -> Unit): IrProperty {
|
fun withProperty(property: IrProperty, firProperty: FirProperty? = null, f: IrProperty.() -> Unit): IrProperty {
|
||||||
propertyStack += property
|
propertyStack += (property to firProperty)
|
||||||
property.f()
|
property.f()
|
||||||
propertyStack.removeAt(propertyStack.size - 1)
|
propertyStack.removeAt(propertyStack.size - 1)
|
||||||
return property
|
return property
|
||||||
@@ -99,6 +99,15 @@ class Fir2IrConversionScope {
|
|||||||
val irTarget = (firTarget as? FirFunction)?.let {
|
val irTarget = (firTarget as? FirFunction)?.let {
|
||||||
when (it) {
|
when (it) {
|
||||||
is FirConstructor -> declarationStorage.getCachedIrConstructor(it)
|
is FirConstructor -> declarationStorage.getCachedIrConstructor(it)
|
||||||
|
is FirPropertyAccessor -> {
|
||||||
|
for ((property, firProperty) in propertyStack.asReversed()) {
|
||||||
|
if (firProperty?.getter === firTarget) {
|
||||||
|
return@let property.getter
|
||||||
|
} else if (firProperty?.setter === firTarget) {
|
||||||
|
return@let property.setter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else -> declarationStorage.getCachedIrFunction(it)
|
else -> declarationStorage.getCachedIrFunction(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ class Fir2IrVisitor(
|
|||||||
override fun visitProperty(property: FirProperty, data: Any?): IrElement {
|
override fun visitProperty(property: FirProperty, data: Any?): IrElement {
|
||||||
if (property.isLocal) return visitLocalVariable(property)
|
if (property.isLocal) return visitLocalVariable(property)
|
||||||
val irProperty = declarationStorage.getCachedIrProperty(property)!!
|
val irProperty = declarationStorage.getCachedIrProperty(property)!!
|
||||||
return conversionScope.withProperty(irProperty) {
|
return conversionScope.withProperty(irProperty, property) {
|
||||||
memberGenerator.convertPropertyContent(irProperty, property, containingClass = conversionScope.containerFirClass())
|
memberGenerator.convertPropertyContent(irProperty, property, containingClass = conversionScope.containerFirClass())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ class FakeOverrideGenerator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun IrProperty.withProperty(f: IrProperty.() -> Unit): IrProperty {
|
private fun IrProperty.withProperty(f: IrProperty.() -> Unit): IrProperty {
|
||||||
return conversionScope.withProperty(this, f)
|
return conversionScope.withProperty(this, firProperty = null, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun FirCallableMemberDeclaration<*>.allowsToHaveFakeOverrideIn(klass: FirClass<*>): Boolean {
|
private fun FirCallableMemberDeclaration<*>.allowsToHaveFakeOverrideIn(klass: FirClass<*>): Boolean {
|
||||||
|
|||||||
Generated
+6
@@ -2182,6 +2182,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
|
|||||||
runTest("compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.kt");
|
runTest("compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("SafeLetWithReturn.kt")
|
||||||
|
public void testSafeLetWithReturn() throws Exception {
|
||||||
|
runTest("compiler/testData/ir/irText/firProblems/SafeLetWithReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("SameJavaFieldReferences.kt")
|
@TestMetadata("SameJavaFieldReferences.kt")
|
||||||
public void testSameJavaFieldReferences() throws Exception {
|
public void testSameJavaFieldReferences() throws Exception {
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// FILE: 1.kt
|
// FILE: 1.kt
|
||||||
package test
|
package test
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// FILE: 1.kt
|
// FILE: 1.kt
|
||||||
|
|
||||||
package test
|
package test
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
fun foo(s: String?): String {
|
||||||
|
{ // BLOCK
|
||||||
|
val tmp0_safe_receiver: String? = s
|
||||||
|
when {
|
||||||
|
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
|
||||||
|
else -> tmp0_safe_receiver.let<String, Nothing>(block = local fun <anonymous>(it: String): Nothing {
|
||||||
|
return it
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} /*~> Unit */
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
fun bar(s: String?, t: String?): String {
|
||||||
|
{ // BLOCK
|
||||||
|
val tmp1_safe_receiver: String? = s
|
||||||
|
when {
|
||||||
|
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
|
||||||
|
else -> tmp1_safe_receiver.let<String, Nothing?>(block = local fun <anonymous>(it: String): Nothing? {
|
||||||
|
return { // BLOCK
|
||||||
|
val tmp2_safe_receiver: String? = t
|
||||||
|
when {
|
||||||
|
EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null
|
||||||
|
else -> tmp2_safe_receiver.let<String, Nothing>(block = local fun <anonymous>(it: String): Nothing {
|
||||||
|
return it
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} /*~> Unit */
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
val String?.baz: String
|
||||||
|
get(): String {
|
||||||
|
{ // BLOCK
|
||||||
|
val tmp3_safe_receiver: String? = <this>
|
||||||
|
when {
|
||||||
|
EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null
|
||||||
|
else -> tmp3_safe_receiver.let<String, Nothing>(block = local fun <anonymous>(it: String): Nothing {
|
||||||
|
return it
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} /*~> Unit */
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
FILE fqName:<root> fileName:/SafeLetWithReturn.kt
|
||||||
|
FUN name:foo visibility:public modality:FINAL <> (s:kotlin.String?) returnType:kotlin.String
|
||||||
|
VALUE_PARAMETER name:s index:0 type:kotlin.String?
|
||||||
|
BLOCK_BODY
|
||||||
|
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
|
BLOCK type=kotlin.Nothing? origin=SAFE_CALL
|
||||||
|
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.String? [val]
|
||||||
|
GET_VAR 's: kotlin.String? declared in <root>.foo' type=kotlin.String? origin=null
|
||||||
|
WHEN type=kotlin.Nothing? origin=null
|
||||||
|
BRANCH
|
||||||
|
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||||
|
arg0: GET_VAR 'val tmp_0: kotlin.String? [val] declared in <root>.foo' type=kotlin.String? origin=null
|
||||||
|
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
then: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: CALL 'public final fun let <T, R> (block: kotlin.Function1<T of kotlin.StandardKt.let, R of kotlin.StandardKt.let>): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
||||||
|
<T>: kotlin.String
|
||||||
|
<R>: kotlin.Nothing
|
||||||
|
$receiver: GET_VAR 'val tmp_0: kotlin.String? [val] declared in <root>.foo' type=kotlin.String? origin=null
|
||||||
|
block: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Nothing> origin=LAMBDA
|
||||||
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Nothing
|
||||||
|
VALUE_PARAMETER name:it index:0 type:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun foo (s: kotlin.String?): kotlin.String declared in <root>'
|
||||||
|
GET_VAR 'it: kotlin.String declared in <root>.foo.<anonymous>' type=kotlin.String origin=null
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun foo (s: kotlin.String?): kotlin.String declared in <root>'
|
||||||
|
CONST String type=kotlin.String value=""
|
||||||
|
FUN name:bar visibility:public modality:FINAL <> (s:kotlin.String?, t:kotlin.String?) returnType:kotlin.String
|
||||||
|
VALUE_PARAMETER name:s index:0 type:kotlin.String?
|
||||||
|
VALUE_PARAMETER name:t index:1 type:kotlin.String?
|
||||||
|
BLOCK_BODY
|
||||||
|
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
|
BLOCK type=kotlin.Nothing? origin=SAFE_CALL
|
||||||
|
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val]
|
||||||
|
GET_VAR 's: kotlin.String? declared in <root>.bar' type=kotlin.String? origin=null
|
||||||
|
WHEN type=kotlin.Nothing? origin=null
|
||||||
|
BRANCH
|
||||||
|
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||||
|
arg0: GET_VAR 'val tmp_1: kotlin.String? [val] declared in <root>.bar' type=kotlin.String? origin=null
|
||||||
|
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
then: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: CALL 'public final fun let <T, R> (block: kotlin.Function1<T of kotlin.StandardKt.let, R of kotlin.StandardKt.let>): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=kotlin.Nothing? origin=null
|
||||||
|
<T>: kotlin.String
|
||||||
|
<R>: kotlin.Nothing?
|
||||||
|
$receiver: GET_VAR 'val tmp_1: kotlin.String? [val] declared in <root>.bar' type=kotlin.String? origin=null
|
||||||
|
block: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Nothing?> origin=LAMBDA
|
||||||
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Nothing?
|
||||||
|
VALUE_PARAMETER name:it index:0 type:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='local final fun <anonymous> (it: kotlin.String): kotlin.Nothing? declared in <root>.bar'
|
||||||
|
BLOCK type=kotlin.Nothing? origin=SAFE_CALL
|
||||||
|
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val]
|
||||||
|
GET_VAR 't: kotlin.String? declared in <root>.bar' type=kotlin.String? origin=null
|
||||||
|
WHEN type=kotlin.Nothing? origin=null
|
||||||
|
BRANCH
|
||||||
|
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||||
|
arg0: GET_VAR 'val tmp_2: kotlin.String? [val] declared in <root>.bar.<anonymous>' type=kotlin.String? origin=null
|
||||||
|
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
then: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: CALL 'public final fun let <T, R> (block: kotlin.Function1<T of kotlin.StandardKt.let, R of kotlin.StandardKt.let>): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
||||||
|
<T>: kotlin.String
|
||||||
|
<R>: kotlin.Nothing
|
||||||
|
$receiver: GET_VAR 'val tmp_2: kotlin.String? [val] declared in <root>.bar.<anonymous>' type=kotlin.String? origin=null
|
||||||
|
block: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Nothing> origin=LAMBDA
|
||||||
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Nothing
|
||||||
|
VALUE_PARAMETER name:it index:0 type:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun bar (s: kotlin.String?, t: kotlin.String?): kotlin.String declared in <root>'
|
||||||
|
GET_VAR 'it: kotlin.String declared in <root>.bar.<anonymous>.<anonymous>' type=kotlin.String origin=null
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun bar (s: kotlin.String?, t: kotlin.String?): kotlin.String declared in <root>'
|
||||||
|
CONST String type=kotlin.String value=""
|
||||||
|
PROPERTY name:baz visibility:public modality:FINAL [val]
|
||||||
|
FUN name:<get-baz> visibility:public modality:FINAL <> ($receiver:kotlin.String?) returnType:kotlin.String
|
||||||
|
correspondingProperty: PROPERTY name:baz visibility:public modality:FINAL [val]
|
||||||
|
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String?
|
||||||
|
BLOCK_BODY
|
||||||
|
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
|
BLOCK type=kotlin.Nothing? origin=SAFE_CALL
|
||||||
|
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.String? [val]
|
||||||
|
GET_VAR '<this>: kotlin.String? declared in <root>.<get-baz>' type=kotlin.String? origin=null
|
||||||
|
WHEN type=kotlin.Nothing? origin=null
|
||||||
|
BRANCH
|
||||||
|
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||||
|
arg0: GET_VAR 'val tmp_3: kotlin.String? [val] declared in <root>.<get-baz>' type=kotlin.String? origin=null
|
||||||
|
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
then: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: CALL 'public final fun let <T, R> (block: kotlin.Function1<T of kotlin.StandardKt.let, R of kotlin.StandardKt.let>): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
||||||
|
<T>: kotlin.String
|
||||||
|
<R>: kotlin.Nothing
|
||||||
|
$receiver: GET_VAR 'val tmp_3: kotlin.String? [val] declared in <root>.<get-baz>' type=kotlin.String? origin=null
|
||||||
|
block: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Nothing> origin=LAMBDA
|
||||||
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Nothing
|
||||||
|
VALUE_PARAMETER name:it index:0 type:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun <get-baz> (): kotlin.String declared in <root>'
|
||||||
|
GET_VAR 'it: kotlin.String declared in <root>.<get-baz>.<anonymous>' type=kotlin.String origin=null
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun <get-baz> (): kotlin.String declared in <root>'
|
||||||
|
CONST String type=kotlin.String value=""
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
|
||||||
|
fun foo(s: String?): String {
|
||||||
|
s?.let { it ->
|
||||||
|
return it
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
fun bar(s: String?, t: String?): String {
|
||||||
|
s?.let {
|
||||||
|
t?.let {
|
||||||
|
return it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
val String?.baz: String
|
||||||
|
get() {
|
||||||
|
this?.let {
|
||||||
|
return it
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
fun foo(s: String?): String {
|
||||||
|
{ // BLOCK
|
||||||
|
val tmp0_safe_receiver: String? = s
|
||||||
|
when {
|
||||||
|
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
|
||||||
|
else -> tmp0_safe_receiver.let<String, Nothing>(block = local fun <anonymous>(it: String): Nothing {
|
||||||
|
return it
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} /*~> Unit */
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
fun bar(s: String?, t: String?): String {
|
||||||
|
{ // BLOCK
|
||||||
|
val tmp0_safe_receiver: String? = s
|
||||||
|
when {
|
||||||
|
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
|
||||||
|
else -> tmp0_safe_receiver.let<String, Nothing?>(block = local fun <anonymous>(it: String): Nothing? {
|
||||||
|
{ // BLOCK
|
||||||
|
val tmp0_safe_receiver: String? = t
|
||||||
|
when {
|
||||||
|
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
|
||||||
|
else -> tmp0_safe_receiver.let<String, Nothing>(block = local fun <anonymous>(it: String): Nothing {
|
||||||
|
return it
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} /*~> Unit */
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} /*~> Unit */
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
val String?.baz: String
|
||||||
|
get(): String {
|
||||||
|
{ // BLOCK
|
||||||
|
val tmp0_safe_receiver: String? = <this>
|
||||||
|
when {
|
||||||
|
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
|
||||||
|
else -> tmp0_safe_receiver.let<String, Nothing>(block = local fun <anonymous>(it: String): Nothing {
|
||||||
|
return it
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} /*~> Unit */
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
FILE fqName:<root> fileName:/SafeLetWithReturn.kt
|
||||||
|
FUN name:foo visibility:public modality:FINAL <> (s:kotlin.String?) returnType:kotlin.String
|
||||||
|
VALUE_PARAMETER name:s index:0 type:kotlin.String?
|
||||||
|
BLOCK_BODY
|
||||||
|
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
|
BLOCK type=kotlin.Nothing? origin=SAFE_CALL
|
||||||
|
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.String? [val]
|
||||||
|
GET_VAR 's: kotlin.String? declared in <root>.foo' type=kotlin.String? origin=null
|
||||||
|
WHEN type=kotlin.Nothing? origin=null
|
||||||
|
BRANCH
|
||||||
|
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||||
|
arg0: GET_VAR 'val tmp_0: kotlin.String? [val] declared in <root>.foo' type=kotlin.String? origin=null
|
||||||
|
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
then: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: CALL 'public final fun let <T, R> (block: kotlin.Function1<T of kotlin.StandardKt.let, R of kotlin.StandardKt.let>): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
||||||
|
<T>: kotlin.String
|
||||||
|
<R>: kotlin.Nothing
|
||||||
|
$receiver: GET_VAR 'val tmp_0: kotlin.String? [val] declared in <root>.foo' type=kotlin.String? origin=null
|
||||||
|
block: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Nothing> origin=LAMBDA
|
||||||
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Nothing
|
||||||
|
VALUE_PARAMETER name:it index:0 type:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun foo (s: kotlin.String?): kotlin.String declared in <root>'
|
||||||
|
GET_VAR 'it: kotlin.String declared in <root>.foo.<anonymous>' type=kotlin.String origin=null
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun foo (s: kotlin.String?): kotlin.String declared in <root>'
|
||||||
|
CONST String type=kotlin.String value=""
|
||||||
|
FUN name:bar visibility:public modality:FINAL <> (s:kotlin.String?, t:kotlin.String?) returnType:kotlin.String
|
||||||
|
VALUE_PARAMETER name:s index:0 type:kotlin.String?
|
||||||
|
VALUE_PARAMETER name:t index:1 type:kotlin.String?
|
||||||
|
BLOCK_BODY
|
||||||
|
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
|
BLOCK type=kotlin.Nothing? origin=SAFE_CALL
|
||||||
|
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val]
|
||||||
|
GET_VAR 's: kotlin.String? declared in <root>.bar' type=kotlin.String? origin=null
|
||||||
|
WHEN type=kotlin.Nothing? origin=null
|
||||||
|
BRANCH
|
||||||
|
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||||
|
arg0: GET_VAR 'val tmp_1: kotlin.String? [val] declared in <root>.bar' type=kotlin.String? origin=null
|
||||||
|
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
then: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: CALL 'public final fun let <T, R> (block: kotlin.Function1<T of kotlin.StandardKt.let, R of kotlin.StandardKt.let>): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=kotlin.Nothing? origin=null
|
||||||
|
<T>: kotlin.String
|
||||||
|
<R>: kotlin.Nothing?
|
||||||
|
$receiver: GET_VAR 'val tmp_1: kotlin.String? [val] declared in <root>.bar' type=kotlin.String? origin=null
|
||||||
|
block: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Nothing?> origin=LAMBDA
|
||||||
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Nothing?
|
||||||
|
VALUE_PARAMETER name:it index:0 type:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
|
BLOCK type=kotlin.Nothing? origin=SAFE_CALL
|
||||||
|
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val]
|
||||||
|
GET_VAR 't: kotlin.String? declared in <root>.bar' type=kotlin.String? origin=null
|
||||||
|
WHEN type=kotlin.Nothing? origin=null
|
||||||
|
BRANCH
|
||||||
|
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||||
|
arg0: GET_VAR 'val tmp_2: kotlin.String? [val] declared in <root>.bar.<anonymous>' type=kotlin.String? origin=null
|
||||||
|
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
then: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: CALL 'public final fun let <T, R> (block: kotlin.Function1<T of kotlin.StandardKt.let, R of kotlin.StandardKt.let>): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
||||||
|
<T>: kotlin.String
|
||||||
|
<R>: kotlin.Nothing
|
||||||
|
$receiver: GET_VAR 'val tmp_2: kotlin.String? [val] declared in <root>.bar.<anonymous>' type=kotlin.String? origin=null
|
||||||
|
block: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Nothing> origin=LAMBDA
|
||||||
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Nothing
|
||||||
|
VALUE_PARAMETER name:it index:0 type:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun bar (s: kotlin.String?, t: kotlin.String?): kotlin.String declared in <root>'
|
||||||
|
GET_VAR 'it: kotlin.String declared in <root>.bar.<anonymous>.<anonymous>' type=kotlin.String origin=null
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun bar (s: kotlin.String?, t: kotlin.String?): kotlin.String declared in <root>'
|
||||||
|
CONST String type=kotlin.String value=""
|
||||||
|
PROPERTY name:baz visibility:public modality:FINAL [val]
|
||||||
|
FUN name:<get-baz> visibility:public modality:FINAL <> ($receiver:kotlin.String?) returnType:kotlin.String
|
||||||
|
correspondingProperty: PROPERTY name:baz visibility:public modality:FINAL [val]
|
||||||
|
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String?
|
||||||
|
BLOCK_BODY
|
||||||
|
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
|
BLOCK type=kotlin.Nothing? origin=SAFE_CALL
|
||||||
|
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.String? [val]
|
||||||
|
GET_VAR '<this>: kotlin.String? declared in <root>.<get-baz>' type=kotlin.String? origin=null
|
||||||
|
WHEN type=kotlin.Nothing? origin=null
|
||||||
|
BRANCH
|
||||||
|
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||||
|
arg0: GET_VAR 'val tmp_3: kotlin.String? [val] declared in <root>.<get-baz>' type=kotlin.String? origin=null
|
||||||
|
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
then: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: CALL 'public final fun let <T, R> (block: kotlin.Function1<T of kotlin.StandardKt.let, R of kotlin.StandardKt.let>): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
||||||
|
<T>: kotlin.String
|
||||||
|
<R>: kotlin.Nothing
|
||||||
|
$receiver: GET_VAR 'val tmp_3: kotlin.String? [val] declared in <root>.<get-baz>' type=kotlin.String? origin=null
|
||||||
|
block: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Nothing> origin=LAMBDA
|
||||||
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Nothing
|
||||||
|
VALUE_PARAMETER name:it index:0 type:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun <get-baz> (): kotlin.String declared in <root>'
|
||||||
|
GET_VAR 'it: kotlin.String declared in <root>.<get-baz>.<anonymous>' type=kotlin.String origin=null
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun <get-baz> (): kotlin.String declared in <root>'
|
||||||
|
CONST String type=kotlin.String value=""
|
||||||
Generated
+6
@@ -2182,6 +2182,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest {
|
|||||||
runTest("compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.kt");
|
runTest("compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("SafeLetWithReturn.kt")
|
||||||
|
public void testSafeLetWithReturn() throws Exception {
|
||||||
|
runTest("compiler/testData/ir/irText/firProblems/SafeLetWithReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("SameJavaFieldReferences.kt")
|
@TestMetadata("SameJavaFieldReferences.kt")
|
||||||
public void testSameJavaFieldReferences() throws Exception {
|
public void testSameJavaFieldReferences() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user