[Psi2Ir] Fix generation of hashcode for generic inline class

This commit is contained in:
Roman Artemev
2020-02-14 17:42:12 +03:00
committed by romanart
parent 6a37955a36
commit 5004bb3636
13 changed files with 313 additions and 0 deletions
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
import org.jetbrains.kotlin.ir.builders.*
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpression
import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl
import org.jetbrains.kotlin.ir.expressions.mapTypeParameters
import org.jetbrains.kotlin.ir.expressions.mapValueParameters
@@ -56,6 +57,8 @@ class DataClassMembersGenerator(
MyDataClassMethodGenerator(ktClassOrObject, irClass, IrDeclarationOrigin.GENERATED_DATA_CLASS_MEMBER).generate()
}
fun IrMemberAccessExpression.commitSubstituted(descriptor: CallableDescriptor) = context.run { commitSubstituted(descriptor) }
private fun declareSimpleFunction(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, function: FunctionDescriptor) =
context.symbolTable.declareSimpleFunctionWithOverrides(
startOffset, endOffset, origin,
@@ -257,7 +260,9 @@ class DataClassMembersGenerator(
}
private fun MemberFunctionBuilder.getHashCodeOf(kotlinType: KotlinType, irValue: IrExpression): IrExpression {
var substituted: FunctionDescriptor? = null
val hashCodeFunctionSymbol = getHashCodeFunction(kotlinType) {
substituted = it
declarationGenerator.context.symbolTable.referenceSimpleFunction(it.original)
}
@@ -267,6 +272,7 @@ class DataClassMembersGenerator(
} else {
putValueArgument(0, irValue)
}
commitSubstituted(substituted ?: hashCodeFunctionSymbol.descriptor)
}
}
@@ -55,4 +55,8 @@ class GeneratorContext(
// TODO: inject a correct StorageManager instance, or store NotFoundClasses inside ModuleDescriptor
val reflectionTypes = ReflectionTypes(moduleDescriptor, NotFoundClasses(LockBasedStorageManager.NO_LOCKS, moduleDescriptor))
fun IrMemberAccessExpression.commitSubstituted(descriptor: CallableDescriptor) {
callToSubstitutedDescriptorMap[this] = descriptor
}
}
@@ -0,0 +1,27 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS
// MODULE: lib1
// FILE: lib1.kt
class C<T>(val t: T) {
override fun hashCode(): Int = t as Int
}
// MODULE: lib2(lib1)
// FILE: lib2.kt
inline class IC<TT>(val c: C<TT>) {
fun foo(): Int = c.hashCode()
}
// MODULE: main(lib2)
// FILE: main.kt
fun box(): String {
val ic = IC<Int>(C(42))
if (ic.foo() != 42) return "FAIL"
return "OK"
}
@@ -0,0 +1,94 @@
FILE fqName:<root> fileName:/inlineClassSyntheticMethods.kt
CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C<T of <root>.C>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
CONSTRUCTOR visibility:public <> (t:T of <root>.C) returnType:<root>.C<T of <root>.C> [primary]
VALUE_PARAMETER name:t index:0 type:T of <root>.C
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:t visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:t type:T of <root>.C visibility:private [final]
EXPRESSION_BODY
GET_VAR 't: T of <root>.C declared in <root>.C.<init>' type=T of <root>.C origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-t> visibility:public modality:FINAL <> ($this:<root>.C<T of <root>.C>) returnType:T of <root>.C
correspondingProperty: PROPERTY name:t visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.C<T of <root>.C>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-t> (): T of <root>.C declared in <root>.C'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:t type:T of <root>.C visibility:private [final]' type=T of <root>.C origin=null
receiver: GET_VAR '<this>: <root>.C<T of <root>.C> declared in <root>.C.<get-t>' type=<root>.C<T of <root>.C> origin=null
FUN name:hashCode visibility:public modality:FINAL <> ($this:<root>.C<T of <root>.C>) returnType:kotlin.Int
$this: VALUE_PARAMETER name:<this> type:<root>.C<T of <root>.C>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun hashCode (): kotlin.Int declared in <root>.C'
TYPE_OP type=kotlin.Int origin=CAST typeOperand=kotlin.Int
CALL 'public final fun <get-t> (): T of <root>.C declared in <root>.C' type=T of <root>.C origin=null
$this: GET_VAR '<this>: <root>.C<T of <root>.C> declared in <root>.C.hashCode' type=<root>.C<T of <root>.C> 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 [operator] 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: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
CLASS CLASS name:IC modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IC<TT of <root>.IC>
TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?]
CONSTRUCTOR visibility:public <> (c:<root>.C<TT of <root>.IC>) returnType:<root>.IC<TT of <root>.IC> [primary]
VALUE_PARAMETER name:c index:0 type:<root>.C<TT of <root>.IC>
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IC modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]'
PROPERTY name:c visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]
EXPRESSION_BODY
GET_VAR 'c: <root>.C<TT of <root>.IC> declared in <root>.IC.<init>' type=<root>.C<TT of <root>.IC> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-c> visibility:public modality:FINAL <> ($this:<root>.IC<TT of <root>.IC>) returnType:<root>.C<TT of <root>.IC>
correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.IC<TT of <root>.IC>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-c> (): <root>.C<TT of <root>.IC> declared in <root>.IC'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]' type=<root>.C<TT of <root>.IC> origin=null
receiver: GET_VAR '<this>: <root>.IC<TT of <root>.IC> declared in <root>.IC.<get-c>' type=<root>.IC<TT of <root>.IC> origin=null
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.IC<TT of <root>.IC>) returnType:kotlin.Int
$this: VALUE_PARAMETER name:<this> type:<root>.IC<TT of <root>.IC>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in <root>.IC'
CALL 'public final fun hashCode (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=null
$this: CALL 'public final fun <get-c> (): <root>.C<TT of <root>.IC> declared in <root>.IC' type=<root>.C<TT of <root>.IC> origin=null
$this: GET_VAR '<this>: <root>.IC<TT of <root>.IC> declared in <root>.IC.foo' type=<root>.IC<TT of <root>.IC> 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 [operator] 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
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
VAR name:ic type:<root>.IC<kotlin.Int> [val]
CONSTRUCTOR_CALL 'public constructor <init> (c: <root>.C<TT of <root>.IC>) [primary] declared in <root>.IC' type=<root>.IC<kotlin.Int> origin=null
<class: TT>: kotlin.Int
c: CONSTRUCTOR_CALL 'public constructor <init> (t: T of <root>.C) [primary] declared in <root>.C' type=<root>.C<kotlin.Int> origin=null
<class: T>: kotlin.Int
t: CONST Int type=kotlin.Int value=42
WHEN type=kotlin.Unit origin=IF
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 foo (): kotlin.Int declared in <root>.IC' type=kotlin.Int origin=null
$this: GET_VAR 'val ic: <root>.IC<kotlin.Int> [val] declared in <root>.box' type=<root>.IC<kotlin.Int> origin=null
arg1: CONST Int type=kotlin.Int value=42
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CONST String type=kotlin.String value="FAIL"
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CONST String type=kotlin.String value="OK"
@@ -0,0 +1,16 @@
// !LANGUAGE: +InlineClasses
class C<T>(val t: T) {
override fun hashCode(): Int = t as Int
}
inline class IC<TT>(val c: C<TT>) {
fun foo(): Int = c.hashCode()
}
fun box(): String {
val ic = IC<Int>(C(42))
if (ic.foo() != 42) return "FAIL"
return "OK"
}
@@ -0,0 +1,131 @@
FILE fqName:<root> fileName:/inlineClassSyntheticMethods.kt
CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C<T of <root>.C>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
CONSTRUCTOR visibility:public <> (t:T of <root>.C) returnType:<root>.C<T of <root>.C> [primary]
VALUE_PARAMETER name:t index:0 type:T of <root>.C
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:t visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:t type:T of <root>.C visibility:private [final]
EXPRESSION_BODY
GET_VAR 't: T of <root>.C declared in <root>.C.<init>' type=T of <root>.C origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-t> visibility:public modality:FINAL <> ($this:<root>.C<T of <root>.C>) returnType:T of <root>.C
correspondingProperty: PROPERTY name:t visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.C<T of <root>.C>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-t> (): T of <root>.C declared in <root>.C'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:t type:T of <root>.C visibility:private [final]' type=T of <root>.C origin=null
receiver: GET_VAR '<this>: <root>.C<T of <root>.C> declared in <root>.C.<get-t>' type=<root>.C<T of <root>.C> origin=null
FUN name:hashCode visibility:public modality:OPEN <> ($this:<root>.C<T of <root>.C>) returnType:kotlin.Int
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.C<T of <root>.C>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.C'
TYPE_OP type=kotlin.Int origin=CAST typeOperand=kotlin.Int
CALL 'public final fun <get-t> (): T of <root>.C declared in <root>.C' type=T of <root>.C origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.C<T of <root>.C> declared in <root>.C.hashCode' type=<root>.C<T of <root>.C> 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 [operator] 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: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
CLASS CLASS name:IC modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IC<TT of <root>.IC>
TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?]
CONSTRUCTOR visibility:public <> (c:<root>.C<TT of <root>.IC>) returnType:<root>.IC<TT of <root>.IC> [primary]
VALUE_PARAMETER name:c index:0 type:<root>.C<TT of <root>.IC>
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IC modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]'
PROPERTY name:c visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]
EXPRESSION_BODY
GET_VAR 'c: <root>.C<TT of <root>.IC> declared in <root>.IC.<init>' type=<root>.C<TT of <root>.IC> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-c> visibility:public modality:FINAL <> ($this:<root>.IC<TT of <root>.IC>) returnType:<root>.C<TT of <root>.IC>
correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.IC<TT of <root>.IC>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-c> (): <root>.C<TT of <root>.IC> declared in <root>.IC'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]' type=<root>.C<TT of <root>.IC> origin=null
receiver: GET_VAR '<this>: <root>.IC<TT of <root>.IC> declared in <root>.IC.<get-c>' type=<root>.IC<TT of <root>.IC> origin=null
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.IC<TT of <root>.IC>) returnType:kotlin.Int
$this: VALUE_PARAMETER name:<this> type:<root>.IC<TT of <root>.IC>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in <root>.IC'
CALL 'public open fun hashCode (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=null
$this: CALL 'public final fun <get-c> (): <root>.C<TT of <root>.IC> declared in <root>.IC' type=<root>.C<TT of <root>.IC> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.IC<TT of <root>.IC> declared in <root>.IC.foo' type=<root>.IC<TT of <root>.IC> origin=null
FUN GENERATED_INLINE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>) returnType:kotlin.String
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.IC<TT of <root>.IC>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.IC'
STRING_CONCATENATION type=kotlin.String
CONST String type=kotlin.String value="IC("
CONST String type=kotlin.String value="c="
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]' type=<root>.C<TT of <root>.IC> origin=null
receiver: GET_VAR '<this>: <root>.IC<TT of <root>.IC> declared in <root>.IC.toString' type=<root>.IC<TT of <root>.IC> origin=null
CONST String type=kotlin.String value=")"
FUN GENERATED_INLINE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>) returnType:kotlin.Int
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.IC<TT of <root>.IC>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.IC'
CALL 'public open fun hashCode (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]' type=<root>.C<TT of <root>.IC> origin=null
receiver: GET_VAR '<this>: <root>.IC<TT of <root>.IC> declared in <root>.IC.hashCode' type=<root>.IC<TT of <root>.IC> origin=null
FUN GENERATED_INLINE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.IC<TT of <root>.IC>
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
BLOCK_BODY
WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=<root>.IC<TT of <root>.IC>
GET_VAR 'other: kotlin.Any? declared in <root>.IC.equals' type=kotlin.Any? origin=null
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.IC'
CONST Boolean type=kotlin.Boolean value=false
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.IC<TT of <root>.IC> [val]
TYPE_OP type=<root>.IC<TT of <root>.IC> origin=CAST typeOperand=<root>.IC<TT of <root>.IC>
GET_VAR 'other: kotlin.Any? declared in <root>.IC.equals' type=kotlin.Any? origin=null
WHEN type=kotlin.Unit origin=null
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: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]' type=<root>.C<TT of <root>.IC> origin=null
receiver: GET_VAR '<this>: <root>.IC<TT of <root>.IC> declared in <root>.IC.equals' type=<root>.IC<TT of <root>.IC> origin=null
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]' type=<root>.C<TT of <root>.IC> origin=null
receiver: GET_VAR 'val tmp_0: <root>.IC<TT of <root>.IC> [val] declared in <root>.IC.equals' type=<root>.IC<TT of <root>.IC> origin=null
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.IC'
CONST Boolean type=kotlin.Boolean value=false
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.IC'
CONST Boolean type=kotlin.Boolean value=true
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
VAR name:ic type:<root>.IC<kotlin.Int> [val]
CONSTRUCTOR_CALL 'public constructor <init> (c: <root>.C<TT of <root>.IC>) [primary] declared in <root>.IC' type=<root>.IC<kotlin.Int> origin=null
<class: TT>: kotlin.Int
c: CONSTRUCTOR_CALL 'public constructor <init> (t: T of <root>.C) [primary] declared in <root>.C' type=<root>.C<kotlin.Int> origin=null
<class: T>: kotlin.Int
t: CONST Int type=kotlin.Int value=42
WHEN type=kotlin.Unit origin=IF
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 foo (): kotlin.Int declared in <root>.IC' type=kotlin.Int origin=null
$this: GET_VAR 'val ic: <root>.IC<kotlin.Int> [val] declared in <root>.box' type=<root>.IC<kotlin.Int> origin=null
arg1: CONST Int type=kotlin.Int value=42
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CONST String type=kotlin.String value="FAIL"
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CONST String type=kotlin.String value="OK"
@@ -13020,6 +13020,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/inlineClasses/fieldNameClash.kt");
}
@TestMetadata("genericInlineClassSynthMembers.kt")
public void testGenericInlineClassSynthMembers() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt");
}
@TestMetadata("inlineClassAsLastExpressionInInLambda.kt")
public void testInlineClassAsLastExpressionInInLambda() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt");
@@ -13030,6 +13030,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun2.kt");
}
@TestMetadata("genericInlineClassSynthMembers.kt")
public void testGenericInlineClassSynthMembers() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt");
}
@TestMetadata("inlineClassAsLastExpressionInInLambda.kt")
public void testInlineClassAsLastExpressionInInLambda() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt");
@@ -11895,6 +11895,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/inlineClasses/fieldNameClash.kt");
}
@TestMetadata("genericInlineClassSynthMembers.kt")
public void testGenericInlineClassSynthMembers() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt");
}
@TestMetadata("inlineClassAsLastExpressionInInLambda.kt")
public void testInlineClassAsLastExpressionInInLambda() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt");
@@ -11895,6 +11895,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/inlineClasses/fieldNameClash.kt");
}
@TestMetadata("genericInlineClassSynthMembers.kt")
public void testGenericInlineClassSynthMembers() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt");
}
@TestMetadata("inlineClassAsLastExpressionInInLambda.kt")
public void testInlineClassAsLastExpressionInInLambda() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt");
@@ -165,6 +165,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
runTest("compiler/testData/ir/irText/classes/inlineClass.kt");
}
@TestMetadata("inlineClassSyntheticMethods.kt")
public void testInlineClassSyntheticMethods() throws Exception {
runTest("compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt");
}
@TestMetadata("innerClass.kt")
public void testInnerClass() throws Exception {
runTest("compiler/testData/ir/irText/classes/innerClass.kt");
@@ -10245,6 +10245,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/fieldNameClash.kt");
}
@TestMetadata("genericInlineClassSynthMembers.kt")
public void testGenericInlineClassSynthMembers() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt");
}
@TestMetadata("inlineClassAsLastExpressionInInLambda.kt")
public void testInlineClassAsLastExpressionInInLambda() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt");
@@ -10310,6 +10310,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/fieldNameClash.kt");
}
@TestMetadata("genericInlineClassSynthMembers.kt")
public void testGenericInlineClassSynthMembers() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt");
}
@TestMetadata("inlineClassAsLastExpressionInInLambda.kt")
public void testInlineClassAsLastExpressionInInLambda() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt");