diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 1c6aee0df5b..a2e7cd8a3da 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -16364,6 +16364,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/functions/kt47449.kt"); } + @Test + @TestMetadata("kt47527.kt") + public void testKt47527() throws Exception { + runTest("compiler/testData/codegen/box/functions/kt47527.kt"); + } + @Test @TestMetadata("kt785.kt") public void testKt785() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java index 636dfd134ff..b7f1302589c 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java @@ -458,6 +458,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/declarations/kt45308.kt"); } + @Test + @TestMetadata("kt47527.kt") + public void testKt47527() throws Exception { + runTest("compiler/testData/ir/irText/declarations/kt47527.kt"); + } + @Test @TestMetadata("localClassWithOverrides.kt") public void testLocalClassWithOverrides() throws Exception { diff --git a/compiler/frontend/cfg/src/org/jetbrains/kotlin/cfg/pseudocode/ControlFlowInstructionsGenerator.kt b/compiler/frontend/cfg/src/org/jetbrains/kotlin/cfg/pseudocode/ControlFlowInstructionsGenerator.kt index 56b07322746..e0d34dc3707 100644 --- a/compiler/frontend/cfg/src/org/jetbrains/kotlin/cfg/pseudocode/ControlFlowInstructionsGenerator.kt +++ b/compiler/frontend/cfg/src/org/jetbrains/kotlin/cfg/pseudocode/ControlFlowInstructionsGenerator.kt @@ -17,7 +17,6 @@ package org.jetbrains.kotlin.cfg.pseudocode import com.intellij.util.containers.Stack -import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.cfg.* import org.jetbrains.kotlin.cfg.pseudocode.instructions.BlockScope import org.jetbrains.kotlin.cfg.pseudocode.instructions.Instruction @@ -383,14 +382,13 @@ class ControlFlowInstructionsGenerator : ControlFlowBuilderAdapter() { receiverValues: Map, arguments: Map ): CallInstruction { - val returnType = resolvedCall.resultingDescriptor.returnType val instruction = CallInstruction( valueElement, currentScope, resolvedCall, receiverValues, arguments, - if (returnType != null && KotlinBuiltIns.isNothing(returnType)) null else valueFactory + valueFactory ) add(instruction) return instruction diff --git a/compiler/testData/cfg/controlStructures/incorrectIndex_After.instructions b/compiler/testData/cfg/controlStructures/incorrectIndex_After.instructions index 09918847783..38787ff45f6 100644 --- a/compiler/testData/cfg/controlStructures/incorrectIndex_After.instructions +++ b/compiler/testData/cfg/controlStructures/incorrectIndex_After.instructions @@ -52,7 +52,7 @@ L0: mark({ if (flag) { s.add(it) } else { s.remove(it) } return true }) r({ if (flag) { s.add(it) } else { s.remove(it) } return true }) -> mark(let { if (flag) { s.add(it) } else { s.remove(it) } return true }) - call(let { if (flag) { s.add(it) } else { s.remove(it) } return true }, let|, ) + call(let { if (flag) { s.add(it) } else { s.remove(it) } return true }, let|, ) -> L4 [before inlined declaration]: inlined({ if (flag) { s.add(it) } else { s.remove(it) } return true }) NEXT:[] L3 [result of call]: diff --git a/compiler/testData/cfg/controlStructures/incorrectIndex_After.values b/compiler/testData/cfg/controlStructures/incorrectIndex_After.values index 7f03d63b12a..3b4f959587e 100644 --- a/compiler/testData/cfg/controlStructures/incorrectIndex_After.values +++ b/compiler/testData/cfg/controlStructures/incorrectIndex_After.values @@ -28,8 +28,8 @@ fun test(name: String?, flag: Boolean): Boolean { : Boolean NEW: magic[FAKE_INITIALIZER](flag: Boolean) -> name : String NEW: r(name) -> { if (flag) { s.add(it) } else { s.remove(it) } return true } : {<: (String) -> Nothing} NEW: r({ if (flag) { s.add(it) } else { s.remove(it) } return true }) -> -let { if (flag) { s.add(it) } else { s.remove(it) } return true } !: * -name?.let { if (flag) { s.add(it) } else { s.remove(it) } return true } !: * COPY +let { if (flag) { s.add(it) } else { s.remove(it) } return true } : * NEW: call(let { if (flag) { s.add(it) } else { s.remove(it) } return true }, let|, ) -> +name?.let { if (flag) { s.add(it) } else { s.remove(it) } return true } : * COPY false : Boolean NEW: r(false) -> return false !: * { name?.let { if (flag) { s.add(it) } else { s.remove(it) } return true } return false } !: * COPY diff --git a/compiler/testData/cfg/controlStructures/incorrectIndex_Before.instructions b/compiler/testData/cfg/controlStructures/incorrectIndex_Before.instructions index 84e588cef3b..8697949b352 100644 --- a/compiler/testData/cfg/controlStructures/incorrectIndex_Before.instructions +++ b/compiler/testData/cfg/controlStructures/incorrectIndex_Before.instructions @@ -55,9 +55,9 @@ L0: L4 [after local declaration]: r({ if (flag) { s.add(it) } else { s.remove(it) } return true }) -> PREV:[jmp?(L4)] mark(let { if (flag) { s.add(it) } else { s.remove(it) } return true }) - call(let { if (flag) { s.add(it) } else { s.remove(it) } return true }, let|, ) + call(let { if (flag) { s.add(it) } else { s.remove(it) } return true }, let|, ) -> L3 [result of call]: - jmp?(L2) NEXT:[mark({ name?.hashCode() }), r(false) -> ] PREV:[jf(L3), call(let { if (flag) { s.add(it) } else { s.remove(it) } return true }, let|, )] + jmp?(L2) NEXT:[mark({ name?.hashCode() }), r(false) -> ] PREV:[jf(L3), call(let { if (flag) { s.add(it) } else { s.remove(it) } return true }, let|, ) -> ] r(false) -> 6 mark({ name?.hashCode() }) mark(name?.hashCode()) diff --git a/compiler/testData/cfg/controlStructures/incorrectIndex_Before.values b/compiler/testData/cfg/controlStructures/incorrectIndex_Before.values index 01c63a9646d..a462144125d 100644 --- a/compiler/testData/cfg/controlStructures/incorrectIndex_Before.values +++ b/compiler/testData/cfg/controlStructures/incorrectIndex_Before.values @@ -28,8 +28,8 @@ fun test(name: String?, flag: Boolean): Boolean { : Boolean NEW: magic[FAKE_INITIALIZER](flag: Boolean) -> name : String NEW: r(name) -> { if (flag) { s.add(it) } else { s.remove(it) } return true } : {<: (String) -> Nothing} NEW: r({ if (flag) { s.add(it) } else { s.remove(it) } return true }) -> -let { if (flag) { s.add(it) } else { s.remove(it) } return true } !: * -name?.let { if (flag) { s.add(it) } else { s.remove(it) } return true } !: * COPY +let { if (flag) { s.add(it) } else { s.remove(it) } return true } : * NEW: call(let { if (flag) { s.add(it) } else { s.remove(it) } return true }, let|, ) -> +name?.let { if (flag) { s.add(it) } else { s.remove(it) } return true } : * COPY false : Boolean NEW: r(false) -> return false !: * { name?.let { if (flag) { s.add(it) } else { s.remove(it) } return true } return false } !: * COPY diff --git a/compiler/testData/cfg/deadCode/notLocalReturn_after.instructions b/compiler/testData/cfg/deadCode/notLocalReturn_after.instructions index 414ca507675..52442e3c2c6 100644 --- a/compiler/testData/cfg/deadCode/notLocalReturn_after.instructions +++ b/compiler/testData/cfg/deadCode/notLocalReturn_after.instructions @@ -103,13 +103,13 @@ L2 [after local declaration]: mark({ return }) r({ return }) -> mark(let { return }) - call(let { return }, let|, ) + call(let { return }, let|, ) -> L6 [before inlined declaration]: inlined({ return }) NEXT:[] L5 [result of call]: L7 [after inlined declaration]: mark(f(null?.let { return })) PREV:[jf(L5)] - call(f(null?.let { return }), f|!) -> + call(f(null?.let { return }), f|) -> mark(doSomething()) call(doSomething(), doSomething) -> L1: @@ -163,28 +163,28 @@ L0: magic[FAKE_INITIALIZER](x: Any?) -> w(x|) mark(x?.let { return true }) - jf(L2) NEXT:[mark(x?.let { return true } ?: false), r(x) -> ] + jf(L2) NEXT:[mark(x?.let { return true } ?: false), r(x) -> ] r(x) -> mark({ return true }) r({ return true }) -> mark(let { return true }) - call(let { return true }, let|, ) + call(let { return true }, let|, ) -> L3 [before inlined declaration]: - inlined({ return true }) NEXT:[] + inlined({ return true }) NEXT:[] L2 [result of call]: L4 [after inlined declaration]: - mark(x?.let { return true } ?: false) PREV:[jf(L2)] - jt(L7|!) NEXT:[r(false) -> , merge(x?.let { return true } ?: false|!, ) -> ] + mark(x?.let { return true } ?: false) PREV:[jf(L2)] + jt(L7|) NEXT:[r(false) -> , merge(x?.let { return true } ?: false|, ) -> ] r(false) -> L7 [after elvis operator]: - merge(x?.let { return true } ?: false|!, ) -> PREV:[jt(L7|!), r(false) -> ] + merge(x?.let { return true } ?: false|, ) -> PREV:[jt(L7|), r(false) -> ] ret(*|) L1 L1: - NEXT:[] PREV:[ret(*|) L1, ret(*|) L1] + NEXT:[] PREV:[ret(*|) L1, ret(*|) L1] error: - PREV:[] + PREV:[] sink: - PREV:[, , inlined({ return true })] + PREV:[, , inlined({ return true })] ===================== == inlined anonymous_2 == { diff --git a/compiler/testData/cfg/deadCode/notLocalReturn_after.values b/compiler/testData/cfg/deadCode/notLocalReturn_after.values index 2fb3c721a07..d810a17f20a 100644 --- a/compiler/testData/cfg/deadCode/notLocalReturn_after.values +++ b/compiler/testData/cfg/deadCode/notLocalReturn_after.values @@ -45,9 +45,9 @@ fun test2() { --------------------- null : Nothing NEW: r(null) -> { return } : {<: (Nothing) -> Nothing} NEW: r({ return }) -> -let { return } !: * -null?.let { return } !: * COPY -f(null?.let { return }) : * NEW: call(f(null?.let { return }), f|!) -> +let { return } : * NEW: call(let { return }, let|, ) -> +null?.let { return } : * COPY +f(null?.let { return }) : * NEW: call(f(null?.let { return }), f|) -> doSomething() : * NEW: call(doSomething(), doSomething) -> { fun f(x: Any?) = x f(null?.let { return }) // false unreachable here doSomething() } : * COPY ===================== @@ -72,10 +72,10 @@ fun test3(x: Any?): Boolean = : * NEW: magic[FAKE_INITIALIZER](x: Any?) -> x : {<: Any} NEW: r(x) -> { return true } : {<: (Any) -> Nothing} NEW: r({ return true }) -> -let { return true } !: * -x?.let { return true } !: * COPY +let { return true } : Boolean NEW: call(let { return true }, let|, ) -> +x?.let { return true } : Boolean COPY false : Boolean NEW: r(false) -> -x?.let { return true } ?: false : Boolean NEW: merge(x?.let { return true } ?: false|!, ) -> +x?.let { return true } ?: false : Boolean NEW: merge(x?.let { return true } ?: false|, ) -> ===================== == inlined anonymous_2 == { diff --git a/compiler/testData/cfg/deadCode/notLocalReturn_before.instructions b/compiler/testData/cfg/deadCode/notLocalReturn_before.instructions index c768cf5ac4b..2214a09e193 100644 --- a/compiler/testData/cfg/deadCode/notLocalReturn_before.instructions +++ b/compiler/testData/cfg/deadCode/notLocalReturn_before.instructions @@ -106,10 +106,10 @@ L2 [after local declaration]: L6 [after local declaration]: r({ return }) -> PREV:[jmp?(L6)] mark(let { return }) - call(let { return }, let|, ) + call(let { return }, let|, ) -> L5 [result of call]: - mark(f(null?.let { return })) PREV:[jf(L5), call(let { return }, let|, )] - call(f(null?.let { return }), f|!) -> + mark(f(null?.let { return })) PREV:[jf(L5), call(let { return }, let|, ) -> ] + call(f(null?.let { return }), f|) -> mark(doSomething()) call(doSomething(), doSomething) -> L1: @@ -163,28 +163,28 @@ L0: magic[FAKE_INITIALIZER](x: Any?) -> w(x|) mark(x?.let { return true }) - jf(L2) NEXT:[mark(x?.let { return true } ?: false), r(x) -> ] + jf(L2) NEXT:[mark(x?.let { return true } ?: false), r(x) -> ] r(x) -> mark({ return true }) - jmp?(L3) NEXT:[r({ return true }) -> , d({ return true })] - d({ return true }) NEXT:[] + jmp?(L3) NEXT:[r({ return true }) -> , d({ return true })] + d({ return true }) NEXT:[] L3 [after local declaration]: - r({ return true }) -> PREV:[jmp?(L3)] + r({ return true }) -> PREV:[jmp?(L3)] mark(let { return true }) - call(let { return true }, let|, ) + call(let { return true }, let|, ) -> L2 [result of call]: - mark(x?.let { return true } ?: false) PREV:[jf(L2), call(let { return true }, let|, )] - jt(L6|!) NEXT:[r(false) -> , merge(x?.let { return true } ?: false|!, ) -> ] + mark(x?.let { return true } ?: false) PREV:[jf(L2), call(let { return true }, let|, ) -> ] + jt(L6|) NEXT:[r(false) -> , merge(x?.let { return true } ?: false|, ) -> ] r(false) -> L6 [after elvis operator]: - merge(x?.let { return true } ?: false|!, ) -> PREV:[jt(L6|!), r(false) -> ] + merge(x?.let { return true } ?: false|, ) -> PREV:[jt(L6|), r(false) -> ] ret(*|) L1 L1: - NEXT:[] PREV:[ret(*|) L1, ret(*|) L1] + NEXT:[] PREV:[ret(*|) L1, ret(*|) L1] error: - PREV:[] + PREV:[] sink: - PREV:[, , d({ return true })] + PREV:[, , d({ return true })] ===================== == anonymous_2 == { diff --git a/compiler/testData/cfg/deadCode/notLocalReturn_before.values b/compiler/testData/cfg/deadCode/notLocalReturn_before.values index 3408d06cc18..ff73da8d754 100644 --- a/compiler/testData/cfg/deadCode/notLocalReturn_before.values +++ b/compiler/testData/cfg/deadCode/notLocalReturn_before.values @@ -45,9 +45,9 @@ fun test2() { --------------------- null : Nothing NEW: r(null) -> { return } : {<: (Nothing) -> Nothing} NEW: r({ return }) -> -let { return } !: * -null?.let { return } !: * COPY -f(null?.let { return }) : * NEW: call(f(null?.let { return }), f|!) -> +let { return } : * NEW: call(let { return }, let|, ) -> +null?.let { return } : * COPY +f(null?.let { return }) : * NEW: call(f(null?.let { return }), f|) -> doSomething() : * NEW: call(doSomething(), doSomething) -> { fun f(x: Any?) = x f(null?.let { return }) // false unreachable here doSomething() } : * COPY ===================== @@ -72,10 +72,10 @@ fun test3(x: Any?): Boolean = : * NEW: magic[FAKE_INITIALIZER](x: Any?) -> x : {<: Any} NEW: r(x) -> { return true } : {<: (Any) -> Nothing} NEW: r({ return true }) -> -let { return true } !: * -x?.let { return true } !: * COPY +let { return true } : Boolean NEW: call(let { return true }, let|, ) -> +x?.let { return true } : Boolean COPY false : Boolean NEW: r(false) -> -x?.let { return true } ?: false : Boolean NEW: merge(x?.let { return true } ?: false|!, ) -> +x?.let { return true } ?: false : Boolean NEW: merge(x?.let { return true } ?: false|, ) -> ===================== == anonymous_2 == { diff --git a/compiler/testData/cfg/deadCode/throwInLambda.instructions b/compiler/testData/cfg/deadCode/throwInLambda.instructions index c23b3e926cd..7b883efbc00 100644 --- a/compiler/testData/cfg/deadCode/throwInLambda.instructions +++ b/compiler/testData/cfg/deadCode/throwInLambda.instructions @@ -52,14 +52,14 @@ L0: L3 [after local declaration]: r({ throw Exception() }) -> PREV:[jmp?(L3)] mark(let { throw Exception() }) - call(let { throw Exception() }, let|, ) + call(let { throw Exception() }, let|, ) -> L2 [result of call]: - mark(fn()?.let { throw Exception() } ?: "unreachable?") PREV:[jf(L2), call(let { throw Exception() }, let|, )] - jt(L6|!) NEXT:[mark("unreachable?"), merge(fn()?.let { throw Exception() } ?: "unreachable?"|!, ) -> ] + mark(fn()?.let { throw Exception() } ?: "unreachable?") PREV:[jf(L2), call(let { throw Exception() }, let|, ) -> ] + jt(L6|) NEXT:[mark("unreachable?"), merge(fn()?.let { throw Exception() } ?: "unreachable?"|, ) -> ] mark("unreachable?") r("unreachable?") -> L6 [after elvis operator]: - merge(fn()?.let { throw Exception() } ?: "unreachable?"|!, ) -> PREV:[jt(L6|!), r("unreachable?") -> ] + merge(fn()?.let { throw Exception() } ?: "unreachable?"|, ) -> PREV:[jt(L6|), r("unreachable?") -> ] w(x|) r(x) -> ret(*|) L1 @@ -119,16 +119,16 @@ L2 [after elvis operator]: L4 [after local declaration]: r({ throw Exception() }) -> PREV:[jmp?(L4)] mark(let { throw Exception() }) - call(let { throw Exception() }, let|, ) + call(let { throw Exception() }, let|, ) -> jmp(error) NEXT:[] L3 [result of call]: jmp(error) NEXT:[] PREV:[jf(L3)] - mark(x?.let { throw Exception() } ?: "unreachable") PREV:[] -- jt(L7|!) NEXT:[mark("unreachable"), merge(x?.let { throw Exception() } ?: "unreachable"|!, ) -> ] PREV:[] +- jt(L7|) NEXT:[mark("unreachable"), merge(x?.let { throw Exception() } ?: "unreachable"|, ) -> ] PREV:[] - mark("unreachable") PREV:[] - r("unreachable") -> PREV:[] L7 [after elvis operator]: -- merge(x?.let { throw Exception() } ?: "unreachable"|!, ) -> PREV:[] +- merge(x?.let { throw Exception() } ?: "unreachable"|, ) -> PREV:[] - w(y|) PREV:[] - r(y) -> PREV:[] - ret(*|) L1 PREV:[] diff --git a/compiler/testData/cfg/deadCode/throwInLambda.values b/compiler/testData/cfg/deadCode/throwInLambda.values index 555e2bc01f7..e51f8cbcf32 100644 --- a/compiler/testData/cfg/deadCode/throwInLambda.values +++ b/compiler/testData/cfg/deadCode/throwInLambda.values @@ -20,10 +20,10 @@ fun foo(): String { --------------------- fn() : String NEW: call(fn(), fn) -> { throw Exception() } : {<: (String) -> Nothing} NEW: r({ throw Exception() }) -> -let { throw Exception() } !: * -fn()?.let { throw Exception() } !: * COPY +let { throw Exception() } : AND{Boolean, String} NEW: call(let { throw Exception() }, let|, ) -> +fn()?.let { throw Exception() } : AND{Boolean, String} COPY "unreachable?" : String NEW: r("unreachable?") -> -fn()?.let { throw Exception() } ?: "unreachable?" : String NEW: merge(fn()?.let { throw Exception() } ?: "unreachable?"|!, ) -> +fn()?.let { throw Exception() } ?: "unreachable?" : String NEW: merge(fn()?.let { throw Exception() } ?: "unreachable?"|, ) -> x : String NEW: r(x) -> return x !: * { val x = fn()?.let { throw Exception() } ?: "unreachable?" return x } !: * COPY @@ -48,10 +48,10 @@ return "" fn() ?: return "" : String NEW: merge(fn() ?: return ""|, !) -> x : String NEW: r(x) -> { throw Exception() } : {<: (String) -> Nothing} NEW: r({ throw Exception() }) -> -let { throw Exception() } !: * -x?.let { throw Exception() } !: * COPY +let { throw Exception() } : AND{Boolean, String} NEW: call(let { throw Exception() }, let|, ) -> +x?.let { throw Exception() } : AND{Boolean, String} COPY "unreachable" : String NEW: r("unreachable") -> -x?.let { throw Exception() } ?: "unreachable" : String NEW: merge(x?.let { throw Exception() } ?: "unreachable"|!, ) -> +x?.let { throw Exception() } ?: "unreachable" : String NEW: merge(x?.let { throw Exception() } ?: "unreachable"|, ) -> y : String NEW: r(y) -> return y !: * { val x = fn() ?: return "" val y = x?.let { throw Exception() } ?: "unreachable" return y } !: * COPY diff --git a/compiler/testData/cfg/expressions/nothingExpr.instructions b/compiler/testData/cfg/expressions/nothingExpr.instructions index 46ecc12559b..d77289425d3 100644 --- a/compiler/testData/cfg/expressions/nothingExpr.instructions +++ b/compiler/testData/cfg/expressions/nothingExpr.instructions @@ -45,14 +45,14 @@ L0: - call(doSomething(), doSomething|) -> PREV:[] - mark(bar().doSomething()) PREV:[] - mark(bar()) PREV:[] -- call(bar(), bar) PREV:[] +- call(bar(), bar) -> PREV:[] - jmp(error) NEXT:[] PREV:[] - mark(doSomething()) PREV:[] -- call(doSomething(), doSomething|!) -> PREV:[] +- call(doSomething(), doSomething|) -> PREV:[] L1: 1 NEXT:[] PREV:[] error: PREV:[jmp(error)] sink: PREV:[, ] -===================== \ No newline at end of file +===================== diff --git a/compiler/testData/cfg/expressions/nothingExpr.values b/compiler/testData/cfg/expressions/nothingExpr.values index b30b4084966..63b73f0f35e 100644 --- a/compiler/testData/cfg/expressions/nothingExpr.values +++ b/compiler/testData/cfg/expressions/nothingExpr.values @@ -13,12 +13,12 @@ fun foo() { bar().doSomething() } --------------------- -null : * NEW: r(null) -> -null!! : * NEW: magic[NOT_NULL_ASSERTION](null!!|) -> -doSomething() : * NEW: call(doSomething(), doSomething|) -> -null!!.doSomething() : * COPY -bar() !: * -doSomething() : * NEW: call(doSomething(), doSomething|!) -> -bar().doSomething() : * COPY -{ null!!.doSomething() bar().doSomething() } : * COPY +null : * NEW: r(null) -> +null!! : * NEW: magic[NOT_NULL_ASSERTION](null!!|) -> +doSomething() : * NEW: call(doSomething(), doSomething|) -> +null!!.doSomething() : * COPY +bar() : * NEW: call(bar(), bar) -> +doSomething() : * NEW: call(doSomething(), doSomething|) -> +bar().doSomething() : * COPY +{ null!!.doSomething() bar().doSomething() } : * COPY ===================== diff --git a/compiler/testData/codegen/box/functions/kt47527.kt b/compiler/testData/codegen/box/functions/kt47527.kt new file mode 100644 index 00000000000..24f129ddec9 --- /dev/null +++ b/compiler/testData/codegen/box/functions/kt47527.kt @@ -0,0 +1,14 @@ +// ISSUE: KT-47527 +// WITH_STDLIB + +fun test_1(value: Any?): String? = value?.let { return "O" } +fun test_2(value: Any?): String? = run { + value?.let { return "K" } +} + +fun box(): String { + var result = "" + result += test_1(1) ?: return "fail 1" + result += test_2(1) ?: return "fail 2" + return result +} diff --git a/compiler/testData/ir/irText/declarations/kt47527.fir.kt.txt b/compiler/testData/ir/irText/declarations/kt47527.fir.kt.txt new file mode 100644 index 00000000000..cb0a540c889 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt47527.fir.kt.txt @@ -0,0 +1,47 @@ +fun test_1(value: Any?): String? { + return { // BLOCK + val tmp0_safe_receiver: Any? = value + when { + EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null + else -> tmp0_safe_receiver.let(block = local fun (it: Any): Nothing { + return "O" + } +) + } + } +} + +fun test_2(value: Any?): String? { + return run(block = local fun (): Nothing? { + return { // BLOCK + val tmp1_safe_receiver: Any? = value + when { + EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null + else -> tmp1_safe_receiver.let(block = local fun (it: Any): Nothing { + return "K" + } +) + } + } + } +) +} + +fun box(): String { + var result: String = "" + result = result.plus(other = { // BLOCK + val : String? = test_1(value = 1) + when { + EQEQ(arg0 = , arg1 = null) -> return "fail 1" + else -> + } + }) + result = result.plus(other = { // BLOCK + val : String? = test_2(value = 1) + when { + EQEQ(arg0 = , arg1 = null) -> return "fail 2" + else -> + } + }) + return result +} diff --git a/compiler/testData/ir/irText/declarations/kt47527.fir.txt b/compiler/testData/ir/irText/declarations/kt47527.fir.txt new file mode 100644 index 00000000000..a8036c99e8f --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt47527.fir.txt @@ -0,0 +1,97 @@ +FILE fqName: fileName:/kt47527.kt + FUN name:test_1 visibility:public modality:FINAL <> (value:kotlin.Any?) returnType:kotlin.String? + VALUE_PARAMETER name:value index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test_1 (value: kotlin.Any?): kotlin.String? declared in ' + BLOCK type=kotlin.Nothing? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val] + GET_VAR 'value: kotlin.Any? declared in .test_1' type=kotlin.Any? 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.Any? [val] declared in .test_1' type=kotlin.Any? 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 (block: kotlin.Function1): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + : kotlin.Any + : kotlin.Nothing + $receiver: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .test_1' type=kotlin.Any? origin=null + block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Any) returnType:kotlin.Nothing + VALUE_PARAMETER name:it index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test_1 (value: kotlin.Any?): kotlin.String? declared in ' + CONST String type=kotlin.String value="O" + FUN name:test_2 visibility:public modality:FINAL <> (value:kotlin.Any?) returnType:kotlin.String? + VALUE_PARAMETER name:value index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test_2 (value: kotlin.Any?): kotlin.String? declared in ' + CALL 'public final fun run (block: kotlin.Function0): R of kotlin.StandardKt.run [inline] declared in kotlin.StandardKt' type=kotlin.Nothing? origin=null + : kotlin.Nothing? + block: FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Nothing? + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Nothing? declared in .test_2' + BLOCK type=kotlin.Nothing? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any? [val] + GET_VAR 'value: kotlin.Any? declared in .test_2' type=kotlin.Any? 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.Any? [val] declared in .test_2.' type=kotlin.Any? 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 (block: kotlin.Function1): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + : kotlin.Any + : kotlin.Nothing + $receiver: GET_VAR 'val tmp_1: kotlin.Any? [val] declared in .test_2.' type=kotlin.Any? origin=null + block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Any) returnType:kotlin.Nothing + VALUE_PARAMETER name:it index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test_2 (value: kotlin.Any?): kotlin.String? declared in ' + CONST String type=kotlin.String value="K" + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:result type:kotlin.String [var] + CONST String type=kotlin.String value="" + SET_VAR 'var result: kotlin.String [var] declared in .box' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=null + $this: GET_VAR 'var result: kotlin.String [var] declared in .box' type=kotlin.String origin=null + other: BLOCK type=kotlin.String origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val] + CALL 'public final fun test_1 (value: kotlin.Any?): kotlin.String? declared in ' type=kotlin.String? origin=null + value: CONST Int type=kotlin.Int value=1 + WHEN type=kotlin.String origin=ELVIS + 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 .box' type=kotlin.String? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="fail 1" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_2: kotlin.String? [val] declared in .box' type=kotlin.String? origin=null + SET_VAR 'var result: kotlin.String [var] declared in .box' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=null + $this: GET_VAR 'var result: kotlin.String [var] declared in .box' type=kotlin.String origin=null + other: BLOCK type=kotlin.String origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.String? [val] + CALL 'public final fun test_2 (value: kotlin.Any?): kotlin.String? declared in ' type=kotlin.String? origin=null + value: CONST Int type=kotlin.Int value=1 + WHEN type=kotlin.String origin=ELVIS + 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 .box' type=kotlin.String? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="fail 2" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_3: kotlin.String? [val] declared in .box' type=kotlin.String? origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + GET_VAR 'var result: kotlin.String [var] declared in .box' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/declarations/kt47527.kt b/compiler/testData/ir/irText/declarations/kt47527.kt new file mode 100644 index 00000000000..24f129ddec9 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt47527.kt @@ -0,0 +1,14 @@ +// ISSUE: KT-47527 +// WITH_STDLIB + +fun test_1(value: Any?): String? = value?.let { return "O" } +fun test_2(value: Any?): String? = run { + value?.let { return "K" } +} + +fun box(): String { + var result = "" + result += test_1(1) ?: return "fail 1" + result += test_2(1) ?: return "fail 2" + return result +} diff --git a/compiler/testData/ir/irText/declarations/kt47527.kt.txt b/compiler/testData/ir/irText/declarations/kt47527.kt.txt new file mode 100644 index 00000000000..ebe0b54ebfc --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt47527.kt.txt @@ -0,0 +1,48 @@ +fun test_1(value: Any?): String? { + return { // BLOCK + val tmp0_safe_receiver: Any? = value + when { + EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null + else -> tmp0_safe_receiver.let(block = local fun (it: Any): Nothing { + return "O" + } +) + } + } +} + +fun test_2(value: Any?): String? { + return run(block = local fun (): Nothing? { + return { // BLOCK + val tmp0_safe_receiver: Any? = value + when { + EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null + else -> tmp0_safe_receiver.let(block = local fun (it: Any): Nothing { + return "K" + } +) + } + } + } +) +} + +fun box(): String { + var result: String = "" + result = result.plus(other = { // BLOCK + val tmp0_elvis_lhs: String? = test_1(value = 1) + when { + EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> return "fail 1" + else -> tmp0_elvis_lhs + } + }) + result = result.plus(other = { // BLOCK + val tmp1_elvis_lhs: String? = test_2(value = 1) + when { + EQEQ(arg0 = tmp1_elvis_lhs, arg1 = null) -> return "fail 2" + else -> tmp1_elvis_lhs + } + }) + return result +} + diff --git a/compiler/testData/ir/irText/declarations/kt47527.txt b/compiler/testData/ir/irText/declarations/kt47527.txt new file mode 100644 index 00000000000..380b5e8108d --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt47527.txt @@ -0,0 +1,97 @@ +FILE fqName: fileName:/kt47527.kt + FUN name:test_1 visibility:public modality:FINAL <> (value:kotlin.Any?) returnType:kotlin.String? + VALUE_PARAMETER name:value index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test_1 (value: kotlin.Any?): kotlin.String? declared in ' + BLOCK type=kotlin.Nothing? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val] + GET_VAR 'value: kotlin.Any? declared in .test_1' type=kotlin.Any? 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.Any? [val] declared in .test_1' type=kotlin.Any? 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 (block: kotlin.Function1): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + : kotlin.Any + : kotlin.Nothing + $receiver: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .test_1' type=kotlin.Any? origin=null + block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Any) returnType:kotlin.Nothing + VALUE_PARAMETER name:it index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test_1 (value: kotlin.Any?): kotlin.String? declared in ' + CONST String type=kotlin.String value="O" + FUN name:test_2 visibility:public modality:FINAL <> (value:kotlin.Any?) returnType:kotlin.String? + VALUE_PARAMETER name:value index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test_2 (value: kotlin.Any?): kotlin.String? declared in ' + CALL 'public final fun run (block: kotlin.Function0): R of kotlin.StandardKt.run [inline] declared in kotlin.StandardKt' type=kotlin.Nothing? origin=null + : kotlin.Nothing? + block: FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Nothing? + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Nothing? declared in .test_2' + BLOCK type=kotlin.Nothing? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any? [val] + GET_VAR 'value: kotlin.Any? declared in .test_2' type=kotlin.Any? 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.Any? [val] declared in .test_2.' type=kotlin.Any? 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 (block: kotlin.Function1): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + : kotlin.Any + : kotlin.Nothing + $receiver: GET_VAR 'val tmp_1: kotlin.Any? [val] declared in .test_2.' type=kotlin.Any? origin=null + block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Any) returnType:kotlin.Nothing + VALUE_PARAMETER name:it index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test_2 (value: kotlin.Any?): kotlin.String? declared in ' + CONST String type=kotlin.String value="K" + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:result type:kotlin.String [var] + CONST String type=kotlin.String value="" + SET_VAR 'var result: kotlin.String [var] declared in .box' type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: GET_VAR 'var result: kotlin.String [var] declared in .box' type=kotlin.String origin=PLUSEQ + other: BLOCK type=kotlin.String origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val] + CALL 'public final fun test_1 (value: kotlin.Any?): kotlin.String? declared in ' type=kotlin.String? origin=null + value: CONST Int type=kotlin.Int value=1 + WHEN type=kotlin.String 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 .box' type=kotlin.String? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="fail 1" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_2: kotlin.String? [val] declared in .box' type=kotlin.String? origin=null + SET_VAR 'var result: kotlin.String [var] declared in .box' type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: GET_VAR 'var result: kotlin.String [var] declared in .box' type=kotlin.String origin=PLUSEQ + other: BLOCK type=kotlin.String origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.String? [val] + CALL 'public final fun test_2 (value: kotlin.Any?): kotlin.String? declared in ' type=kotlin.String? origin=null + value: CONST Int type=kotlin.Int value=1 + WHEN type=kotlin.String 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 .box' type=kotlin.String? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="fail 2" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_3: kotlin.String? [val] declared in .box' type=kotlin.String? origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + GET_VAR 'var result: kotlin.String [var] declared in .box' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/argumentMappedWithError.fir.kt.txt b/compiler/testData/ir/irText/expressions/argumentMappedWithError.fir.kt.txt deleted file mode 100644 index f74e529006e..00000000000 --- a/compiler/testData/ir/irText/expressions/argumentMappedWithError.fir.kt.txt +++ /dev/null @@ -1,11 +0,0 @@ -fun Number.convert(): R { - return TODO() -} - -fun foo(arg: Number) { -} - -fun main(args: Array) { - val x: Int = 0 - foo(arg = x.convert()) -} diff --git a/compiler/testData/ir/irText/expressions/argumentMappedWithError.fir.txt b/compiler/testData/ir/irText/expressions/argumentMappedWithError.fir.txt deleted file mode 100644 index 2545cc9f75b..00000000000 --- a/compiler/testData/ir/irText/expressions/argumentMappedWithError.fir.txt +++ /dev/null @@ -1,19 +0,0 @@ -FILE fqName: fileName:/argumentMappedWithError.kt - FUN name:convert visibility:public modality:FINAL ($receiver:kotlin.Number) returnType:R of .convert - TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Number] - $receiver: VALUE_PARAMETER name: type:kotlin.Number - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun convert (): R of .convert declared in ' - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null - FUN name:foo visibility:public modality:FINAL <> (arg:kotlin.Number) returnType:kotlin.Unit - VALUE_PARAMETER name:arg index:0 type:kotlin.Number - BLOCK_BODY - FUN name:main visibility:public modality:FINAL <> (args:kotlin.Array) returnType:kotlin.Unit - VALUE_PARAMETER name:args index:0 type:kotlin.Array - BLOCK_BODY - VAR name:x type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - CALL 'public final fun foo (arg: kotlin.Number): kotlin.Unit declared in ' type=kotlin.Unit origin=null - arg: CALL 'public final fun convert (): R of .convert declared in ' type=kotlin.Number origin=null - : kotlin.Number - $receiver: GET_VAR 'val x: kotlin.Int [val] declared in .main' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/argumentMappedWithError.kt b/compiler/testData/ir/irText/expressions/argumentMappedWithError.kt index 560788252c6..0ef96e066e7 100644 --- a/compiler/testData/ir/irText/expressions/argumentMappedWithError.kt +++ b/compiler/testData/ir/irText/expressions/argumentMappedWithError.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun Number.convert(): R = TODO() fun foo(arg: Number) { diff --git a/compiler/testData/ir/irText/expressions/argumentMappedWithError.kt.txt b/compiler/testData/ir/irText/expressions/argumentMappedWithError.kt.txt index 6a88ea35abe..708f813e2f4 100644 --- a/compiler/testData/ir/irText/expressions/argumentMappedWithError.kt.txt +++ b/compiler/testData/ir/irText/expressions/argumentMappedWithError.kt.txt @@ -1,5 +1,5 @@ fun Number.convert(): R { - TODO() + return TODO() } fun foo(arg: Number) { diff --git a/compiler/testData/ir/irText/expressions/argumentMappedWithError.txt b/compiler/testData/ir/irText/expressions/argumentMappedWithError.txt index 166106f210b..2545cc9f75b 100644 --- a/compiler/testData/ir/irText/expressions/argumentMappedWithError.txt +++ b/compiler/testData/ir/irText/expressions/argumentMappedWithError.txt @@ -3,7 +3,8 @@ FILE fqName: fileName:/argumentMappedWithError.kt TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Number] $receiver: VALUE_PARAMETER name: type:kotlin.Number BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public final fun convert (): R of .convert declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN name:foo visibility:public modality:FINAL <> (arg:kotlin.Number) returnType:kotlin.Unit VALUE_PARAMETER name:arg index:0 type:kotlin.Number BLOCK_BODY diff --git a/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.kt.txt b/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.kt.txt index aca6153a0e8..208be1daa15 100644 --- a/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.kt.txt +++ b/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.kt.txt @@ -18,7 +18,7 @@ fun bar(s: String?, t: String?): String { when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null else -> tmp0_safe_receiver.let(block = local fun (it: String): Nothing? { - { // BLOCK + return { // BLOCK val tmp0_safe_receiver: String? = t when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null @@ -27,7 +27,7 @@ fun bar(s: String?, t: String?): String { } ) } - } /*~> Unit */ + } } ) } diff --git a/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.txt b/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.txt index 78487630cb9..4a50937c199 100644 --- a/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.txt +++ b/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.txt @@ -50,7 +50,7 @@ FILE fqName: fileName:/SafeLetWithReturn.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: 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 + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.String): kotlin.Nothing? declared in .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 .bar' type=kotlin.String? origin=null diff --git a/compiler/testData/ir/irText/firProblems/kt19251.kt.txt b/compiler/testData/ir/irText/firProblems/kt19251.kt.txt index 504268b1f0d..d31ff18091e 100644 --- a/compiler/testData/ir/irText/firProblems/kt19251.kt.txt +++ b/compiler/testData/ir/irText/firProblems/kt19251.kt.txt @@ -1,7 +1,7 @@ fun box(): String { val map: MutableMap = mutableMapOf() val fn: Fun = local fun (it: @FlexibleNullability String?): @FlexibleNullability String? { - TODO() + return TODO() } /*-> Fun */ return map.computeIfAbsent(p0 = fn, p1 = local fun (it: @EnhancedNullability Fun): @EnhancedNullability String { diff --git a/compiler/testData/ir/irText/firProblems/kt19251.txt b/compiler/testData/ir/irText/firProblems/kt19251.txt index 9cc7b4ca1c7..c19421f21a5 100644 --- a/compiler/testData/ir/irText/firProblems/kt19251.txt +++ b/compiler/testData/ir/irText/firProblems/kt19251.txt @@ -11,7 +11,8 @@ FILE fqName: fileName:/test.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:@[FlexibleNullability] kotlin.String? VALUE_PARAMETER name:it index:0 type:@[FlexibleNullability] kotlin.String? BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='local final fun (it: @[FlexibleNullability] kotlin.String?): @[FlexibleNullability] kotlin.String? declared in .box' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String CALL 'public open fun computeIfAbsent (p0: @[EnhancedNullability] K of kotlin.collections.MutableMap, p1: @[EnhancedNullability] java.util.function.Function): @[EnhancedNullability] V of kotlin.collections.MutableMap declared in kotlin.collections.MutableMap' type=@[EnhancedNullability] kotlin.String origin=null diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.kt.txt b/compiler/testData/ir/irText/regressions/integerCoercionToT.kt.txt index e0f3ad2ecf3..87d0b0596ef 100644 --- a/compiler/testData/ir/irText/regressions/integerCoercionToT.kt.txt +++ b/compiler/testData/ir/irText/regressions/integerCoercionToT.kt.txt @@ -3,7 +3,7 @@ interface CPointed { } inline fun CPointed.reinterpret(): T { - TODO() + return TODO() } class CInt32VarX : CPointed { @@ -18,7 +18,7 @@ class CInt32VarX : CPointed { typealias CInt32Var = CInt32VarX var CInt32VarX.value: T_INT get(): T_INT { - TODO() + return TODO() } set(value: T_INT) { } diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.txt b/compiler/testData/ir/irText/regressions/integerCoercionToT.txt index e2463c6cfd6..00e2adbc87b 100644 --- a/compiler/testData/ir/irText/regressions/integerCoercionToT.txt +++ b/compiler/testData/ir/irText/regressions/integerCoercionToT.txt @@ -18,7 +18,8 @@ FILE fqName: fileName:/integerCoercionToT.kt TYPE_PARAMETER name:T index:0 variance: superTypes:[.CPointed] $receiver: VALUE_PARAMETER name: type:.CPointed BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public final fun reinterpret (): T of .reinterpret [inline] declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null CLASS CLASS name:CInt32VarX modality:FINAL visibility:public superTypes:[.CPointed] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CInt32VarX.CInt32VarX> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] @@ -46,7 +47,8 @@ FILE fqName: fileName:/integerCoercionToT.kt TYPE_PARAMETER name:T_INT index:0 variance: superTypes:[kotlin.Int] $receiver: VALUE_PARAMETER name: type:.CInt32VarX.> BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public final fun (): T_INT of . declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN name: visibility:public modality:FINAL ($receiver:.CInt32VarX.>, value:T_INT of .) returnType:kotlin.Unit correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] TYPE_PARAMETER name:T_INT index:0 variance: superTypes:[kotlin.Int] diff --git a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.fir.kt.txt b/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.fir.kt.txt deleted file mode 100644 index 6ae5f6007b2..00000000000 --- a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.fir.kt.txt +++ /dev/null @@ -1,20 +0,0 @@ -fun foo(): Function1 { - return TODO() -} - -interface Inv2 { - -} - -fun check(x: T, y: R, f: Function1): Inv2 { - return TODO() -} - -fun test(): Inv2 { - return check(x = "", y = 1, f = foo()) -} - -fun box(): String { - val x: Inv2 = test() - return "OK" -} diff --git a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.fir.txt b/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.fir.txt deleted file mode 100644 index 6367b2e0687..00000000000 --- a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.fir.txt +++ /dev/null @@ -1,50 +0,0 @@ -FILE fqName: fileName:/fixationOrder1.kt - FUN name:foo visibility:public modality:FINAL () returnType:kotlin.Function1.foo, Y of .foo> - TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] - TYPE_PARAMETER name:Y index:1 variance: superTypes:[kotlin.Any?] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Function1.foo, Y of .foo> declared in ' - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null - CLASS INTERFACE name:Inv2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Inv2.Inv2, B of .Inv2> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:check visibility:public modality:FINAL (x:T of .check, y:R of .check, f:kotlin.Function1.check, R of .check>) returnType:.Inv2.check, R of .check> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - TYPE_PARAMETER name:R index:1 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:x index:0 type:T of .check - VALUE_PARAMETER name:y index:1 type:R of .check - VALUE_PARAMETER name:f index:2 type:kotlin.Function1.check, R of .check> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun check (x: T of .check, y: R of .check, f: kotlin.Function1.check, R of .check>): .Inv2.check, R of .check> declared in ' - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null - FUN name:test visibility:public modality:FINAL <> () returnType:.Inv2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test (): .Inv2 declared in ' - CALL 'public final fun check (x: T of .check, y: R of .check, f: kotlin.Function1.check, R of .check>): .Inv2.check, R of .check> declared in ' type=.Inv2 origin=null - : kotlin.String - : kotlin.Int - x: CONST String type=kotlin.String value="" - y: CONST Int type=kotlin.Int value=1 - f: CALL 'public final fun foo (): kotlin.Function1.foo, Y of .foo> declared in ' type=kotlin.Function1 origin=null - : kotlin.String - : kotlin.Int - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - VAR name:x type:.Inv2 [val] - CALL 'public final fun test (): .Inv2 declared in ' type=.Inv2 origin=null - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' - CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt b/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt index 097f3f8a46c..26a7ec331c6 100644 --- a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt +++ b/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo(): (X) -> Y = TODO() interface Inv2 diff --git a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt.txt b/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt.txt index 4b06006e664..16405caf161 100644 --- a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt.txt +++ b/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt.txt @@ -1,5 +1,5 @@ fun foo(): Function1 { - TODO() + return TODO() } interface Inv2 { @@ -7,7 +7,7 @@ interface Inv2 { } fun check(x: T, y: R, f: Function1): Inv2 { - TODO() + return TODO() } fun test(): Inv2 { diff --git a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.txt b/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.txt index 53c50b78d0d..6367b2e0687 100644 --- a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.txt +++ b/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.txt @@ -3,7 +3,8 @@ FILE fqName: fileName:/fixationOrder1.kt TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] TYPE_PARAMETER name:Y index:1 variance: superTypes:[kotlin.Any?] BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Function1.foo, Y of .foo> declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null CLASS INTERFACE name:Inv2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Inv2.Inv2, B of .Inv2> TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] @@ -28,7 +29,8 @@ FILE fqName: fileName:/fixationOrder1.kt VALUE_PARAMETER name:y index:1 type:R of .check VALUE_PARAMETER name:f index:2 type:kotlin.Function1.check, R of .check> BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public final fun check (x: T of .check, y: R of .check, f: kotlin.Function1.check, R of .check>): .Inv2.check, R of .check> declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN name:test visibility:public modality:FINAL <> () returnType:.Inv2 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test (): .Inv2 declared in ' diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt index 149e016f412..0e69616348d 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt @@ -23,7 +23,7 @@ suspend fun FlowCollector.invokeSafely(action: @ExtensionFunctionT @OptIn(markerClass = [ExperimentalTypeInference::class]) inline fun unsafeFlow(@BuilderInference crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { - TODO() + return TODO() } @Deprecated(message = "binary compatibility with a version w/o FlowCollector receiver", level = DeprecationLevel.HIDDEN) @@ -85,12 +85,12 @@ class SafeCollector : FlowCollector { @OptIn(markerClass = [ExperimentalTypeInference::class]) fun flow(@BuilderInference block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { - TODO() + return TODO() } @OptIn(markerClass = [ExperimentalTypeInference::class]) suspend fun flowScope(@BuilderInference block: @ExtensionFunctionType SuspendFunction1): R { - TODO() + return TODO() } suspend inline fun Flow.collect(crossinline action: SuspendFunction1<@ParameterName(name = "value") T, Unit>) { @@ -128,7 +128,7 @@ interface ReceiveChannel { @OptIn(markerClass = [ExperimentalTypeInference::class]) fun CoroutineScope.produce(@BuilderInference block: @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel { - TODO() + return TODO() } interface ProducerScope : CoroutineScope, SendChannel { diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.txt index 998c6c1d66f..01ec858bef1 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.txt @@ -59,7 +59,8 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt annotations: BuilderInference BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> [inline] declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN name:onCompletion visibility:public modality:FINAL ($receiver:.Flow.onCompletion>, action:kotlin.coroutines.SuspendFunction1<@[ParameterName(name = 'cause')] kotlin.Throwable?, kotlin.Unit>) returnType:.Flow.onCompletion> annotations: Deprecated(message = 'binary compatibility with a version w/o FlowCollector receiver', replaceWith = , level = GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:HIDDEN' type=kotlin.DeprecationLevel) @@ -198,7 +199,8 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt annotations: BuilderInference BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public final fun flow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN name:flowScope visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>) returnType:R of .flowScope [suspend] annotations: OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) @@ -207,7 +209,8 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt annotations: BuilderInference BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public final fun flowScope (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope [suspend] declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN name:collect visibility:public modality:FINAL ($receiver:.Flow.collect>, action:kotlin.coroutines.SuspendFunction1<@[ParameterName(name = 'value')] T of .collect, kotlin.Unit>) returnType:kotlin.Unit [inline,suspend] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] $receiver: VALUE_PARAMETER name: type:.Flow.collect> @@ -315,7 +318,8 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt annotations: BuilderInference BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public final fun produce (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null CLASS INTERFACE name:ProducerScope modality:ABSTRACT visibility:public superTypes:[.CoroutineScope; .SendChannel.ProducerScope>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ProducerScope.ProducerScope> TYPE_PARAMETER name:E index:0 variance:in superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.kt.txt b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.kt.txt index cc82a1c85f5..360a9cc50fc 100644 --- a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.kt.txt @@ -10,23 +10,23 @@ class MySet : Set { override val size: Int override get(): Int { - TODO() + return TODO() } override operator fun contains(element: String): Boolean { - TODO() + return TODO() } override fun containsAll(elements: Collection): Boolean { - TODO() + return TODO() } override fun isEmpty(): Boolean { - TODO() + return TODO() } override operator fun iterator(): Iterator { - TODO() + return TODO() } } diff --git a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.txt b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.txt index c5aef49614c..a4e30dd0dd9 100644 --- a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.txt +++ b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.txt @@ -17,33 +17,38 @@ FILE fqName: fileName:/implicitNotNullOnPlatformType.kt public abstract fun (): kotlin.Int declared in kotlin.collections.Set $this: VALUE_PARAMETER name: type:.MySet BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .MySet' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN name:contains visibility:public modality:OPEN <> ($this:.MySet, element:kotlin.String) returnType:kotlin.Boolean [operator] overridden: public abstract fun contains (element: E of kotlin.collections.Set): kotlin.Boolean [operator] declared in kotlin.collections.Set $this: VALUE_PARAMETER name: type:.MySet VALUE_PARAMETER name:element index:0 type:kotlin.String BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public open fun contains (element: kotlin.String): kotlin.Boolean [operator] declared in .MySet' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN name:containsAll visibility:public modality:OPEN <> ($this:.MySet, elements:kotlin.collections.Collection) returnType:kotlin.Boolean overridden: public abstract fun containsAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.Set $this: VALUE_PARAMETER name: type:.MySet VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public open fun containsAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in .MySet' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN name:isEmpty visibility:public modality:OPEN <> ($this:.MySet) returnType:kotlin.Boolean overridden: public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.Set $this: VALUE_PARAMETER name: type:.MySet BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public open fun isEmpty (): kotlin.Boolean declared in .MySet' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN name:iterator visibility:public modality:OPEN <> ($this:.MySet) returnType:kotlin.collections.Iterator [operator] overridden: public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.Set $this: VALUE_PARAMETER name: type:.MySet BLOCK_BODY - CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null + RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator [operator] declared in .MySet' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.Set diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index fb043446876..101d88f636f 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -16334,6 +16334,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/functions/kt47449.kt"); } + @Test + @TestMetadata("kt47527.kt") + public void testKt47527() throws Exception { + runTest("compiler/testData/codegen/box/functions/kt47527.kt"); + } + @Test @TestMetadata("kt785.kt") public void testKt785() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index d0bcf6b9f49..1cd7be83a06 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -16364,6 +16364,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/functions/kt47449.kt"); } + @Test + @TestMetadata("kt47527.kt") + public void testKt47527() throws Exception { + runTest("compiler/testData/codegen/box/functions/kt47527.kt"); + } + @Test @TestMetadata("kt785.kt") public void testKt785() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java index 80a01a3fa00..fffa0711c72 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java @@ -458,6 +458,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest { runTest("compiler/testData/ir/irText/declarations/kt45308.kt"); } + @Test + @TestMetadata("kt47527.kt") + public void testKt47527() throws Exception { + runTest("compiler/testData/ir/irText/declarations/kt47527.kt"); + } + @Test @TestMetadata("localClassWithOverrides.kt") public void testLocalClassWithOverrides() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 4bb8d49979c..36dc61fb632 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -13470,6 +13470,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/functions/kt47449.kt"); } + @TestMetadata("kt47527.kt") + public void testKt47527() throws Exception { + runTest("compiler/testData/codegen/box/functions/kt47527.kt"); + } + @TestMetadata("kt785.kt") public void testKt785() throws Exception { runTest("compiler/testData/codegen/box/functions/kt785.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java index 297ee99ea8c..e10f624a60a 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java @@ -355,6 +355,11 @@ public class KlibTextTestCaseGenerated extends AbstractKlibTextTestCase { runTest("compiler/testData/ir/irText/declarations/kt45308.kt"); } + @TestMetadata("kt47527.kt") + public void testKt47527() throws Exception { + runTest("compiler/testData/ir/irText/declarations/kt47527.kt"); + } + @TestMetadata("localClassWithOverrides.kt") public void testLocalClassWithOverrides() throws Exception { runTest("compiler/testData/ir/irText/declarations/localClassWithOverrides.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 58db93b2026..19f93221da3 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -11869,6 +11869,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/functions/kt47449.kt"); } + @TestMetadata("kt47527.kt") + public void testKt47527() throws Exception { + runTest("compiler/testData/codegen/box/functions/kt47527.kt"); + } + @TestMetadata("kt785.kt") public void testKt785() throws Exception { runTest("compiler/testData/codegen/box/functions/kt785.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 3b9ba5a30e5..793efc4d00d 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -11275,6 +11275,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/functions/kt47449.kt"); } + @TestMetadata("kt47527.kt") + public void testKt47527() throws Exception { + runTest("compiler/testData/codegen/box/functions/kt47527.kt"); + } + @TestMetadata("kt785.kt") public void testKt785() throws Exception { runTest("compiler/testData/codegen/box/functions/kt785.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index b13467ae80b..33942d129bc 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -11275,6 +11275,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/functions/kt47449.kt"); } + @TestMetadata("kt47527.kt") + public void testKt47527() throws Exception { + runTest("compiler/testData/codegen/box/functions/kt47527.kt"); + } + @TestMetadata("kt785.kt") public void testKt785() throws Exception { runTest("compiler/testData/codegen/box/functions/kt785.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index ac5440a1a58..1eae2b30087 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -5765,6 +5765,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/functions/kt47449.kt"); } + @TestMetadata("kt47527.kt") + public void testKt47527() throws Exception { + runTest("compiler/testData/codegen/box/functions/kt47527.kt"); + } + @TestMetadata("kt785.kt") public void testKt785() throws Exception { runTest("compiler/testData/codegen/box/functions/kt785.kt");