[FIR] KT-57655: Ensure the current IR is incorrect
The `FirPsiBlackBoxCodegenTestGenerated.testImplicitIntegerCoercionNamedArg` test fails in K2 with "java.lang.Integer cannot be cast to kotlin.UInt".
This commit is contained in:
committed by
Space Team
parent
20661d1f95
commit
c4d5332251
+6
@@ -3734,6 +3734,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaField.kt")
|
@TestMetadata("javaField.kt")
|
||||||
public void testJavaField() throws Exception {
|
public void testJavaField() throws Exception {
|
||||||
|
|||||||
+6
@@ -3734,6 +3734,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaField.kt")
|
@TestMetadata("javaField.kt")
|
||||||
public void testJavaField() throws Exception {
|
public void testJavaField() throws Exception {
|
||||||
|
|||||||
Vendored
+53
@@ -0,0 +1,53 @@
|
|||||||
|
FILE fqName:kotlin.internal fileName:/annotation.kt
|
||||||
|
CLASS ANNOTATION_CLASS name:ImplicitIntegerCoercion modality:OPEN visibility:public superTypes:[kotlin.Annotation]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:kotlin.internal.ImplicitIntegerCoercion
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:kotlin.internal.ImplicitIntegerCoercion [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:ImplicitIntegerCoercion modality:OPEN visibility:public superTypes:[kotlin.Annotation]'
|
||||||
|
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.Annotation
|
||||||
|
$this: VALUE_PARAMETER name:<this> 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 [fake_override] declared in kotlin.Annotation
|
||||||
|
$this: VALUE_PARAMETER name:<this> 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 [fake_override] declared in kotlin.Annotation
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
|
FILE fqName:<root> fileName:/test.kt
|
||||||
|
FUN name:test visibility:public modality:FINAL <> (x:kotlin.UInt) returnType:kotlin.UInt
|
||||||
|
VALUE_PARAMETER name:x index:0 type:kotlin.UInt
|
||||||
|
annotations:
|
||||||
|
ImplicitIntegerCoercion
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun test (x: kotlin.UInt): kotlin.UInt declared in <root>'
|
||||||
|
TYPE_OP type=kotlin.UInt origin=CAST typeOperand=kotlin.UInt
|
||||||
|
GET_VAR 'x: kotlin.UInt declared in <root>.test' type=kotlin.UInt origin=null
|
||||||
|
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||||
|
WHEN type=kotlin.String origin=WHEN
|
||||||
|
BRANCH
|
||||||
|
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||||
|
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||||
|
arg0: CALL 'public final fun test (x: kotlin.UInt): kotlin.UInt declared in <root>' type=kotlin.UInt origin=null
|
||||||
|
x: CALL 'public final fun toUInt (): kotlin.UInt [inline] declared in kotlin.UIntKt' type=kotlin.UInt origin=null
|
||||||
|
$receiver: CONST Int type=kotlin.Int value=5
|
||||||
|
arg1: CALL 'public final fun toUInt (): kotlin.UInt [inline] declared in kotlin.UIntKt' type=kotlin.UInt origin=null
|
||||||
|
$receiver: CONST Int type=kotlin.Int value=5
|
||||||
|
then: CONST String type=kotlin.String value="Fail: test(5)"
|
||||||
|
BRANCH
|
||||||
|
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||||
|
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||||
|
arg0: CALL 'public final fun test (x: kotlin.UInt): kotlin.UInt declared in <root>' type=kotlin.UInt origin=null
|
||||||
|
x: CONST Int type=kotlin.Int value=5
|
||||||
|
arg1: CALL 'public final fun toUInt (): kotlin.UInt [inline] declared in kotlin.UIntKt' type=kotlin.UInt origin=null
|
||||||
|
$receiver: CONST Int type=kotlin.Int value=5
|
||||||
|
then: CONST String type=kotlin.String value="Fail: test(x = 5)"
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: CONST String type=kotlin.String value="OK"
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
// ISSUE: KT-57655
|
||||||
|
// !LANGUAGE: +ImplicitSignedToUnsignedIntegerConversion
|
||||||
|
// ALLOW_KOTLIN_PACKAGE
|
||||||
|
// WITH_STDLIB
|
||||||
|
// DUMP_IR
|
||||||
|
|
||||||
|
// FILE: annotation.kt
|
||||||
|
|
||||||
|
package kotlin.internal
|
||||||
|
|
||||||
|
annotation class ImplicitIntegerCoercion
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
|
||||||
|
import kotlin.internal.ImplicitIntegerCoercion
|
||||||
|
|
||||||
|
fun test(@ImplicitIntegerCoercion x: UInt) = x as UInt
|
||||||
|
|
||||||
|
fun box(): String = when {
|
||||||
|
test(5) != 5.toUInt() -> "Fail: test(5)"
|
||||||
|
test(x = 5) != 5.toUInt() -> "Fail: test(x = 5)"
|
||||||
|
else -> "OK"
|
||||||
|
}
|
||||||
+6
@@ -3578,6 +3578,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaField.kt")
|
@TestMetadata("javaField.kt")
|
||||||
public void testJavaField() throws Exception {
|
public void testJavaField() throws Exception {
|
||||||
|
|||||||
+6
@@ -3734,6 +3734,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaField.kt")
|
@TestMetadata("javaField.kt")
|
||||||
public void testJavaField() throws Exception {
|
public void testJavaField() throws Exception {
|
||||||
|
|||||||
+6
@@ -3734,6 +3734,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaField.kt")
|
@TestMetadata("javaField.kt")
|
||||||
public void testJavaField() throws Exception {
|
public void testJavaField() throws Exception {
|
||||||
|
|||||||
+5
@@ -3131,6 +3131,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("javaField.kt")
|
@TestMetadata("javaField.kt")
|
||||||
public void testJavaField() throws Exception {
|
public void testJavaField() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/bound/javaField.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/javaField.kt");
|
||||||
|
|||||||
+6
@@ -2402,6 +2402,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kCallableNameIntrinsic.kt")
|
@TestMetadata("kCallableNameIntrinsic.kt")
|
||||||
public void testKCallableNameIntrinsic() throws Exception {
|
public void testKCallableNameIntrinsic() throws Exception {
|
||||||
|
|||||||
+6
@@ -2456,6 +2456,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kCallableNameIntrinsic.kt")
|
@TestMetadata("kCallableNameIntrinsic.kt")
|
||||||
public void testKCallableNameIntrinsic() throws Exception {
|
public void testKCallableNameIntrinsic() throws Exception {
|
||||||
|
|||||||
+6
@@ -2456,6 +2456,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kCallableNameIntrinsic.kt")
|
@TestMetadata("kCallableNameIntrinsic.kt")
|
||||||
public void testKCallableNameIntrinsic() throws Exception {
|
public void testKCallableNameIntrinsic() throws Exception {
|
||||||
|
|||||||
+6
@@ -2456,6 +2456,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kCallableNameIntrinsic.kt")
|
@TestMetadata("kCallableNameIntrinsic.kt")
|
||||||
public void testKCallableNameIntrinsic() throws Exception {
|
public void testKCallableNameIntrinsic() throws Exception {
|
||||||
|
|||||||
+6
@@ -2575,6 +2575,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kCallableNameIntrinsic.kt")
|
@TestMetadata("kCallableNameIntrinsic.kt")
|
||||||
public void testKCallableNameIntrinsic() throws Exception {
|
public void testKCallableNameIntrinsic() throws Exception {
|
||||||
|
|||||||
+6
@@ -2637,6 +2637,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kCallableNameIntrinsic.kt")
|
@TestMetadata("kCallableNameIntrinsic.kt")
|
||||||
public void testKCallableNameIntrinsic() throws Exception {
|
public void testKCallableNameIntrinsic() throws Exception {
|
||||||
|
|||||||
+6
@@ -2544,6 +2544,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kCallableNameIntrinsic.kt")
|
@TestMetadata("kCallableNameIntrinsic.kt")
|
||||||
public void testKCallableNameIntrinsic() throws Exception {
|
public void testKCallableNameIntrinsic() throws Exception {
|
||||||
|
|||||||
+6
@@ -2606,6 +2606,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kCallableNameIntrinsic.kt")
|
@TestMetadata("kCallableNameIntrinsic.kt")
|
||||||
public void testKCallableNameIntrinsic() throws Exception {
|
public void testKCallableNameIntrinsic() throws Exception {
|
||||||
|
|||||||
Generated
+5
@@ -2181,6 +2181,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/genericValOnLHS.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("implicitIntegerCoercionNamedArg.kt")
|
||||||
|
public void testImplicitIntegerCoercionNamedArg() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/bound/implicitIntegerCoercionNamedArg.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kCallableNameIntrinsic.kt")
|
@TestMetadata("kCallableNameIntrinsic.kt")
|
||||||
public void testKCallableNameIntrinsic() throws Exception {
|
public void testKCallableNameIntrinsic() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/bound/kCallableNameIntrinsic.kt");
|
runTest("compiler/testData/codegen/box/callableReference/bound/kCallableNameIntrinsic.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user