[IR] Make IrTypeOperatorCall copyable
^KT-45655 fixed
This commit is contained in:
committed by
TeamCityServer
parent
2a5153f0fd
commit
47f1a8a0bb
+6
@@ -8790,6 +8790,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("castWithSuspend.kt")
|
||||
public void testCastWithSuspend() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/castWithSuspend.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("catchWithInlineInsideSuspend.kt")
|
||||
public void testCatchWithInlineInsideSuspend() throws Exception {
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ class MultipleCatchesLowering(private val context: JsIrBackendContext) : BodyLow
|
||||
}
|
||||
|
||||
val catchBody = catch.result.transform(object : IrElementTransformer<IrValueSymbol> {
|
||||
override fun visitGetValue(expression: IrGetValue, data: IrValueSymbol) =
|
||||
override fun visitGetValue(expression: IrGetValue, data: IrValueSymbol): IrExpression =
|
||||
if (expression.symbol == data)
|
||||
castedPendingException()
|
||||
else
|
||||
|
||||
@@ -66,7 +66,7 @@ enum class IrTypeOperator {
|
||||
REINTERPRET_CAST;
|
||||
}
|
||||
|
||||
abstract class IrTypeOperatorCall : IrExpression() {
|
||||
abstract class IrTypeOperatorCall : IrExpression(), IrExpressionWithCopy {
|
||||
abstract val operator: IrTypeOperator
|
||||
abstract var argument: IrExpression
|
||||
abstract var typeOperand: IrType
|
||||
|
||||
+10
@@ -46,4 +46,14 @@ class IrTypeOperatorCallImpl(
|
||||
override fun <D> transformChildren(transformer: IrElementTransformer<D>, data: D) {
|
||||
argument = argument.transform(transformer, data)
|
||||
}
|
||||
|
||||
override fun copy(): IrExpression =
|
||||
IrTypeOperatorCallImpl(
|
||||
startOffset,
|
||||
endOffset,
|
||||
type,
|
||||
operator,
|
||||
typeOperand,
|
||||
argument
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
suspend fun foo() {
|
||||
DeferredCoroutine<Unit>().await()
|
||||
}
|
||||
|
||||
class DeferredCoroutine<T> {
|
||||
suspend fun await(): T = awaitInternal() as T
|
||||
}
|
||||
|
||||
internal suspend fun awaitInternal(): Any? = suspendCoroutineUninterceptedOrReturn { uCont ->
|
||||
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -8790,6 +8790,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("castWithSuspend.kt")
|
||||
public void testCastWithSuspend() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/castWithSuspend.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("catchWithInlineInsideSuspend.kt")
|
||||
public void testCatchWithInlineInsideSuspend() throws Exception {
|
||||
|
||||
+6
@@ -8790,6 +8790,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("castWithSuspend.kt")
|
||||
public void testCastWithSuspend() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/castWithSuspend.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("catchWithInlineInsideSuspend.kt")
|
||||
public void testCatchWithInlineInsideSuspend() throws Exception {
|
||||
|
||||
+5
@@ -6854,6 +6854,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("castWithSuspend.kt")
|
||||
public void testCastWithSuspend() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/castWithSuspend.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("catchWithInlineInsideSuspend.kt")
|
||||
public void testCatchWithInlineInsideSuspend() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/catchWithInlineInsideSuspend.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -6118,6 +6118,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("castWithSuspend.kt")
|
||||
public void testCastWithSuspend() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/castWithSuspend.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("catchWithInlineInsideSuspend.kt")
|
||||
public void testCatchWithInlineInsideSuspend() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/catchWithInlineInsideSuspend.kt");
|
||||
|
||||
Generated
+5
@@ -5539,6 +5539,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("castWithSuspend.kt")
|
||||
public void testCastWithSuspend() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/castWithSuspend.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("catchWithInlineInsideSuspend.kt")
|
||||
public void testCatchWithInlineInsideSuspend() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/catchWithInlineInsideSuspend.kt");
|
||||
|
||||
Generated
+5
@@ -5539,6 +5539,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("castWithSuspend.kt")
|
||||
public void testCastWithSuspend() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/castWithSuspend.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("catchWithInlineInsideSuspend.kt")
|
||||
public void testCatchWithInlineInsideSuspend() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/catchWithInlineInsideSuspend.kt");
|
||||
|
||||
Reference in New Issue
Block a user