K2: reproduce KT-63164

This commit is contained in:
Mikhail Glukhikh
2023-11-15 13:43:39 +01:00
committed by Space Team
parent 271f83d07d
commit a139965231
22 changed files with 262 additions and 0 deletions
@@ -19732,6 +19732,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
runTest("compiler/testData/codegen/box/fir/selectingLambdas.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("StackOverflowInAnnotationLoader.kt")
public void testStackOverflowInAnnotationLoader() throws Exception {
@@ -19732,6 +19732,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
runTest("compiler/testData/codegen/box/fir/selectingLambdas.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("StackOverflowInAnnotationLoader.kt")
public void testStackOverflowInAnnotationLoader() throws Exception {
@@ -19397,6 +19397,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/fir/selectingLambdas.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("StackOverflowInAnnotationLoader.kt")
public void testStackOverflowInAnnotationLoader() throws Exception {
@@ -19397,6 +19397,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
runTest("compiler/testData/codegen/box/fir/selectingLambdas.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("StackOverflowInAnnotationLoader.kt")
public void testStackOverflowInAnnotationLoader() throws Exception {
@@ -19397,6 +19397,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/fir/selectingLambdas.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("StackOverflowInAnnotationLoader.kt")
public void testStackOverflowInAnnotationLoader() throws Exception {
@@ -0,0 +1,61 @@
Module: m1
FILE fqName:<root> fileName:/info.kt
CLASS CLASS name:Info modality:FINAL visibility:internal superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Info
CONSTRUCTOR visibility:public <> () returnType:<root>.Info [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Info modality:FINAL visibility:internal superTypes:[kotlin.Any]'
PROPERTY name:status visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:status type:kotlin.String visibility:private [final]
EXPRESSION_BODY
CONST String type=kotlin.String value="OK"
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-status> visibility:public modality:FINAL <> ($this:<root>.Info) returnType:kotlin.String
correspondingProperty: PROPERTY name:status visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Info
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-status> (): kotlin.String declared in <root>.Info'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:status type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
receiver: GET_VAR '<this>: <root>.Info declared in <root>.Info.<get-status>' type=<root>.Info 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 declared in kotlin.Any
$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 declared in kotlin.Any
$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 declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
PROPERTY name:info visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:info type:kotlin.Any? visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Info' type=<root>.Info origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-info> visibility:public modality:FINAL <> () returnType:kotlin.Any?
correspondingProperty: PROPERTY name:info visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-info> (): kotlin.Any? declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:info type:kotlin.Any? visibility:private [final,static]' type=kotlin.Any? origin=null
Module: m2
FILE fqName:<root> fileName:/box.kt
FUN name:getStatus visibility:public modality:FINAL <> (param:kotlin.Any?) returnType:kotlin.String
VALUE_PARAMETER name:param index:0 type:kotlin.Any?
BLOCK_BODY
WHEN type=kotlin.Unit origin=IF
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.Info
GET_VAR 'param: kotlin.Any? declared in <root>.getStatus' type=kotlin.Any? origin=null
then: BLOCK type=kotlin.Unit origin=null
RETURN type=kotlin.Nothing from='public final fun getStatus (param: kotlin.Any?): kotlin.String declared in <root>'
CALL 'public final fun <get-status> (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=GET_PROPERTY
$this: GET_VAR 'param: kotlin.Any? declared in <root>.getStatus' type=kotlin.Any? origin=null
RETURN type=kotlin.Nothing from='public final fun getStatus (param: kotlin.Any?): kotlin.String declared in <root>'
CONST String type=kotlin.String value="NO STATUS"
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>'
CALL 'public final fun getStatus (param: kotlin.Any?): kotlin.String declared in <root>' type=kotlin.String origin=null
param: CALL 'public final fun <get-info> (): kotlin.Any? declared in <root>' type=kotlin.Any? origin=GET_PROPERTY
@@ -0,0 +1,62 @@
Module: m1
FILE fqName:<root> fileName:/info.kt
CLASS CLASS name:Info modality:FINAL visibility:internal superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Info
CONSTRUCTOR visibility:public <> () returnType:<root>.Info [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Info modality:FINAL visibility:internal superTypes:[kotlin.Any]'
PROPERTY name:status visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:status type:kotlin.String visibility:private [final]
EXPRESSION_BODY
CONST String type=kotlin.String value="OK"
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-status> visibility:public modality:FINAL <> ($this:<root>.Info) returnType:kotlin.String
correspondingProperty: PROPERTY name:status visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Info
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-status> (): kotlin.String declared in <root>.Info'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:status type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
receiver: GET_VAR '<this>: <root>.Info declared in <root>.Info.<get-status>' type=<root>.Info 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 declared in kotlin.Any
$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 declared in kotlin.Any
$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 declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
PROPERTY name:info visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:info type:kotlin.Any? visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Info' type=<root>.Info origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-info> visibility:public modality:FINAL <> () returnType:kotlin.Any?
correspondingProperty: PROPERTY name:info visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-info> (): kotlin.Any? declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:info type:kotlin.Any? visibility:private [final,static]' type=kotlin.Any? origin=null
Module: m2
FILE fqName:<root> fileName:/box.kt
FUN name:getStatus visibility:public modality:FINAL <> (param:kotlin.Any?) returnType:kotlin.String
VALUE_PARAMETER name:param index:0 type:kotlin.Any?
BLOCK_BODY
WHEN type=kotlin.Unit origin=IF
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.Info
GET_VAR 'param: kotlin.Any? declared in <root>.getStatus' type=kotlin.Any? origin=null
then: BLOCK type=kotlin.Unit origin=null
RETURN type=kotlin.Nothing from='public final fun getStatus (param: kotlin.Any?): kotlin.String declared in <root>'
CALL 'public final fun <get-status> (): kotlin.String declared in <root>.Info' type=kotlin.String origin=GET_PROPERTY
$this: TYPE_OP type=<root>.Info origin=IMPLICIT_CAST typeOperand=<root>.Info
GET_VAR 'param: kotlin.Any? declared in <root>.getStatus' type=kotlin.Any? origin=null
RETURN type=kotlin.Nothing from='public final fun getStatus (param: kotlin.Any?): kotlin.String declared in <root>'
CONST String type=kotlin.String value="NO STATUS"
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>'
CALL 'public final fun getStatus (param: kotlin.Any?): kotlin.String declared in <root>' type=kotlin.String origin=null
param: CALL 'public final fun <get-info> (): kotlin.Any? declared in <root>' type=kotlin.Any? origin=GET_PROPERTY
@@ -0,0 +1,26 @@
// IGNORE_BACKEND_K2: JVM_IR, JS_IR, NATIVE, WASM
// FIR status: see KT-63164
// ISSUE: KT-63164
// DUMP_IR
// MODULE: m1
// FILE: info.kt
internal class Info {
val status: String = "OK"
}
val info: Any? = Info()
// MODULE: m2(m1)
// FILE: box.kt
fun getStatus(param: Any?): String {
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
if (param is Info) {
return param.status
}
return "NO STATUS"
}
fun box(): String = getStatus(info)
@@ -18389,6 +18389,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("suppressedInvisibleReferenceQualifier.kt")
public void testSuppressedInvisibleReferenceQualifier() throws Exception {
@@ -19397,6 +19397,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/fir/selectingLambdas.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("StackOverflowInAnnotationLoader.kt")
public void testStackOverflowInAnnotationLoader() throws Exception {
@@ -19397,6 +19397,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
runTest("compiler/testData/codegen/box/fir/selectingLambdas.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("StackOverflowInAnnotationLoader.kt")
public void testStackOverflowInAnnotationLoader() throws Exception {
@@ -16171,6 +16171,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
}
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@TestMetadata("StackOverflowInAnnotationLoader.kt")
public void testStackOverflowInAnnotationLoader() throws Exception {
runTest("compiler/testData/codegen/box/fir/StackOverflowInAnnotationLoader.kt");
@@ -14291,6 +14291,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("suppressedInvisibleReferenceQualifier.kt")
public void testSuppressedInvisibleReferenceQualifier() throws Exception {
@@ -14291,6 +14291,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("suppressedInvisibleReferenceQualifier.kt")
public void testSuppressedInvisibleReferenceQualifier() throws Exception {
@@ -14291,6 +14291,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("suppressedInvisibleReferenceQualifier.kt")
public void testSuppressedInvisibleReferenceQualifier() throws Exception {
@@ -14291,6 +14291,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("suppressedInvisibleReferenceQualifier.kt")
public void testSuppressedInvisibleReferenceQualifier() throws Exception {
@@ -15697,6 +15697,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("suppressedInvisibleReferenceQualifier.kt")
public void testSuppressedInvisibleReferenceQualifier() throws Exception {
@@ -16069,6 +16069,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("suppressedInvisibleReferenceQualifier.kt")
public void testSuppressedInvisibleReferenceQualifier() throws Exception {
@@ -15325,6 +15325,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("suppressedInvisibleReferenceQualifier.kt")
public void testSuppressedInvisibleReferenceQualifier() throws Exception {
@@ -15698,6 +15698,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("suppressedInvisibleReferenceQualifier.kt")
public void testSuppressedInvisibleReferenceQualifier() throws Exception {
@@ -14267,6 +14267,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("suppressedInvisibleReferenceQualifier.kt")
public void testSuppressedInvisibleReferenceQualifier() throws Exception {
@@ -14267,6 +14267,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
}
@Test
@TestMetadata("smartCastToInvisibleClassMember.kt")
public void testSmartCastToInvisibleClassMember() throws Exception {
runTest("compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.kt");
}
@Test
@TestMetadata("suppressedInvisibleReferenceQualifier.kt")
public void testSuppressedInvisibleReferenceQualifier() throws Exception {