diff --git a/compiler/testData/codegen/box/annotations/instances/AnnotationInstantiationWithArray.ir.txt b/compiler/testData/codegen/box/annotations/instances/AnnotationInstantiationWithArray.ir.txt index 0b1fd24cf6e..5dfede510f4 100644 --- a/compiler/testData/codegen/box/annotations/instances/AnnotationInstantiationWithArray.ir.txt +++ b/compiler/testData/codegen/box/annotations/instances/AnnotationInstantiationWithArray.ir.txt @@ -2,6 +2,50 @@ Module: lib FILE fqName:a fileName:/AnnotationInstantiationWithArrayLib.kt CLASS ANNOTATION_CLASS name:Outer modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:a.Outer + PROPERTY name:array visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:array type:kotlin.Array visibility:private [final] + EXPRESSION_BODY + GET_VAR 'array: kotlin.Array declared in a.Outer.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:a.Outer) returnType:kotlin.Array + correspondingProperty: PROPERTY name:array visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:a.Outer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in a.Outer' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:array type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null + receiver: GET_VAR ': a.Outer declared in a.Outer.' type=a.Outer origin=null + CLASS ANNOTATION_CLASS name:Inner modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:a.Outer.Inner + PROPERTY name:v visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:v type:kotlin.IntArray visibility:private [final] + EXPRESSION_BODY + GET_VAR 'v: kotlin.IntArray declared in a.Outer.Inner.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:a.Outer.Inner) returnType:kotlin.IntArray + correspondingProperty: PROPERTY name:v visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:a.Outer.Inner + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in a.Outer.Inner' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:v type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null + receiver: GET_VAR ': a.Outer.Inner declared in a.Outer.Inner.' type=a.Outer.Inner origin=null + CONSTRUCTOR visibility:public <> (v:kotlin.IntArray) returnType:a.Outer.Inner [primary] + VALUE_PARAMETER name:v index:0 type:kotlin.IntArray + EXPRESSION_BODY + VARARG type=kotlin.IntArray varargElementType=kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Inner 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any CONSTRUCTOR visibility:public <> (array:kotlin.Array) returnType:a.Outer [primary] VALUE_PARAMETER name:array index:0 type:kotlin.Array EXPRESSION_BODY @@ -17,50 +61,6 @@ FILE fqName:a fileName:/AnnotationInstantiationWithArrayLib.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Outer modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:array visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:array type:kotlin.Array visibility:private [final] - EXPRESSION_BODY - GET_VAR 'array: kotlin.Array declared in a.Outer.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:a.Outer) returnType:kotlin.Array - correspondingProperty: PROPERTY name:array visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:a.Outer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in a.Outer' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:array type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null - receiver: GET_VAR ': a.Outer declared in a.Outer.' type=a.Outer origin=null - CLASS ANNOTATION_CLASS name:Inner modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:a.Outer.Inner - CONSTRUCTOR visibility:public <> (v:kotlin.IntArray) returnType:a.Outer.Inner [primary] - VALUE_PARAMETER name:v index:0 type:kotlin.IntArray - EXPRESSION_BODY - VARARG type=kotlin.IntArray varargElementType=kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Inner modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:v visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:v type:kotlin.IntArray visibility:private [final] - EXPRESSION_BODY - GET_VAR 'v: kotlin.IntArray declared in a.Outer.Inner.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:a.Outer.Inner) returnType:kotlin.IntArray - correspondingProperty: PROPERTY name:v visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:a.Outer.Inner - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in a.Outer.Inner' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:v type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null - receiver: GET_VAR ': a.Outer.Inner declared in a.Outer.Inner.' type=a.Outer.Inner 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.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type: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 declared in kotlin.Annotation @@ -82,11 +82,6 @@ FILE fqName:test fileName:/AnnotationInstantiationWithArrayApp.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:six visibility:public modality:FINAL <> ($this:test.C) returnType:a.Outer - $this: VALUE_PARAMETER name: type:test.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun six (): a.Outer declared in test.C' - CONSTRUCTOR_CALL 'public constructor (array: kotlin.Array) declared in a.Outer' type=a.Outer 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 @@ -100,6 +95,11 @@ FILE fqName:test fileName:/AnnotationInstantiationWithArrayApp.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:six visibility:public modality:FINAL <> ($this:test.C) returnType:a.Outer + $this: VALUE_PARAMETER name: type:test.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun six (): a.Outer declared in test.C' + CONSTRUCTOR_CALL 'public constructor (array: kotlin.Array) declared in a.Outer' type=a.Outer origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit diff --git a/compiler/testData/codegen/box/annotations/javaTargetOnPrimaryCtorParameter.fir.ir.txt b/compiler/testData/codegen/box/annotations/javaTargetOnPrimaryCtorParameter.fir.ir.txt index da3cfdf09f7..c36c41b806e 100644 --- a/compiler/testData/codegen/box/annotations/javaTargetOnPrimaryCtorParameter.fir.ir.txt +++ b/compiler/testData/codegen/box/annotations/javaTargetOnPrimaryCtorParameter.fir.ir.txt @@ -1,15 +1,6 @@ FILE fqName: fileName:/test.kt CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo - CONSTRUCTOR visibility:public <> (param:kotlin.Int) returnType:.Foo [primary] - VALUE_PARAMETER name:param index:0 type:kotlin.Int - annotations: - NoTarget - PropValueField - ParameterOnly - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:param visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:param type:kotlin.Int visibility:private annotations: @@ -31,6 +22,15 @@ FILE fqName: fileName:/test.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:param type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Foo declared in .Foo.' type=.Foo origin=null value: GET_VAR ': kotlin.Int declared in .Foo.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (param:kotlin.Int) returnType:.Foo [primary] + VALUE_PARAMETER name:param index:0 type:kotlin.Int + annotations: + NoTarget + PropValueField + ParameterOnly + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/codegen/box/annotations/javaTargetOnPrimaryCtorParameter.ir.txt b/compiler/testData/codegen/box/annotations/javaTargetOnPrimaryCtorParameter.ir.txt index 84086e36d60..96073b2e830 100644 --- a/compiler/testData/codegen/box/annotations/javaTargetOnPrimaryCtorParameter.ir.txt +++ b/compiler/testData/codegen/box/annotations/javaTargetOnPrimaryCtorParameter.ir.txt @@ -1,15 +1,6 @@ FILE fqName: fileName:/test.kt CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo - CONSTRUCTOR visibility:public <> (param:kotlin.Int) returnType:.Foo [primary] - VALUE_PARAMETER name:param index:0 type:kotlin.Int - annotations: - NoTarget - PropValueField - ParameterOnly - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:param visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:param type:kotlin.Int visibility:private annotations: @@ -31,6 +22,15 @@ FILE fqName: fileName:/test.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:param type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Foo declared in .Foo.' type=.Foo origin=null value: GET_VAR ': kotlin.Int declared in .Foo.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (param:kotlin.Int) returnType:.Foo [primary] + VALUE_PARAMETER name:param index:0 type:kotlin.Int + annotations: + NoTarget + PropValueField + ParameterOnly + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/codegen/box/annotations/selfReferentialAnnotation.fir.ir.txt b/compiler/testData/codegen/box/annotations/selfReferentialAnnotation.fir.ir.txt index 437e8b2c797..9017d07e7fc 100644 --- a/compiler/testData/codegen/box/annotations/selfReferentialAnnotation.fir.ir.txt +++ b/compiler/testData/codegen/box/annotations/selfReferentialAnnotation.fir.ir.txt @@ -1,13 +1,6 @@ FILE fqName: fileName:/selfReferentialAnnotation.kt CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann - CONSTRUCTOR visibility:public <> (e:kotlin.Int) returnType:.Ann [primary] - VALUE_PARAMETER name:e index:0 type:kotlin.Int - annotations: - Ann(e = 1) - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:e visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:e type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -19,6 +12,13 @@ FILE fqName: fileName:/selfReferentialAnnotation.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Ann' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:e type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Ann declared in .Ann.' type=.Ann origin=null + CONSTRUCTOR visibility:public <> (e:kotlin.Int) returnType:.Ann [primary] + VALUE_PARAMETER name:e index:0 type:kotlin.Int + annotations: + Ann(e = 1) + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann 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 declared in kotlin.Annotation @@ -36,18 +36,6 @@ FILE fqName: fileName:/selfReferentialAnnotation.kt annotations: MyRequiresOptIn(a = "", b = GET_ENUM 'ENUM_ENTRY name:ERROR' type=.MyRequiresOptIn.MyLevel) $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyRequiresOptIn - CONSTRUCTOR visibility:public <> (a:kotlin.String, b:.MyRequiresOptIn.MyLevel) returnType:.MyRequiresOptIn [primary] - VALUE_PARAMETER name:a index:0 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - VALUE_PARAMETER name:b index:1 type:.MyRequiresOptIn.MyLevel - annotations: - MyRequiresOptIn(a = "", b = GET_ENUM 'ENUM_ENTRY name:WARNING' type=.MyRequiresOptIn.MyLevel) - EXPRESSION_BODY - GET_ENUM 'ENUM_ENTRY name:ERROR' type=.MyRequiresOptIn.MyLevel - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:MyRequiresOptIn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -83,15 +71,11 @@ FILE fqName: fileName:/selfReferentialAnnotation.kt ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' : .MyRequiresOptIn.MyLevel INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyLevel modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyRequiresOptIn.MyLevel>]' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyRequiresOptIn.MyLevel> - SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyRequiresOptIn.MyLevel VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyRequiresOptIn.MyLevel> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyRequiresOptIn.MyLevel> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyRequiresOptIn.MyLevel>, other:.MyRequiresOptIn.MyLevel) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -110,6 +94,10 @@ FILE fqName: fileName:/selfReferentialAnnotation.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyRequiresOptIn.MyLevel> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyRequiresOptIn.MyLevel> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -128,6 +116,18 @@ FILE fqName: fileName:/selfReferentialAnnotation.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyRequiresOptIn.MyLevel> + CONSTRUCTOR visibility:public <> (a:kotlin.String, b:.MyRequiresOptIn.MyLevel) returnType:.MyRequiresOptIn [primary] + VALUE_PARAMETER name:a index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + VALUE_PARAMETER name:b index:1 type:.MyRequiresOptIn.MyLevel + annotations: + MyRequiresOptIn(a = "", b = GET_ENUM 'ENUM_ENTRY name:WARNING' type=.MyRequiresOptIn.MyLevel) + EXPRESSION_BODY + GET_ENUM 'ENUM_ENTRY name:ERROR' type=.MyRequiresOptIn.MyLevel + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:MyRequiresOptIn 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 declared in kotlin.Annotation diff --git a/compiler/testData/codegen/box/annotations/selfReferentialAnnotation.ir.txt b/compiler/testData/codegen/box/annotations/selfReferentialAnnotation.ir.txt index f4ec8a2bebc..7ef873eec23 100644 --- a/compiler/testData/codegen/box/annotations/selfReferentialAnnotation.ir.txt +++ b/compiler/testData/codegen/box/annotations/selfReferentialAnnotation.ir.txt @@ -1,13 +1,6 @@ FILE fqName: fileName:/selfReferentialAnnotation.kt CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann - CONSTRUCTOR visibility:public <> (e:kotlin.Int) returnType:.Ann [primary] - VALUE_PARAMETER name:e index:0 type:kotlin.Int - annotations: - Ann(e = 1) - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:e visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:e type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -19,6 +12,13 @@ FILE fqName: fileName:/selfReferentialAnnotation.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Ann' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:e type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Ann declared in .Ann.' type=.Ann origin=null + CONSTRUCTOR visibility:public <> (e:kotlin.Int) returnType:.Ann [primary] + VALUE_PARAMETER name:e index:0 type:kotlin.Int + annotations: + Ann(e = 1) + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann 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 declared in kotlin.Annotation @@ -36,18 +36,6 @@ FILE fqName: fileName:/selfReferentialAnnotation.kt annotations: MyRequiresOptIn(a = "", b = GET_ENUM 'ENUM_ENTRY name:ERROR' type=.MyRequiresOptIn.MyLevel) $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyRequiresOptIn - CONSTRUCTOR visibility:public <> (a:kotlin.String, b:.MyRequiresOptIn.MyLevel) returnType:.MyRequiresOptIn [primary] - VALUE_PARAMETER name:a index:0 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - VALUE_PARAMETER name:b index:1 type:.MyRequiresOptIn.MyLevel - annotations: - MyRequiresOptIn(a = "", b = GET_ENUM 'ENUM_ENTRY name:WARNING' type=.MyRequiresOptIn.MyLevel) - EXPRESSION_BODY - GET_ENUM 'ENUM_ENTRY name:ERROR' type=.MyRequiresOptIn.MyLevel - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:MyRequiresOptIn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -72,35 +60,22 @@ FILE fqName: fileName:/selfReferentialAnnotation.kt receiver: GET_VAR ': .MyRequiresOptIn declared in .MyRequiresOptIn.' type=.MyRequiresOptIn origin=null CLASS ENUM_CLASS name:MyLevel modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyRequiresOptIn.MyLevel>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyRequiresOptIn.MyLevel - CONSTRUCTOR visibility:private <> () returnType:.MyRequiresOptIn.MyLevel [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .MyRequiresOptIn.MyLevel - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyLevel modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyRequiresOptIn.MyLevel>]' ENUM_ENTRY name:WARNING init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyRequiresOptIn.MyLevel' ENUM_ENTRY name:ERROR init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyRequiresOptIn.MyLevel' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyRequiresOptIn.MyLevel>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyRequiresOptIn.MyLevel> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyRequiresOptIn.MyLevel>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyRequiresOptIn.MyLevel> + CONSTRUCTOR visibility:private <> () returnType:.MyRequiresOptIn.MyLevel [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .MyRequiresOptIn.MyLevel + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyLevel modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyRequiresOptIn.MyLevel>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyRequiresOptIn.MyLevel + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyRequiresOptIn.MyLevel> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyRequiresOptIn.MyLevel>, other:.MyRequiresOptIn.MyLevel) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -119,15 +94,40 @@ FILE fqName: fileName:/selfReferentialAnnotation.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyRequiresOptIn.MyLevel> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyRequiresOptIn.MyLevel> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyRequiresOptIn.MyLevel - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyRequiresOptIn.MyLevel> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyRequiresOptIn.MyLevel>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyRequiresOptIn.MyLevel> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyRequiresOptIn.MyLevel>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyRequiresOptIn.MyLevel> + CONSTRUCTOR visibility:public <> (a:kotlin.String, b:.MyRequiresOptIn.MyLevel) returnType:.MyRequiresOptIn [primary] + VALUE_PARAMETER name:a index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + VALUE_PARAMETER name:b index:1 type:.MyRequiresOptIn.MyLevel + annotations: + MyRequiresOptIn(a = "", b = GET_ENUM 'ENUM_ENTRY name:WARNING' type=.MyRequiresOptIn.MyLevel) + EXPRESSION_BODY + GET_ENUM 'ENUM_ENTRY name:ERROR' type=.MyRequiresOptIn.MyLevel + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:MyRequiresOptIn 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 declared in kotlin.Annotation diff --git a/compiler/testData/codegen/box/annotations/targetOnPrimaryCtorParameter.fir.ir.txt b/compiler/testData/codegen/box/annotations/targetOnPrimaryCtorParameter.fir.ir.txt index 11c2b28b052..c511e568706 100644 --- a/compiler/testData/codegen/box/annotations/targetOnPrimaryCtorParameter.fir.ir.txt +++ b/compiler/testData/codegen/box/annotations/targetOnPrimaryCtorParameter.fir.ir.txt @@ -1,4 +1,25 @@ FILE fqName: fileName:/targetOnPrimaryCtorParameter.kt + CLASS ANNOTATION_CLASS name:FieldOnly modality:OPEN visibility:public superTypes:[kotlin.Annotation] + annotations: + Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FIELD' type=kotlin.annotation.AnnotationTarget]) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FieldOnly + CONSTRUCTOR visibility:public <> () returnType:.FieldOnly [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:FieldOnly 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:NoTarget modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.NoTarget CONSTRUCTOR visibility:public <> () returnType:.NoTarget [primary] @@ -18,6 +39,27 @@ FILE fqName: fileName:/targetOnPrimaryCtorParameter.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:ParameterOnly modality:OPEN visibility:public superTypes:[kotlin.Annotation] + annotations: + Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:VALUE_PARAMETER' type=kotlin.annotation.AnnotationTarget]) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ParameterOnly + CONSTRUCTOR visibility:public <> () returnType:.ParameterOnly [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:ParameterOnly 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:PropValueField modality:OPEN visibility:public superTypes:[kotlin.Annotation] annotations: Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:VALUE_PARAMETER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FIELD' type=kotlin.annotation.AnnotationTarget]) @@ -60,48 +102,6 @@ FILE fqName: fileName:/targetOnPrimaryCtorParameter.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:ParameterOnly modality:OPEN visibility:public superTypes:[kotlin.Annotation] - annotations: - Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:VALUE_PARAMETER' type=kotlin.annotation.AnnotationTarget]) - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ParameterOnly - CONSTRUCTOR visibility:public <> () returnType:.ParameterOnly [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:ParameterOnly 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:FieldOnly modality:OPEN visibility:public superTypes:[kotlin.Annotation] - annotations: - Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FIELD' type=kotlin.annotation.AnnotationTarget]) - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FieldOnly - CONSTRUCTOR visibility:public <> () returnType:.FieldOnly [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:FieldOnly 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:PropertyOnly2 modality:OPEN visibility:public superTypes:[kotlin.Annotation] annotations: Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY' type=kotlin.annotation.AnnotationTarget]) @@ -125,15 +125,6 @@ FILE fqName: fileName:/targetOnPrimaryCtorParameter.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo - CONSTRUCTOR visibility:public <> (param:kotlin.Int) returnType:.Foo [primary] - VALUE_PARAMETER name:param index:0 type:kotlin.Int - annotations: - NoTarget - PropValueField - ParameterOnly - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:param visibility:public modality:FINAL [var] annotations: PropertyOnly @@ -158,6 +149,15 @@ FILE fqName: fileName:/targetOnPrimaryCtorParameter.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:param type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Foo declared in .Foo.' type=.Foo origin=null value: GET_VAR ': kotlin.Int declared in .Foo.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (param:kotlin.Int) returnType:.Foo [primary] + VALUE_PARAMETER name:param index:0 type:kotlin.Int + annotations: + NoTarget + PropValueField + ParameterOnly + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/codegen/box/annotations/targetOnPrimaryCtorParameter.ir.txt b/compiler/testData/codegen/box/annotations/targetOnPrimaryCtorParameter.ir.txt index a3dca4dd8a5..0c582203c66 100644 --- a/compiler/testData/codegen/box/annotations/targetOnPrimaryCtorParameter.ir.txt +++ b/compiler/testData/codegen/box/annotations/targetOnPrimaryCtorParameter.ir.txt @@ -1,4 +1,25 @@ FILE fqName: fileName:/targetOnPrimaryCtorParameter.kt + CLASS ANNOTATION_CLASS name:FieldOnly modality:OPEN visibility:public superTypes:[kotlin.Annotation] + annotations: + Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FIELD' type=kotlin.annotation.AnnotationTarget]) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FieldOnly + CONSTRUCTOR visibility:public <> () returnType:.FieldOnly [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:FieldOnly 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:NoTarget modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.NoTarget CONSTRUCTOR visibility:public <> () returnType:.NoTarget [primary] @@ -18,6 +39,27 @@ FILE fqName: fileName:/targetOnPrimaryCtorParameter.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:ParameterOnly modality:OPEN visibility:public superTypes:[kotlin.Annotation] + annotations: + Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:VALUE_PARAMETER' type=kotlin.annotation.AnnotationTarget]) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ParameterOnly + CONSTRUCTOR visibility:public <> () returnType:.ParameterOnly [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:ParameterOnly 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:PropValueField modality:OPEN visibility:public superTypes:[kotlin.Annotation] annotations: Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:VALUE_PARAMETER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FIELD' type=kotlin.annotation.AnnotationTarget]) @@ -60,48 +102,6 @@ FILE fqName: fileName:/targetOnPrimaryCtorParameter.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:ParameterOnly modality:OPEN visibility:public superTypes:[kotlin.Annotation] - annotations: - Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:VALUE_PARAMETER' type=kotlin.annotation.AnnotationTarget]) - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ParameterOnly - CONSTRUCTOR visibility:public <> () returnType:.ParameterOnly [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:ParameterOnly 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:FieldOnly modality:OPEN visibility:public superTypes:[kotlin.Annotation] - annotations: - Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FIELD' type=kotlin.annotation.AnnotationTarget]) - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FieldOnly - CONSTRUCTOR visibility:public <> () returnType:.FieldOnly [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:FieldOnly 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:PropertyOnly2 modality:OPEN visibility:public superTypes:[kotlin.Annotation] annotations: Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY' type=kotlin.annotation.AnnotationTarget]) @@ -125,15 +125,6 @@ FILE fqName: fileName:/targetOnPrimaryCtorParameter.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo - CONSTRUCTOR visibility:public <> (param:kotlin.Int) returnType:.Foo [primary] - VALUE_PARAMETER name:param index:0 type:kotlin.Int - annotations: - NoTarget - PropValueField - ParameterOnly - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:param visibility:public modality:FINAL [var] annotations: PropertyOnly @@ -158,6 +149,15 @@ FILE fqName: fileName:/targetOnPrimaryCtorParameter.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:param type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Foo declared in .Foo.' type=.Foo origin=null value: GET_VAR ': kotlin.Int declared in .Foo.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (param:kotlin.Int) returnType:.Foo [primary] + VALUE_PARAMETER name:param index:0 type:kotlin.Int + annotations: + NoTarget + PropValueField + ParameterOnly + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/codegen/box/callableReference/serializability/referenceToCompanionFunction.fir.ir.txt b/compiler/testData/codegen/box/callableReference/serializability/referenceToCompanionFunction.fir.ir.txt index 880a747bc57..0eb0aecea3d 100644 --- a/compiler/testData/codegen/box/callableReference/serializability/referenceToCompanionFunction.fir.ir.txt +++ b/compiler/testData/codegen/box/callableReference/serializability/referenceToCompanionFunction.fir.ir.txt @@ -5,13 +5,6 @@ FILE fqName: fileName:/referenceToCompanionFunction.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Base - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .Base' - CONST String type=kotlin.String value="A" - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.Base) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Base 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 @@ -25,34 +18,30 @@ FILE fqName: fileName:/referenceToCompanionFunction.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.Base) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Base + FUN name:foo visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .Base' + CONST String type=kotlin.String value="A" CLASS CLASS name:Some modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Some - CONSTRUCTOR visibility:public <> () returnType:.Some [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Some.Companion CONSTRUCTOR visibility:private <> () returnType:.Some.Companion [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[.Base]' - FUN name:bar visibility:public modality:OPEN <> ($this:.Some.Companion) returnType:kotlin.String - overridden: - public abstract fun bar (): kotlin.String declared in .Base - $this: VALUE_PARAMETER name: type:.Some.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.String declared in .Some.Companion' - CONST String type=kotlin.String value="B" - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.String [fake_override] - overridden: - public final fun foo (): kotlin.String declared in .Base - $this: VALUE_PARAMETER name: type:.Base 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 .Base $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.String [fake_override] + overridden: + public final fun foo (): kotlin.String declared in .Base + $this: VALUE_PARAMETER name: type:.Base 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 .Base @@ -61,6 +50,17 @@ FILE fqName: fileName:/referenceToCompanionFunction.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:OPEN <> ($this:.Some.Companion) returnType:kotlin.String + overridden: + public abstract fun bar (): kotlin.String declared in .Base + $this: VALUE_PARAMETER name: type:.Some.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.String declared in .Some.Companion' + CONST String type=kotlin.String value="B" + CONSTRUCTOR visibility:public <> () returnType:.Some [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public 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 declared in kotlin.Any @@ -80,22 +80,15 @@ FILE fqName: fileName:/referenceToCompanionFunction.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Singleton modality:FINAL visibility:public superTypes:[.Base]' - FUN name:bar visibility:public modality:OPEN <> ($this:.Singleton) returnType:kotlin.String - overridden: - public abstract fun bar (): kotlin.String declared in .Base - $this: VALUE_PARAMETER name: type:.Singleton - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.String declared in .Singleton' - CONST String type=kotlin.String value="C" - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.String [fake_override] - overridden: - public final fun foo (): kotlin.String declared in .Base - $this: VALUE_PARAMETER name: type:.Base 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 .Base $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.String [fake_override] + overridden: + public final fun foo (): kotlin.String declared in .Base + $this: VALUE_PARAMETER name: type:.Base 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 .Base @@ -104,6 +97,13 @@ FILE fqName: fileName:/referenceToCompanionFunction.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:OPEN <> ($this:.Singleton) returnType:kotlin.String + overridden: + public abstract fun bar (): kotlin.String declared in .Base + $this: VALUE_PARAMETER name: type:.Singleton + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.String declared in .Singleton' + CONST String type=kotlin.String value="C" FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:ref1 type:kotlin.reflect.KFunction0 [val] diff --git a/compiler/testData/codegen/box/delegatedProperty/typeParameterInDelegatedProperty.fir.ir.txt b/compiler/testData/codegen/box/delegatedProperty/typeParameterInDelegatedProperty.fir.ir.txt index e81811f00eb..71e97357f12 100644 --- a/compiler/testData/codegen/box/delegatedProperty/typeParameterInDelegatedProperty.fir.ir.txt +++ b/compiler/testData/codegen/box/delegatedProperty/typeParameterInDelegatedProperty.fir.ir.txt @@ -1,24 +1,4 @@ FILE fqName: fileName:/typeParameterInDelegatedProperty.kt - CLASS INTERFACE name:IDelegate modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IDelegate.IDelegate> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:getValue visibility:public modality:ABSTRACT <> ($this:.IDelegate.IDelegate>, t:T of .IDelegate, p:kotlin.reflect.KProperty<*>) returnType:T of .IDelegate [operator] - $this: VALUE_PARAMETER name: type:.IDelegate.IDelegate> - VALUE_PARAMETER name:t index:0 type:T of .IDelegate - VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - 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: 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 PROPERTY name:property visibility:public modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:property$delegate type:.property$delegate..> visibility:private [final,static] EXPRESSION_BODY @@ -29,15 +9,6 @@ FILE fqName: fileName:/typeParameterInDelegatedProperty.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate]' - FUN name:getValue visibility:public modality:OPEN <> ($this:.property$delegate..>, t:kotlin.Any?, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] - overridden: - public abstract fun getValue (t: T of .IDelegate, p: kotlin.reflect.KProperty<*>): T of .IDelegate declared in .IDelegate - $this: VALUE_PARAMETER name: type:.property$delegate..> - VALUE_PARAMETER name:t index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getValue (t: kotlin.Any?, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .property$delegate.' - GET_VAR 't: kotlin.Any? declared in .property$delegate..getValue' type=kotlin.Any? 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 .IDelegate @@ -51,6 +22,15 @@ FILE fqName: fileName:/typeParameterInDelegatedProperty.kt overridden: public open fun toString (): kotlin.String declared in .IDelegate $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:OPEN <> ($this:.property$delegate..>, t:kotlin.Any?, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] + overridden: + public abstract fun getValue (t: T of .IDelegate, p: kotlin.reflect.KProperty<*>): T of .IDelegate declared in .IDelegate + $this: VALUE_PARAMETER name: type:.property$delegate..> + VALUE_PARAMETER name:t index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: kotlin.Any?, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .property$delegate.' + GET_VAR 't: kotlin.Any? declared in .property$delegate..getValue' type=kotlin.Any? origin=null CONSTRUCTOR_CALL 'public constructor () declared in .property$delegate.' type=.property$delegate..> origin=OBJECT_LITERAL FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:T of .) returnType:T of . correspondingProperty: PROPERTY name:property visibility:public modality:FINAL [delegated,val] @@ -84,16 +64,6 @@ FILE fqName: fileName:/typeParameterInDelegatedProperty.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate]' - FUN name:getValue visibility:public modality:OPEN <> ($this:.property2$delegate...>, t:kotlin.Any?, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] - overridden: - public abstract fun getValue (t: T of .IDelegate, p: kotlin.reflect.KProperty<*>): T of .IDelegate declared in .IDelegate - $this: VALUE_PARAMETER name: type:.property2$delegate...> - VALUE_PARAMETER name:t index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getValue (t: kotlin.Any?, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .property2$delegate..' - CALL 'local final fun test (t: T of .): T of . declared in .property2$delegate.' type=kotlin.Any? origin=null - t: GET_VAR 't: kotlin.Any? declared in .property2$delegate...getValue' type=kotlin.Any? 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 .IDelegate @@ -107,6 +77,16 @@ FILE fqName: fileName:/typeParameterInDelegatedProperty.kt overridden: public open fun toString (): kotlin.String declared in .IDelegate $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:OPEN <> ($this:.property2$delegate...>, t:kotlin.Any?, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] + overridden: + public abstract fun getValue (t: T of .IDelegate, p: kotlin.reflect.KProperty<*>): T of .IDelegate declared in .IDelegate + $this: VALUE_PARAMETER name: type:.property2$delegate...> + VALUE_PARAMETER name:t index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: kotlin.Any?, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .property2$delegate..' + CALL 'local final fun test (t: T of .): T of . declared in .property2$delegate.' type=kotlin.Any? origin=null + t: GET_VAR 't: kotlin.Any? declared in .property2$delegate...getValue' type=kotlin.Any? origin=null CONSTRUCTOR_CALL 'public constructor () declared in .property2$delegate..' type=.property2$delegate...> origin=OBJECT_LITERAL FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:T of .) returnType:T of . correspondingProperty: PROPERTY name:property2 visibility:public modality:FINAL [delegated,val] @@ -119,6 +99,26 @@ FILE fqName: fileName:/typeParameterInDelegatedProperty.kt t: GET_VAR ': T of . declared in .' type=T of . origin=null p: PROPERTY_REFERENCE 'public final property2: T of .' field=null getter='public final fun (): T of . declared in ' setter=null type=kotlin.reflect.KProperty1., T of .> origin=PROPERTY_REFERENCE_FOR_DELEGATE <1>: T of . + CLASS INTERFACE name:IDelegate modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IDelegate.IDelegate> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:getValue visibility:public modality:ABSTRACT <> ($this:.IDelegate.IDelegate>, t:T of .IDelegate, p:kotlin.reflect.KProperty<*>) returnType:T of .IDelegate [operator] + $this: VALUE_PARAMETER name: type:.IDelegate.IDelegate> + VALUE_PARAMETER name:t index:0 type:T of .IDelegate + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:superInterfaces type:kotlin.Array [val] diff --git a/compiler/testData/codegen/box/delegatedProperty/typeParameterInDelegatedProperty.ir.txt b/compiler/testData/codegen/box/delegatedProperty/typeParameterInDelegatedProperty.ir.txt index f29982a1fb2..1d84b0f7bcd 100644 --- a/compiler/testData/codegen/box/delegatedProperty/typeParameterInDelegatedProperty.ir.txt +++ b/compiler/testData/codegen/box/delegatedProperty/typeParameterInDelegatedProperty.ir.txt @@ -1,24 +1,4 @@ FILE fqName: fileName:/typeParameterInDelegatedProperty.kt - CLASS INTERFACE name:IDelegate modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IDelegate.IDelegate> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:getValue visibility:public modality:ABSTRACT <> ($this:.IDelegate.IDelegate>, t:T of .IDelegate, p:kotlin.reflect.KProperty<*>) returnType:T of .IDelegate [operator] - $this: VALUE_PARAMETER name: type:.IDelegate.IDelegate> - VALUE_PARAMETER name:t index:0 type:T of .IDelegate - VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - 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: 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 PROPERTY name:property visibility:public modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:property$delegate type:.property$delegate. visibility:private [final,static] EXPRESSION_BODY @@ -29,16 +9,6 @@ FILE fqName: fileName:/typeParameterInDelegatedProperty.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate]' - FUN name:getValue visibility:public modality:OPEN <> ($this:.property$delegate., t:kotlin.Any?, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] - overridden: - public abstract fun getValue (t: T of .IDelegate, p: kotlin.reflect.KProperty<*>): T of .IDelegate declared in .IDelegate - $this: VALUE_PARAMETER name: type:.property$delegate. - VALUE_PARAMETER name:t index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getValue (t: kotlin.Any?, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .property$delegate.' - TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? - GET_VAR 't: kotlin.Any? declared in .property$delegate..getValue' type=kotlin.Any? 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 .IDelegate @@ -52,6 +22,16 @@ FILE fqName: fileName:/typeParameterInDelegatedProperty.kt overridden: public open fun toString (): kotlin.String declared in .IDelegate $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:OPEN <> ($this:.property$delegate., t:kotlin.Any?, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] + overridden: + public abstract fun getValue (t: T of .IDelegate, p: kotlin.reflect.KProperty<*>): T of .IDelegate declared in .IDelegate + $this: VALUE_PARAMETER name: type:.property$delegate. + VALUE_PARAMETER name:t index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: kotlin.Any?, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .property$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + GET_VAR 't: kotlin.Any? declared in .property$delegate..getValue' type=kotlin.Any? origin=null CONSTRUCTOR_CALL 'public constructor () declared in .property$delegate.' type=.property$delegate. origin=OBJECT_LITERAL FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:T of .) returnType:T of . correspondingProperty: PROPERTY name:property visibility:public modality:FINAL [delegated,val] @@ -86,18 +66,6 @@ FILE fqName: fileName:/typeParameterInDelegatedProperty.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate]' - FUN name:getValue visibility:public modality:OPEN <> ($this:.property2$delegate.., t:kotlin.Any?, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] - overridden: - public abstract fun getValue (t: T of .IDelegate, p: kotlin.reflect.KProperty<*>): T of .IDelegate declared in .IDelegate - $this: VALUE_PARAMETER name: type:.property2$delegate.. - VALUE_PARAMETER name:t index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getValue (t: kotlin.Any?, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .property2$delegate..' - TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? - CALL 'local final fun test (t: kotlin.Any?): kotlin.Any? declared in .property2$delegate.' type=kotlin.Any? origin=null - t: TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? - GET_VAR 't: kotlin.Any? declared in .property2$delegate...getValue' type=kotlin.Any? 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 .IDelegate @@ -111,6 +79,18 @@ FILE fqName: fileName:/typeParameterInDelegatedProperty.kt overridden: public open fun toString (): kotlin.String declared in .IDelegate $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:OPEN <> ($this:.property2$delegate.., t:kotlin.Any?, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] + overridden: + public abstract fun getValue (t: T of .IDelegate, p: kotlin.reflect.KProperty<*>): T of .IDelegate declared in .IDelegate + $this: VALUE_PARAMETER name: type:.property2$delegate.. + VALUE_PARAMETER name:t index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: kotlin.Any?, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .property2$delegate..' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'local final fun test (t: kotlin.Any?): kotlin.Any? declared in .property2$delegate.' type=kotlin.Any? origin=null + t: TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + GET_VAR 't: kotlin.Any? declared in .property2$delegate...getValue' type=kotlin.Any? origin=null CONSTRUCTOR_CALL 'public constructor () declared in .property2$delegate..' type=.property2$delegate.. origin=OBJECT_LITERAL FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:T of .) returnType:T of . correspondingProperty: PROPERTY name:property2 visibility:public modality:FINAL [delegated,val] @@ -123,6 +103,26 @@ FILE fqName: fileName:/typeParameterInDelegatedProperty.kt t: GET_VAR ': T of . declared in .' type=T of . origin=null p: PROPERTY_REFERENCE 'public final property2: T of .' field=null getter='public final fun (): T of . declared in ' setter=null type=kotlin.reflect.KProperty1., T of .> origin=PROPERTY_REFERENCE_FOR_DELEGATE <1>: T of . + CLASS INTERFACE name:IDelegate modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IDelegate.IDelegate> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:getValue visibility:public modality:ABSTRACT <> ($this:.IDelegate.IDelegate>, t:T of .IDelegate, p:kotlin.reflect.KProperty<*>) returnType:T of .IDelegate [operator] + $this: VALUE_PARAMETER name: type:.IDelegate.IDelegate> + VALUE_PARAMETER name:t index:0 type:T of .IDelegate + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:superInterfaces type:kotlin.Array [val] diff --git a/compiler/testData/codegen/box/delegation/delegationToIntersectionType.fir.ir.txt b/compiler/testData/codegen/box/delegation/delegationToIntersectionType.fir.ir.txt index 20b3f706f6a..1202afaf5b2 100644 --- a/compiler/testData/codegen/box/delegation/delegationToIntersectionType.fir.ir.txt +++ b/compiler/testData/codegen/box/delegation/delegationToIntersectionType.fir.ir.txt @@ -1,11 +1,62 @@ FILE fqName: fileName:/delegationToIntersectionType.kt - FUN name:select visibility:public modality:FINAL (a:T of .select, b:T of .select) returnType:T of .select - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:a index:0 type:T of .select - VALUE_PARAMETER name:b index:1 type:T of .select - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun select (a: T of .select, b: T of .select): T of .select declared in ' - GET_VAR 'a: T of .select declared in .select' type=T of .select origin=null + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A; .B] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A; .B]' + 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 .A + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B + $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 .A + public open fun hashCode (): kotlin.Int declared in .B + $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 .A + public open fun toString (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .C' + CONST String type=kotlin.String value="OK" + CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.A; .B] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D + CONSTRUCTOR visibility:public <> () returnType:.D [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.A; .B]' + 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 .A + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B + $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 .A + public open fun hashCode (): kotlin.Int declared in .B + $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 .A + public open fun toString (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.D) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .D' + CONST String type=kotlin.String value="FAIL" CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -23,8 +74,6 @@ FILE fqName: fileName:/delegationToIntersectionType.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.B 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 @@ -38,64 +87,21 @@ FILE fqName: fileName:/delegationToIntersectionType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A; .B] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A; .B]' - FUN name:foo visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String - overridden: - public abstract fun foo (): kotlin.String declared in .B - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .C' - CONST String type=kotlin.String value="OK" - 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 .A - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B - $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 .A - public open fun hashCode (): kotlin.Int declared in .B - $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 .A - public open fun toString (): kotlin.String declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.A; .B] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D - CONSTRUCTOR visibility:public <> () returnType:.D [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.A; .B]' - FUN name:foo visibility:public modality:OPEN <> ($this:.D) returnType:kotlin.String - overridden: - public abstract fun foo (): kotlin.String declared in .B - $this: VALUE_PARAMETER name: type:.D - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .D' - CONST String type=kotlin.String value="FAIL" - 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 .A - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B - $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 .A - public open fun hashCode (): kotlin.Int declared in .B - $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 .A - public open fun toString (): kotlin.String declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.B + 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 ' + CALL 'public final fun test (c: .C, d: .D): kotlin.String declared in ' type=kotlin.String origin=null + c: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + d: CONSTRUCTOR_CALL 'public constructor () declared in .D' type=.D origin=null + FUN name:select visibility:public modality:FINAL (a:T of .select, b:T of .select) returnType:T of .select + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:a index:0 type:T of .select + VALUE_PARAMETER name:b index:1 type:T of .select + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun select (a: T of .select, b: T of .select): T of .select declared in ' + GET_VAR 'a: T of .select declared in .select' type=T of .select origin=null FUN name:test visibility:public modality:FINAL <> (c:.C, d:.D) returnType:kotlin.String VALUE_PARAMETER name:c index:0 type:.C VALUE_PARAMETER name:d index:1 type:.D @@ -110,13 +116,13 @@ FILE fqName: fileName:/delegationToIntersectionType.kt $this: BLOCK type=.test. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test. + FIELD DELEGATE name:$$delegate_0 type:kotlin.Any visibility:private [final] + EXPRESSION_BODY + GET_VAR 'val intersection: kotlin.Any declared in .test' type=kotlin.Any origin=null CONSTRUCTOR visibility:public <> () returnType:.test. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.B]' - FIELD DELEGATE name:$$delegate_0 type:kotlin.Any visibility:private [final] - EXPRESSION_BODY - GET_VAR 'val intersection: kotlin.Any declared in .test' type=kotlin.Any origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.test.) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .B @@ -141,9 +147,3 @@ FILE fqName: fileName:/delegationToIntersectionType.kt public open fun toString (): kotlin.String declared in .B $this: VALUE_PARAMETER name: type:kotlin.Any CONSTRUCTOR_CALL 'public constructor () declared in .test.' type=.test. origin=OBJECT_LITERAL - 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 ' - CALL 'public final fun test (c: .C, d: .D): kotlin.String declared in ' type=kotlin.String origin=null - c: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - d: CONSTRUCTOR_CALL 'public constructor () declared in .D' type=.D origin=null diff --git a/compiler/testData/codegen/box/delegation/delegationToIntersectionType.ir.txt b/compiler/testData/codegen/box/delegation/delegationToIntersectionType.ir.txt index 20b3f706f6a..1202afaf5b2 100644 --- a/compiler/testData/codegen/box/delegation/delegationToIntersectionType.ir.txt +++ b/compiler/testData/codegen/box/delegation/delegationToIntersectionType.ir.txt @@ -1,11 +1,62 @@ FILE fqName: fileName:/delegationToIntersectionType.kt - FUN name:select visibility:public modality:FINAL (a:T of .select, b:T of .select) returnType:T of .select - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:a index:0 type:T of .select - VALUE_PARAMETER name:b index:1 type:T of .select - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun select (a: T of .select, b: T of .select): T of .select declared in ' - GET_VAR 'a: T of .select declared in .select' type=T of .select origin=null + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A; .B] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A; .B]' + 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 .A + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B + $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 .A + public open fun hashCode (): kotlin.Int declared in .B + $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 .A + public open fun toString (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .C' + CONST String type=kotlin.String value="OK" + CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.A; .B] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D + CONSTRUCTOR visibility:public <> () returnType:.D [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.A; .B]' + 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 .A + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B + $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 .A + public open fun hashCode (): kotlin.Int declared in .B + $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 .A + public open fun toString (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.D) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .D' + CONST String type=kotlin.String value="FAIL" CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -23,8 +74,6 @@ FILE fqName: fileName:/delegationToIntersectionType.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.B 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 @@ -38,64 +87,21 @@ FILE fqName: fileName:/delegationToIntersectionType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A; .B] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A; .B]' - FUN name:foo visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String - overridden: - public abstract fun foo (): kotlin.String declared in .B - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .C' - CONST String type=kotlin.String value="OK" - 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 .A - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B - $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 .A - public open fun hashCode (): kotlin.Int declared in .B - $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 .A - public open fun toString (): kotlin.String declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.A; .B] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D - CONSTRUCTOR visibility:public <> () returnType:.D [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.A; .B]' - FUN name:foo visibility:public modality:OPEN <> ($this:.D) returnType:kotlin.String - overridden: - public abstract fun foo (): kotlin.String declared in .B - $this: VALUE_PARAMETER name: type:.D - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .D' - CONST String type=kotlin.String value="FAIL" - 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 .A - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B - $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 .A - public open fun hashCode (): kotlin.Int declared in .B - $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 .A - public open fun toString (): kotlin.String declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.B + 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 ' + CALL 'public final fun test (c: .C, d: .D): kotlin.String declared in ' type=kotlin.String origin=null + c: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + d: CONSTRUCTOR_CALL 'public constructor () declared in .D' type=.D origin=null + FUN name:select visibility:public modality:FINAL (a:T of .select, b:T of .select) returnType:T of .select + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:a index:0 type:T of .select + VALUE_PARAMETER name:b index:1 type:T of .select + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun select (a: T of .select, b: T of .select): T of .select declared in ' + GET_VAR 'a: T of .select declared in .select' type=T of .select origin=null FUN name:test visibility:public modality:FINAL <> (c:.C, d:.D) returnType:kotlin.String VALUE_PARAMETER name:c index:0 type:.C VALUE_PARAMETER name:d index:1 type:.D @@ -110,13 +116,13 @@ FILE fqName: fileName:/delegationToIntersectionType.kt $this: BLOCK type=.test. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test. + FIELD DELEGATE name:$$delegate_0 type:kotlin.Any visibility:private [final] + EXPRESSION_BODY + GET_VAR 'val intersection: kotlin.Any declared in .test' type=kotlin.Any origin=null CONSTRUCTOR visibility:public <> () returnType:.test. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.B]' - FIELD DELEGATE name:$$delegate_0 type:kotlin.Any visibility:private [final] - EXPRESSION_BODY - GET_VAR 'val intersection: kotlin.Any declared in .test' type=kotlin.Any origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.test.) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .B @@ -141,9 +147,3 @@ FILE fqName: fileName:/delegationToIntersectionType.kt public open fun toString (): kotlin.String declared in .B $this: VALUE_PARAMETER name: type:kotlin.Any CONSTRUCTOR_CALL 'public constructor () declared in .test.' type=.test. origin=OBJECT_LITERAL - 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 ' - CALL 'public final fun test (c: .C, d: .D): kotlin.String declared in ' type=kotlin.String origin=null - c: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - d: CONSTRUCTOR_CALL 'public constructor () declared in .D' type=.D origin=null diff --git a/compiler/testData/codegen/box/delegation/delegationToIntersectionType2.fir.ir.txt b/compiler/testData/codegen/box/delegation/delegationToIntersectionType2.fir.ir.txt index 15aac97d855..50eabb1dc63 100644 --- a/compiler/testData/codegen/box/delegation/delegationToIntersectionType2.fir.ir.txt +++ b/compiler/testData/codegen/box/delegation/delegationToIntersectionType2.fir.ir.txt @@ -1,51 +1,26 @@ FILE fqName: fileName:/delegationToIntersectionType2.kt - FUN name:select visibility:public modality:FINAL (a:T of .select, b:T of .select) returnType:T of .select - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:a index:0 type:T of .select - VALUE_PARAMETER name:b index:1 type:T of .select - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun select (a: T of .select, b: T of .select): T of .select declared in ' - GET_VAR 'a: T of .select declared in .select' type=T of .select origin=null - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Any - $this: VALUE_PARAMETER name: type:.A - 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: 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 - CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.B - 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: 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 CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A; .B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A; .B]' + 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 .A + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B + $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 .A + public open fun hashCode (): kotlin.Int declared in .B + $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 .A + public open fun toString (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:foo visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.Any declared in .A @@ -54,6 +29,12 @@ FILE fqName: fileName:/delegationToIntersectionType2.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .C' CONST String type=kotlin.String value="OK" + CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.A; .B] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D + CONSTRUCTOR visibility:public <> () returnType:.D [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.A; .B]' 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 .A @@ -70,12 +51,6 @@ FILE fqName: fileName:/delegationToIntersectionType2.kt public open fun toString (): kotlin.String declared in .A public open fun toString (): kotlin.String declared in .B $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.A; .B] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D - CONSTRUCTOR visibility:public <> () returnType:.D [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.A; .B]' FUN name:foo visibility:public modality:OPEN <> ($this:.D) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.Any declared in .A @@ -84,22 +59,53 @@ FILE fqName: fileName:/delegationToIntersectionType2.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .D' CONST String type=kotlin.String value="FAIL" + CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A 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 .A - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .A - public open fun hashCode (): kotlin.Int declared in .B + 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 .A - public open fun toString (): kotlin.String declared in .B + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Any + $this: VALUE_PARAMETER name: type:.A + CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.B + 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 ' + CALL 'public final fun test (c: .C, d: .D): kotlin.String declared in ' type=kotlin.String origin=null + c: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + d: CONSTRUCTOR_CALL 'public constructor () declared in .D' type=.D origin=null + FUN name:select visibility:public modality:FINAL (a:T of .select, b:T of .select) returnType:T of .select + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:a index:0 type:T of .select + VALUE_PARAMETER name:b index:1 type:T of .select + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun select (a: T of .select, b: T of .select): T of .select declared in ' + GET_VAR 'a: T of .select declared in .select' type=T of .select origin=null FUN name:test visibility:public modality:FINAL <> (c:.C, d:.D) returnType:kotlin.String VALUE_PARAMETER name:c index:0 type:.C VALUE_PARAMETER name:d index:1 type:.D @@ -115,13 +121,13 @@ FILE fqName: fileName:/delegationToIntersectionType2.kt $this: BLOCK type=.test. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test. + FIELD DELEGATE name:$$delegate_0 type:kotlin.Any visibility:private [final] + EXPRESSION_BODY + GET_VAR 'val intersection: kotlin.Any declared in .test' type=kotlin.Any origin=null CONSTRUCTOR visibility:public <> () returnType:.test. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.A]' - FIELD DELEGATE name:$$delegate_0 type:kotlin.Any visibility:private [final] - EXPRESSION_BODY - GET_VAR 'val intersection: kotlin.Any declared in .test' type=kotlin.Any origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.test.) returnType:kotlin.Any overridden: public abstract fun foo (): kotlin.Any declared in .A @@ -146,9 +152,3 @@ FILE fqName: fileName:/delegationToIntersectionType2.kt public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any CONSTRUCTOR_CALL 'public constructor () declared in .test.' type=.test. origin=OBJECT_LITERAL - 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 ' - CALL 'public final fun test (c: .C, d: .D): kotlin.String declared in ' type=kotlin.String origin=null - c: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - d: CONSTRUCTOR_CALL 'public constructor () declared in .D' type=.D origin=null diff --git a/compiler/testData/codegen/box/delegation/nestedNameClash.fir.ir.txt b/compiler/testData/codegen/box/delegation/nestedNameClash.fir.ir.txt index df7415c6702..80b246aac4e 100644 --- a/compiler/testData/codegen/box/delegation/nestedNameClash.fir.ir.txt +++ b/compiler/testData/codegen/box/delegation/nestedNameClash.fir.ir.txt @@ -1,64 +1,6 @@ FILE fqName:second fileName:/nestedNameClash.kt - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - VAR name:data type:second.MyClass [val] - CONSTRUCTOR_CALL 'public constructor (prop: second.Base>) declared in second.MyClass' type=second.MyClass origin=null - prop: BLOCK type=second.box. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.box. - CONSTRUCTOR visibility:public <> () returnType:second.box. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base>]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:second.Base>) returnType:kotlin.String [fake_override] - overridden: - public open fun foo (): kotlin.String declared in second.Base - $this: VALUE_PARAMETER name: type:second.Base> - 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 second.Base - $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 second.Base - $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 second.Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in second.box.' type=second.box. origin=OBJECT_LITERAL - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in second' - CALL 'public open fun foo (): kotlin.String declared in second.MyClass' type=kotlin.String origin=null - $this: GET_VAR 'val data: second.MyClass declared in second.box' type=second.MyClass origin=null - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.Base - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:second.Base - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.Base' - CONST String type=kotlin.String value="OK" - 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: 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 CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[second.Base>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.MyClass - CONSTRUCTOR visibility:public <> (prop:second.Base>) returnType:second.MyClass [primary] - VALUE_PARAMETER name:prop index:0 type:second.Base> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[second.Base>]' PROPERTY name:prop visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base> visibility:private [final] EXPRESSION_BODY @@ -70,15 +12,6 @@ FILE fqName:second fileName:/nestedNameClash.kt RETURN type=kotlin.Nothing from='public final fun (): second.Base> declared in second.MyClass' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base> visibility:private [final]' type=second.Base> origin=null receiver: GET_VAR ': second.MyClass declared in second.MyClass.' type=second.MyClass origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:second.MyClass) returnType:kotlin.String - overridden: - public open fun foo (): kotlin.String declared in second.Base - $this: VALUE_PARAMETER name: type:second.MyClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.MyClass' - CALL 'public open fun foo (): kotlin.String declared in second.Base' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base> visibility:private [final]' type=second.Base> origin=null - receiver: GET_VAR ': second.MyClass declared in second.MyClass.foo' type=second.MyClass origin=null CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.MyClass.Base FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -94,6 +27,20 @@ FILE fqName:second fileName:/nestedNameClash.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> (prop:second.Base>) returnType:second.MyClass [primary] + VALUE_PARAMETER name:prop index:0 type:second.Base> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[second.Base>]' + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:second.MyClass) returnType:kotlin.String + overridden: + public open fun foo (): kotlin.String declared in second.Base + $this: VALUE_PARAMETER name: type:second.MyClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.MyClass' + CALL 'public open fun foo (): kotlin.String declared in second.Base' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base> visibility:private [final]' type=second.Base> origin=null + receiver: GET_VAR ': second.MyClass declared in second.MyClass.foo' type=second.MyClass 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 second.Base @@ -107,3 +54,56 @@ FILE fqName:second fileName:/nestedNameClash.kt overridden: public open fun toString (): kotlin.String declared in second.Base $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.Base + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:second.Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.Base' + CONST String type=kotlin.String value="OK" + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:data type:second.MyClass [val] + CONSTRUCTOR_CALL 'public constructor (prop: second.Base>) declared in second.MyClass' type=second.MyClass origin=null + prop: BLOCK type=second.box. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.box. + CONSTRUCTOR visibility:public <> () returnType:second.box. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base>]' + 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 second.Base + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:second.Base>) returnType:kotlin.String [fake_override] + overridden: + public open fun foo (): kotlin.String declared in second.Base + $this: VALUE_PARAMETER name: type:second.Base> + 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 second.Base + $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 second.Base + $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR_CALL 'public constructor () declared in second.box.' type=second.box. origin=OBJECT_LITERAL + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in second' + CALL 'public open fun foo (): kotlin.String declared in second.MyClass' type=kotlin.String origin=null + $this: GET_VAR 'val data: second.MyClass declared in second.box' type=second.MyClass origin=null diff --git a/compiler/testData/codegen/box/delegation/nestedNameClash.ir.txt b/compiler/testData/codegen/box/delegation/nestedNameClash.ir.txt index df7415c6702..80b246aac4e 100644 --- a/compiler/testData/codegen/box/delegation/nestedNameClash.ir.txt +++ b/compiler/testData/codegen/box/delegation/nestedNameClash.ir.txt @@ -1,64 +1,6 @@ FILE fqName:second fileName:/nestedNameClash.kt - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - VAR name:data type:second.MyClass [val] - CONSTRUCTOR_CALL 'public constructor (prop: second.Base>) declared in second.MyClass' type=second.MyClass origin=null - prop: BLOCK type=second.box. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.box. - CONSTRUCTOR visibility:public <> () returnType:second.box. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base>]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:second.Base>) returnType:kotlin.String [fake_override] - overridden: - public open fun foo (): kotlin.String declared in second.Base - $this: VALUE_PARAMETER name: type:second.Base> - 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 second.Base - $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 second.Base - $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 second.Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in second.box.' type=second.box. origin=OBJECT_LITERAL - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in second' - CALL 'public open fun foo (): kotlin.String declared in second.MyClass' type=kotlin.String origin=null - $this: GET_VAR 'val data: second.MyClass declared in second.box' type=second.MyClass origin=null - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.Base - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:second.Base - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.Base' - CONST String type=kotlin.String value="OK" - 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: 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 CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[second.Base>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.MyClass - CONSTRUCTOR visibility:public <> (prop:second.Base>) returnType:second.MyClass [primary] - VALUE_PARAMETER name:prop index:0 type:second.Base> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[second.Base>]' PROPERTY name:prop visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base> visibility:private [final] EXPRESSION_BODY @@ -70,15 +12,6 @@ FILE fqName:second fileName:/nestedNameClash.kt RETURN type=kotlin.Nothing from='public final fun (): second.Base> declared in second.MyClass' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base> visibility:private [final]' type=second.Base> origin=null receiver: GET_VAR ': second.MyClass declared in second.MyClass.' type=second.MyClass origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:second.MyClass) returnType:kotlin.String - overridden: - public open fun foo (): kotlin.String declared in second.Base - $this: VALUE_PARAMETER name: type:second.MyClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.MyClass' - CALL 'public open fun foo (): kotlin.String declared in second.Base' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base> visibility:private [final]' type=second.Base> origin=null - receiver: GET_VAR ': second.MyClass declared in second.MyClass.foo' type=second.MyClass origin=null CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.MyClass.Base FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -94,6 +27,20 @@ FILE fqName:second fileName:/nestedNameClash.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> (prop:second.Base>) returnType:second.MyClass [primary] + VALUE_PARAMETER name:prop index:0 type:second.Base> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[second.Base>]' + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:second.MyClass) returnType:kotlin.String + overridden: + public open fun foo (): kotlin.String declared in second.Base + $this: VALUE_PARAMETER name: type:second.MyClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.MyClass' + CALL 'public open fun foo (): kotlin.String declared in second.Base' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base> visibility:private [final]' type=second.Base> origin=null + receiver: GET_VAR ': second.MyClass declared in second.MyClass.foo' type=second.MyClass 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 second.Base @@ -107,3 +54,56 @@ FILE fqName:second fileName:/nestedNameClash.kt overridden: public open fun toString (): kotlin.String declared in second.Base $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.Base + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:second.Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.Base' + CONST String type=kotlin.String value="OK" + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:data type:second.MyClass [val] + CONSTRUCTOR_CALL 'public constructor (prop: second.Base>) declared in second.MyClass' type=second.MyClass origin=null + prop: BLOCK type=second.box. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.box. + CONSTRUCTOR visibility:public <> () returnType:second.box. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base>]' + 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 second.Base + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:second.Base>) returnType:kotlin.String [fake_override] + overridden: + public open fun foo (): kotlin.String declared in second.Base + $this: VALUE_PARAMETER name: type:second.Base> + 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 second.Base + $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 second.Base + $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR_CALL 'public constructor () declared in second.box.' type=second.box. origin=OBJECT_LITERAL + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in second' + CALL 'public open fun foo (): kotlin.String declared in second.MyClass' type=kotlin.String origin=null + $this: GET_VAR 'val data: second.MyClass declared in second.box' type=second.MyClass origin=null diff --git a/compiler/testData/codegen/box/delegation/nestedNameClash2.fir.ir.txt b/compiler/testData/codegen/box/delegation/nestedNameClash2.fir.ir.txt index 69c22b183ee..8d030a0def6 100644 --- a/compiler/testData/codegen/box/delegation/nestedNameClash2.fir.ir.txt +++ b/compiler/testData/codegen/box/delegation/nestedNameClash2.fir.ir.txt @@ -1,63 +1,6 @@ FILE fqName:second fileName:/nestedNameClash2.kt - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - VAR name:data type:second.MyClass [val] - CONSTRUCTOR_CALL 'public constructor (prop: second.Base) declared in second.MyClass' type=second.MyClass origin=null - prop: BLOCK type=second.box. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.box. - CONSTRUCTOR visibility:public <> () returnType:second.box. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String [fake_override] - overridden: - public open fun foo (): kotlin.String declared in second.Base - $this: VALUE_PARAMETER name: type:second.Base - 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 second.Base - $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 second.Base - $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 second.Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in second.box.' type=second.box. origin=OBJECT_LITERAL - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in second' - CALL 'public open fun foo (): kotlin.String declared in second.MyClass' type=kotlin.String origin=null - $this: GET_VAR 'val data: second.MyClass declared in second.box' type=second.MyClass origin=null - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.Base - FUN name:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:second.Base - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.Base' - CONST String type=kotlin.String value="OK" - 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: 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 CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[second.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.MyClass - CONSTRUCTOR visibility:public <> (prop:second.Base) returnType:second.MyClass [primary] - VALUE_PARAMETER name:prop index:0 type:second.Base - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[second.Base]' PROPERTY name:prop visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base visibility:private [final] EXPRESSION_BODY @@ -69,15 +12,6 @@ FILE fqName:second fileName:/nestedNameClash2.kt RETURN type=kotlin.Nothing from='public final fun (): second.Base declared in second.MyClass' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base visibility:private [final]' type=second.Base origin=null receiver: GET_VAR ': second.MyClass declared in second.MyClass.' type=second.MyClass origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:second.MyClass) returnType:kotlin.String - overridden: - public open fun foo (): kotlin.String declared in second.Base - $this: VALUE_PARAMETER name: type:second.MyClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.MyClass' - CALL 'public open fun foo (): kotlin.String declared in second.Base' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base visibility:private [final]' type=second.Base origin=null - receiver: GET_VAR ': second.MyClass declared in second.MyClass.foo' type=second.MyClass origin=null CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.MyClass.Base FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -93,6 +27,20 @@ FILE fqName:second fileName:/nestedNameClash2.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> (prop:second.Base) returnType:second.MyClass [primary] + VALUE_PARAMETER name:prop index:0 type:second.Base + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[second.Base]' + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:second.MyClass) returnType:kotlin.String + overridden: + public open fun foo (): kotlin.String declared in second.Base + $this: VALUE_PARAMETER name: type:second.MyClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.MyClass' + CALL 'public open fun foo (): kotlin.String declared in second.Base' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base visibility:private [final]' type=second.Base origin=null + receiver: GET_VAR ': second.MyClass declared in second.MyClass.foo' type=second.MyClass 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 second.Base @@ -106,3 +54,55 @@ FILE fqName:second fileName:/nestedNameClash2.kt overridden: public open fun toString (): kotlin.String declared in second.Base $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.Base + 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: 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:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:second.Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.Base' + CONST String type=kotlin.String value="OK" + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:data type:second.MyClass [val] + CONSTRUCTOR_CALL 'public constructor (prop: second.Base) declared in second.MyClass' type=second.MyClass origin=null + prop: BLOCK type=second.box. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.box. + CONSTRUCTOR visibility:public <> () returnType:second.box. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base]' + 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 second.Base + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String [fake_override] + overridden: + public open fun foo (): kotlin.String declared in second.Base + $this: VALUE_PARAMETER name: type:second.Base + 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 second.Base + $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 second.Base + $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR_CALL 'public constructor () declared in second.box.' type=second.box. origin=OBJECT_LITERAL + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in second' + CALL 'public open fun foo (): kotlin.String declared in second.MyClass' type=kotlin.String origin=null + $this: GET_VAR 'val data: second.MyClass declared in second.box' type=second.MyClass origin=null diff --git a/compiler/testData/codegen/box/delegation/nestedNameClash2.ir.txt b/compiler/testData/codegen/box/delegation/nestedNameClash2.ir.txt index 69c22b183ee..8d030a0def6 100644 --- a/compiler/testData/codegen/box/delegation/nestedNameClash2.ir.txt +++ b/compiler/testData/codegen/box/delegation/nestedNameClash2.ir.txt @@ -1,63 +1,6 @@ FILE fqName:second fileName:/nestedNameClash2.kt - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - VAR name:data type:second.MyClass [val] - CONSTRUCTOR_CALL 'public constructor (prop: second.Base) declared in second.MyClass' type=second.MyClass origin=null - prop: BLOCK type=second.box. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.box. - CONSTRUCTOR visibility:public <> () returnType:second.box. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String [fake_override] - overridden: - public open fun foo (): kotlin.String declared in second.Base - $this: VALUE_PARAMETER name: type:second.Base - 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 second.Base - $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 second.Base - $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 second.Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in second.box.' type=second.box. origin=OBJECT_LITERAL - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in second' - CALL 'public open fun foo (): kotlin.String declared in second.MyClass' type=kotlin.String origin=null - $this: GET_VAR 'val data: second.MyClass declared in second.box' type=second.MyClass origin=null - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.Base - FUN name:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:second.Base - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.Base' - CONST String type=kotlin.String value="OK" - 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: 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 CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[second.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.MyClass - CONSTRUCTOR visibility:public <> (prop:second.Base) returnType:second.MyClass [primary] - VALUE_PARAMETER name:prop index:0 type:second.Base - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[second.Base]' PROPERTY name:prop visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base visibility:private [final] EXPRESSION_BODY @@ -69,15 +12,6 @@ FILE fqName:second fileName:/nestedNameClash2.kt RETURN type=kotlin.Nothing from='public final fun (): second.Base declared in second.MyClass' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base visibility:private [final]' type=second.Base origin=null receiver: GET_VAR ': second.MyClass declared in second.MyClass.' type=second.MyClass origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:second.MyClass) returnType:kotlin.String - overridden: - public open fun foo (): kotlin.String declared in second.Base - $this: VALUE_PARAMETER name: type:second.MyClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.MyClass' - CALL 'public open fun foo (): kotlin.String declared in second.Base' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base visibility:private [final]' type=second.Base origin=null - receiver: GET_VAR ': second.MyClass declared in second.MyClass.foo' type=second.MyClass origin=null CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.MyClass.Base FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -93,6 +27,20 @@ FILE fqName:second fileName:/nestedNameClash2.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> (prop:second.Base) returnType:second.MyClass [primary] + VALUE_PARAMETER name:prop index:0 type:second.Base + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[second.Base]' + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:second.MyClass) returnType:kotlin.String + overridden: + public open fun foo (): kotlin.String declared in second.Base + $this: VALUE_PARAMETER name: type:second.MyClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.MyClass' + CALL 'public open fun foo (): kotlin.String declared in second.Base' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base visibility:private [final]' type=second.Base origin=null + receiver: GET_VAR ': second.MyClass declared in second.MyClass.foo' type=second.MyClass 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 second.Base @@ -106,3 +54,55 @@ FILE fqName:second fileName:/nestedNameClash2.kt overridden: public open fun toString (): kotlin.String declared in second.Base $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.Base + 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: 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:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:second.Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.Base' + CONST String type=kotlin.String value="OK" + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:data type:second.MyClass [val] + CONSTRUCTOR_CALL 'public constructor (prop: second.Base) declared in second.MyClass' type=second.MyClass origin=null + prop: BLOCK type=second.box. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:second.box. + CONSTRUCTOR visibility:public <> () returnType:second.box. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[second.Base]' + 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 second.Base + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String [fake_override] + overridden: + public open fun foo (): kotlin.String declared in second.Base + $this: VALUE_PARAMETER name: type:second.Base + 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 second.Base + $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 second.Base + $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR_CALL 'public constructor () declared in second.box.' type=second.box. origin=OBJECT_LITERAL + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in second' + CALL 'public open fun foo (): kotlin.String declared in second.MyClass' type=kotlin.String origin=null + $this: GET_VAR 'val data: second.MyClass declared in second.box' type=second.MyClass origin=null diff --git a/compiler/testData/codegen/box/fakeOverride/complexOverriddensInLazyFunctions.fir.ir.txt b/compiler/testData/codegen/box/fakeOverride/complexOverriddensInLazyFunctions.fir.ir.txt index 84535764b1f..89e49ee8e82 100644 --- a/compiler/testData/codegen/box/fakeOverride/complexOverriddensInLazyFunctions.fir.ir.txt +++ b/compiler/testData/codegen/box/fakeOverride/complexOverriddensInLazyFunctions.fir.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/base.kt CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A 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 @@ -18,12 +14,12 @@ FILE fqName: fileName:/base.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.A FUN FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] overridden: public abstract fun bar (): kotlin.Unit declared in .A @@ -33,6 +29,10 @@ FILE fqName: fileName:/base.kt public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun foo (): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.A 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 .A @@ -43,10 +43,6 @@ FILE fqName: fileName:/base.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:C modality:ABSTRACT visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.A FUN FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] overridden: public abstract fun bar (): kotlin.Unit declared in .A @@ -56,6 +52,10 @@ FILE fqName: fileName:/base.kt public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun foo (): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.A 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 .A @@ -66,8 +66,6 @@ FILE fqName: fileName:/base.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:D modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.D) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.D 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 @@ -81,7 +79,13 @@ FILE fqName: fileName:/base.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.D FILE fqName: fileName:/main.kt + 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 ' + CONST String type=kotlin.String value="OK" FUN name:test visibility:public modality:FINAL <> (x:.JavaInterface) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:.JavaInterface BLOCK_BODY @@ -89,7 +93,3 @@ FILE fqName: fileName:/main.kt $this: GET_VAR 'x: .JavaInterface declared in .test' type=.JavaInterface origin=null CALL 'public abstract fun bar (): kotlin.Unit declared in .JavaInterface' type=kotlin.Unit origin=null $this: GET_VAR 'x: .JavaInterface declared in .test' type=.JavaInterface 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 ' - CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/codegen/box/fakeOverride/complexOverriddensInLazyFunctions.ir.txt b/compiler/testData/codegen/box/fakeOverride/complexOverriddensInLazyFunctions.ir.txt index 84535764b1f..89e49ee8e82 100644 --- a/compiler/testData/codegen/box/fakeOverride/complexOverriddensInLazyFunctions.ir.txt +++ b/compiler/testData/codegen/box/fakeOverride/complexOverriddensInLazyFunctions.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/base.kt CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A 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 @@ -18,12 +14,12 @@ FILE fqName: fileName:/base.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.A FUN FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] overridden: public abstract fun bar (): kotlin.Unit declared in .A @@ -33,6 +29,10 @@ FILE fqName: fileName:/base.kt public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun foo (): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.A 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 .A @@ -43,10 +43,6 @@ FILE fqName: fileName:/base.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:C modality:ABSTRACT visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.A FUN FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] overridden: public abstract fun bar (): kotlin.Unit declared in .A @@ -56,6 +52,10 @@ FILE fqName: fileName:/base.kt public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun foo (): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.A 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 .A @@ -66,8 +66,6 @@ FILE fqName: fileName:/base.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:D modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.D) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.D 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 @@ -81,7 +79,13 @@ FILE fqName: fileName:/base.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.D FILE fqName: fileName:/main.kt + 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 ' + CONST String type=kotlin.String value="OK" FUN name:test visibility:public modality:FINAL <> (x:.JavaInterface) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:.JavaInterface BLOCK_BODY @@ -89,7 +93,3 @@ FILE fqName: fileName:/main.kt $this: GET_VAR 'x: .JavaInterface declared in .test' type=.JavaInterface origin=null CALL 'public abstract fun bar (): kotlin.Unit declared in .JavaInterface' type=kotlin.Unit origin=null $this: GET_VAR 'x: .JavaInterface declared in .test' type=.JavaInterface 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 ' - CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.ir.txt b/compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.ir.txt index d56e2ca93c9..4e254634ae5 100644 --- a/compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.ir.txt +++ b/compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.ir.txt @@ -5,68 +5,29 @@ FILE fqName: fileName:/intersectionOverrideBetweenValAndVar.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public 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 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 PROPERTY name:x visibility:public modality:ABSTRACT [val] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.String correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [val] $this: VALUE_PARAMETER name: type:.A - 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: 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 - CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - PROPERTY name:x visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.String - correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.B - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.B, :kotlin.String) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name: index:0 type:kotlin.String - 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: 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 CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[.A; .B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[.A; .B]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] - overridden: - public abstract x: kotlin.String - public abstract x: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] - overridden: - public abstract fun (): kotlin.String declared in .A - public abstract fun (): kotlin.String declared in .B - $this: VALUE_PARAMETER name: type:.B - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.B, :kotlin.String) returnType:kotlin.Unit [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] - overridden: - public abstract fun (: kotlin.String): kotlin.Unit declared in .B - $this: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name: index:0 type:kotlin.String 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 .A @@ -83,13 +44,24 @@ FILE fqName: fileName:/intersectionOverrideBetweenValAndVar.kt public open fun toString (): kotlin.String declared in .A public open fun toString (): kotlin.String declared in .B $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] + overridden: + public abstract x: kotlin.String + public abstract x: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] + overridden: + public abstract fun (): kotlin.String declared in .A + public abstract fun (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:.B + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.B, :kotlin.String) returnType:kotlin.Unit [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] + overridden: + public abstract fun (: kotlin.String): kotlin.Unit declared in .B + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name: index:0 type:kotlin.String CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.C] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.D [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .C' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.C]' PROPERTY name:x visibility:public modality:OPEN [var] overridden: public abstract x: kotlin.String @@ -115,6 +87,11 @@ FILE fqName: fileName:/intersectionOverrideBetweenValAndVar.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .D declared in .D.' type=.D origin=null value: GET_VAR ': kotlin.String declared in .D.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.D [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .C' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.C]' 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 .C @@ -128,12 +105,29 @@ FILE fqName: fileName:/intersectionOverrideBetweenValAndVar.kt overridden: public open fun toString (): kotlin.String declared in .C $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test visibility:public modality:FINAL <> (c:.C) returnType:kotlin.Unit - VALUE_PARAMETER name:c index:0 type:.C - BLOCK_BODY - CALL 'public abstract fun (: kotlin.String): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ - $this: GET_VAR 'c: .C declared in .test' type=.C origin=null - : CONST String type=kotlin.String value="OK" + CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + 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: 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 + PROPERTY name:x visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.B + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.B, :kotlin.String) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name: index:0 type:kotlin.String FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:d type:.D [val] @@ -144,3 +138,9 @@ FILE fqName: fileName:/intersectionOverrideBetweenValAndVar.kt RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CALL 'public open fun (): kotlin.String declared in .D' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR 'val d: .D declared in .box' type=.D origin=null + FUN name:test visibility:public modality:FINAL <> (c:.C) returnType:kotlin.Unit + VALUE_PARAMETER name:c index:0 type:.C + BLOCK_BODY + CALL 'public abstract fun (: kotlin.String): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + : CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/codegen/box/fir/callableReferenceToJavaField.fir.ir.txt b/compiler/testData/codegen/box/fir/callableReferenceToJavaField.fir.ir.txt index a8336b398de..9f0ae3adb43 100644 --- a/compiler/testData/codegen/box/fir/callableReferenceToJavaField.fir.ir.txt +++ b/compiler/testData/codegen/box/fir/callableReferenceToJavaField.fir.ir.txt @@ -1,11 +1,6 @@ FILE fqName:foo fileName:/main.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.A - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.A [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName:foo fileName:/main.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': foo.A declared in foo.A.' type=foo.A origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.A [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -36,28 +36,6 @@ FILE fqName:foo fileName:/main.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in bar.Base' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[bar.Base]' - FUN name:foo visibility:protected modality:OPEN <> ($this:foo.Derived) returnType:kotlin.Unit - overridden: - protected/*protected and package*/ open fun foo (): kotlin.Unit declared in bar.Base - $this: VALUE_PARAMETER name: type:foo.Derived - BLOCK_BODY - CALL 'public open fun set (p0: @[FlexibleNullability] kotlin.Any?, p1: @[FlexibleNullability] kotlin.Any?): kotlin.Unit declared in java.lang.reflect.Field' type=kotlin.Unit origin=null - $this: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=java.lang.reflect.Field origin=EXCLEXCL - : java.lang.reflect.Field - arg0: CALL 'public final fun (): java.lang.reflect.Field? declared in kotlin.reflect.jvm' type=java.lang.reflect.Field? origin=GET_PROPERTY - $receiver: PROPERTY_REFERENCE 'protected/*protected and package*/ open a: @[FlexibleNullability] foo.A?' field='FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] foo.A? visibility:protected/*protected and package*/' getter='protected/*protected and package*/ open fun (): @[FlexibleNullability] foo.A? declared in bar.Base' setter='protected/*protected and package*/ open fun (: @[FlexibleNullability] foo.A?): kotlin.Unit declared in bar.Base' type=kotlin.reflect.KMutableProperty1 origin=null - p0: GET_VAR ': foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null - p1: CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.A' type=foo.A origin=null - s: CONST String type=kotlin.String value="OK" - FUN name:box visibility:public modality:FINAL <> ($this:foo.Derived) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:foo.Derived - BLOCK_BODY - CALL 'protected open fun foo (): kotlin.Unit declared in foo.Derived' type=kotlin.Unit origin=null - $this: GET_VAR ': foo.Derived declared in foo.Derived.box' type=foo.Derived origin=null - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in foo.Derived' - CALL 'public final fun (): kotlin.String declared in foo.A' type=kotlin.String origin=GET_PROPERTY - $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] foo.A? visibility:protected/*protected and package*/' type=@[FlexibleNullability] foo.A? origin=null - receiver: GET_VAR ': foo.Derived declared in foo.Derived.box' type=foo.Derived 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 bar.Base @@ -71,6 +49,28 @@ FILE fqName:foo fileName:/main.kt overridden: public open fun toString (): kotlin.String declared in bar.Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:box visibility:public modality:FINAL <> ($this:foo.Derived) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:foo.Derived + BLOCK_BODY + CALL 'protected open fun foo (): kotlin.Unit declared in foo.Derived' type=kotlin.Unit origin=null + $this: GET_VAR ': foo.Derived declared in foo.Derived.box' type=foo.Derived origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in foo.Derived' + CALL 'public final fun (): kotlin.String declared in foo.A' type=kotlin.String origin=GET_PROPERTY + $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] foo.A? visibility:protected/*protected and package*/' type=@[FlexibleNullability] foo.A? origin=null + receiver: GET_VAR ': foo.Derived declared in foo.Derived.box' type=foo.Derived origin=null + FUN name:foo visibility:protected modality:OPEN <> ($this:foo.Derived) returnType:kotlin.Unit + overridden: + protected/*protected and package*/ open fun foo (): kotlin.Unit declared in bar.Base + $this: VALUE_PARAMETER name: type:foo.Derived + BLOCK_BODY + CALL 'public open fun set (p0: @[FlexibleNullability] kotlin.Any?, p1: @[FlexibleNullability] kotlin.Any?): kotlin.Unit declared in java.lang.reflect.Field' type=kotlin.Unit origin=null + $this: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=java.lang.reflect.Field origin=EXCLEXCL + : java.lang.reflect.Field + arg0: CALL 'public final fun (): java.lang.reflect.Field? declared in kotlin.reflect.jvm' type=java.lang.reflect.Field? origin=GET_PROPERTY + $receiver: PROPERTY_REFERENCE 'protected/*protected and package*/ open a: @[FlexibleNullability] foo.A?' field='FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] foo.A? visibility:protected/*protected and package*/' getter='protected/*protected and package*/ open fun (): @[FlexibleNullability] foo.A? declared in bar.Base' setter='protected/*protected and package*/ open fun (: @[FlexibleNullability] foo.A?): kotlin.Unit declared in bar.Base' type=kotlin.reflect.KMutableProperty1 origin=null + p0: GET_VAR ': foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null + p1: CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.A' type=foo.A origin=null + s: CONST String type=kotlin.String value="OK" 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 foo' diff --git a/compiler/testData/codegen/box/fir/callableReferenceToJavaField.ir.txt b/compiler/testData/codegen/box/fir/callableReferenceToJavaField.ir.txt index 92c48ea35c4..f97d8098584 100644 --- a/compiler/testData/codegen/box/fir/callableReferenceToJavaField.ir.txt +++ b/compiler/testData/codegen/box/fir/callableReferenceToJavaField.ir.txt @@ -1,11 +1,6 @@ FILE fqName:foo fileName:/main.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.A - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.A [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName:foo fileName:/main.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': foo.A declared in foo.A.' type=foo.A origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.A [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -36,29 +36,6 @@ FILE fqName:foo fileName:/main.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in bar.Base' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[bar.Base]' - FUN name:foo visibility:protected modality:OPEN <> ($this:foo.Derived) returnType:kotlin.Unit - overridden: - protected/*protected and package*/ open fun foo (): kotlin.Unit declared in bar.Base - $this: VALUE_PARAMETER name: type:foo.Derived - BLOCK_BODY - CALL 'public open fun set (p0: @[FlexibleNullability] kotlin.Any?, p1: @[FlexibleNullability] kotlin.Any?): kotlin.Unit declared in java.lang.reflect.Field' type=kotlin.Unit origin=EQ - $this: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=java.lang.reflect.Field origin=EXCLEXCL - : java.lang.reflect.Field - arg0: CALL 'public final fun (): java.lang.reflect.Field? declared in kotlin.reflect.jvm' type=java.lang.reflect.Field? origin=GET_PROPERTY - $receiver: PROPERTY_REFERENCE 'protected/*protected and package*/ final a' field='FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] foo.A? visibility:protected/*protected and package*/' getter=null setter=null type=kotlin.reflect.KMutableProperty1 origin=null - p0: GET_VAR ': foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null - p1: CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.A' type=foo.A origin=null - s: CONST String type=kotlin.String value="OK" - FUN name:box visibility:public modality:FINAL <> ($this:foo.Derived) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:foo.Derived - BLOCK_BODY - CALL 'protected open fun foo (): kotlin.Unit declared in foo.Derived' type=kotlin.Unit origin=null - $this: GET_VAR ': foo.Derived declared in foo.Derived.box' type=foo.Derived origin=null - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in foo.Derived' - CALL 'public final fun (): kotlin.String declared in foo.A' type=kotlin.String origin=GET_PROPERTY - $this: TYPE_OP type=foo.A origin=IMPLICIT_NOTNULL typeOperand=foo.A - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] foo.A? visibility:protected/*protected and package*/' type=@[FlexibleNullability] foo.A? origin=null - receiver: GET_VAR ': foo.Derived declared in foo.Derived.box' type=foo.Derived 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 bar.Base @@ -72,6 +49,29 @@ FILE fqName:foo fileName:/main.kt overridden: public open fun toString (): kotlin.String declared in bar.Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:box visibility:public modality:FINAL <> ($this:foo.Derived) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:foo.Derived + BLOCK_BODY + CALL 'protected open fun foo (): kotlin.Unit declared in foo.Derived' type=kotlin.Unit origin=null + $this: GET_VAR ': foo.Derived declared in foo.Derived.box' type=foo.Derived origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in foo.Derived' + CALL 'public final fun (): kotlin.String declared in foo.A' type=kotlin.String origin=GET_PROPERTY + $this: TYPE_OP type=foo.A origin=IMPLICIT_NOTNULL typeOperand=foo.A + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] foo.A? visibility:protected/*protected and package*/' type=@[FlexibleNullability] foo.A? origin=null + receiver: GET_VAR ': foo.Derived declared in foo.Derived.box' type=foo.Derived origin=null + FUN name:foo visibility:protected modality:OPEN <> ($this:foo.Derived) returnType:kotlin.Unit + overridden: + protected/*protected and package*/ open fun foo (): kotlin.Unit declared in bar.Base + $this: VALUE_PARAMETER name: type:foo.Derived + BLOCK_BODY + CALL 'public open fun set (p0: @[FlexibleNullability] kotlin.Any?, p1: @[FlexibleNullability] kotlin.Any?): kotlin.Unit declared in java.lang.reflect.Field' type=kotlin.Unit origin=EQ + $this: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=java.lang.reflect.Field origin=EXCLEXCL + : java.lang.reflect.Field + arg0: CALL 'public final fun (): java.lang.reflect.Field? declared in kotlin.reflect.jvm' type=java.lang.reflect.Field? origin=GET_PROPERTY + $receiver: PROPERTY_REFERENCE 'protected/*protected and package*/ final a' field='FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] foo.A? visibility:protected/*protected and package*/' getter=null setter=null type=kotlin.reflect.KMutableProperty1 origin=null + p0: GET_VAR ': foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null + p1: CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.A' type=foo.A origin=null + s: CONST String type=kotlin.String value="OK" PROPERTY FAKE_OVERRIDE name:a visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] overridden: protected/*protected and package*/ final a: @[FlexibleNullability] foo.A? diff --git a/compiler/testData/codegen/box/fir/functionsDifferInTypeParameterBounds.fir.ir.txt b/compiler/testData/codegen/box/fir/functionsDifferInTypeParameterBounds.fir.ir.txt index 913872c99a9..189ac7763a7 100644 --- a/compiler/testData/codegen/box/fir/functionsDifferInTypeParameterBounds.fir.ir.txt +++ b/compiler/testData/codegen/box/fir/functionsDifferInTypeParameterBounds.fir.ir.txt @@ -1,19 +1,4 @@ FILE fqName: fileName:/functionsDifferInTypeParameterBounds.kt - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - 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: 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 CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B CONSTRUCTOR visibility:public <> () returnType:.B [primary] @@ -58,6 +43,27 @@ FILE fqName: fileName:/functionsDifferInTypeParameterBounds.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:X modality:ABSTRACT visibility:public 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 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:foo visibility:public modality:ABSTRACT ($this:.X, s:S2 of .X.foo) returnType:kotlin.String + TYPE_PARAMETER name:S2 index:0 variance: superTypes:[.B] reified:false + $this: VALUE_PARAMETER name: type:.X + VALUE_PARAMETER name:s index:0 type:S2 of .X.foo + FUN name:foo visibility:public modality:ABSTRACT ($this:.X, s:S3 of .X.foo) returnType:kotlin.String + TYPE_PARAMETER name:S3 index:0 variance: superTypes:[.C] reified:false + $this: VALUE_PARAMETER name: type:.X + VALUE_PARAMETER name:s index:0 type:S3 of .X.foo FUN name:foo visibility:public modality:FINAL ($this:.X, s:S1 of .X.foo) returnType:kotlin.String TYPE_PARAMETER name:S1 index:0 variance: superTypes:[.A] reified:false $this: VALUE_PARAMETER name: type:.X @@ -87,33 +93,31 @@ FILE fqName: fileName:/functionsDifferInTypeParameterBounds.kt then: THROW type=kotlin.Nothing CONSTRUCTOR_CALL 'public constructor (p0: @[FlexibleNullability] kotlin.Any?) declared in java.lang.AssertionError' type=java.lang.AssertionError origin=null p0: GET_VAR 's: S1 of .X.foo declared in .X.foo' type=S1 of .X.foo origin=null - FUN name:foo visibility:public modality:ABSTRACT ($this:.X, s:S2 of .X.foo) returnType:kotlin.String - TYPE_PARAMETER name:S2 index:0 variance: superTypes:[.B] reified:false - $this: VALUE_PARAMETER name: type:.X - VALUE_PARAMETER name:s index:0 type:S2 of .X.foo - FUN name:foo visibility:public modality:ABSTRACT ($this:.X, s:S3 of .X.foo) returnType:kotlin.String - TYPE_PARAMETER name:S3 index:0 variance: superTypes:[.C] reified:false - $this: VALUE_PARAMETER name: type:.X - VALUE_PARAMETER name:s index:0 type:S3 of .X.foo - 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: 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 CLASS CLASS name:Y modality:FINAL visibility:public superTypes:[.X] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Y CONSTRUCTOR visibility:public <> () returnType:.Y [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .X' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Y modality:FINAL visibility:public superTypes:[.X]' + 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 .X + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL ($this:.X, s:S1 of .Y.foo) returnType:kotlin.String [fake_override] + overridden: + public final fun foo (s: S1 of .X.foo): kotlin.String declared in .X + TYPE_PARAMETER name:S1 index:0 variance: superTypes:[.A] reified:false + $this: VALUE_PARAMETER name: type:.X + VALUE_PARAMETER name:s index:0 type:S1 of .Y.foo + 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 .X + $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 .X + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:foo visibility:public modality:OPEN ($this:.Y, s:S4 of .Y.foo) returnType:kotlin.String overridden: public abstract fun foo (s: S2 of .X.foo): kotlin.String declared in .X @@ -132,24 +136,20 @@ FILE fqName: fileName:/functionsDifferInTypeParameterBounds.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (s: S5 of .Y.foo): kotlin.String declared in .Y' CONST String type=kotlin.String value="K" - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL ($this:.X, s:S1 of .Y.foo) returnType:kotlin.String [fake_override] - overridden: - public final fun foo (s: S1 of .X.foo): kotlin.String declared in .X - TYPE_PARAMETER name:S1 index:0 variance: superTypes:[.A] reified:false - $this: VALUE_PARAMETER name: type:.X - VALUE_PARAMETER name:s index:0 type:S1 of .Y.foo + CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A 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 .X + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .X + 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 .X + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY diff --git a/compiler/testData/codegen/box/fir/functionsDifferInTypeParameterBounds.ir.txt b/compiler/testData/codegen/box/fir/functionsDifferInTypeParameterBounds.ir.txt index 3e39adce72a..99114da0363 100644 --- a/compiler/testData/codegen/box/fir/functionsDifferInTypeParameterBounds.ir.txt +++ b/compiler/testData/codegen/box/fir/functionsDifferInTypeParameterBounds.ir.txt @@ -1,19 +1,4 @@ FILE fqName: fileName:/functionsDifferInTypeParameterBounds.kt - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - 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: 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 CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B CONSTRUCTOR visibility:public <> () returnType:.B [primary] @@ -58,6 +43,27 @@ FILE fqName: fileName:/functionsDifferInTypeParameterBounds.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:X modality:ABSTRACT visibility:public 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 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:foo visibility:public modality:ABSTRACT ($this:.X, s:S2 of .X.foo) returnType:kotlin.String + TYPE_PARAMETER name:S2 index:0 variance: superTypes:[.B] reified:false + $this: VALUE_PARAMETER name: type:.X + VALUE_PARAMETER name:s index:0 type:S2 of .X.foo + FUN name:foo visibility:public modality:ABSTRACT ($this:.X, s:S3 of .X.foo) returnType:kotlin.String + TYPE_PARAMETER name:S3 index:0 variance: superTypes:[.C] reified:false + $this: VALUE_PARAMETER name: type:.X + VALUE_PARAMETER name:s index:0 type:S3 of .X.foo FUN name:foo visibility:public modality:FINAL ($this:.X, s:S1 of .X.foo) returnType:kotlin.String TYPE_PARAMETER name:S1 index:0 variance: superTypes:[.A] reified:false $this: VALUE_PARAMETER name: type:.X @@ -89,33 +95,31 @@ FILE fqName: fileName:/functionsDifferInTypeParameterBounds.kt then: THROW type=kotlin.Nothing CONSTRUCTOR_CALL 'public constructor (p0: @[FlexibleNullability] kotlin.Any?) declared in java.lang.AssertionError' type=java.lang.AssertionError origin=null p0: GET_VAR 's: S1 of .X.foo declared in .X.foo' type=S1 of .X.foo origin=null - FUN name:foo visibility:public modality:ABSTRACT ($this:.X, s:S2 of .X.foo) returnType:kotlin.String - TYPE_PARAMETER name:S2 index:0 variance: superTypes:[.B] reified:false - $this: VALUE_PARAMETER name: type:.X - VALUE_PARAMETER name:s index:0 type:S2 of .X.foo - FUN name:foo visibility:public modality:ABSTRACT ($this:.X, s:S3 of .X.foo) returnType:kotlin.String - TYPE_PARAMETER name:S3 index:0 variance: superTypes:[.C] reified:false - $this: VALUE_PARAMETER name: type:.X - VALUE_PARAMETER name:s index:0 type:S3 of .X.foo - 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: 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 CLASS CLASS name:Y modality:FINAL visibility:public superTypes:[.X] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Y CONSTRUCTOR visibility:public <> () returnType:.Y [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .X' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Y modality:FINAL visibility:public superTypes:[.X]' + 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 .X + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL ($this:.X, s:S1 of .Y.foo) returnType:kotlin.String [fake_override] + overridden: + public final fun foo (s: S1 of .X.foo): kotlin.String declared in .X + TYPE_PARAMETER name:S1 index:0 variance: superTypes:[.A] reified:false + $this: VALUE_PARAMETER name: type:.X + VALUE_PARAMETER name:s index:0 type:S1 of .Y.foo + 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 .X + $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 .X + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:foo visibility:public modality:OPEN ($this:.Y, s:S4 of .Y.foo) returnType:kotlin.String overridden: public abstract fun foo (s: S2 of .X.foo): kotlin.String declared in .X @@ -134,24 +138,20 @@ FILE fqName: fileName:/functionsDifferInTypeParameterBounds.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (s: S5 of .Y.foo): kotlin.String declared in .Y' CONST String type=kotlin.String value="K" - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL ($this:.X, s:S1 of .Y.foo) returnType:kotlin.String [fake_override] - overridden: - public final fun foo (s: S1 of .X.foo): kotlin.String declared in .X - TYPE_PARAMETER name:S1 index:0 variance: superTypes:[.A] reified:false - $this: VALUE_PARAMETER name: type:.X - VALUE_PARAMETER name:s index:0 type:S1 of .Y.foo + CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A 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 .X + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .X + 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 .X + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY diff --git a/compiler/testData/codegen/box/fir/listAssignmentInWhen.fir.ir.txt b/compiler/testData/codegen/box/fir/listAssignmentInWhen.fir.ir.txt index 9ec52728379..7c57608252d 100644 --- a/compiler/testData/codegen/box/fir/listAssignmentInWhen.fir.ir.txt +++ b/compiler/testData/codegen/box/fir/listAssignmentInWhen.fir.ir.txt @@ -1,21 +1,4 @@ FILE fqName: fileName:/listAssignmentInWhen.kt - FUN name:foo visibility:public modality:FINAL <> (list:kotlin.collections.MutableList, condition:kotlin.Boolean) returnType:kotlin.Unit - VALUE_PARAMETER name:list index:0 type:kotlin.collections.MutableList - VALUE_PARAMETER name:condition index:1 type:kotlin.Boolean - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (list: kotlin.collections.MutableList, condition: kotlin.Boolean): kotlin.Unit declared in ' - WHEN type=kotlin.Unit origin=WHEN - BRANCH - if: GET_VAR 'condition: kotlin.Boolean declared in .foo' type=kotlin.Boolean origin=null - then: BLOCK type=kotlin.Unit origin=null - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun set (index: kotlin.Int, element: E of kotlin.collections.MutableList): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList' type=kotlin.Any? origin=null - $this: GET_VAR 'list: kotlin.collections.MutableList declared in .foo' type=kotlin.collections.MutableList origin=null - index: CONST Int type=kotlin.Int value=0 - element: CONST String type=kotlin.String value="OK" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:list type:kotlin.collections.MutableList [val] @@ -34,3 +17,20 @@ FILE fqName: fileName:/listAssignmentInWhen.kt CALL 'public abstract fun get (index: kotlin.Int): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList' type=kotlin.Any? origin=GET_ARRAY_ELEMENT $this: GET_VAR 'val list: kotlin.collections.MutableList declared in .box' type=kotlin.collections.MutableList origin=null index: CONST Int type=kotlin.Int value=0 + FUN name:foo visibility:public modality:FINAL <> (list:kotlin.collections.MutableList, condition:kotlin.Boolean) returnType:kotlin.Unit + VALUE_PARAMETER name:list index:0 type:kotlin.collections.MutableList + VALUE_PARAMETER name:condition index:1 type:kotlin.Boolean + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (list: kotlin.collections.MutableList, condition: kotlin.Boolean): kotlin.Unit declared in ' + WHEN type=kotlin.Unit origin=WHEN + BRANCH + if: GET_VAR 'condition: kotlin.Boolean declared in .foo' type=kotlin.Boolean origin=null + then: BLOCK type=kotlin.Unit origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public abstract fun set (index: kotlin.Int, element: E of kotlin.collections.MutableList): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList' type=kotlin.Any? origin=null + $this: GET_VAR 'list: kotlin.collections.MutableList declared in .foo' type=kotlin.collections.MutableList origin=null + index: CONST Int type=kotlin.Int value=0 + element: CONST String type=kotlin.String value="OK" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit diff --git a/compiler/testData/codegen/box/fir/listAssignmentInWhen.ir.txt b/compiler/testData/codegen/box/fir/listAssignmentInWhen.ir.txt index 71825085e4e..3b9ef0589cc 100644 --- a/compiler/testData/codegen/box/fir/listAssignmentInWhen.ir.txt +++ b/compiler/testData/codegen/box/fir/listAssignmentInWhen.ir.txt @@ -1,20 +1,4 @@ FILE fqName: fileName:/listAssignmentInWhen.kt - FUN name:foo visibility:public modality:FINAL <> (list:kotlin.collections.MutableList, condition:kotlin.Boolean) returnType:kotlin.Unit - VALUE_PARAMETER name:list index:0 type:kotlin.collections.MutableList - VALUE_PARAMETER name:condition index:1 type:kotlin.Boolean - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (list: kotlin.collections.MutableList, condition: kotlin.Boolean): kotlin.Unit declared in ' - WHEN type=kotlin.Unit origin=WHEN - BRANCH - if: GET_VAR 'condition: kotlin.Boolean declared in .foo' type=kotlin.Boolean origin=null - then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun set (index: kotlin.Int, element: E of kotlin.collections.MutableList): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList' type=kotlin.Any? origin=EQ - $this: GET_VAR 'list: kotlin.collections.MutableList declared in .foo' type=kotlin.collections.MutableList origin=null - index: CONST Int type=kotlin.Int value=0 - element: CONST String type=kotlin.String value="OK" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:list type:kotlin.collections.MutableList [val] @@ -33,3 +17,19 @@ FILE fqName: fileName:/listAssignmentInWhen.kt CALL 'public abstract fun get (index: kotlin.Int): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList' type=kotlin.Any? origin=GET_ARRAY_ELEMENT $this: GET_VAR 'val list: kotlin.collections.MutableList declared in .box' type=kotlin.collections.MutableList origin=null index: CONST Int type=kotlin.Int value=0 + FUN name:foo visibility:public modality:FINAL <> (list:kotlin.collections.MutableList, condition:kotlin.Boolean) returnType:kotlin.Unit + VALUE_PARAMETER name:list index:0 type:kotlin.collections.MutableList + VALUE_PARAMETER name:condition index:1 type:kotlin.Boolean + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (list: kotlin.collections.MutableList, condition: kotlin.Boolean): kotlin.Unit declared in ' + WHEN type=kotlin.Unit origin=WHEN + BRANCH + if: GET_VAR 'condition: kotlin.Boolean declared in .foo' type=kotlin.Boolean origin=null + then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public abstract fun set (index: kotlin.Int, element: E of kotlin.collections.MutableList): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList' type=kotlin.Any? origin=EQ + $this: GET_VAR 'list: kotlin.collections.MutableList declared in .foo' type=kotlin.collections.MutableList origin=null + index: CONST Int type=kotlin.Int value=0 + element: CONST String type=kotlin.String value="OK" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit diff --git a/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.fir.ir.txt b/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.fir.ir.txt index 912b12f7a6b..51020f2e92e 100644 --- a/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.fir.ir.txt +++ b/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.fir.ir.txt @@ -14,6 +14,21 @@ FILE fqName: fileName:/noSymbolForIntRangeIterator.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + CALL 'public final fun test (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + WHEN type=kotlin.String origin=IF + 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: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + arg1: CONST Int type=kotlin.Int value=3025 + then: CONST String type=kotlin.String value="OK" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Fail: " + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY FUN name:takeString visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY @@ -95,18 +110,3 @@ FILE fqName: fileName:/noSymbolForIntRangeIterator.kt CALL 'public final fun takeString (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null s: GET_VAR 'val s: kotlin.String declared in .test.localFunc' type=kotlin.String origin=null CALL 'local final fun localFunc (): kotlin.Unit declared in .test' type=kotlin.Unit origin=null - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - CALL 'public final fun test (): kotlin.Unit declared in ' type=kotlin.Unit origin=null - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' - WHEN type=kotlin.String origin=IF - 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: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - arg1: CONST Int type=kotlin.Int value=3025 - then: CONST String type=kotlin.String value="OK" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Fail: " - CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY diff --git a/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.ir.txt b/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.ir.txt index 694cc69d1d6..a559b757067 100644 --- a/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.ir.txt +++ b/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.ir.txt @@ -14,6 +14,21 @@ FILE fqName: fileName:/noSymbolForIntRangeIterator.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + CALL 'public final fun test (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + WHEN type=kotlin.String origin=IF + 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: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + arg1: CONST Int type=kotlin.Int value=3025 + then: CONST String type=kotlin.String value="OK" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Fail: " + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY FUN name:takeString visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY @@ -96,18 +111,3 @@ FILE fqName: fileName:/noSymbolForIntRangeIterator.kt CALL 'public final fun takeString (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null s: GET_VAR 'val s: kotlin.String declared in .test.localFunc' type=kotlin.String origin=null CALL 'local final fun localFunc (): kotlin.Unit declared in .test' type=kotlin.Unit origin=null - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - CALL 'public final fun test (): kotlin.Unit declared in ' type=kotlin.Unit origin=null - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' - WHEN type=kotlin.String origin=IF - 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: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - arg1: CONST Int type=kotlin.Int value=3025 - then: CONST String type=kotlin.String value="OK" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Fail: " - CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY diff --git a/compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.ir.txt b/compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.ir.txt index 0f47849fdab..108b6fe66dc 100644 --- a/compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.ir.txt +++ b/compiler/testData/codegen/box/fir/smartCastToInvisibleClassMember.ir.txt @@ -1,11 +1,16 @@ Module: m1 FILE fqName: fileName:/info.kt + 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 () declared in .Info' type=.Info origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: 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 (): kotlin.Any? declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:info type:kotlin.Any? visibility:private [final,static]' type=kotlin.Any? origin=null CLASS CLASS name:Info modality:FINAL visibility:internal superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Info - CONSTRUCTOR visibility:public <> () returnType:.Info [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () 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 @@ -17,6 +22,10 @@ FILE fqName: fileName:/info.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Info' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:status type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Info declared in .Info.' type=.Info origin=null + CONSTRUCTOR visibility:public <> () returnType:.Info [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Info modality:FINAL visibility:internal 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 declared in kotlin.Any @@ -30,17 +39,13 @@ FILE fqName: fileName:/info.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: 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 () declared in .Info' type=.Info origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: 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 (): kotlin.Any? declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:info type:kotlin.Any? visibility:private [final,static]' type=kotlin.Any? origin=null Module: m2 FILE fqName: fileName:/box.kt + 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 ' + CALL 'public final fun getStatus (param: kotlin.Any?): kotlin.String declared in ' type=kotlin.String origin=null + param: CALL 'public final fun (): kotlin.Any? declared in ' type=kotlin.Any? origin=GET_PROPERTY FUN name:getStatus visibility:public modality:FINAL <> (param:kotlin.Any?) returnType:kotlin.String VALUE_PARAMETER name:param index:0 type:kotlin.Any? BLOCK_BODY @@ -55,8 +60,3 @@ FILE fqName: fileName:/box.kt GET_VAR 'param: kotlin.Any? declared in .getStatus' type=kotlin.Any? origin=null RETURN type=kotlin.Nothing from='public final fun getStatus (param: kotlin.Any?): kotlin.String declared in ' 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 ' - CALL 'public final fun getStatus (param: kotlin.Any?): kotlin.String declared in ' type=kotlin.String origin=null - param: CALL 'public final fun (): kotlin.Any? declared in ' type=kotlin.Any? origin=GET_PROPERTY diff --git a/compiler/testData/codegen/box/fir/starProjectionLambdaNullReturn.fir.ir.txt b/compiler/testData/codegen/box/fir/starProjectionLambdaNullReturn.fir.ir.txt index 4fbdd0005a6..4462d6c5069 100644 --- a/compiler/testData/codegen/box/fir/starProjectionLambdaNullReturn.fir.ir.txt +++ b/compiler/testData/codegen/box/fir/starProjectionLambdaNullReturn.fir.ir.txt @@ -1,23 +1,4 @@ FILE fqName: fileName:/starProjectionLambdaNullReturn.kt - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.I.I>, func:kotlin.Function0.I?>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.I.I> - VALUE_PARAMETER name:func index:0 type:kotlin.Function0.I?> - 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: 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 CLASS CLASS name:Impl modality:FINAL visibility:public superTypes:[.I.Impl>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Impl.Impl> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false @@ -25,15 +6,6 @@ FILE fqName: fileName:/starProjectionLambdaNullReturn.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Impl modality:FINAL visibility:public superTypes:[.I.Impl>]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Impl.Impl>, func:kotlin.Function0.Impl?>) returnType:kotlin.Unit - overridden: - public abstract fun foo (func: kotlin.Function0.I?>): kotlin.Unit declared in .I - $this: VALUE_PARAMETER name: type:.Impl.Impl> - VALUE_PARAMETER name:func index:0 type:kotlin.Function0.Impl?> - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .Impl? origin=INVOKE - $this: GET_VAR 'func: kotlin.Function0.Impl?> declared in .Impl.foo' type=kotlin.Function0.Impl?> origin=VARIABLE_AS_FUNCTION 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 .I @@ -47,6 +19,43 @@ FILE fqName: fileName:/starProjectionLambdaNullReturn.kt overridden: public open fun toString (): kotlin.String declared in .I $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.Impl.Impl>, func:kotlin.Function0.Impl?>) returnType:kotlin.Unit + overridden: + public abstract fun foo (func: kotlin.Function0.I?>): kotlin.Unit declared in .I + $this: VALUE_PARAMETER name: type:.Impl.Impl> + VALUE_PARAMETER name:func index:0 type:kotlin.Function0.Impl?> + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .Impl? origin=INVOKE + $this: GET_VAR 'func: kotlin.Function0.Impl?> declared in .Impl.foo' type=kotlin.Function0.Impl?> origin=VARIABLE_AS_FUNCTION + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.I.I>, func:kotlin.Function0.I?>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.I.I> + VALUE_PARAMETER name:func index:0 type:kotlin.Function0.I?> + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:foo type:.Impl [val] + CONSTRUCTOR_CALL 'public constructor () declared in .Impl' type=.Impl origin=null + : kotlin.String + CALL 'public final fun foo (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $receiver: GET_VAR 'val foo: .Impl declared in .box' type=.Impl origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" FUN name:foo visibility:public modality:FINAL <> ($receiver:.I<*>) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.I<*> BLOCK_BODY @@ -57,12 +66,3 @@ FILE fqName: fileName:/starProjectionLambdaNullReturn.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Any? declared in .foo' CONST Null type=kotlin.Nothing? value=null - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - VAR name:foo type:.Impl [val] - CONSTRUCTOR_CALL 'public constructor () declared in .Impl' type=.Impl origin=null - : kotlin.String - CALL 'public final fun foo (): kotlin.Unit declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'val foo: .Impl declared in .box' type=.Impl 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/codegen/box/fir/starProjectionLambdaNullReturn.ir.txt b/compiler/testData/codegen/box/fir/starProjectionLambdaNullReturn.ir.txt index 9c531d54ad4..a77735d8d02 100644 --- a/compiler/testData/codegen/box/fir/starProjectionLambdaNullReturn.ir.txt +++ b/compiler/testData/codegen/box/fir/starProjectionLambdaNullReturn.ir.txt @@ -1,23 +1,4 @@ FILE fqName: fileName:/starProjectionLambdaNullReturn.kt - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.I.I>, func:kotlin.Function0.I?>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.I.I> - VALUE_PARAMETER name:func index:0 type:kotlin.Function0.I?> - 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: 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 CLASS CLASS name:Impl modality:FINAL visibility:public superTypes:[.I.Impl>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Impl.Impl> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false @@ -25,15 +6,6 @@ FILE fqName: fileName:/starProjectionLambdaNullReturn.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Impl modality:FINAL visibility:public superTypes:[.I.Impl>]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Impl.Impl>, func:kotlin.Function0.Impl?>) returnType:kotlin.Unit - overridden: - public abstract fun foo (func: kotlin.Function0.I?>): kotlin.Unit declared in .I - $this: VALUE_PARAMETER name: type:.Impl.Impl> - VALUE_PARAMETER name:func index:0 type:kotlin.Function0.Impl?> - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .Impl? origin=INVOKE - $this: GET_VAR 'func: kotlin.Function0.Impl?> declared in .Impl.foo' type=kotlin.Function0.Impl?> origin=VARIABLE_AS_FUNCTION 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 .I @@ -47,6 +19,43 @@ FILE fqName: fileName:/starProjectionLambdaNullReturn.kt overridden: public open fun toString (): kotlin.String declared in .I $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.Impl.Impl>, func:kotlin.Function0.Impl?>) returnType:kotlin.Unit + overridden: + public abstract fun foo (func: kotlin.Function0.I?>): kotlin.Unit declared in .I + $this: VALUE_PARAMETER name: type:.Impl.Impl> + VALUE_PARAMETER name:func index:0 type:kotlin.Function0.Impl?> + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .Impl? origin=INVOKE + $this: GET_VAR 'func: kotlin.Function0.Impl?> declared in .Impl.foo' type=kotlin.Function0.Impl?> origin=VARIABLE_AS_FUNCTION + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.I.I>, func:kotlin.Function0.I?>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.I.I> + VALUE_PARAMETER name:func index:0 type:kotlin.Function0.I?> + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:foo type:.Impl [val] + CONSTRUCTOR_CALL 'public constructor () declared in .Impl' type=.Impl origin=null + : kotlin.String + CALL 'public final fun foo (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $receiver: GET_VAR 'val foo: .Impl declared in .box' type=.Impl origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" FUN name:foo visibility:public modality:FINAL <> ($receiver:.I<*>) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.I<*> BLOCK_BODY @@ -57,12 +66,3 @@ FILE fqName: fileName:/starProjectionLambdaNullReturn.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Nothing? declared in .foo' CONST Null type=kotlin.Nothing? value=null - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - VAR name:foo type:.Impl [val] - CONSTRUCTOR_CALL 'public constructor () declared in .Impl' type=.Impl origin=null - : kotlin.String - CALL 'public final fun foo (): kotlin.Unit declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'val foo: .Impl declared in .box' type=.Impl 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/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt index 9bc0cc6a290..2bbb5cbc9e1 100644 --- a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt @@ -1,116 +1,49 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.kt - CLASS INTERFACE name:MyCollection modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCollection.MyCollection> - TYPE_PARAMETER name:E1 index:0 variance:out superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E1 of .MyCollection - $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E1 of .MyCollection - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MC + FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .MyArrayList' type=.MyArrayList origin=null + : kotlin.String + CONSTRUCTOR visibility:public <> () returnType:.MC [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 - CLASS INTERFACE name:MyList modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyList>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList.MyList> - TYPE_PARAMETER name:E2 index:0 variance:out superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E2 of .MyList - overridden: - public abstract fun foo (): E1 of .MyCollection declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyList.MyList> - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - overridden: - public abstract bar: E1 of .MyCollection - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E2 of .MyList - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - overridden: - public abstract fun (): E1 of .MyCollection declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyList.MyList> - 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 .MyCollection - $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 .MyCollection - $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 .MyCollection - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:MyMutableCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyMutableCollection>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableCollection.MyMutableCollection> - TYPE_PARAMETER name:E3 index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyMutableCollection>) returnType:E3 of .MyMutableCollection [fake_override] - overridden: - public abstract fun foo (): E1 of .MyCollection declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyCollection.MyMutableCollection> - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract bar: E1 of .MyCollection - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyMutableCollection>) returnType:E3 of .MyMutableCollection [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): E1 of .MyCollection declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyCollection.MyMutableCollection> - 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 .MyCollection - $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 .MyCollection - $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 .MyCollection - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:MyMutableList modality:ABSTRACT visibility:public superTypes:[.MyList.MyMutableList>; .MyMutableCollection.MyMutableList>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableList.MyMutableList> - TYPE_PARAMETER name:E4 index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyList.MyMutableList>) returnType:E4 of .MyMutableList [fake_override] - overridden: - public abstract fun foo (): E2 of .MyList declared in .MyList public abstract fun foo (): E3 of .MyMutableCollection declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MyList.MyMutableList> - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract bar: E2 of .MyList - public abstract bar: E3 of .MyMutableCollection - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyList.MyMutableList>) returnType:E4 of .MyMutableList [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): E2 of .MyList declared in .MyList - public abstract fun (): E3 of .MyMutableCollection declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MyList.MyMutableList> + $this: VALUE_PARAMETER name: type:.MC + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .MC' + CALL 'public open fun foo (): E6 of .MyArrayList declared in .MyArrayList' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null + receiver: GET_VAR ': .MC declared in .MC.foo' type=.MC 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 .MyList public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyMutableCollection $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 .MyList public open fun hashCode (): kotlin.Int declared in .MyMutableCollection $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 .MyList public open fun toString (): kotlin.String declared in .MyMutableCollection $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: E3 of .MyMutableCollection + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): E3 of .MyMutableCollection declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MC + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MC' + CALL 'public open fun (): E6 of .MyArrayList declared in .MyArrayList' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null + receiver: GET_VAR ': .MC declared in .MC.' type=.MC origin=null CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyAbstractCollection>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyAbstractCollection.MyAbstractCollection> TYPE_PARAMETER name:E5 index:0 variance:out superTypes:[kotlin.Any?] reified:false @@ -118,6 +51,19 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.k BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyAbstractCollection>]' + 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 .MyCollection + $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 .MyCollection + $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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection.MyAbstractCollection>) returnType:E5 of .MyAbstractCollection overridden: public abstract fun foo (): E1 of .MyCollection declared in .MyCollection @@ -130,36 +76,9 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.k overridden: public abstract fun (): E1 of .MyCollection declared in .MyCollection $this: VALUE_PARAMETER name: type:.MyAbstractCollection.MyAbstractCollection> - 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 .MyCollection - $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 .MyCollection - $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 .MyCollection - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList.MyArrayList>; .MyAbstractCollection.MyArrayList>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyArrayList.MyArrayList> TYPE_PARAMETER name:E6 index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.MyArrayList.MyArrayList> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .MyAbstractCollection' - : E6 of .MyArrayList - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList.MyArrayList>; .MyAbstractCollection.MyArrayList>]' - FUN name:foo visibility:public modality:OPEN <> ($this:.MyArrayList.MyArrayList>) returnType:E6 of .MyArrayList - overridden: - public abstract fun foo (): E4 of .MyMutableList declared in .MyMutableList - public abstract fun foo (): E5 of .MyAbstractCollection declared in .MyAbstractCollection - $this: VALUE_PARAMETER name: type:.MyArrayList.MyArrayList> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): E6 of .MyArrayList declared in .MyArrayList' - TYPE_OP type=E6 of .MyArrayList origin=CAST typeOperand=E6 of .MyArrayList - CONST String type=kotlin.String value="O" PROPERTY name:bar visibility:public modality:OPEN [val] overridden: public abstract bar: E4 of .MyMutableList @@ -178,6 +97,11 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.k RETURN type=kotlin.Nothing from='public open fun (): E6 of .MyArrayList declared in .MyArrayList' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:E6 of .MyArrayList visibility:private [final]' type=E6 of .MyArrayList origin=null receiver: GET_VAR ': .MyArrayList.MyArrayList> declared in .MyArrayList.' type=.MyArrayList.MyArrayList> origin=null + CONSTRUCTOR visibility:public <> () returnType:.MyArrayList.MyArrayList> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .MyAbstractCollection' + : E6 of .MyArrayList + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList.MyArrayList>; .MyAbstractCollection.MyArrayList>]' 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 .MyMutableList @@ -194,51 +118,127 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.k public open fun toString (): kotlin.String declared in .MyMutableList public open fun toString (): kotlin.String declared in .MyAbstractCollection $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MC - CONSTRUCTOR visibility:public <> () returnType:.MC [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' - FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .MyArrayList' type=.MyArrayList origin=null - : kotlin.String - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + FUN name:foo visibility:public modality:OPEN <> ($this:.MyArrayList.MyArrayList>) returnType:E6 of .MyArrayList overridden: - public abstract fun foo (): E3 of .MyMutableCollection declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MC + public abstract fun foo (): E4 of .MyMutableList declared in .MyMutableList + public abstract fun foo (): E5 of .MyAbstractCollection declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList.MyArrayList> BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .MC' - CALL 'public open fun foo (): E6 of .MyArrayList declared in .MyArrayList' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null - receiver: GET_VAR ': .MC declared in .MC.foo' type=.MC origin=null - PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract bar: E3 of .MyMutableCollection - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract fun (): E3 of .MyMutableCollection declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MC - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MC' - CALL 'public open fun (): E6 of .MyArrayList declared in .MyArrayList' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null - receiver: GET_VAR ': .MC declared in .MC.' type=.MC origin=null + RETURN type=kotlin.Nothing from='public open fun foo (): E6 of .MyArrayList declared in .MyArrayList' + TYPE_OP type=E6 of .MyArrayList origin=CAST typeOperand=E6 of .MyArrayList + CONST String type=kotlin.String value="O" + CLASS INTERFACE name:MyCollection modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCollection.MyCollection> + TYPE_PARAMETER name:E1 index:0 variance:out superTypes:[kotlin.Any?] reified:false 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 .MyMutableCollection + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E1 of .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E1 of .MyCollection + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> + CLASS INTERFACE name:MyList modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyList>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList.MyList> + TYPE_PARAMETER name:E2 index:0 variance:out superTypes:[kotlin.Any?] reified:false + 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 .MyCollection + $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 .MyCollection + $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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E2 of .MyList + overridden: + public abstract fun foo (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList.MyList> + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: E1 of .MyCollection + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E2 of .MyList + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList.MyList> + CLASS INTERFACE name:MyMutableCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyMutableCollection>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableCollection.MyMutableCollection> + TYPE_PARAMETER name:E3 index:0 variance: superTypes:[kotlin.Any?] reified:false + 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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyMutableCollection>) returnType:E3 of .MyMutableCollection [fake_override] + overridden: + public abstract fun foo (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection.MyMutableCollection> + 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 .MyCollection + $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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: E1 of .MyCollection + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyMutableCollection>) returnType:E3 of .MyMutableCollection [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection.MyMutableCollection> + CLASS INTERFACE name:MyMutableList modality:ABSTRACT visibility:public superTypes:[.MyList.MyMutableList>; .MyMutableCollection.MyMutableList>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableList.MyMutableList> + TYPE_PARAMETER name:E4 index:0 variance: superTypes:[kotlin.Any?] reified:false + 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 .MyList + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyList.MyMutableList>) returnType:E4 of .MyMutableList [fake_override] + overridden: + public abstract fun foo (): E2 of .MyList declared in .MyList + public abstract fun foo (): E3 of .MyMutableCollection declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MyList.MyMutableList> + 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 .MyList public open fun hashCode (): kotlin.Int declared in .MyMutableCollection $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 .MyList public open fun toString (): kotlin.String declared in .MyMutableCollection $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: E2 of .MyList + public abstract bar: E3 of .MyMutableCollection + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyList.MyMutableList>) returnType:E4 of .MyMutableList [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): E2 of .MyList declared in .MyList + public abstract fun (): E3 of .MyMutableCollection declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MyList.MyMutableList> FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:x type:.MC [val] diff --git a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.ir.txt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.ir.txt index 41d3184f077..2bbb5cbc9e1 100644 --- a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.ir.txt +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.ir.txt @@ -1,222 +1,14 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.kt - CLASS INTERFACE name:MyCollection modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCollection.MyCollection> - TYPE_PARAMETER name:E1 index:0 variance:out superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E1 of .MyCollection - $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E1 of .MyCollection - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> - 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: 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 - CLASS INTERFACE name:MyList modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyList>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList.MyList> - TYPE_PARAMETER name:E2 index:0 variance:out superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E2 of .MyList - overridden: - public abstract fun foo (): E1 of .MyCollection declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyList.MyList> - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - overridden: - public abstract bar: E1 of .MyCollection - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E2 of .MyList - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - overridden: - public abstract fun (): E1 of .MyCollection declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyList.MyList> - 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 .MyCollection - $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 .MyCollection - $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 .MyCollection - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:MyMutableCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyMutableCollection>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableCollection.MyMutableCollection> - TYPE_PARAMETER name:E3 index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyMutableCollection>) returnType:E3 of .MyMutableCollection [fake_override] - overridden: - public abstract fun foo (): E1 of .MyCollection declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyCollection.MyMutableCollection> - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract bar: E1 of .MyCollection - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyMutableCollection>) returnType:E3 of .MyMutableCollection [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): E1 of .MyCollection declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyCollection.MyMutableCollection> - 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 .MyCollection - $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 .MyCollection - $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 .MyCollection - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:MyMutableList modality:ABSTRACT visibility:public superTypes:[.MyList.MyMutableList>; .MyMutableCollection.MyMutableList>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableList.MyMutableList> - TYPE_PARAMETER name:E4 index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyList.MyMutableList>) returnType:E4 of .MyMutableList [fake_override] - overridden: - public abstract fun foo (): E2 of .MyList declared in .MyList - public abstract fun foo (): E3 of .MyMutableCollection declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MyList.MyMutableList> - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract bar: E2 of .MyList - public abstract bar: E3 of .MyMutableCollection - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyList.MyMutableList>) returnType:E4 of .MyMutableList [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): E2 of .MyList declared in .MyList - public abstract fun (): E3 of .MyMutableCollection declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MyList.MyMutableList> - 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 .MyList - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyMutableCollection - $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 .MyList - public open fun hashCode (): kotlin.Int declared in .MyMutableCollection - $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 .MyList - public open fun toString (): kotlin.String declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyAbstractCollection>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyAbstractCollection.MyAbstractCollection> - TYPE_PARAMETER name:E5 index:0 variance:out superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:protected <> () returnType:.MyAbstractCollection.MyAbstractCollection> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyAbstractCollection>]' - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection.MyAbstractCollection>) returnType:E5 of .MyAbstractCollection - overridden: - public abstract fun foo (): E1 of .MyCollection declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyAbstractCollection.MyAbstractCollection> - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - overridden: - public abstract bar: E1 of .MyCollection - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection.MyAbstractCollection>) returnType:E5 of .MyAbstractCollection - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - overridden: - public abstract fun (): E1 of .MyCollection declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyAbstractCollection.MyAbstractCollection> - 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 .MyCollection - $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 .MyCollection - $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 .MyCollection - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList.MyArrayList>; .MyAbstractCollection.MyArrayList>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyArrayList.MyArrayList> - TYPE_PARAMETER name:E6 index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.MyArrayList.MyArrayList> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .MyAbstractCollection' - : E6 of .MyArrayList - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList.MyArrayList>; .MyAbstractCollection.MyArrayList>]' - FUN name:foo visibility:public modality:OPEN <> ($this:.MyArrayList.MyArrayList>) returnType:E6 of .MyArrayList - overridden: - public abstract fun foo (): E4 of .MyMutableList declared in .MyMutableList - public abstract fun foo (): E5 of .MyAbstractCollection declared in .MyAbstractCollection - $this: VALUE_PARAMETER name: type:.MyArrayList.MyArrayList> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): E6 of .MyArrayList declared in .MyArrayList' - TYPE_OP type=E6 of .MyArrayList origin=CAST typeOperand=E6 of .MyArrayList - CONST String type=kotlin.String value="O" - PROPERTY name:bar visibility:public modality:OPEN [val] - overridden: - public abstract bar: E4 of .MyMutableList - public abstract bar: E5 of .MyAbstractCollection - FIELD PROPERTY_BACKING_FIELD name:bar type:E6 of .MyArrayList visibility:private [final] - EXPRESSION_BODY - TYPE_OP type=E6 of .MyArrayList origin=CAST typeOperand=E6 of .MyArrayList - CONST String type=kotlin.String value="K" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.MyArrayList.MyArrayList>) returnType:E6 of .MyArrayList - correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] - overridden: - public abstract fun (): E4 of .MyMutableList declared in .MyMutableList - public abstract fun (): E5 of .MyAbstractCollection declared in .MyAbstractCollection - $this: VALUE_PARAMETER name: type:.MyArrayList.MyArrayList> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): E6 of .MyArrayList declared in .MyArrayList' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:E6 of .MyArrayList visibility:private [final]' type=E6 of .MyArrayList origin=null - receiver: GET_VAR ': .MyArrayList.MyArrayList> declared in .MyArrayList.' type=.MyArrayList.MyArrayList> 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 .MyMutableList - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyAbstractCollection - $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 .MyMutableList - public open fun hashCode (): kotlin.Int declared in .MyAbstractCollection - $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 .MyMutableList - public open fun toString (): kotlin.String declared in .MyAbstractCollection - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MC - CONSTRUCTOR visibility:public <> () returnType:.MC [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor () declared in .MyArrayList' type=.MyArrayList origin=null : kotlin.String - PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract bar: E3 of .MyMutableCollection - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract fun (): E3 of .MyMutableCollection declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MC - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MC' - CALL 'public open fun (): E6 of .MyArrayList declared in .MyArrayList' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null - receiver: GET_VAR ': .MC declared in .MC.' type=.MC origin=null + CONSTRUCTOR visibility:public <> () returnType:.MC [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String overridden: public abstract fun foo (): E3 of .MyMutableCollection declared in .MyMutableCollection @@ -239,6 +31,214 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.k overridden: public open fun toString (): kotlin.String declared in .MyMutableCollection $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: E3 of .MyMutableCollection + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): E3 of .MyMutableCollection declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MC + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MC' + CALL 'public open fun (): E6 of .MyArrayList declared in .MyArrayList' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null + receiver: GET_VAR ': .MC declared in .MC.' type=.MC origin=null + CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyAbstractCollection>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyAbstractCollection.MyAbstractCollection> + TYPE_PARAMETER name:E5 index:0 variance:out superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:protected <> () returnType:.MyAbstractCollection.MyAbstractCollection> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyAbstractCollection>]' + 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 .MyCollection + $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 .MyCollection + $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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection.MyAbstractCollection>) returnType:E5 of .MyAbstractCollection + overridden: + public abstract fun foo (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyAbstractCollection.MyAbstractCollection> + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: E1 of .MyCollection + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection.MyAbstractCollection>) returnType:E5 of .MyAbstractCollection + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyAbstractCollection.MyAbstractCollection> + CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList.MyArrayList>; .MyAbstractCollection.MyArrayList>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyArrayList.MyArrayList> + TYPE_PARAMETER name:E6 index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: E4 of .MyMutableList + public abstract bar: E5 of .MyAbstractCollection + FIELD PROPERTY_BACKING_FIELD name:bar type:E6 of .MyArrayList visibility:private [final] + EXPRESSION_BODY + TYPE_OP type=E6 of .MyArrayList origin=CAST typeOperand=E6 of .MyArrayList + CONST String type=kotlin.String value="K" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.MyArrayList.MyArrayList>) returnType:E6 of .MyArrayList + correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): E4 of .MyMutableList declared in .MyMutableList + public abstract fun (): E5 of .MyAbstractCollection declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList.MyArrayList> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): E6 of .MyArrayList declared in .MyArrayList' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:E6 of .MyArrayList visibility:private [final]' type=E6 of .MyArrayList origin=null + receiver: GET_VAR ': .MyArrayList.MyArrayList> declared in .MyArrayList.' type=.MyArrayList.MyArrayList> origin=null + CONSTRUCTOR visibility:public <> () returnType:.MyArrayList.MyArrayList> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .MyAbstractCollection' + : E6 of .MyArrayList + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList.MyArrayList>; .MyAbstractCollection.MyArrayList>]' + 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 .MyMutableList + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyAbstractCollection + $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 .MyMutableList + public open fun hashCode (): kotlin.Int declared in .MyAbstractCollection + $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 .MyMutableList + public open fun toString (): kotlin.String declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.MyArrayList.MyArrayList>) returnType:E6 of .MyArrayList + overridden: + public abstract fun foo (): E4 of .MyMutableList declared in .MyMutableList + public abstract fun foo (): E5 of .MyAbstractCollection declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList.MyArrayList> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): E6 of .MyArrayList declared in .MyArrayList' + TYPE_OP type=E6 of .MyArrayList origin=CAST typeOperand=E6 of .MyArrayList + CONST String type=kotlin.String value="O" + CLASS INTERFACE name:MyCollection modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCollection.MyCollection> + TYPE_PARAMETER name:E1 index:0 variance:out superTypes:[kotlin.Any?] reified:false + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E1 of .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E1 of .MyCollection + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> + CLASS INTERFACE name:MyList modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyList>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList.MyList> + TYPE_PARAMETER name:E2 index:0 variance:out superTypes:[kotlin.Any?] reified:false + 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 .MyCollection + $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 .MyCollection + $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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E2 of .MyList + overridden: + public abstract fun foo (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList.MyList> + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: E1 of .MyCollection + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E2 of .MyList + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList.MyList> + CLASS INTERFACE name:MyMutableCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyMutableCollection>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableCollection.MyMutableCollection> + TYPE_PARAMETER name:E3 index:0 variance: superTypes:[kotlin.Any?] reified:false + 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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyMutableCollection>) returnType:E3 of .MyMutableCollection [fake_override] + overridden: + public abstract fun foo (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection.MyMutableCollection> + 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 .MyCollection + $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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: E1 of .MyCollection + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyMutableCollection>) returnType:E3 of .MyMutableCollection [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection.MyMutableCollection> + CLASS INTERFACE name:MyMutableList modality:ABSTRACT visibility:public superTypes:[.MyList.MyMutableList>; .MyMutableCollection.MyMutableList>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableList.MyMutableList> + TYPE_PARAMETER name:E4 index:0 variance: superTypes:[kotlin.Any?] reified:false + 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 .MyList + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyList.MyMutableList>) returnType:E4 of .MyMutableList [fake_override] + overridden: + public abstract fun foo (): E2 of .MyList declared in .MyList + public abstract fun foo (): E3 of .MyMutableCollection declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MyList.MyMutableList> + 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 .MyList + public open fun hashCode (): kotlin.Int declared in .MyMutableCollection + $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 .MyList + public open fun toString (): kotlin.String declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: E2 of .MyList + public abstract bar: E3 of .MyMutableCollection + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyList.MyMutableList>) returnType:E4 of .MyMutableList [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): E2 of .MyList declared in .MyList + public abstract fun (): E3 of .MyMutableCollection declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MyList.MyMutableList> FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:x type:.MC [val] diff --git a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.fir.ir.txt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.fir.ir.txt index 079f0a6d314..bb8875a531e 100644 --- a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.fir.ir.txt +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.fir.ir.txt @@ -1,118 +1,67 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_noGenerics.kt - CLASS INTERFACE name:MyCollection modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCollection - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.MyCollection - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.MyCollection - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MC + FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .MyArrayList' type=.MyArrayList origin=null + CONSTRUCTOR visibility:public <> () returnType:.MC [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 - CLASS INTERFACE name:MyList modality:ABSTRACT visibility:public superTypes:[.MyCollection] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String - overridden: - public abstract fun foo (): kotlin.String declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyList - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - overridden: - public abstract bar: kotlin.String - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - overridden: - public abstract fun (): kotlin.String declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyList - 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 .MyCollection - $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 .MyCollection - $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 .MyCollection - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:MyMutableCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableCollection - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String [fake_override] - overridden: - public abstract fun foo (): kotlin.String declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyCollection - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract bar: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.String declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyCollection - 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 .MyCollection - $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 .MyCollection - $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 .MyCollection - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:MyMutableList modality:ABSTRACT visibility:public superTypes:[.MyList; .MyMutableCollection] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableList - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String [fake_override] - overridden: - public abstract fun foo (): kotlin.String declared in .MyList public abstract fun foo (): kotlin.String declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MyList - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract bar: kotlin.String - public abstract bar: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.String declared in .MyList - public abstract fun (): kotlin.String declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MyList + $this: VALUE_PARAMETER name: type:.MC + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .MC' + CALL 'public open fun foo (): kotlin.String declared in .MyArrayList' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null + receiver: GET_VAR ': .MC declared in .MC.foo' type=.MC 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 .MyList public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyMutableCollection $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 .MyList public open fun hashCode (): kotlin.Int declared in .MyMutableCollection $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 .MyList public open fun toString (): kotlin.String declared in .MyMutableCollection $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: kotlin.String + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.String declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MC + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MC' + CALL 'public open fun (): kotlin.String declared in .MyArrayList' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null + receiver: GET_VAR ': .MC declared in .MC.' type=.MC origin=null CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyAbstractCollection CONSTRUCTOR visibility:protected <> () returnType:.MyAbstractCollection [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection]' + 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 .MyCollection + $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 .MyCollection + $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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .MyCollection @@ -125,33 +74,8 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_noGenerics overridden: public abstract fun (): kotlin.String declared in .MyCollection $this: VALUE_PARAMETER name: type:.MyAbstractCollection - 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 .MyCollection - $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 .MyCollection - $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 .MyCollection - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList; .MyAbstractCollection] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyArrayList - CONSTRUCTOR visibility:public <> () returnType:.MyArrayList [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .MyAbstractCollection' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList; .MyAbstractCollection]' - FUN name:foo visibility:public modality:OPEN <> ($this:.MyArrayList) returnType:kotlin.String - overridden: - public abstract fun foo (): kotlin.String declared in .MyMutableList - public abstract fun foo (): kotlin.String declared in .MyAbstractCollection - $this: VALUE_PARAMETER name: type:.MyArrayList - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .MyArrayList' - CONST String type=kotlin.String value="O" PROPERTY name:bar visibility:public modality:OPEN [val] overridden: public abstract bar: kotlin.String @@ -169,6 +93,10 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_noGenerics RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MyArrayList' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .MyArrayList declared in .MyArrayList.' type=.MyArrayList origin=null + CONSTRUCTOR visibility:public <> () returnType:.MyArrayList [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .MyAbstractCollection' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList; .MyAbstractCollection]' 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 .MyMutableList @@ -185,50 +113,122 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_noGenerics public open fun toString (): kotlin.String declared in .MyMutableList public open fun toString (): kotlin.String declared in .MyAbstractCollection $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MC - CONSTRUCTOR visibility:public <> () returnType:.MC [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' - FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .MyArrayList' type=.MyArrayList origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + FUN name:foo visibility:public modality:OPEN <> ($this:.MyArrayList) returnType:kotlin.String overridden: - public abstract fun foo (): kotlin.String declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MC + public abstract fun foo (): kotlin.String declared in .MyMutableList + public abstract fun foo (): kotlin.String declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .MC' - CALL 'public open fun foo (): kotlin.String declared in .MyArrayList' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null - receiver: GET_VAR ': .MC declared in .MC.foo' type=.MC origin=null - PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract bar: kotlin.String - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.String declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MC - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MC' - CALL 'public open fun (): kotlin.String declared in .MyArrayList' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null - receiver: GET_VAR ': .MC declared in .MC.' type=.MC origin=null + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .MyArrayList' + CONST String type=kotlin.String value="O" + CLASS INTERFACE name:MyCollection modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCollection 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 .MyMutableCollection + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.MyCollection + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.MyCollection + CLASS INTERFACE name:MyList modality:ABSTRACT visibility:public superTypes:[.MyCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList + 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 .MyCollection + $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 .MyCollection + $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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: kotlin.String + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList + CLASS INTERFACE name:MyMutableCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableCollection + 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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String [fake_override] + overridden: + public abstract fun foo (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection + 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 .MyCollection + $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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection + CLASS INTERFACE name:MyMutableList modality:ABSTRACT visibility:public superTypes:[.MyList; .MyMutableCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableList + 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 .MyList + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String [fake_override] + overridden: + public abstract fun foo (): kotlin.String declared in .MyList + public abstract fun foo (): kotlin.String declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MyList + 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 .MyList public open fun hashCode (): kotlin.Int declared in .MyMutableCollection $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 .MyList public open fun toString (): kotlin.String declared in .MyMutableCollection $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: kotlin.String + public abstract bar: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.String declared in .MyList + public abstract fun (): kotlin.String declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MyList FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:x type:.MC [val] diff --git a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.ir.txt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.ir.txt index 24f3229b69c..bb8875a531e 100644 --- a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.ir.txt +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.ir.txt @@ -1,212 +1,13 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_noGenerics.kt - CLASS INTERFACE name:MyCollection modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCollection - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.MyCollection - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.MyCollection - 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: 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 - CLASS INTERFACE name:MyList modality:ABSTRACT visibility:public superTypes:[.MyCollection] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String - overridden: - public abstract fun foo (): kotlin.String declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyList - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - overridden: - public abstract bar: kotlin.String - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - overridden: - public abstract fun (): kotlin.String declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyList - 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 .MyCollection - $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 .MyCollection - $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 .MyCollection - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:MyMutableCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableCollection - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String [fake_override] - overridden: - public abstract fun foo (): kotlin.String declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyCollection - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract bar: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.String declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyCollection - 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 .MyCollection - $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 .MyCollection - $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 .MyCollection - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:MyMutableList modality:ABSTRACT visibility:public superTypes:[.MyList; .MyMutableCollection] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableList - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String [fake_override] - overridden: - public abstract fun foo (): kotlin.String declared in .MyList - public abstract fun foo (): kotlin.String declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MyList - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract bar: kotlin.String - public abstract bar: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.String declared in .MyList - public abstract fun (): kotlin.String declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MyList - 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 .MyList - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyMutableCollection - $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 .MyList - public open fun hashCode (): kotlin.Int declared in .MyMutableCollection - $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 .MyList - public open fun toString (): kotlin.String declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyAbstractCollection - CONSTRUCTOR visibility:protected <> () returnType:.MyAbstractCollection [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection]' - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection) returnType:kotlin.String - overridden: - public abstract fun foo (): kotlin.String declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyAbstractCollection - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - overridden: - public abstract bar: kotlin.String - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection) returnType:kotlin.String - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - overridden: - public abstract fun (): kotlin.String declared in .MyCollection - $this: VALUE_PARAMETER name: type:.MyAbstractCollection - 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 .MyCollection - $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 .MyCollection - $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 .MyCollection - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList; .MyAbstractCollection] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyArrayList - CONSTRUCTOR visibility:public <> () returnType:.MyArrayList [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .MyAbstractCollection' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList; .MyAbstractCollection]' - FUN name:foo visibility:public modality:OPEN <> ($this:.MyArrayList) returnType:kotlin.String - overridden: - public abstract fun foo (): kotlin.String declared in .MyMutableList - public abstract fun foo (): kotlin.String declared in .MyAbstractCollection - $this: VALUE_PARAMETER name: type:.MyArrayList - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .MyArrayList' - CONST String type=kotlin.String value="O" - PROPERTY name:bar visibility:public modality:OPEN [val] - overridden: - public abstract bar: kotlin.String - public abstract bar: kotlin.String - FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final] - EXPRESSION_BODY - CONST String type=kotlin.String value="K" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.MyArrayList) returnType:kotlin.String - correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.String declared in .MyMutableList - public abstract fun (): kotlin.String declared in .MyAbstractCollection - $this: VALUE_PARAMETER name: type:.MyArrayList - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MyArrayList' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .MyArrayList declared in .MyArrayList.' type=.MyArrayList 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 .MyMutableList - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyAbstractCollection - $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 .MyMutableList - public open fun hashCode (): kotlin.Int declared in .MyAbstractCollection - $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 .MyMutableList - public open fun toString (): kotlin.String declared in .MyAbstractCollection - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MC + FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .MyArrayList' type=.MyArrayList origin=null CONSTRUCTOR visibility:public <> () returnType:.MC [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' - FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .MyArrayList' type=.MyArrayList origin=null - PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract bar: kotlin.String - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.String declared in .MyMutableCollection - $this: VALUE_PARAMETER name: type:.MC - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MC' - CALL 'public open fun (): kotlin.String declared in .MyArrayList' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null - receiver: GET_VAR ': .MC declared in .MC.' type=.MC origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .MyMutableCollection @@ -229,6 +30,205 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_noGenerics overridden: public open fun toString (): kotlin.String declared in .MyMutableCollection $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: kotlin.String + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.String declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MC + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MC' + CALL 'public open fun (): kotlin.String declared in .MyArrayList' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null + receiver: GET_VAR ': .MC declared in .MC.' type=.MC origin=null + CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyAbstractCollection + CONSTRUCTOR visibility:protected <> () returnType:.MyAbstractCollection [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection]' + 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 .MyCollection + $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 .MyCollection + $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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyAbstractCollection + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: kotlin.String + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyAbstractCollection + CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList; .MyAbstractCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyArrayList + PROPERTY name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: kotlin.String + public abstract bar: kotlin.String + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="K" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.MyArrayList) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.String declared in .MyMutableList + public abstract fun (): kotlin.String declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MyArrayList' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .MyArrayList declared in .MyArrayList.' type=.MyArrayList origin=null + CONSTRUCTOR visibility:public <> () returnType:.MyArrayList [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .MyAbstractCollection' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList; .MyAbstractCollection]' + 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 .MyMutableList + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyAbstractCollection + $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 .MyMutableList + public open fun hashCode (): kotlin.Int declared in .MyAbstractCollection + $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 .MyMutableList + public open fun toString (): kotlin.String declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.MyArrayList) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String declared in .MyMutableList + public abstract fun foo (): kotlin.String declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .MyArrayList' + CONST String type=kotlin.String value="O" + CLASS INTERFACE name:MyCollection modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCollection + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.MyCollection + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.MyCollection + CLASS INTERFACE name:MyList modality:ABSTRACT visibility:public superTypes:[.MyCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList + 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 .MyCollection + $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 .MyCollection + $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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: kotlin.String + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList + CLASS INTERFACE name:MyMutableCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableCollection + 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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String [fake_override] + overridden: + public abstract fun foo (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection + 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 .MyCollection + $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 .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection + CLASS INTERFACE name:MyMutableList modality:ABSTRACT visibility:public superTypes:[.MyList; .MyMutableCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableList + 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 .MyList + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String [fake_override] + overridden: + public abstract fun foo (): kotlin.String declared in .MyList + public abstract fun foo (): kotlin.String declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MyList + 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 .MyList + public open fun hashCode (): kotlin.Int declared in .MyMutableCollection + $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 .MyList + public open fun toString (): kotlin.String declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: kotlin.String + public abstract bar: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.String declared in .MyList + public abstract fun (): kotlin.String declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MyList FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:x type:.MC [val] diff --git a/compiler/testData/codegen/box/javaFieldAndKotlinProperty/javaFieldAndKotlinProperty.fir.ir.txt b/compiler/testData/codegen/box/javaFieldAndKotlinProperty/javaFieldAndKotlinProperty.fir.ir.txt index 2de99b2e641..eac8f889e8c 100644 --- a/compiler/testData/codegen/box/javaFieldAndKotlinProperty/javaFieldAndKotlinProperty.fir.ir.txt +++ b/compiler/testData/codegen/box/javaFieldAndKotlinProperty/javaFieldAndKotlinProperty.fir.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/Derived.kt CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.BaseJava] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .BaseJava' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.BaseJava]' PROPERTY name:a visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private EXPRESSION_BODY @@ -24,6 +20,10 @@ FILE fqName: fileName:/Derived.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Derived declared in .Derived.' type=.Derived origin=null value: GET_VAR ': kotlin.String declared in .Derived.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .BaseJava' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.BaseJava]' 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 .BaseJava diff --git a/compiler/testData/codegen/box/javaVisibility/package/cannotAccessInterfaceMemberViaReceiver.fir.ir.txt b/compiler/testData/codegen/box/javaVisibility/package/cannotAccessInterfaceMemberViaReceiver.fir.ir.txt index 14de88f83f8..7196e76864a 100644 --- a/compiler/testData/codegen/box/javaVisibility/package/cannotAccessInterfaceMemberViaReceiver.fir.ir.txt +++ b/compiler/testData/codegen/box/javaVisibility/package/cannotAccessInterfaceMemberViaReceiver.fir.ir.txt @@ -5,11 +5,6 @@ FILE fqName: fileName:/Child.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in javapackage.PublicParentClass' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Child modality:FINAL visibility:public superTypes:[javapackage.PublicParentClass]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Child) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Child - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .Child' - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:publicStaticField type:kotlin.String visibility:public [final,static]' type=kotlin.String 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 javapackage.PublicParentClass @@ -23,6 +18,11 @@ FILE fqName: fileName:/Child.kt overridden: public open fun toString (): kotlin.String declared in javapackage.PublicParentClass $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.Child) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Child + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .Child' + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:publicStaticField type:kotlin.String visibility:public [final,static]' type=kotlin.String origin=null FILE fqName: fileName:/test.kt FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY diff --git a/compiler/testData/codegen/box/javaVisibility/package/cannotAccessInterfaceMemberViaReceiver.ir.txt b/compiler/testData/codegen/box/javaVisibility/package/cannotAccessInterfaceMemberViaReceiver.ir.txt index 14de88f83f8..7196e76864a 100644 --- a/compiler/testData/codegen/box/javaVisibility/package/cannotAccessInterfaceMemberViaReceiver.ir.txt +++ b/compiler/testData/codegen/box/javaVisibility/package/cannotAccessInterfaceMemberViaReceiver.ir.txt @@ -5,11 +5,6 @@ FILE fqName: fileName:/Child.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in javapackage.PublicParentClass' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Child modality:FINAL visibility:public superTypes:[javapackage.PublicParentClass]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Child) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Child - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .Child' - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:publicStaticField type:kotlin.String visibility:public [final,static]' type=kotlin.String 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 javapackage.PublicParentClass @@ -23,6 +18,11 @@ FILE fqName: fileName:/Child.kt overridden: public open fun toString (): kotlin.String declared in javapackage.PublicParentClass $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.Child) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Child + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .Child' + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:publicStaticField type:kotlin.String visibility:public [final,static]' type=kotlin.String origin=null FILE fqName: fileName:/test.kt FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY diff --git a/compiler/testData/codegen/box/multiplatform/k2/internalOverride2.fir.ir.txt b/compiler/testData/codegen/box/multiplatform/k2/internalOverride2.fir.ir.txt index 8486a1dcf9a..87ade09145a 100644 --- a/compiler/testData/codegen/box/multiplatform/k2/internalOverride2.fir.ir.txt +++ b/compiler/testData/codegen/box/multiplatform/k2/internalOverride2.fir.ir.txt @@ -5,6 +5,19 @@ FILE fqName: fileName:/common.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public 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 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:foo1 visibility:internal modality:OPEN <> ($this:.A) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.A BLOCK_BODY @@ -20,32 +33,17 @@ FILE fqName: fileName:/common.kt BLOCK_BODY RETURN type=kotlin.Nothing from='internal open fun foo3 (): kotlin.String declared in .A' CONST String type=kotlin.String value="A::foo3" - 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: 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 CLASS CLASS name:C modality:OPEN visibility:public superTypes:[.B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .B' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public superTypes:[.B]' - FUN name:foo1 visibility:internal modality:OPEN <> ($this:.C) returnType:kotlin.String + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: - internal open fun foo1 (): kotlin.String declared in .B - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='internal open fun foo1 (): kotlin.String declared in .C' - CONST String type=kotlin.String value="C::foo1" + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? FUN FAKE_OVERRIDE name:foo2 visibility:internal modality:OPEN <> ($this:.B) returnType:kotlin.String [fake_override] overridden: internal open fun foo2 (): kotlin.String declared in .B @@ -54,11 +52,6 @@ FILE fqName: fileName:/common.kt overridden: internal open fun foo3 (): kotlin.String declared in .B $this: VALUE_PARAMETER name: type:.A - 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 .B - $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 .B @@ -67,6 +60,13 @@ FILE fqName: fileName:/common.kt overridden: public open fun toString (): kotlin.String declared in .B $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo1 visibility:internal modality:OPEN <> ($this:.C) returnType:kotlin.String + overridden: + internal open fun foo1 (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='internal open fun foo1 (): kotlin.String declared in .C' + CONST String type=kotlin.String value="C::foo1" FILE fqName: fileName:/main.kt CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B @@ -74,6 +74,23 @@ FILE fqName: fileName:/main.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A]' + 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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo3 visibility:internal modality:OPEN <> ($this:.A) returnType:kotlin.String [fake_override] + overridden: + internal open fun foo3 (): kotlin.String declared in .A + $this: VALUE_PARAMETER name: type:.A + 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 .A + $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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:foo1 visibility:internal modality:OPEN <> ($this:.B) returnType:kotlin.String overridden: internal open fun foo1 (): kotlin.String declared in .A @@ -88,23 +105,6 @@ FILE fqName: fileName:/main.kt BLOCK_BODY RETURN type=kotlin.Nothing from='internal open fun foo2 (): kotlin.String declared in .B' CONST String type=kotlin.String value="B::foo2" - FUN FAKE_OVERRIDE name:foo3 visibility:internal modality:OPEN <> ($this:.A) returnType:kotlin.String [fake_override] - overridden: - internal open fun foo3 (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:.A - 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 .A - $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 .A - $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 .A - $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:a type:.A [val] diff --git a/compiler/testData/codegen/box/primitiveTypes/reassignDestructured.fir.ir.txt b/compiler/testData/codegen/box/primitiveTypes/reassignDestructured.fir.ir.txt index 6b26b2e3ff6..7f591f0a86e 100644 --- a/compiler/testData/codegen/box/primitiveTypes/reassignDestructured.fir.ir.txt +++ b/compiler/testData/codegen/box/primitiveTypes/reassignDestructured.fir.ir.txt @@ -1,4 +1,10 @@ FILE fqName: fileName:/reassignDestructured.kt + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + CALL 'public final fun test1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun test2 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" FUN name:getInt visibility:public modality:FINAL <> () returnType:kotlin.Int? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun getInt (): kotlin.Int? declared in ' @@ -58,9 +64,3 @@ FILE fqName: fileName:/reassignDestructured.kt $this: GET_VAR 'val tmp_1: kotlin.Pair declared in .test2' type=kotlin.Pair origin=null SET_VAR 'var int1: kotlin.Int? declared in .test2' type=kotlin.Unit origin=EQ CONST Null type=kotlin.Nothing? value=null - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - CALL 'public final fun test1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null - CALL 'public final fun test2 (): kotlin.Unit declared in ' type=kotlin.Unit 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/codegen/box/smartCasts/kt44814.fir.ir.txt b/compiler/testData/codegen/box/smartCasts/kt44814.fir.ir.txt index 886a377291f..46a56111455 100644 --- a/compiler/testData/codegen/box/smartCasts/kt44814.fir.ir.txt +++ b/compiler/testData/codegen/box/smartCasts/kt44814.fir.ir.txt @@ -1,10 +1,10 @@ FILE fqName: fileName:/kt44814.kt - CLASS CLASS name:FlyweightCapableTreeStructure modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FlyweightCapableTreeStructure - CONSTRUCTOR visibility:public <> () returnType:.FlyweightCapableTreeStructure [primary] + CLASS CLASS name:ASTNode modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ASTNode + CONSTRUCTOR visibility:public <> () returnType:.ASTNode [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FlyweightCapableTreeStructure modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ASTNode modality:FINAL visibility:public 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 declared in kotlin.Any @@ -18,107 +18,8 @@ FILE fqName: fileName:/kt44814.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:FirSourceElement modality:SEALED visibility:public superTypes:[kotlin.Any] - sealedSubclasses: - CLASS CLASS name:FirLightSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] - CLASS CLASS name:FirPsiSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirSourceElement - CONSTRUCTOR visibility:protected <> () returnType:.FirSourceElement [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirSourceElement modality:SEALED visibility:public superTypes:[kotlin.Any]' - PROPERTY name:lighterASTNode visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirSourceElement) returnType:.LighterASTNode - correspondingProperty: PROPERTY name:lighterASTNode visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.FirSourceElement - PROPERTY name:treeStructure visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirSourceElement) returnType:.FlyweightCapableTreeStructure - correspondingProperty: PROPERTY name:treeStructure visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.FirSourceElement - 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: 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 - CLASS CLASS name:FirPsiSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirPsiSourceElement - CONSTRUCTOR visibility:public <> (psi:.PsiElement, lighterASTNode:.LighterASTNode, treeStructure:.FlyweightCapableTreeStructure) returnType:.FirPsiSourceElement [primary] - VALUE_PARAMETER name:psi index:0 type:.PsiElement - VALUE_PARAMETER name:lighterASTNode index:1 type:.LighterASTNode - VALUE_PARAMETER name:treeStructure index:2 type:.FlyweightCapableTreeStructure - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirSourceElement' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirPsiSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement]' - PROPERTY name:psi visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:psi type:.PsiElement visibility:private [final] - EXPRESSION_BODY - GET_VAR 'psi: .PsiElement declared in .FirPsiSourceElement.' type=.PsiElement origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirPsiSourceElement) returnType:.PsiElement - correspondingProperty: PROPERTY name:psi visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.FirPsiSourceElement - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .PsiElement declared in .FirPsiSourceElement' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:psi type:.PsiElement visibility:private [final]' type=.PsiElement origin=null - receiver: GET_VAR ': .FirPsiSourceElement declared in .FirPsiSourceElement.' type=.FirPsiSourceElement origin=null - PROPERTY name:lighterASTNode visibility:public modality:OPEN [val] - overridden: - public abstract lighterASTNode: .LighterASTNode - FIELD PROPERTY_BACKING_FIELD name:lighterASTNode type:.LighterASTNode visibility:private [final] - EXPRESSION_BODY - GET_VAR 'lighterASTNode: .LighterASTNode declared in .FirPsiSourceElement.' type=.LighterASTNode origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.FirPsiSourceElement) returnType:.LighterASTNode - correspondingProperty: PROPERTY name:lighterASTNode visibility:public modality:OPEN [val] - overridden: - public abstract fun (): .LighterASTNode declared in .FirSourceElement - $this: VALUE_PARAMETER name: type:.FirPsiSourceElement - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): .LighterASTNode declared in .FirPsiSourceElement' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:lighterASTNode type:.LighterASTNode visibility:private [final]' type=.LighterASTNode origin=null - receiver: GET_VAR ': .FirPsiSourceElement declared in .FirPsiSourceElement.' type=.FirPsiSourceElement origin=null - PROPERTY name:treeStructure visibility:public modality:OPEN [val] - overridden: - public abstract treeStructure: .FlyweightCapableTreeStructure - FIELD PROPERTY_BACKING_FIELD name:treeStructure type:.FlyweightCapableTreeStructure visibility:private [final] - EXPRESSION_BODY - GET_VAR 'treeStructure: .FlyweightCapableTreeStructure declared in .FirPsiSourceElement.' type=.FlyweightCapableTreeStructure origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.FirPsiSourceElement) returnType:.FlyweightCapableTreeStructure - correspondingProperty: PROPERTY name:treeStructure visibility:public modality:OPEN [val] - overridden: - public abstract fun (): .FlyweightCapableTreeStructure declared in .FirSourceElement - $this: VALUE_PARAMETER name: type:.FirPsiSourceElement - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): .FlyweightCapableTreeStructure declared in .FirPsiSourceElement' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:treeStructure type:.FlyweightCapableTreeStructure visibility:private [final]' type=.FlyweightCapableTreeStructure origin=null - receiver: GET_VAR ': .FirPsiSourceElement declared in .FirPsiSourceElement.' type=.FirPsiSourceElement 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 .FirSourceElement - $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 .FirSourceElement - $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 .FirSourceElement - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:FirLightSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirLightSourceElement - CONSTRUCTOR visibility:public <> (lighterASTNode:.LighterASTNode, treeStructure:.FlyweightCapableTreeStructure) returnType:.FirLightSourceElement [primary] - VALUE_PARAMETER name:lighterASTNode index:0 type:.LighterASTNode - VALUE_PARAMETER name:treeStructure index:1 type:.FlyweightCapableTreeStructure - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirSourceElement' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirLightSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement]' PROPERTY name:lighterASTNode visibility:public modality:OPEN [val] overridden: public abstract lighterASTNode: .LighterASTNode @@ -149,6 +50,12 @@ FILE fqName: fileName:/kt44814.kt RETURN type=kotlin.Nothing from='public open fun (): .FlyweightCapableTreeStructure declared in .FirLightSourceElement' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:treeStructure type:.FlyweightCapableTreeStructure visibility:private [final]' type=.FlyweightCapableTreeStructure origin=null receiver: GET_VAR ': .FirLightSourceElement declared in .FirLightSourceElement.' type=.FirLightSourceElement origin=null + CONSTRUCTOR visibility:public <> (lighterASTNode:.LighterASTNode, treeStructure:.FlyweightCapableTreeStructure) returnType:.FirLightSourceElement [primary] + VALUE_PARAMETER name:lighterASTNode index:0 type:.LighterASTNode + VALUE_PARAMETER name:treeStructure index:1 type:.FlyweightCapableTreeStructure + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirSourceElement' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirLightSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement]' 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 .FirSourceElement @@ -162,226 +69,12 @@ FILE fqName: fileName:/kt44814.kt overridden: public open fun toString (): kotlin.String declared in .FirSourceElement $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:PsiElement modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PsiElement - CONSTRUCTOR visibility:public <> () returnType:.PsiElement [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PsiElement modality:OPEN visibility:public 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 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 - CLASS CLASS name:ASTNode modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ASTNode - CONSTRUCTOR visibility:public <> () returnType:.ASTNode [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ASTNode modality:FINAL visibility:public 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 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 - CLASS CLASS name:LighterASTNode modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.LighterASTNode - CONSTRUCTOR visibility:public <> (_children:kotlin.collections.List<.LighterASTNode?>) returnType:.LighterASTNode [primary] - VALUE_PARAMETER name:_children index:0 type:kotlin.collections.List<.LighterASTNode?> - EXPRESSION_BODY - CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.LighterASTNode?> origin=null - : .LighterASTNode? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LighterASTNode modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:_children visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:_children type:kotlin.collections.List<.LighterASTNode?> visibility:private [final] - EXPRESSION_BODY - GET_VAR '_children: kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode.' type=kotlin.collections.List<.LighterASTNode?> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.LighterASTNode) returnType:kotlin.collections.List<.LighterASTNode?> - correspondingProperty: PROPERTY name:_children visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.LighterASTNode - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:_children type:kotlin.collections.List<.LighterASTNode?> visibility:private [final]' type=kotlin.collections.List<.LighterASTNode?> origin=null - receiver: GET_VAR ': .LighterASTNode declared in .LighterASTNode.' type=.LighterASTNode origin=null - FUN name:getChildren visibility:public modality:FINAL <> ($this:.LighterASTNode, treeStructure:.FlyweightCapableTreeStructure) returnType:kotlin.collections.List<.LighterASTNode?> - $this: VALUE_PARAMETER name: type:.LighterASTNode - VALUE_PARAMETER name:treeStructure index:0 type:.FlyweightCapableTreeStructure - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getChildren (treeStructure: .FlyweightCapableTreeStructure): kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode' - CALL 'public final fun (): kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode' type=kotlin.collections.List<.LighterASTNode?> origin=GET_PROPERTY - $this: GET_VAR ': .LighterASTNode declared in .LighterASTNode.getChildren' type=.LighterASTNode origin=null - PROPERTY name:tokenType visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:tokenType type:.TokenType visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun (): .TokenType declared in .TokenType.Companion' type=.TokenType origin=GET_PROPERTY - $this: GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.TokenType.Companion - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.LighterASTNode) returnType:.TokenType - correspondingProperty: PROPERTY name:tokenType visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.LighterASTNode - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .TokenType declared in .LighterASTNode' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:tokenType type:.TokenType visibility:private [final]' type=.TokenType origin=null - receiver: GET_VAR ': .LighterASTNode declared in .LighterASTNode.' type=.LighterASTNode 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: 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 - CLASS CLASS name:TokenType modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TokenType - CONSTRUCTOR visibility:public <> () returnType:.TokenType [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TokenType modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TokenType.Companion - CONSTRUCTOR visibility:private <> () returnType:.TokenType.Companion [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' - PROPERTY name:MODIFIER_LIST visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:MODIFIER_LIST type:.TokenType visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .TokenType' type=.TokenType origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TokenType.Companion) returnType:.TokenType - correspondingProperty: PROPERTY name:MODIFIER_LIST visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.TokenType.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .TokenType declared in .TokenType.Companion' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:MODIFIER_LIST type:.TokenType visibility:private [final]' type=.TokenType origin=null - receiver: GET_VAR ': .TokenType.Companion declared in .TokenType.Companion.' type=.TokenType.Companion 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: 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 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: 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 - CLASS CLASS name:KtModifierKeywordToken modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KtModifierKeywordToken - CONSTRUCTOR visibility:public <> () returnType:.KtModifierKeywordToken [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KtModifierKeywordToken modality:FINAL visibility:public 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 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 - CLASS CLASS name:KtModifierList modality:FINAL visibility:public superTypes:[.PsiElement] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KtModifierList - CONSTRUCTOR visibility:public <> () returnType:.KtModifierList [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .PsiElement' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KtModifierList modality:FINAL visibility:public superTypes:[.PsiElement]' - 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 .PsiElement - $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 .PsiElement - $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 .PsiElement - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:KtModifierListOwner modality:FINAL visibility:public superTypes:[.PsiElement] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KtModifierListOwner - CONSTRUCTOR visibility:public <> () returnType:.KtModifierListOwner [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .PsiElement' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KtModifierListOwner modality:FINAL visibility:public superTypes:[.PsiElement]' - PROPERTY name:modifierList visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .KtModifierList' type=.KtModifierList origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.KtModifierListOwner) returnType:.KtModifierList - correspondingProperty: PROPERTY name:modifierList visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.KtModifierListOwner - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .KtModifierList declared in .KtModifierListOwner' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final]' type=.KtModifierList origin=null - receiver: GET_VAR ': .KtModifierListOwner declared in .KtModifierListOwner.' type=.KtModifierListOwner 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 .PsiElement - $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 .PsiElement - $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 .PsiElement - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:FirModifier modality:SEALED visibility:internal superTypes:[kotlin.Any] sealedSubclasses: CLASS CLASS name:FirLightModifier modality:FINAL visibility:public superTypes:[.FirModifier<.LighterASTNode>] CLASS CLASS name:FirPsiModifier modality:FINAL visibility:public superTypes:[.FirModifier<.ASTNode>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifier.FirModifier> TYPE_PARAMETER name:Node index:0 variance: superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:protected <> (node:Node of .FirModifier, token:.KtModifierKeywordToken) returnType:.FirModifier.FirModifier> [primary] - VALUE_PARAMETER name:node index:0 type:Node of .FirModifier - VALUE_PARAMETER name:token index:1 type:.KtModifierKeywordToken - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirModifier modality:SEALED visibility:internal superTypes:[kotlin.Any]' PROPERTY name:node visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:node type:Node of .FirModifier visibility:private [final] EXPRESSION_BODY @@ -404,33 +97,29 @@ FILE fqName: fileName:/kt44814.kt RETURN type=kotlin.Nothing from='public final fun (): .KtModifierKeywordToken declared in .FirModifier' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:token type:.KtModifierKeywordToken visibility:private [final]' type=.KtModifierKeywordToken origin=null receiver: GET_VAR ': .FirModifier.FirModifier> declared in .FirModifier.' type=.FirModifier.FirModifier> origin=null - CLASS CLASS name:FirPsiModifier modality:FINAL visibility:public superTypes:[.FirModifier<.ASTNode>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifier.FirPsiModifier - CONSTRUCTOR visibility:public <> (node:.ASTNode, token:.KtModifierKeywordToken) returnType:.FirModifier.FirPsiModifier [primary] - VALUE_PARAMETER name:node index:0 type:.ASTNode + CLASS CLASS name:FirLightModifier modality:FINAL visibility:public superTypes:[.FirModifier<.LighterASTNode>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifier.FirLightModifier + PROPERTY name:tree visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:tree type:.FlyweightCapableTreeStructure visibility:private [final] + EXPRESSION_BODY + GET_VAR 'tree: .FlyweightCapableTreeStructure declared in .FirModifier.FirLightModifier.' type=.FlyweightCapableTreeStructure origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirModifier.FirLightModifier) returnType:.FlyweightCapableTreeStructure + correspondingProperty: PROPERTY name:tree visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.FirModifier.FirLightModifier + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .FlyweightCapableTreeStructure declared in .FirModifier.FirLightModifier' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:tree type:.FlyweightCapableTreeStructure visibility:private [final]' type=.FlyweightCapableTreeStructure origin=null + receiver: GET_VAR ': .FirModifier.FirLightModifier declared in .FirModifier.FirLightModifier.' type=.FirModifier.FirLightModifier origin=null + CONSTRUCTOR visibility:public <> (node:.LighterASTNode, token:.KtModifierKeywordToken, tree:.FlyweightCapableTreeStructure) returnType:.FirModifier.FirLightModifier [primary] + VALUE_PARAMETER name:node index:0 type:.LighterASTNode VALUE_PARAMETER name:token index:1 type:.KtModifierKeywordToken + VALUE_PARAMETER name:tree index:2 type:.FlyweightCapableTreeStructure BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'protected constructor (node: Node of .FirModifier, token: .KtModifierKeywordToken) declared in .FirModifier' - : .ASTNode - node: GET_VAR 'node: .ASTNode declared in .FirModifier.FirPsiModifier.' type=.ASTNode origin=null - token: GET_VAR 'token: .KtModifierKeywordToken declared in .FirModifier.FirPsiModifier.' type=.KtModifierKeywordToken origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirPsiModifier modality:FINAL visibility:public superTypes:[.FirModifier<.ASTNode>]' - PROPERTY FAKE_OVERRIDE name:node visibility:public modality:FINAL [fake_override,val] - overridden: - public final node: Node of .FirModifier - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifier<.ASTNode>) returnType:.ASTNode [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:node visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): Node of .FirModifier declared in .FirModifier - $this: VALUE_PARAMETER name: type:.FirModifier<.ASTNode> - PROPERTY FAKE_OVERRIDE name:token visibility:public modality:FINAL [fake_override,val] - overridden: - public final token: .KtModifierKeywordToken - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifier<.ASTNode>) returnType:.KtModifierKeywordToken [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:token visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): .KtModifierKeywordToken declared in .FirModifier - $this: VALUE_PARAMETER name: type:.FirModifier<.ASTNode> + : .LighterASTNode + node: GET_VAR 'node: .LighterASTNode declared in .FirModifier.FirLightModifier.' type=.LighterASTNode origin=null + token: GET_VAR 'token: .KtModifierKeywordToken declared in .FirModifier.FirLightModifier.' type=.KtModifierKeywordToken origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirLightModifier modality:FINAL visibility:public superTypes:[.FirModifier<.LighterASTNode>]' 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 .FirModifier @@ -444,29 +133,6 @@ FILE fqName: fileName:/kt44814.kt overridden: public open fun toString (): kotlin.String declared in .FirModifier $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:FirLightModifier modality:FINAL visibility:public superTypes:[.FirModifier<.LighterASTNode>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifier.FirLightModifier - CONSTRUCTOR visibility:public <> (node:.LighterASTNode, token:.KtModifierKeywordToken, tree:.FlyweightCapableTreeStructure) returnType:.FirModifier.FirLightModifier [primary] - VALUE_PARAMETER name:node index:0 type:.LighterASTNode - VALUE_PARAMETER name:token index:1 type:.KtModifierKeywordToken - VALUE_PARAMETER name:tree index:2 type:.FlyweightCapableTreeStructure - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor (node: Node of .FirModifier, token: .KtModifierKeywordToken) declared in .FirModifier' - : .LighterASTNode - node: GET_VAR 'node: .LighterASTNode declared in .FirModifier.FirLightModifier.' type=.LighterASTNode origin=null - token: GET_VAR 'token: .KtModifierKeywordToken declared in .FirModifier.FirLightModifier.' type=.KtModifierKeywordToken origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirLightModifier modality:FINAL visibility:public superTypes:[.FirModifier<.LighterASTNode>]' - PROPERTY name:tree visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:tree type:.FlyweightCapableTreeStructure visibility:private [final] - EXPRESSION_BODY - GET_VAR 'tree: .FlyweightCapableTreeStructure declared in .FirModifier.FirLightModifier.' type=.FlyweightCapableTreeStructure origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirModifier.FirLightModifier) returnType:.FlyweightCapableTreeStructure - correspondingProperty: PROPERTY name:tree visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.FirModifier.FirLightModifier - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .FlyweightCapableTreeStructure declared in .FirModifier.FirLightModifier' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:tree type:.FlyweightCapableTreeStructure visibility:private [final]' type=.FlyweightCapableTreeStructure origin=null - receiver: GET_VAR ': .FirModifier.FirLightModifier declared in .FirModifier.FirLightModifier.' type=.FirModifier.FirLightModifier origin=null PROPERTY FAKE_OVERRIDE name:node visibility:public modality:FINAL [fake_override,val] overridden: public final node: Node of .FirModifier @@ -483,6 +149,17 @@ FILE fqName: fileName:/kt44814.kt overridden: public final fun (): .KtModifierKeywordToken declared in .FirModifier $this: VALUE_PARAMETER name: type:.FirModifier<.LighterASTNode> + CLASS CLASS name:FirPsiModifier modality:FINAL visibility:public superTypes:[.FirModifier<.ASTNode>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifier.FirPsiModifier + CONSTRUCTOR visibility:public <> (node:.ASTNode, token:.KtModifierKeywordToken) returnType:.FirModifier.FirPsiModifier [primary] + VALUE_PARAMETER name:node index:0 type:.ASTNode + VALUE_PARAMETER name:token index:1 type:.KtModifierKeywordToken + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor (node: Node of .FirModifier, token: .KtModifierKeywordToken) declared in .FirModifier' + : .ASTNode + node: GET_VAR 'node: .ASTNode declared in .FirModifier.FirPsiModifier.' type=.ASTNode origin=null + token: GET_VAR 'token: .KtModifierKeywordToken declared in .FirModifier.FirPsiModifier.' type=.KtModifierKeywordToken origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirPsiModifier modality:FINAL visibility:public superTypes:[.FirModifier<.ASTNode>]' 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 .FirModifier @@ -496,6 +173,28 @@ FILE fqName: fileName:/kt44814.kt overridden: public open fun toString (): kotlin.String declared in .FirModifier $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:node visibility:public modality:FINAL [fake_override,val] + overridden: + public final node: Node of .FirModifier + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifier<.ASTNode>) returnType:.ASTNode [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:node visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): Node of .FirModifier declared in .FirModifier + $this: VALUE_PARAMETER name: type:.FirModifier<.ASTNode> + PROPERTY FAKE_OVERRIDE name:token visibility:public modality:FINAL [fake_override,val] + overridden: + public final token: .KtModifierKeywordToken + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifier<.ASTNode>) returnType:.KtModifierKeywordToken [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:token visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): .KtModifierKeywordToken declared in .FirModifier + $this: VALUE_PARAMETER name: type:.FirModifier<.ASTNode> + CONSTRUCTOR visibility:protected <> (node:Node of .FirModifier, token:.KtModifierKeywordToken) returnType:.FirModifier.FirModifier> [primary] + VALUE_PARAMETER name:node index:0 type:Node of .FirModifier + VALUE_PARAMETER name:token index:1 type:.KtModifierKeywordToken + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirModifier modality:SEALED visibility:internal 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 declared in kotlin.Any @@ -514,10 +213,6 @@ FILE fqName: fileName:/kt44814.kt CLASS CLASS name:FirLightModifierList modality:FINAL visibility:public superTypes:[.FirModifierList] CLASS CLASS name:FirPsiModifierList modality:FINAL visibility:public superTypes:[.FirModifierList] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifierList - CONSTRUCTOR visibility:protected <> () returnType:.FirModifierList [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirModifierList modality:SEALED visibility:internal superTypes:[kotlin.Any]' PROPERTY name:modifiers visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:modifiers type:kotlin.collections.List<.FirModifier<*>> visibility:private [final] EXPRESSION_BODY @@ -530,53 +225,8 @@ FILE fqName: fileName:/kt44814.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.List<.FirModifier<*>> declared in .FirModifierList' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:modifiers type:kotlin.collections.List<.FirModifier<*>> visibility:private [final]' type=kotlin.collections.List<.FirModifier<*>> origin=null receiver: GET_VAR ': .FirModifierList declared in .FirModifierList.' type=.FirModifierList origin=null - CLASS CLASS name:FirPsiModifierList modality:FINAL visibility:public superTypes:[.FirModifierList] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifierList.FirPsiModifierList - CONSTRUCTOR visibility:public <> (modifierList:.KtModifierList) returnType:.FirModifierList.FirPsiModifierList [primary] - VALUE_PARAMETER name:modifierList index:0 type:.KtModifierList - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirModifierList' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirPsiModifierList modality:FINAL visibility:public superTypes:[.FirModifierList]' - PROPERTY name:modifierList visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final] - EXPRESSION_BODY - GET_VAR 'modifierList: .KtModifierList declared in .FirModifierList.FirPsiModifierList.' type=.KtModifierList origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirModifierList.FirPsiModifierList) returnType:.KtModifierList - correspondingProperty: PROPERTY name:modifierList visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.FirModifierList.FirPsiModifierList - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .KtModifierList declared in .FirModifierList.FirPsiModifierList' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final]' type=.KtModifierList origin=null - receiver: GET_VAR ': .FirModifierList.FirPsiModifierList declared in .FirModifierList.FirPsiModifierList.' type=.FirModifierList.FirPsiModifierList origin=null - PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] - overridden: - public final modifiers: kotlin.collections.List<.FirModifier<*>> - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifierList) returnType:kotlin.collections.List<.FirModifier<*>> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.collections.List<.FirModifier<*>> declared in .FirModifierList - $this: VALUE_PARAMETER name: type:.FirModifierList - 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 .FirModifierList - $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 .FirModifierList - $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 .FirModifierList - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:FirLightModifierList modality:FINAL visibility:public superTypes:[.FirModifierList] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifierList.FirLightModifierList - CONSTRUCTOR visibility:public <> (modifierList:.LighterASTNode, tree:.FlyweightCapableTreeStructure) returnType:.FirModifierList.FirLightModifierList [primary] - VALUE_PARAMETER name:modifierList index:0 type:.LighterASTNode - VALUE_PARAMETER name:tree index:1 type:.FlyweightCapableTreeStructure - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirModifierList' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirLightModifierList modality:FINAL visibility:public superTypes:[.FirModifierList]' PROPERTY name:modifierList visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:modifierList type:.LighterASTNode visibility:private [final] EXPRESSION_BODY @@ -599,14 +249,12 @@ FILE fqName: fileName:/kt44814.kt RETURN type=kotlin.Nothing from='public final fun (): .FlyweightCapableTreeStructure declared in .FirModifierList.FirLightModifierList' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:tree type:.FlyweightCapableTreeStructure visibility:private [final]' type=.FlyweightCapableTreeStructure origin=null receiver: GET_VAR ': .FirModifierList.FirLightModifierList declared in .FirModifierList.FirLightModifierList.' type=.FirModifierList.FirLightModifierList origin=null - PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] - overridden: - public final modifiers: kotlin.collections.List<.FirModifier<*>> - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifierList) returnType:kotlin.collections.List<.FirModifier<*>> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.collections.List<.FirModifier<*>> declared in .FirModifierList - $this: VALUE_PARAMETER name: type:.FirModifierList + CONSTRUCTOR visibility:public <> (modifierList:.LighterASTNode, tree:.FlyweightCapableTreeStructure) returnType:.FirModifierList.FirLightModifierList [primary] + VALUE_PARAMETER name:modifierList index:0 type:.LighterASTNode + VALUE_PARAMETER name:tree index:1 type:.FlyweightCapableTreeStructure + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirModifierList' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirLightModifierList modality:FINAL visibility:public superTypes:[.FirModifierList]' 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 .FirModifierList @@ -620,12 +268,95 @@ FILE fqName: fileName:/kt44814.kt overridden: public open fun toString (): kotlin.String declared in .FirModifierList $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] + overridden: + public final modifiers: kotlin.collections.List<.FirModifier<*>> + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifierList) returnType:kotlin.collections.List<.FirModifier<*>> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.collections.List<.FirModifier<*>> declared in .FirModifierList + $this: VALUE_PARAMETER name: type:.FirModifierList + CLASS CLASS name:FirPsiModifierList modality:FINAL visibility:public superTypes:[.FirModifierList] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifierList.FirPsiModifierList + PROPERTY name:modifierList visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final] + EXPRESSION_BODY + GET_VAR 'modifierList: .KtModifierList declared in .FirModifierList.FirPsiModifierList.' type=.KtModifierList origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirModifierList.FirPsiModifierList) returnType:.KtModifierList + correspondingProperty: PROPERTY name:modifierList visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.FirModifierList.FirPsiModifierList + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .KtModifierList declared in .FirModifierList.FirPsiModifierList' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final]' type=.KtModifierList origin=null + receiver: GET_VAR ': .FirModifierList.FirPsiModifierList declared in .FirModifierList.FirPsiModifierList.' type=.FirModifierList.FirPsiModifierList origin=null + CONSTRUCTOR visibility:public <> (modifierList:.KtModifierList) returnType:.FirModifierList.FirPsiModifierList [primary] + VALUE_PARAMETER name:modifierList index:0 type:.KtModifierList + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirModifierList' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirPsiModifierList modality:FINAL visibility:public superTypes:[.FirModifierList]' + 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 .FirModifierList + $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 .FirModifierList + $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 .FirModifierList + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] + overridden: + public final modifiers: kotlin.collections.List<.FirModifier<*>> + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifierList) returnType:kotlin.collections.List<.FirModifier<*>> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.collections.List<.FirModifier<*>> declared in .FirModifierList + $this: VALUE_PARAMETER name: type:.FirModifierList CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifierList.Companion CONSTRUCTOR visibility:private <> () returnType:.FirModifierList.Companion [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] 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 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:boxImpl visibility:public modality:FINAL <> ($this:.FirModifierList.Companion) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.FirModifierList.Companion + BLOCK_BODY + VAR name:sourceElement type:.FirSourceElement? [val] + CONSTRUCTOR_CALL 'public constructor (lighterASTNode: .LighterASTNode, treeStructure: .FlyweightCapableTreeStructure) declared in .FirLightSourceElement' type=.FirLightSourceElement origin=null + lighterASTNode: CONSTRUCTOR_CALL 'public constructor (_children: kotlin.collections.List<.LighterASTNode?>) declared in .LighterASTNode' type=.LighterASTNode origin=null + _children: CALL 'public final fun listOf (element: T of kotlin.collections.listOf): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.LighterASTNode> origin=null + : .LighterASTNode + element: CONSTRUCTOR_CALL 'public constructor (_children: kotlin.collections.List<.LighterASTNode?>) declared in .LighterASTNode' type=.LighterASTNode origin=null + treeStructure: CONSTRUCTOR_CALL 'public constructor () declared in .FlyweightCapableTreeStructure' type=.FlyweightCapableTreeStructure origin=null + VAR name:result type:.FirModifierList? [val] + CALL 'public final fun getModifierList (): .FirModifierList? declared in .FirModifierList.Companion' type=.FirModifierList? origin=null + $this: GET_VAR ': .FirModifierList.Companion declared in .FirModifierList.Companion.boxImpl' type=.FirModifierList.Companion origin=null + $receiver: GET_VAR 'val sourceElement: .FirSourceElement? declared in .FirModifierList.Companion.boxImpl' type=.FirSourceElement? origin=null + RETURN type=kotlin.Nothing from='public final fun boxImpl (): kotlin.String declared in .FirModifierList.Companion' + WHEN type=kotlin.String origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.FirModifierList.FirLightModifierList + GET_VAR 'val result: .FirModifierList? declared in .FirModifierList.Companion.boxImpl' type=.FirModifierList? origin=null + then: CONST String type=kotlin.String value="OK" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST String type=kotlin.String value="Fail" FUN name:getModifierList visibility:public modality:FINAL <> ($this:.FirModifierList.Companion, $receiver:.FirSourceElement?) returnType:.FirModifierList? $this: VALUE_PARAMETER name: type:.FirModifierList.Companion $receiver: VALUE_PARAMETER name: type:.FirSourceElement? @@ -735,29 +466,294 @@ FILE fqName: fileName:/kt44814.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null - FUN name:boxImpl visibility:public modality:FINAL <> ($this:.FirModifierList.Companion) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.FirModifierList.Companion + CONSTRUCTOR visibility:protected <> () returnType:.FirModifierList [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirModifierList modality:SEALED visibility:internal 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 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 + CLASS CLASS name:FirPsiSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirPsiSourceElement + PROPERTY name:psi visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:psi type:.PsiElement visibility:private [final] + EXPRESSION_BODY + GET_VAR 'psi: .PsiElement declared in .FirPsiSourceElement.' type=.PsiElement origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirPsiSourceElement) returnType:.PsiElement + correspondingProperty: PROPERTY name:psi visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.FirPsiSourceElement BLOCK_BODY - VAR name:sourceElement type:.FirSourceElement? [val] - CONSTRUCTOR_CALL 'public constructor (lighterASTNode: .LighterASTNode, treeStructure: .FlyweightCapableTreeStructure) declared in .FirLightSourceElement' type=.FirLightSourceElement origin=null - lighterASTNode: CONSTRUCTOR_CALL 'public constructor (_children: kotlin.collections.List<.LighterASTNode?>) declared in .LighterASTNode' type=.LighterASTNode origin=null - _children: CALL 'public final fun listOf (element: T of kotlin.collections.listOf): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.LighterASTNode> origin=null - : .LighterASTNode - element: CONSTRUCTOR_CALL 'public constructor (_children: kotlin.collections.List<.LighterASTNode?>) declared in .LighterASTNode' type=.LighterASTNode origin=null - treeStructure: CONSTRUCTOR_CALL 'public constructor () declared in .FlyweightCapableTreeStructure' type=.FlyweightCapableTreeStructure origin=null - VAR name:result type:.FirModifierList? [val] - CALL 'public final fun getModifierList (): .FirModifierList? declared in .FirModifierList.Companion' type=.FirModifierList? origin=null - $this: GET_VAR ': .FirModifierList.Companion declared in .FirModifierList.Companion.boxImpl' type=.FirModifierList.Companion origin=null - $receiver: GET_VAR 'val sourceElement: .FirSourceElement? declared in .FirModifierList.Companion.boxImpl' type=.FirSourceElement? origin=null - RETURN type=kotlin.Nothing from='public final fun boxImpl (): kotlin.String declared in .FirModifierList.Companion' - WHEN type=kotlin.String origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.FirModifierList.FirLightModifierList - GET_VAR 'val result: .FirModifierList? declared in .FirModifierList.Companion.boxImpl' type=.FirModifierList? origin=null - then: CONST String type=kotlin.String value="OK" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST String type=kotlin.String value="Fail" + RETURN type=kotlin.Nothing from='public final fun (): .PsiElement declared in .FirPsiSourceElement' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:psi type:.PsiElement visibility:private [final]' type=.PsiElement origin=null + receiver: GET_VAR ': .FirPsiSourceElement declared in .FirPsiSourceElement.' type=.FirPsiSourceElement origin=null + PROPERTY name:lighterASTNode visibility:public modality:OPEN [val] + overridden: + public abstract lighterASTNode: .LighterASTNode + FIELD PROPERTY_BACKING_FIELD name:lighterASTNode type:.LighterASTNode visibility:private [final] + EXPRESSION_BODY + GET_VAR 'lighterASTNode: .LighterASTNode declared in .FirPsiSourceElement.' type=.LighterASTNode origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.FirPsiSourceElement) returnType:.LighterASTNode + correspondingProperty: PROPERTY name:lighterASTNode visibility:public modality:OPEN [val] + overridden: + public abstract fun (): .LighterASTNode declared in .FirSourceElement + $this: VALUE_PARAMETER name: type:.FirPsiSourceElement + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): .LighterASTNode declared in .FirPsiSourceElement' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:lighterASTNode type:.LighterASTNode visibility:private [final]' type=.LighterASTNode origin=null + receiver: GET_VAR ': .FirPsiSourceElement declared in .FirPsiSourceElement.' type=.FirPsiSourceElement origin=null + PROPERTY name:treeStructure visibility:public modality:OPEN [val] + overridden: + public abstract treeStructure: .FlyweightCapableTreeStructure + FIELD PROPERTY_BACKING_FIELD name:treeStructure type:.FlyweightCapableTreeStructure visibility:private [final] + EXPRESSION_BODY + GET_VAR 'treeStructure: .FlyweightCapableTreeStructure declared in .FirPsiSourceElement.' type=.FlyweightCapableTreeStructure origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.FirPsiSourceElement) returnType:.FlyweightCapableTreeStructure + correspondingProperty: PROPERTY name:treeStructure visibility:public modality:OPEN [val] + overridden: + public abstract fun (): .FlyweightCapableTreeStructure declared in .FirSourceElement + $this: VALUE_PARAMETER name: type:.FirPsiSourceElement + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): .FlyweightCapableTreeStructure declared in .FirPsiSourceElement' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:treeStructure type:.FlyweightCapableTreeStructure visibility:private [final]' type=.FlyweightCapableTreeStructure origin=null + receiver: GET_VAR ': .FirPsiSourceElement declared in .FirPsiSourceElement.' type=.FirPsiSourceElement origin=null + CONSTRUCTOR visibility:public <> (psi:.PsiElement, lighterASTNode:.LighterASTNode, treeStructure:.FlyweightCapableTreeStructure) returnType:.FirPsiSourceElement [primary] + VALUE_PARAMETER name:psi index:0 type:.PsiElement + VALUE_PARAMETER name:lighterASTNode index:1 type:.LighterASTNode + VALUE_PARAMETER name:treeStructure index:2 type:.FlyweightCapableTreeStructure + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirSourceElement' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirPsiSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement]' + 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 .FirSourceElement + $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 .FirSourceElement + $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 .FirSourceElement + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:FirSourceElement modality:SEALED visibility:public superTypes:[kotlin.Any] + sealedSubclasses: + CLASS CLASS name:FirLightSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] + CLASS CLASS name:FirPsiSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirSourceElement + CONSTRUCTOR visibility:protected <> () returnType:.FirSourceElement [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirSourceElement modality:SEALED visibility:public 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 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 + PROPERTY name:lighterASTNode visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirSourceElement) returnType:.LighterASTNode + correspondingProperty: PROPERTY name:lighterASTNode visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.FirSourceElement + PROPERTY name:treeStructure visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirSourceElement) returnType:.FlyweightCapableTreeStructure + correspondingProperty: PROPERTY name:treeStructure visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.FirSourceElement + CLASS CLASS name:FlyweightCapableTreeStructure modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FlyweightCapableTreeStructure + CONSTRUCTOR visibility:public <> () returnType:.FlyweightCapableTreeStructure [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FlyweightCapableTreeStructure modality:FINAL visibility:public 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 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 + CLASS CLASS name:KtModifierKeywordToken modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KtModifierKeywordToken + CONSTRUCTOR visibility:public <> () returnType:.KtModifierKeywordToken [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KtModifierKeywordToken modality:FINAL visibility:public 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 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 + CLASS CLASS name:KtModifierList modality:FINAL visibility:public superTypes:[.PsiElement] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KtModifierList + CONSTRUCTOR visibility:public <> () returnType:.KtModifierList [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .PsiElement' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KtModifierList modality:FINAL visibility:public superTypes:[.PsiElement]' + 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 .PsiElement + $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 .PsiElement + $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 .PsiElement + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:KtModifierListOwner modality:FINAL visibility:public superTypes:[.PsiElement] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KtModifierListOwner + PROPERTY name:modifierList visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .KtModifierList' type=.KtModifierList origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.KtModifierListOwner) returnType:.KtModifierList + correspondingProperty: PROPERTY name:modifierList visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.KtModifierListOwner + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .KtModifierList declared in .KtModifierListOwner' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final]' type=.KtModifierList origin=null + receiver: GET_VAR ': .KtModifierListOwner declared in .KtModifierListOwner.' type=.KtModifierListOwner origin=null + CONSTRUCTOR visibility:public <> () returnType:.KtModifierListOwner [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .PsiElement' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KtModifierListOwner modality:FINAL visibility:public superTypes:[.PsiElement]' + 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 .PsiElement + $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 .PsiElement + $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 .PsiElement + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:LighterASTNode modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.LighterASTNode + PROPERTY name:_children visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:_children type:kotlin.collections.List<.LighterASTNode?> visibility:private [final] + EXPRESSION_BODY + GET_VAR '_children: kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode.' type=kotlin.collections.List<.LighterASTNode?> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.LighterASTNode) returnType:kotlin.collections.List<.LighterASTNode?> + correspondingProperty: PROPERTY name:_children visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.LighterASTNode + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:_children type:kotlin.collections.List<.LighterASTNode?> visibility:private [final]' type=kotlin.collections.List<.LighterASTNode?> origin=null + receiver: GET_VAR ': .LighterASTNode declared in .LighterASTNode.' type=.LighterASTNode origin=null + PROPERTY name:tokenType visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:tokenType type:.TokenType visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun (): .TokenType declared in .TokenType.Companion' type=.TokenType origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.TokenType.Companion + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.LighterASTNode) returnType:.TokenType + correspondingProperty: PROPERTY name:tokenType visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.LighterASTNode + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .TokenType declared in .LighterASTNode' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:tokenType type:.TokenType visibility:private [final]' type=.TokenType origin=null + receiver: GET_VAR ': .LighterASTNode declared in .LighterASTNode.' type=.LighterASTNode origin=null + CONSTRUCTOR visibility:public <> (_children:kotlin.collections.List<.LighterASTNode?>) returnType:.LighterASTNode [primary] + VALUE_PARAMETER name:_children index:0 type:kotlin.collections.List<.LighterASTNode?> + EXPRESSION_BODY + CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.LighterASTNode?> origin=null + : .LighterASTNode? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LighterASTNode modality:FINAL visibility:public 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 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:getChildren visibility:public modality:FINAL <> ($this:.LighterASTNode, treeStructure:.FlyweightCapableTreeStructure) returnType:kotlin.collections.List<.LighterASTNode?> + $this: VALUE_PARAMETER name: type:.LighterASTNode + VALUE_PARAMETER name:treeStructure index:0 type:.FlyweightCapableTreeStructure + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getChildren (treeStructure: .FlyweightCapableTreeStructure): kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode' + CALL 'public final fun (): kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode' type=kotlin.collections.List<.LighterASTNode?> origin=GET_PROPERTY + $this: GET_VAR ': .LighterASTNode declared in .LighterASTNode.getChildren' type=.LighterASTNode origin=null + CLASS CLASS name:PsiElement modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PsiElement + CONSTRUCTOR visibility:public <> () returnType:.PsiElement [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PsiElement modality:OPEN visibility:public 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 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 + CLASS CLASS name:TokenType modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TokenType + CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TokenType.Companion + PROPERTY name:MODIFIER_LIST visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:MODIFIER_LIST type:.TokenType visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .TokenType' type=.TokenType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TokenType.Companion) returnType:.TokenType + correspondingProperty: PROPERTY name:MODIFIER_LIST visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TokenType.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .TokenType declared in .TokenType.Companion' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:MODIFIER_LIST type:.TokenType visibility:private [final]' type=.TokenType origin=null + receiver: GET_VAR ': .TokenType.Companion declared in .TokenType.Companion.' type=.TokenType.Companion origin=null + CONSTRUCTOR visibility:private <> () returnType:.TokenType.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] 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 declared in kotlin.Any @@ -771,6 +767,10 @@ FILE fqName: fileName:/kt44814.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.TokenType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TokenType modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/codegen/box/smartCasts/kt44814.ir.txt b/compiler/testData/codegen/box/smartCasts/kt44814.ir.txt index 6ea3006a790..77c43591495 100644 --- a/compiler/testData/codegen/box/smartCasts/kt44814.ir.txt +++ b/compiler/testData/codegen/box/smartCasts/kt44814.ir.txt @@ -1,10 +1,10 @@ FILE fqName: fileName:/kt44814.kt - CLASS CLASS name:FlyweightCapableTreeStructure modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FlyweightCapableTreeStructure - CONSTRUCTOR visibility:public <> () returnType:.FlyweightCapableTreeStructure [primary] + CLASS CLASS name:ASTNode modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ASTNode + CONSTRUCTOR visibility:public <> () returnType:.ASTNode [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FlyweightCapableTreeStructure modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ASTNode modality:FINAL visibility:public 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 declared in kotlin.Any @@ -18,107 +18,8 @@ FILE fqName: fileName:/kt44814.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:FirSourceElement modality:SEALED visibility:public superTypes:[kotlin.Any] - sealedSubclasses: - CLASS CLASS name:FirLightSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] - CLASS CLASS name:FirPsiSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirSourceElement - CONSTRUCTOR visibility:protected <> () returnType:.FirSourceElement [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirSourceElement modality:SEALED visibility:public superTypes:[kotlin.Any]' - PROPERTY name:lighterASTNode visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirSourceElement) returnType:.LighterASTNode - correspondingProperty: PROPERTY name:lighterASTNode visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.FirSourceElement - PROPERTY name:treeStructure visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirSourceElement) returnType:.FlyweightCapableTreeStructure - correspondingProperty: PROPERTY name:treeStructure visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.FirSourceElement - 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: 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 - CLASS CLASS name:FirPsiSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirPsiSourceElement - CONSTRUCTOR visibility:public <> (psi:.PsiElement, lighterASTNode:.LighterASTNode, treeStructure:.FlyweightCapableTreeStructure) returnType:.FirPsiSourceElement [primary] - VALUE_PARAMETER name:psi index:0 type:.PsiElement - VALUE_PARAMETER name:lighterASTNode index:1 type:.LighterASTNode - VALUE_PARAMETER name:treeStructure index:2 type:.FlyweightCapableTreeStructure - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirSourceElement' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirPsiSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement]' - PROPERTY name:psi visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:psi type:.PsiElement visibility:private [final] - EXPRESSION_BODY - GET_VAR 'psi: .PsiElement declared in .FirPsiSourceElement.' type=.PsiElement origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirPsiSourceElement) returnType:.PsiElement - correspondingProperty: PROPERTY name:psi visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.FirPsiSourceElement - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .PsiElement declared in .FirPsiSourceElement' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:psi type:.PsiElement visibility:private [final]' type=.PsiElement origin=null - receiver: GET_VAR ': .FirPsiSourceElement declared in .FirPsiSourceElement.' type=.FirPsiSourceElement origin=null - PROPERTY name:lighterASTNode visibility:public modality:OPEN [val] - overridden: - public abstract lighterASTNode: .LighterASTNode - FIELD PROPERTY_BACKING_FIELD name:lighterASTNode type:.LighterASTNode visibility:private [final] - EXPRESSION_BODY - GET_VAR 'lighterASTNode: .LighterASTNode declared in .FirPsiSourceElement.' type=.LighterASTNode origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.FirPsiSourceElement) returnType:.LighterASTNode - correspondingProperty: PROPERTY name:lighterASTNode visibility:public modality:OPEN [val] - overridden: - public abstract fun (): .LighterASTNode declared in .FirSourceElement - $this: VALUE_PARAMETER name: type:.FirPsiSourceElement - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): .LighterASTNode declared in .FirPsiSourceElement' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:lighterASTNode type:.LighterASTNode visibility:private [final]' type=.LighterASTNode origin=null - receiver: GET_VAR ': .FirPsiSourceElement declared in .FirPsiSourceElement.' type=.FirPsiSourceElement origin=null - PROPERTY name:treeStructure visibility:public modality:OPEN [val] - overridden: - public abstract treeStructure: .FlyweightCapableTreeStructure - FIELD PROPERTY_BACKING_FIELD name:treeStructure type:.FlyweightCapableTreeStructure visibility:private [final] - EXPRESSION_BODY - GET_VAR 'treeStructure: .FlyweightCapableTreeStructure declared in .FirPsiSourceElement.' type=.FlyweightCapableTreeStructure origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.FirPsiSourceElement) returnType:.FlyweightCapableTreeStructure - correspondingProperty: PROPERTY name:treeStructure visibility:public modality:OPEN [val] - overridden: - public abstract fun (): .FlyweightCapableTreeStructure declared in .FirSourceElement - $this: VALUE_PARAMETER name: type:.FirPsiSourceElement - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): .FlyweightCapableTreeStructure declared in .FirPsiSourceElement' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:treeStructure type:.FlyweightCapableTreeStructure visibility:private [final]' type=.FlyweightCapableTreeStructure origin=null - receiver: GET_VAR ': .FirPsiSourceElement declared in .FirPsiSourceElement.' type=.FirPsiSourceElement 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 .FirSourceElement - $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 .FirSourceElement - $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 .FirSourceElement - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:FirLightSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirLightSourceElement - CONSTRUCTOR visibility:public <> (lighterASTNode:.LighterASTNode, treeStructure:.FlyweightCapableTreeStructure) returnType:.FirLightSourceElement [primary] - VALUE_PARAMETER name:lighterASTNode index:0 type:.LighterASTNode - VALUE_PARAMETER name:treeStructure index:1 type:.FlyweightCapableTreeStructure - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirSourceElement' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirLightSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement]' PROPERTY name:lighterASTNode visibility:public modality:OPEN [val] overridden: public abstract lighterASTNode: .LighterASTNode @@ -149,6 +50,12 @@ FILE fqName: fileName:/kt44814.kt RETURN type=kotlin.Nothing from='public open fun (): .FlyweightCapableTreeStructure declared in .FirLightSourceElement' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:treeStructure type:.FlyweightCapableTreeStructure visibility:private [final]' type=.FlyweightCapableTreeStructure origin=null receiver: GET_VAR ': .FirLightSourceElement declared in .FirLightSourceElement.' type=.FirLightSourceElement origin=null + CONSTRUCTOR visibility:public <> (lighterASTNode:.LighterASTNode, treeStructure:.FlyweightCapableTreeStructure) returnType:.FirLightSourceElement [primary] + VALUE_PARAMETER name:lighterASTNode index:0 type:.LighterASTNode + VALUE_PARAMETER name:treeStructure index:1 type:.FlyweightCapableTreeStructure + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirSourceElement' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirLightSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement]' 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 .FirSourceElement @@ -162,226 +69,12 @@ FILE fqName: fileName:/kt44814.kt overridden: public open fun toString (): kotlin.String declared in .FirSourceElement $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:PsiElement modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PsiElement - CONSTRUCTOR visibility:public <> () returnType:.PsiElement [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PsiElement modality:OPEN visibility:public 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 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 - CLASS CLASS name:ASTNode modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ASTNode - CONSTRUCTOR visibility:public <> () returnType:.ASTNode [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ASTNode modality:FINAL visibility:public 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 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 - CLASS CLASS name:LighterASTNode modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.LighterASTNode - CONSTRUCTOR visibility:public <> (_children:kotlin.collections.List<.LighterASTNode?>) returnType:.LighterASTNode [primary] - VALUE_PARAMETER name:_children index:0 type:kotlin.collections.List<.LighterASTNode?> - EXPRESSION_BODY - CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.LighterASTNode?> origin=null - : .LighterASTNode? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LighterASTNode modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:_children visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:_children type:kotlin.collections.List<.LighterASTNode?> visibility:private [final] - EXPRESSION_BODY - GET_VAR '_children: kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode.' type=kotlin.collections.List<.LighterASTNode?> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.LighterASTNode) returnType:kotlin.collections.List<.LighterASTNode?> - correspondingProperty: PROPERTY name:_children visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.LighterASTNode - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:_children type:kotlin.collections.List<.LighterASTNode?> visibility:private [final]' type=kotlin.collections.List<.LighterASTNode?> origin=null - receiver: GET_VAR ': .LighterASTNode declared in .LighterASTNode.' type=.LighterASTNode origin=null - FUN name:getChildren visibility:public modality:FINAL <> ($this:.LighterASTNode, treeStructure:.FlyweightCapableTreeStructure) returnType:kotlin.collections.List<.LighterASTNode?> - $this: VALUE_PARAMETER name: type:.LighterASTNode - VALUE_PARAMETER name:treeStructure index:0 type:.FlyweightCapableTreeStructure - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getChildren (treeStructure: .FlyweightCapableTreeStructure): kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode' - CALL 'public final fun (): kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode' type=kotlin.collections.List<.LighterASTNode?> origin=GET_PROPERTY - $this: GET_VAR ': .LighterASTNode declared in .LighterASTNode.getChildren' type=.LighterASTNode origin=null - PROPERTY name:tokenType visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:tokenType type:.TokenType visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun (): .TokenType declared in .TokenType.Companion' type=.TokenType origin=GET_PROPERTY - $this: GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.TokenType.Companion - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.LighterASTNode) returnType:.TokenType - correspondingProperty: PROPERTY name:tokenType visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.LighterASTNode - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .TokenType declared in .LighterASTNode' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:tokenType type:.TokenType visibility:private [final]' type=.TokenType origin=null - receiver: GET_VAR ': .LighterASTNode declared in .LighterASTNode.' type=.LighterASTNode 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: 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 - CLASS CLASS name:TokenType modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TokenType - CONSTRUCTOR visibility:public <> () returnType:.TokenType [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TokenType modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TokenType.Companion - CONSTRUCTOR visibility:private <> () returnType:.TokenType.Companion [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' - PROPERTY name:MODIFIER_LIST visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:MODIFIER_LIST type:.TokenType visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .TokenType' type=.TokenType origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TokenType.Companion) returnType:.TokenType - correspondingProperty: PROPERTY name:MODIFIER_LIST visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.TokenType.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .TokenType declared in .TokenType.Companion' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:MODIFIER_LIST type:.TokenType visibility:private [final]' type=.TokenType origin=null - receiver: GET_VAR ': .TokenType.Companion declared in .TokenType.Companion.' type=.TokenType.Companion 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: 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 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: 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 - CLASS CLASS name:KtModifierKeywordToken modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KtModifierKeywordToken - CONSTRUCTOR visibility:public <> () returnType:.KtModifierKeywordToken [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KtModifierKeywordToken modality:FINAL visibility:public 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 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 - CLASS CLASS name:KtModifierList modality:FINAL visibility:public superTypes:[.PsiElement] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KtModifierList - CONSTRUCTOR visibility:public <> () returnType:.KtModifierList [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .PsiElement' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KtModifierList modality:FINAL visibility:public superTypes:[.PsiElement]' - 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 .PsiElement - $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 .PsiElement - $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 .PsiElement - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:KtModifierListOwner modality:FINAL visibility:public superTypes:[.PsiElement] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KtModifierListOwner - CONSTRUCTOR visibility:public <> () returnType:.KtModifierListOwner [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .PsiElement' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KtModifierListOwner modality:FINAL visibility:public superTypes:[.PsiElement]' - PROPERTY name:modifierList visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .KtModifierList' type=.KtModifierList origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.KtModifierListOwner) returnType:.KtModifierList - correspondingProperty: PROPERTY name:modifierList visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.KtModifierListOwner - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .KtModifierList declared in .KtModifierListOwner' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final]' type=.KtModifierList origin=null - receiver: GET_VAR ': .KtModifierListOwner declared in .KtModifierListOwner.' type=.KtModifierListOwner 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 .PsiElement - $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 .PsiElement - $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 .PsiElement - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:FirModifier modality:SEALED visibility:internal superTypes:[kotlin.Any] sealedSubclasses: CLASS CLASS name:FirLightModifier modality:FINAL visibility:public superTypes:[.FirModifier<.LighterASTNode>] CLASS CLASS name:FirPsiModifier modality:FINAL visibility:public superTypes:[.FirModifier<.ASTNode>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifier.FirModifier> TYPE_PARAMETER name:Node index:0 variance: superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:protected <> (node:Node of .FirModifier, token:.KtModifierKeywordToken) returnType:.FirModifier.FirModifier> [primary] - VALUE_PARAMETER name:node index:0 type:Node of .FirModifier - VALUE_PARAMETER name:token index:1 type:.KtModifierKeywordToken - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirModifier modality:SEALED visibility:internal superTypes:[kotlin.Any]' PROPERTY name:node visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:node type:Node of .FirModifier visibility:private [final] EXPRESSION_BODY @@ -404,33 +97,29 @@ FILE fqName: fileName:/kt44814.kt RETURN type=kotlin.Nothing from='public final fun (): .KtModifierKeywordToken declared in .FirModifier' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:token type:.KtModifierKeywordToken visibility:private [final]' type=.KtModifierKeywordToken origin=null receiver: GET_VAR ': .FirModifier.FirModifier> declared in .FirModifier.' type=.FirModifier.FirModifier> origin=null - CLASS CLASS name:FirPsiModifier modality:FINAL visibility:public superTypes:[.FirModifier<.ASTNode>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifier.FirPsiModifier - CONSTRUCTOR visibility:public <> (node:.ASTNode, token:.KtModifierKeywordToken) returnType:.FirModifier.FirPsiModifier [primary] - VALUE_PARAMETER name:node index:0 type:.ASTNode + CLASS CLASS name:FirLightModifier modality:FINAL visibility:public superTypes:[.FirModifier<.LighterASTNode>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifier.FirLightModifier + PROPERTY name:tree visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:tree type:.FlyweightCapableTreeStructure visibility:private [final] + EXPRESSION_BODY + GET_VAR 'tree: .FlyweightCapableTreeStructure declared in .FirModifier.FirLightModifier.' type=.FlyweightCapableTreeStructure origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirModifier.FirLightModifier) returnType:.FlyweightCapableTreeStructure + correspondingProperty: PROPERTY name:tree visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.FirModifier.FirLightModifier + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .FlyweightCapableTreeStructure declared in .FirModifier.FirLightModifier' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:tree type:.FlyweightCapableTreeStructure visibility:private [final]' type=.FlyweightCapableTreeStructure origin=null + receiver: GET_VAR ': .FirModifier.FirLightModifier declared in .FirModifier.FirLightModifier.' type=.FirModifier.FirLightModifier origin=null + CONSTRUCTOR visibility:public <> (node:.LighterASTNode, token:.KtModifierKeywordToken, tree:.FlyweightCapableTreeStructure) returnType:.FirModifier.FirLightModifier [primary] + VALUE_PARAMETER name:node index:0 type:.LighterASTNode VALUE_PARAMETER name:token index:1 type:.KtModifierKeywordToken + VALUE_PARAMETER name:tree index:2 type:.FlyweightCapableTreeStructure BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'protected constructor (node: Node of .FirModifier, token: .KtModifierKeywordToken) declared in .FirModifier' - : .ASTNode - node: GET_VAR 'node: .ASTNode declared in .FirModifier.FirPsiModifier.' type=.ASTNode origin=null - token: GET_VAR 'token: .KtModifierKeywordToken declared in .FirModifier.FirPsiModifier.' type=.KtModifierKeywordToken origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirPsiModifier modality:FINAL visibility:public superTypes:[.FirModifier<.ASTNode>]' - PROPERTY FAKE_OVERRIDE name:node visibility:public modality:FINAL [fake_override,val] - overridden: - public final node: Node of .FirModifier - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifier<.ASTNode>) returnType:.ASTNode [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:node visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): Node of .FirModifier declared in .FirModifier - $this: VALUE_PARAMETER name: type:.FirModifier<.ASTNode> - PROPERTY FAKE_OVERRIDE name:token visibility:public modality:FINAL [fake_override,val] - overridden: - public final token: .KtModifierKeywordToken - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifier<.ASTNode>) returnType:.KtModifierKeywordToken [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:token visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): .KtModifierKeywordToken declared in .FirModifier - $this: VALUE_PARAMETER name: type:.FirModifier<.ASTNode> + : .LighterASTNode + node: GET_VAR 'node: .LighterASTNode declared in .FirModifier.FirLightModifier.' type=.LighterASTNode origin=null + token: GET_VAR 'token: .KtModifierKeywordToken declared in .FirModifier.FirLightModifier.' type=.KtModifierKeywordToken origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirLightModifier modality:FINAL visibility:public superTypes:[.FirModifier<.LighterASTNode>]' 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 .FirModifier @@ -444,29 +133,6 @@ FILE fqName: fileName:/kt44814.kt overridden: public open fun toString (): kotlin.String declared in .FirModifier $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:FirLightModifier modality:FINAL visibility:public superTypes:[.FirModifier<.LighterASTNode>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifier.FirLightModifier - CONSTRUCTOR visibility:public <> (node:.LighterASTNode, token:.KtModifierKeywordToken, tree:.FlyweightCapableTreeStructure) returnType:.FirModifier.FirLightModifier [primary] - VALUE_PARAMETER name:node index:0 type:.LighterASTNode - VALUE_PARAMETER name:token index:1 type:.KtModifierKeywordToken - VALUE_PARAMETER name:tree index:2 type:.FlyweightCapableTreeStructure - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor (node: Node of .FirModifier, token: .KtModifierKeywordToken) declared in .FirModifier' - : .LighterASTNode - node: GET_VAR 'node: .LighterASTNode declared in .FirModifier.FirLightModifier.' type=.LighterASTNode origin=null - token: GET_VAR 'token: .KtModifierKeywordToken declared in .FirModifier.FirLightModifier.' type=.KtModifierKeywordToken origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirLightModifier modality:FINAL visibility:public superTypes:[.FirModifier<.LighterASTNode>]' - PROPERTY name:tree visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:tree type:.FlyweightCapableTreeStructure visibility:private [final] - EXPRESSION_BODY - GET_VAR 'tree: .FlyweightCapableTreeStructure declared in .FirModifier.FirLightModifier.' type=.FlyweightCapableTreeStructure origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirModifier.FirLightModifier) returnType:.FlyweightCapableTreeStructure - correspondingProperty: PROPERTY name:tree visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.FirModifier.FirLightModifier - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .FlyweightCapableTreeStructure declared in .FirModifier.FirLightModifier' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:tree type:.FlyweightCapableTreeStructure visibility:private [final]' type=.FlyweightCapableTreeStructure origin=null - receiver: GET_VAR ': .FirModifier.FirLightModifier declared in .FirModifier.FirLightModifier.' type=.FirModifier.FirLightModifier origin=null PROPERTY FAKE_OVERRIDE name:node visibility:public modality:FINAL [fake_override,val] overridden: public final node: Node of .FirModifier @@ -483,6 +149,17 @@ FILE fqName: fileName:/kt44814.kt overridden: public final fun (): .KtModifierKeywordToken declared in .FirModifier $this: VALUE_PARAMETER name: type:.FirModifier<.LighterASTNode> + CLASS CLASS name:FirPsiModifier modality:FINAL visibility:public superTypes:[.FirModifier<.ASTNode>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifier.FirPsiModifier + CONSTRUCTOR visibility:public <> (node:.ASTNode, token:.KtModifierKeywordToken) returnType:.FirModifier.FirPsiModifier [primary] + VALUE_PARAMETER name:node index:0 type:.ASTNode + VALUE_PARAMETER name:token index:1 type:.KtModifierKeywordToken + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor (node: Node of .FirModifier, token: .KtModifierKeywordToken) declared in .FirModifier' + : .ASTNode + node: GET_VAR 'node: .ASTNode declared in .FirModifier.FirPsiModifier.' type=.ASTNode origin=null + token: GET_VAR 'token: .KtModifierKeywordToken declared in .FirModifier.FirPsiModifier.' type=.KtModifierKeywordToken origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirPsiModifier modality:FINAL visibility:public superTypes:[.FirModifier<.ASTNode>]' 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 .FirModifier @@ -496,6 +173,28 @@ FILE fqName: fileName:/kt44814.kt overridden: public open fun toString (): kotlin.String declared in .FirModifier $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:node visibility:public modality:FINAL [fake_override,val] + overridden: + public final node: Node of .FirModifier + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifier<.ASTNode>) returnType:.ASTNode [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:node visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): Node of .FirModifier declared in .FirModifier + $this: VALUE_PARAMETER name: type:.FirModifier<.ASTNode> + PROPERTY FAKE_OVERRIDE name:token visibility:public modality:FINAL [fake_override,val] + overridden: + public final token: .KtModifierKeywordToken + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifier<.ASTNode>) returnType:.KtModifierKeywordToken [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:token visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): .KtModifierKeywordToken declared in .FirModifier + $this: VALUE_PARAMETER name: type:.FirModifier<.ASTNode> + CONSTRUCTOR visibility:protected <> (node:Node of .FirModifier, token:.KtModifierKeywordToken) returnType:.FirModifier.FirModifier> [primary] + VALUE_PARAMETER name:node index:0 type:Node of .FirModifier + VALUE_PARAMETER name:token index:1 type:.KtModifierKeywordToken + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirModifier modality:SEALED visibility:internal 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 declared in kotlin.Any @@ -514,10 +213,6 @@ FILE fqName: fileName:/kt44814.kt CLASS CLASS name:FirLightModifierList modality:FINAL visibility:public superTypes:[.FirModifierList] CLASS CLASS name:FirPsiModifierList modality:FINAL visibility:public superTypes:[.FirModifierList] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifierList - CONSTRUCTOR visibility:protected <> () returnType:.FirModifierList [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirModifierList modality:SEALED visibility:internal superTypes:[kotlin.Any]' PROPERTY name:modifiers visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:modifiers type:kotlin.collections.List<.FirModifier<*>> visibility:private [final] EXPRESSION_BODY @@ -530,53 +225,8 @@ FILE fqName: fileName:/kt44814.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.List<.FirModifier<*>> declared in .FirModifierList' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:modifiers type:kotlin.collections.List<.FirModifier<*>> visibility:private [final]' type=kotlin.collections.List<.FirModifier<*>> origin=null receiver: GET_VAR ': .FirModifierList declared in .FirModifierList.' type=.FirModifierList origin=null - CLASS CLASS name:FirPsiModifierList modality:FINAL visibility:public superTypes:[.FirModifierList] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifierList.FirPsiModifierList - CONSTRUCTOR visibility:public <> (modifierList:.KtModifierList) returnType:.FirModifierList.FirPsiModifierList [primary] - VALUE_PARAMETER name:modifierList index:0 type:.KtModifierList - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirModifierList' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirPsiModifierList modality:FINAL visibility:public superTypes:[.FirModifierList]' - PROPERTY name:modifierList visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final] - EXPRESSION_BODY - GET_VAR 'modifierList: .KtModifierList declared in .FirModifierList.FirPsiModifierList.' type=.KtModifierList origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirModifierList.FirPsiModifierList) returnType:.KtModifierList - correspondingProperty: PROPERTY name:modifierList visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.FirModifierList.FirPsiModifierList - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .KtModifierList declared in .FirModifierList.FirPsiModifierList' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final]' type=.KtModifierList origin=null - receiver: GET_VAR ': .FirModifierList.FirPsiModifierList declared in .FirModifierList.FirPsiModifierList.' type=.FirModifierList.FirPsiModifierList origin=null - PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] - overridden: - public final modifiers: kotlin.collections.List<.FirModifier<*>> - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifierList) returnType:kotlin.collections.List<.FirModifier<*>> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.collections.List<.FirModifier<*>> declared in .FirModifierList - $this: VALUE_PARAMETER name: type:.FirModifierList - 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 .FirModifierList - $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 .FirModifierList - $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 .FirModifierList - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:FirLightModifierList modality:FINAL visibility:public superTypes:[.FirModifierList] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifierList.FirLightModifierList - CONSTRUCTOR visibility:public <> (modifierList:.LighterASTNode, tree:.FlyweightCapableTreeStructure) returnType:.FirModifierList.FirLightModifierList [primary] - VALUE_PARAMETER name:modifierList index:0 type:.LighterASTNode - VALUE_PARAMETER name:tree index:1 type:.FlyweightCapableTreeStructure - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirModifierList' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirLightModifierList modality:FINAL visibility:public superTypes:[.FirModifierList]' PROPERTY name:modifierList visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:modifierList type:.LighterASTNode visibility:private [final] EXPRESSION_BODY @@ -599,14 +249,12 @@ FILE fqName: fileName:/kt44814.kt RETURN type=kotlin.Nothing from='public final fun (): .FlyweightCapableTreeStructure declared in .FirModifierList.FirLightModifierList' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:tree type:.FlyweightCapableTreeStructure visibility:private [final]' type=.FlyweightCapableTreeStructure origin=null receiver: GET_VAR ': .FirModifierList.FirLightModifierList declared in .FirModifierList.FirLightModifierList.' type=.FirModifierList.FirLightModifierList origin=null - PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] - overridden: - public final modifiers: kotlin.collections.List<.FirModifier<*>> - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifierList) returnType:kotlin.collections.List<.FirModifier<*>> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.collections.List<.FirModifier<*>> declared in .FirModifierList - $this: VALUE_PARAMETER name: type:.FirModifierList + CONSTRUCTOR visibility:public <> (modifierList:.LighterASTNode, tree:.FlyweightCapableTreeStructure) returnType:.FirModifierList.FirLightModifierList [primary] + VALUE_PARAMETER name:modifierList index:0 type:.LighterASTNode + VALUE_PARAMETER name:tree index:1 type:.FlyweightCapableTreeStructure + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirModifierList' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirLightModifierList modality:FINAL visibility:public superTypes:[.FirModifierList]' 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 .FirModifierList @@ -620,12 +268,95 @@ FILE fqName: fileName:/kt44814.kt overridden: public open fun toString (): kotlin.String declared in .FirModifierList $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] + overridden: + public final modifiers: kotlin.collections.List<.FirModifier<*>> + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifierList) returnType:kotlin.collections.List<.FirModifier<*>> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.collections.List<.FirModifier<*>> declared in .FirModifierList + $this: VALUE_PARAMETER name: type:.FirModifierList + CLASS CLASS name:FirPsiModifierList modality:FINAL visibility:public superTypes:[.FirModifierList] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifierList.FirPsiModifierList + PROPERTY name:modifierList visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final] + EXPRESSION_BODY + GET_VAR 'modifierList: .KtModifierList declared in .FirModifierList.FirPsiModifierList.' type=.KtModifierList origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirModifierList.FirPsiModifierList) returnType:.KtModifierList + correspondingProperty: PROPERTY name:modifierList visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.FirModifierList.FirPsiModifierList + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .KtModifierList declared in .FirModifierList.FirPsiModifierList' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final]' type=.KtModifierList origin=null + receiver: GET_VAR ': .FirModifierList.FirPsiModifierList declared in .FirModifierList.FirPsiModifierList.' type=.FirModifierList.FirPsiModifierList origin=null + CONSTRUCTOR visibility:public <> (modifierList:.KtModifierList) returnType:.FirModifierList.FirPsiModifierList [primary] + VALUE_PARAMETER name:modifierList index:0 type:.KtModifierList + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirModifierList' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirPsiModifierList modality:FINAL visibility:public superTypes:[.FirModifierList]' + 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 .FirModifierList + $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 .FirModifierList + $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 .FirModifierList + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] + overridden: + public final modifiers: kotlin.collections.List<.FirModifier<*>> + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.FirModifierList) returnType:kotlin.collections.List<.FirModifier<*>> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:modifiers visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.collections.List<.FirModifier<*>> declared in .FirModifierList + $this: VALUE_PARAMETER name: type:.FirModifierList CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirModifierList.Companion CONSTRUCTOR visibility:private <> () returnType:.FirModifierList.Companion [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] 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 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:boxImpl visibility:public modality:FINAL <> ($this:.FirModifierList.Companion) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.FirModifierList.Companion + BLOCK_BODY + VAR name:sourceElement type:.FirSourceElement? [val] + CONSTRUCTOR_CALL 'public constructor (lighterASTNode: .LighterASTNode, treeStructure: .FlyweightCapableTreeStructure) declared in .FirLightSourceElement' type=.FirLightSourceElement origin=null + lighterASTNode: CONSTRUCTOR_CALL 'public constructor (_children: kotlin.collections.List<.LighterASTNode?>) declared in .LighterASTNode' type=.LighterASTNode origin=null + _children: CALL 'public final fun listOf (element: T of kotlin.collections.listOf): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.LighterASTNode> origin=null + : .LighterASTNode + element: CONSTRUCTOR_CALL 'public constructor (_children: kotlin.collections.List<.LighterASTNode?>) declared in .LighterASTNode' type=.LighterASTNode origin=null + treeStructure: CONSTRUCTOR_CALL 'public constructor () declared in .FlyweightCapableTreeStructure' type=.FlyweightCapableTreeStructure origin=null + VAR name:result type:.FirModifierList? [val] + CALL 'public final fun getModifierList (): .FirModifierList? declared in .FirModifierList.Companion' type=.FirModifierList? origin=null + $this: GET_VAR ': .FirModifierList.Companion declared in .FirModifierList.Companion.boxImpl' type=.FirModifierList.Companion origin=null + $receiver: GET_VAR 'val sourceElement: .FirSourceElement? declared in .FirModifierList.Companion.boxImpl' type=.FirSourceElement? origin=null + RETURN type=kotlin.Nothing from='public final fun boxImpl (): kotlin.String declared in .FirModifierList.Companion' + WHEN type=kotlin.String origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.FirModifierList.FirLightModifierList + GET_VAR 'val result: .FirModifierList? declared in .FirModifierList.Companion.boxImpl' type=.FirModifierList? origin=null + then: CONST String type=kotlin.String value="OK" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST String type=kotlin.String value="Fail" FUN name:getModifierList visibility:public modality:FINAL <> ($this:.FirModifierList.Companion, $receiver:.FirSourceElement?) returnType:.FirModifierList? $this: VALUE_PARAMETER name: type:.FirModifierList.Companion $receiver: VALUE_PARAMETER name: type:.FirSourceElement? @@ -732,29 +463,294 @@ FILE fqName: fileName:/kt44814.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null - FUN name:boxImpl visibility:public modality:FINAL <> ($this:.FirModifierList.Companion) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.FirModifierList.Companion + CONSTRUCTOR visibility:protected <> () returnType:.FirModifierList [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirModifierList modality:SEALED visibility:internal 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 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 + CLASS CLASS name:FirPsiSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirPsiSourceElement + PROPERTY name:psi visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:psi type:.PsiElement visibility:private [final] + EXPRESSION_BODY + GET_VAR 'psi: .PsiElement declared in .FirPsiSourceElement.' type=.PsiElement origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirPsiSourceElement) returnType:.PsiElement + correspondingProperty: PROPERTY name:psi visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.FirPsiSourceElement BLOCK_BODY - VAR name:sourceElement type:.FirSourceElement? [val] - CONSTRUCTOR_CALL 'public constructor (lighterASTNode: .LighterASTNode, treeStructure: .FlyweightCapableTreeStructure) declared in .FirLightSourceElement' type=.FirLightSourceElement origin=null - lighterASTNode: CONSTRUCTOR_CALL 'public constructor (_children: kotlin.collections.List<.LighterASTNode?>) declared in .LighterASTNode' type=.LighterASTNode origin=null - _children: CALL 'public final fun listOf (element: T of kotlin.collections.listOf): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.LighterASTNode> origin=null - : .LighterASTNode - element: CONSTRUCTOR_CALL 'public constructor (_children: kotlin.collections.List<.LighterASTNode?>) declared in .LighterASTNode' type=.LighterASTNode origin=null - treeStructure: CONSTRUCTOR_CALL 'public constructor () declared in .FlyweightCapableTreeStructure' type=.FlyweightCapableTreeStructure origin=null - VAR name:result type:.FirModifierList? [val] - CALL 'public final fun getModifierList (): .FirModifierList? declared in .FirModifierList.Companion' type=.FirModifierList? origin=null - $this: GET_VAR ': .FirModifierList.Companion declared in .FirModifierList.Companion.boxImpl' type=.FirModifierList.Companion origin=null - $receiver: GET_VAR 'val sourceElement: .FirSourceElement? declared in .FirModifierList.Companion.boxImpl' type=.FirSourceElement? origin=null - RETURN type=kotlin.Nothing from='public final fun boxImpl (): kotlin.String declared in .FirModifierList.Companion' - WHEN type=kotlin.String origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.FirModifierList.FirLightModifierList - GET_VAR 'val result: .FirModifierList? declared in .FirModifierList.Companion.boxImpl' type=.FirModifierList? origin=null - then: CONST String type=kotlin.String value="OK" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST String type=kotlin.String value="Fail" + RETURN type=kotlin.Nothing from='public final fun (): .PsiElement declared in .FirPsiSourceElement' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:psi type:.PsiElement visibility:private [final]' type=.PsiElement origin=null + receiver: GET_VAR ': .FirPsiSourceElement declared in .FirPsiSourceElement.' type=.FirPsiSourceElement origin=null + PROPERTY name:lighterASTNode visibility:public modality:OPEN [val] + overridden: + public abstract lighterASTNode: .LighterASTNode + FIELD PROPERTY_BACKING_FIELD name:lighterASTNode type:.LighterASTNode visibility:private [final] + EXPRESSION_BODY + GET_VAR 'lighterASTNode: .LighterASTNode declared in .FirPsiSourceElement.' type=.LighterASTNode origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.FirPsiSourceElement) returnType:.LighterASTNode + correspondingProperty: PROPERTY name:lighterASTNode visibility:public modality:OPEN [val] + overridden: + public abstract fun (): .LighterASTNode declared in .FirSourceElement + $this: VALUE_PARAMETER name: type:.FirPsiSourceElement + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): .LighterASTNode declared in .FirPsiSourceElement' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:lighterASTNode type:.LighterASTNode visibility:private [final]' type=.LighterASTNode origin=null + receiver: GET_VAR ': .FirPsiSourceElement declared in .FirPsiSourceElement.' type=.FirPsiSourceElement origin=null + PROPERTY name:treeStructure visibility:public modality:OPEN [val] + overridden: + public abstract treeStructure: .FlyweightCapableTreeStructure + FIELD PROPERTY_BACKING_FIELD name:treeStructure type:.FlyweightCapableTreeStructure visibility:private [final] + EXPRESSION_BODY + GET_VAR 'treeStructure: .FlyweightCapableTreeStructure declared in .FirPsiSourceElement.' type=.FlyweightCapableTreeStructure origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.FirPsiSourceElement) returnType:.FlyweightCapableTreeStructure + correspondingProperty: PROPERTY name:treeStructure visibility:public modality:OPEN [val] + overridden: + public abstract fun (): .FlyweightCapableTreeStructure declared in .FirSourceElement + $this: VALUE_PARAMETER name: type:.FirPsiSourceElement + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): .FlyweightCapableTreeStructure declared in .FirPsiSourceElement' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:treeStructure type:.FlyweightCapableTreeStructure visibility:private [final]' type=.FlyweightCapableTreeStructure origin=null + receiver: GET_VAR ': .FirPsiSourceElement declared in .FirPsiSourceElement.' type=.FirPsiSourceElement origin=null + CONSTRUCTOR visibility:public <> (psi:.PsiElement, lighterASTNode:.LighterASTNode, treeStructure:.FlyweightCapableTreeStructure) returnType:.FirPsiSourceElement [primary] + VALUE_PARAMETER name:psi index:0 type:.PsiElement + VALUE_PARAMETER name:lighterASTNode index:1 type:.LighterASTNode + VALUE_PARAMETER name:treeStructure index:2 type:.FlyweightCapableTreeStructure + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .FirSourceElement' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirPsiSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement]' + 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 .FirSourceElement + $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 .FirSourceElement + $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 .FirSourceElement + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:FirSourceElement modality:SEALED visibility:public superTypes:[kotlin.Any] + sealedSubclasses: + CLASS CLASS name:FirLightSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] + CLASS CLASS name:FirPsiSourceElement modality:FINAL visibility:public superTypes:[.FirSourceElement] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirSourceElement + CONSTRUCTOR visibility:protected <> () returnType:.FirSourceElement [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirSourceElement modality:SEALED visibility:public 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 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 + PROPERTY name:lighterASTNode visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirSourceElement) returnType:.LighterASTNode + correspondingProperty: PROPERTY name:lighterASTNode visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.FirSourceElement + PROPERTY name:treeStructure visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirSourceElement) returnType:.FlyweightCapableTreeStructure + correspondingProperty: PROPERTY name:treeStructure visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.FirSourceElement + CLASS CLASS name:FlyweightCapableTreeStructure modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FlyweightCapableTreeStructure + CONSTRUCTOR visibility:public <> () returnType:.FlyweightCapableTreeStructure [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FlyweightCapableTreeStructure modality:FINAL visibility:public 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 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 + CLASS CLASS name:KtModifierKeywordToken modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KtModifierKeywordToken + CONSTRUCTOR visibility:public <> () returnType:.KtModifierKeywordToken [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KtModifierKeywordToken modality:FINAL visibility:public 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 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 + CLASS CLASS name:KtModifierList modality:FINAL visibility:public superTypes:[.PsiElement] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KtModifierList + CONSTRUCTOR visibility:public <> () returnType:.KtModifierList [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .PsiElement' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KtModifierList modality:FINAL visibility:public superTypes:[.PsiElement]' + 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 .PsiElement + $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 .PsiElement + $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 .PsiElement + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:KtModifierListOwner modality:FINAL visibility:public superTypes:[.PsiElement] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KtModifierListOwner + PROPERTY name:modifierList visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .KtModifierList' type=.KtModifierList origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.KtModifierListOwner) returnType:.KtModifierList + correspondingProperty: PROPERTY name:modifierList visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.KtModifierListOwner + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .KtModifierList declared in .KtModifierListOwner' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:modifierList type:.KtModifierList visibility:private [final]' type=.KtModifierList origin=null + receiver: GET_VAR ': .KtModifierListOwner declared in .KtModifierListOwner.' type=.KtModifierListOwner origin=null + CONSTRUCTOR visibility:public <> () returnType:.KtModifierListOwner [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .PsiElement' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KtModifierListOwner modality:FINAL visibility:public superTypes:[.PsiElement]' + 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 .PsiElement + $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 .PsiElement + $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 .PsiElement + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:LighterASTNode modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.LighterASTNode + PROPERTY name:_children visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:_children type:kotlin.collections.List<.LighterASTNode?> visibility:private [final] + EXPRESSION_BODY + GET_VAR '_children: kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode.' type=kotlin.collections.List<.LighterASTNode?> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.LighterASTNode) returnType:kotlin.collections.List<.LighterASTNode?> + correspondingProperty: PROPERTY name:_children visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.LighterASTNode + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:_children type:kotlin.collections.List<.LighterASTNode?> visibility:private [final]' type=kotlin.collections.List<.LighterASTNode?> origin=null + receiver: GET_VAR ': .LighterASTNode declared in .LighterASTNode.' type=.LighterASTNode origin=null + PROPERTY name:tokenType visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:tokenType type:.TokenType visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun (): .TokenType declared in .TokenType.Companion' type=.TokenType origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.TokenType.Companion + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.LighterASTNode) returnType:.TokenType + correspondingProperty: PROPERTY name:tokenType visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.LighterASTNode + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .TokenType declared in .LighterASTNode' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:tokenType type:.TokenType visibility:private [final]' type=.TokenType origin=null + receiver: GET_VAR ': .LighterASTNode declared in .LighterASTNode.' type=.LighterASTNode origin=null + CONSTRUCTOR visibility:public <> (_children:kotlin.collections.List<.LighterASTNode?>) returnType:.LighterASTNode [primary] + VALUE_PARAMETER name:_children index:0 type:kotlin.collections.List<.LighterASTNode?> + EXPRESSION_BODY + CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.LighterASTNode?> origin=null + : .LighterASTNode? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LighterASTNode modality:FINAL visibility:public 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 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:getChildren visibility:public modality:FINAL <> ($this:.LighterASTNode, treeStructure:.FlyweightCapableTreeStructure) returnType:kotlin.collections.List<.LighterASTNode?> + $this: VALUE_PARAMETER name: type:.LighterASTNode + VALUE_PARAMETER name:treeStructure index:0 type:.FlyweightCapableTreeStructure + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getChildren (treeStructure: .FlyweightCapableTreeStructure): kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode' + CALL 'public final fun (): kotlin.collections.List<.LighterASTNode?> declared in .LighterASTNode' type=kotlin.collections.List<.LighterASTNode?> origin=GET_PROPERTY + $this: GET_VAR ': .LighterASTNode declared in .LighterASTNode.getChildren' type=.LighterASTNode origin=null + CLASS CLASS name:PsiElement modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PsiElement + CONSTRUCTOR visibility:public <> () returnType:.PsiElement [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PsiElement modality:OPEN visibility:public 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 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 + CLASS CLASS name:TokenType modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TokenType + CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TokenType.Companion + PROPERTY name:MODIFIER_LIST visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:MODIFIER_LIST type:.TokenType visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .TokenType' type=.TokenType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TokenType.Companion) returnType:.TokenType + correspondingProperty: PROPERTY name:MODIFIER_LIST visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TokenType.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .TokenType declared in .TokenType.Companion' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:MODIFIER_LIST type:.TokenType visibility:private [final]' type=.TokenType origin=null + receiver: GET_VAR ': .TokenType.Companion declared in .TokenType.Companion.' type=.TokenType.Companion origin=null + CONSTRUCTOR visibility:private <> () returnType:.TokenType.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] 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 declared in kotlin.Any @@ -768,6 +764,10 @@ FILE fqName: fileName:/kt44814.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.TokenType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TokenType modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/codegen/box/smartCasts/propertyInitializationAfterSmartCast.fir.ir.txt b/compiler/testData/codegen/box/smartCasts/propertyInitializationAfterSmartCast.fir.ir.txt index 5507693065c..1478bfde578 100644 --- a/compiler/testData/codegen/box/smartCasts/propertyInitializationAfterSmartCast.fir.ir.txt +++ b/compiler/testData/codegen/box/smartCasts/propertyInitializationAfterSmartCast.fir.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt CLASS CLASS name:Base_1 modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base_1 - CONSTRUCTOR visibility:public <> () returnType:.Base_1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base_1 modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Base_1) returnType:kotlin.Any? @@ -34,6 +30,10 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Any? visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .Base_1 declared in .Base_1' type=.Base_1 origin=null value: CONST String type=kotlin.String value="O" + CONSTRUCTOR visibility:public <> () returnType:.Base_1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base_1 modality:OPEN visibility:public 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 declared in kotlin.Any @@ -47,47 +47,8 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Derived_1 modality:FINAL visibility:public superTypes:[.Base_1] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived_1 - CONSTRUCTOR visibility:public <> () returnType:.Derived_1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base_1' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived_1 modality:FINAL visibility:public superTypes:[.Base_1]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Any? - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base_1) returnType:kotlin.Any? [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Any? declared in .Base_1 - $this: VALUE_PARAMETER name: type:.Base_1 - PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] - overridden: - public final y: kotlin.Any? - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base_1) returnType:kotlin.Any? [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Any? declared in .Base_1 - $this: VALUE_PARAMETER name: type:.Base_1 - 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 .Base_1 - $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 .Base_1 - $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 .Base_1 - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Base_2 modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base_2 - CONSTRUCTOR visibility:public <> () returnType:.Base_2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base_2 modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Base_2) returnType:kotlin.Any? @@ -117,6 +78,10 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Any? visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .Base_2 declared in .Base_2' type=.Base_2 origin=null value: CONST String type=kotlin.String value="K" + CONSTRUCTOR visibility:public <> () returnType:.Base_2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base_2 modality:OPEN visibility:public 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 declared in kotlin.Any @@ -130,12 +95,60 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Derived_1 modality:FINAL visibility:public superTypes:[.Base_1] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived_1 + CONSTRUCTOR visibility:public <> () returnType:.Derived_1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base_1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived_1 modality:FINAL visibility:public superTypes:[.Base_1]' + 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 .Base_1 + $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 .Base_1 + $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 .Base_1 + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Any? + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base_1) returnType:kotlin.Any? [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Any? declared in .Base_1 + $this: VALUE_PARAMETER name: type:.Base_1 + PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] + overridden: + public final y: kotlin.Any? + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base_1) returnType:kotlin.Any? [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Any? declared in .Base_1 + $this: VALUE_PARAMETER name: type:.Base_1 CLASS CLASS name:Derived_2 modality:OPEN visibility:public superTypes:[.Base_2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived_2 CONSTRUCTOR visibility:public <> () returnType:.Derived_2 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base_2' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived_2 modality:OPEN visibility:public superTypes:[.Base_2]' + 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 .Base_2 + $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 .Base_2 + $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 .Base_2 + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] overridden: public final x: kotlin.Any? @@ -152,25 +165,25 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt overridden: public final fun (): kotlin.Any? declared in .Base_2 $this: VALUE_PARAMETER name: type:.Base_2 - 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 .Base_2 - $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 .Base_2 - $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 .Base_2 - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Impl_2 modality:FINAL visibility:public superTypes:[.Derived_2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Impl_2 CONSTRUCTOR visibility:public <> () returnType:.Impl_2 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Derived_2' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Impl_2 modality:FINAL visibility:public superTypes:[.Derived_2]' + 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 .Derived_2 + $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 .Derived_2 + $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 .Derived_2 + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] overridden: public final x: kotlin.Any? @@ -187,19 +200,6 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt overridden: public final fun (): kotlin.Any? declared in .Derived_2 $this: VALUE_PARAMETER name: type:.Base_2 - 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 .Derived_2 - $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 .Derived_2 - $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 .Derived_2 - $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:a type:.Derived_1 [val] diff --git a/compiler/testData/codegen/box/smartCasts/propertyInitializationAfterSmartCast.ir.txt b/compiler/testData/codegen/box/smartCasts/propertyInitializationAfterSmartCast.ir.txt index 5507693065c..1478bfde578 100644 --- a/compiler/testData/codegen/box/smartCasts/propertyInitializationAfterSmartCast.ir.txt +++ b/compiler/testData/codegen/box/smartCasts/propertyInitializationAfterSmartCast.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt CLASS CLASS name:Base_1 modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base_1 - CONSTRUCTOR visibility:public <> () returnType:.Base_1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base_1 modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Base_1) returnType:kotlin.Any? @@ -34,6 +30,10 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Any? visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .Base_1 declared in .Base_1' type=.Base_1 origin=null value: CONST String type=kotlin.String value="O" + CONSTRUCTOR visibility:public <> () returnType:.Base_1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base_1 modality:OPEN visibility:public 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 declared in kotlin.Any @@ -47,47 +47,8 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Derived_1 modality:FINAL visibility:public superTypes:[.Base_1] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived_1 - CONSTRUCTOR visibility:public <> () returnType:.Derived_1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base_1' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived_1 modality:FINAL visibility:public superTypes:[.Base_1]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Any? - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base_1) returnType:kotlin.Any? [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Any? declared in .Base_1 - $this: VALUE_PARAMETER name: type:.Base_1 - PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] - overridden: - public final y: kotlin.Any? - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base_1) returnType:kotlin.Any? [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Any? declared in .Base_1 - $this: VALUE_PARAMETER name: type:.Base_1 - 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 .Base_1 - $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 .Base_1 - $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 .Base_1 - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Base_2 modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base_2 - CONSTRUCTOR visibility:public <> () returnType:.Base_2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base_2 modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Base_2) returnType:kotlin.Any? @@ -117,6 +78,10 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Any? visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .Base_2 declared in .Base_2' type=.Base_2 origin=null value: CONST String type=kotlin.String value="K" + CONSTRUCTOR visibility:public <> () returnType:.Base_2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base_2 modality:OPEN visibility:public 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 declared in kotlin.Any @@ -130,12 +95,60 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Derived_1 modality:FINAL visibility:public superTypes:[.Base_1] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived_1 + CONSTRUCTOR visibility:public <> () returnType:.Derived_1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base_1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived_1 modality:FINAL visibility:public superTypes:[.Base_1]' + 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 .Base_1 + $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 .Base_1 + $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 .Base_1 + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Any? + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base_1) returnType:kotlin.Any? [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Any? declared in .Base_1 + $this: VALUE_PARAMETER name: type:.Base_1 + PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] + overridden: + public final y: kotlin.Any? + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base_1) returnType:kotlin.Any? [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Any? declared in .Base_1 + $this: VALUE_PARAMETER name: type:.Base_1 CLASS CLASS name:Derived_2 modality:OPEN visibility:public superTypes:[.Base_2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived_2 CONSTRUCTOR visibility:public <> () returnType:.Derived_2 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base_2' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived_2 modality:OPEN visibility:public superTypes:[.Base_2]' + 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 .Base_2 + $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 .Base_2 + $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 .Base_2 + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] overridden: public final x: kotlin.Any? @@ -152,25 +165,25 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt overridden: public final fun (): kotlin.Any? declared in .Base_2 $this: VALUE_PARAMETER name: type:.Base_2 - 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 .Base_2 - $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 .Base_2 - $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 .Base_2 - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Impl_2 modality:FINAL visibility:public superTypes:[.Derived_2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Impl_2 CONSTRUCTOR visibility:public <> () returnType:.Impl_2 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Derived_2' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Impl_2 modality:FINAL visibility:public superTypes:[.Derived_2]' + 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 .Derived_2 + $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 .Derived_2 + $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 .Derived_2 + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] overridden: public final x: kotlin.Any? @@ -187,19 +200,6 @@ FILE fqName: fileName:/propertyInitializationAfterSmartCast.kt overridden: public final fun (): kotlin.Any? declared in .Derived_2 $this: VALUE_PARAMETER name: type:.Base_2 - 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 .Derived_2 - $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 .Derived_2 - $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 .Derived_2 - $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:a type:.Derived_1 [val] diff --git a/compiler/testData/codegen/box/smartCasts/smartcastFromGenericToString.ir.txt b/compiler/testData/codegen/box/smartCasts/smartcastFromGenericToString.ir.txt index 49e9c156c5f..8b39be06593 100644 --- a/compiler/testData/codegen/box/smartCasts/smartcastFromGenericToString.ir.txt +++ b/compiler/testData/codegen/box/smartCasts/smartcastFromGenericToString.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/smartcastFromGenericToString.kt CLASS CLASS name:Some modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Some.Some> TYPE_PARAMETER name:V index:0 variance: superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:public <> (map:kotlin.collections.Map.Some>) returnType:.Some.Some> [primary] - VALUE_PARAMETER name:map index:0 type:kotlin.collections.Map.Some> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:map visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.Some> visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,32 @@ FILE fqName: fileName:/smartcastFromGenericToString.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.Map.Some> declared in .Some' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.Some> visibility:private [final]' type=kotlin.collections.Map.Some> origin=null receiver: GET_VAR ': .Some.Some> declared in .Some.' type=.Some.Some> origin=null + CONSTRUCTOR visibility:public <> (map:kotlin.collections.Map.Some>) returnType:.Some.Some> [primary] + VALUE_PARAMETER name:map index:0 type:kotlin.collections.Map.Some> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public 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 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:addK visibility:public modality:FINAL <> ($this:.Some.Some>, s:kotlin.String) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Some.Some> + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun addK (s: kotlin.String): kotlin.String declared in .Some' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS + $this: GET_VAR 's: kotlin.String declared in .Some.addK' type=kotlin.String origin=null + other: CONST String type=kotlin.String value="K" FUN name:test visibility:public modality:FINAL <> ($this:.Some.Some>, key:kotlin.String) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.Some.Some> VALUE_PARAMETER name:key index:0 type:kotlin.String @@ -44,27 +65,6 @@ FILE fqName: fileName:/smartcastFromGenericToString.kt then: STRING_CONCATENATION type=kotlin.String CONST String type=kotlin.String value="Fail: " GET_VAR 'val value: V of .Some declared in .Some.test' type=V of .Some origin=null - FUN name:addK visibility:public modality:FINAL <> ($this:.Some.Some>, s:kotlin.String) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Some.Some> - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun addK (s: kotlin.String): kotlin.String declared in .Some' - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS - $this: GET_VAR 's: kotlin.String declared in .Some.addK' type=kotlin.String origin=null - other: CONST String type=kotlin.String value="K" - 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: 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:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:x type:.Some [val] diff --git a/compiler/testData/codegen/box/smartCasts/smartcastToStarType.ir.txt b/compiler/testData/codegen/box/smartCasts/smartcastToStarType.ir.txt index a591c3c7fe7..b76fed6db51 100644 --- a/compiler/testData/codegen/box/smartCasts/smartcastToStarType.ir.txt +++ b/compiler/testData/codegen/box/smartCasts/smartcastToStarType.ir.txt @@ -1,22 +1,4 @@ FILE fqName: fileName:/smartcastToStarType.kt - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base.Base> - TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Base.Base>) returnType:T of .Base - $this: VALUE_PARAMETER name: type:.Base.Base> - 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: 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 CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base.Derived>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived.Derived> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -24,14 +6,6 @@ FILE fqName: fileName:/smartcastToStarType.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base.Derived>]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Derived.Derived>) returnType:T of .Derived - overridden: - public abstract fun foo (): T of .Base declared in .Base - $this: VALUE_PARAMETER name: type:.Derived.Derived> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): T of .Derived declared in .Derived' - TYPE_OP type=T of .Derived origin=CAST typeOperand=T of .Derived - CONST String type=kotlin.String value="error" 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 .Base @@ -45,6 +19,32 @@ FILE fqName: fileName:/smartcastToStarType.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.Derived.Derived>) returnType:T of .Derived + overridden: + public abstract fun foo (): T of .Base declared in .Base + $this: VALUE_PARAMETER name: type:.Derived.Derived> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): T of .Derived declared in .Derived' + TYPE_OP type=T of .Derived origin=CAST typeOperand=T of .Derived + CONST String type=kotlin.String value="error" + CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base.Base> + TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.Base.Base>) returnType:T of .Base + $this: VALUE_PARAMETER name: type:.Base.Base> FUN name:bar visibility:public modality:FINAL ($receiver:.Derived.bar>) returnType:.Base.bar> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false $receiver: VALUE_PARAMETER name: type:.Derived.bar> @@ -57,14 +57,6 @@ FILE fqName: fileName:/smartcastToStarType.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Base.bar>]' - FUN name:foo visibility:public modality:OPEN <> ($this:.bar..bar>) returnType:T of .bar - overridden: - public abstract fun foo (): T of .Base declared in .Base - $this: VALUE_PARAMETER name: type:.bar..bar> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): T of .bar declared in .bar.' - TYPE_OP type=T of .bar origin=CAST typeOperand=T of .bar - CONST String type=kotlin.String value="OK" 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 .Base @@ -78,7 +70,24 @@ FILE fqName: fileName:/smartcastToStarType.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.bar..bar>) returnType:T of .bar + overridden: + public abstract fun foo (): T of .Base declared in .Base + $this: VALUE_PARAMETER name: type:.bar..bar> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): T of .bar declared in .bar.' + TYPE_OP type=T of .bar origin=CAST typeOperand=T of .bar + CONST String type=kotlin.String value="OK" CONSTRUCTOR_CALL 'public constructor () declared in .bar.' type=.bar..bar> origin=OBJECT_LITERAL + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:x type:.Derived [val] + CONSTRUCTOR_CALL 'public constructor () declared in .Derived' type=.Derived origin=null + : kotlin.String + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun test (x: .Base.test>): T of .test declared in ' type=kotlin.String origin=null + : kotlin.String + x: GET_VAR 'val x: .Derived declared in .box' type=.Derived origin=null FUN name:test visibility:public modality:FINAL (x:.Base.test>) returnType:T of .test TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:x index:0 type:.Base.test> @@ -100,12 +109,3 @@ FILE fqName: fileName:/smartcastToStarType.kt RETURN type=kotlin.Nothing from='public final fun test (x: .Base.test>): T of .test declared in ' CALL 'public abstract fun foo (): T of .Base declared in .Base' type=T of .test origin=null $this: GET_VAR 'x: .Base.test> declared in .test' type=.Base.test> origin=null - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - VAR name:x type:.Derived [val] - CONSTRUCTOR_CALL 'public constructor () declared in .Derived' type=.Derived origin=null - : kotlin.String - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' - CALL 'public final fun test (x: .Base.test>): T of .test declared in ' type=kotlin.String origin=null - : kotlin.String - x: GET_VAR 'val x: .Derived declared in .box' type=.Derived origin=null diff --git a/compiler/testData/codegen/box/unsignedTypes/implicitIntegerCoercionNamedArg.fir.ir.txt b/compiler/testData/codegen/box/unsignedTypes/implicitIntegerCoercionNamedArg.fir.ir.txt index a6a53f0322b..e4db4ad03db 100644 --- a/compiler/testData/codegen/box/unsignedTypes/implicitIntegerCoercionNamedArg.fir.ir.txt +++ b/compiler/testData/codegen/box/unsignedTypes/implicitIntegerCoercionNamedArg.fir.ir.txt @@ -19,22 +19,6 @@ FILE fqName:kotlin.internal fileName:/annotation.kt public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any FILE fqName: fileName:/test.kt - FUN name:testInt 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 testInt (x: kotlin.UInt): kotlin.UInt declared in ' - TYPE_OP type=kotlin.UInt origin=CAST typeOperand=kotlin.UInt - GET_VAR 'x: kotlin.UInt declared in .testInt' type=kotlin.UInt origin=null - FUN name:testLong visibility:public modality:FINAL <> (x:kotlin.ULong) returnType:kotlin.ULong - VALUE_PARAMETER name:x index:0 type:kotlin.ULong - annotations: - ImplicitIntegerCoercion - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testLong (x: kotlin.ULong): kotlin.ULong declared in ' - TYPE_OP type=kotlin.ULong origin=CAST typeOperand=kotlin.ULong - GET_VAR 'x: kotlin.ULong declared in .testLong' type=kotlin.ULong 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 ' @@ -78,3 +62,19 @@ FILE fqName: fileName:/test.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="OK" + FUN name:testInt 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 testInt (x: kotlin.UInt): kotlin.UInt declared in ' + TYPE_OP type=kotlin.UInt origin=CAST typeOperand=kotlin.UInt + GET_VAR 'x: kotlin.UInt declared in .testInt' type=kotlin.UInt origin=null + FUN name:testLong visibility:public modality:FINAL <> (x:kotlin.ULong) returnType:kotlin.ULong + VALUE_PARAMETER name:x index:0 type:kotlin.ULong + annotations: + ImplicitIntegerCoercion + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testLong (x: kotlin.ULong): kotlin.ULong declared in ' + TYPE_OP type=kotlin.ULong origin=CAST typeOperand=kotlin.ULong + GET_VAR 'x: kotlin.ULong declared in .testLong' type=kotlin.ULong origin=null diff --git a/compiler/testData/codegen/box/unsignedTypes/implicitIntegerCoercionNamedArg.ir.txt b/compiler/testData/codegen/box/unsignedTypes/implicitIntegerCoercionNamedArg.ir.txt index 3c386f3c2e2..271c0524e8f 100644 --- a/compiler/testData/codegen/box/unsignedTypes/implicitIntegerCoercionNamedArg.ir.txt +++ b/compiler/testData/codegen/box/unsignedTypes/implicitIntegerCoercionNamedArg.ir.txt @@ -19,22 +19,6 @@ FILE fqName:kotlin.internal fileName:/annotation.kt public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any FILE fqName: fileName:/test.kt - FUN name:testInt 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 testInt (x: kotlin.UInt): kotlin.UInt declared in ' - TYPE_OP type=kotlin.UInt origin=CAST typeOperand=kotlin.UInt - GET_VAR 'x: kotlin.UInt declared in .testInt' type=kotlin.UInt origin=null - FUN name:testLong visibility:public modality:FINAL <> (x:kotlin.ULong) returnType:kotlin.ULong - VALUE_PARAMETER name:x index:0 type:kotlin.ULong - annotations: - ImplicitIntegerCoercion - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testLong (x: kotlin.ULong): kotlin.ULong declared in ' - TYPE_OP type=kotlin.ULong origin=CAST typeOperand=kotlin.ULong - GET_VAR 'x: kotlin.ULong declared in .testLong' type=kotlin.ULong 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 ' @@ -74,3 +58,19 @@ FILE fqName: fileName:/test.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="OK" + FUN name:testInt 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 testInt (x: kotlin.UInt): kotlin.UInt declared in ' + TYPE_OP type=kotlin.UInt origin=CAST typeOperand=kotlin.UInt + GET_VAR 'x: kotlin.UInt declared in .testInt' type=kotlin.UInt origin=null + FUN name:testLong visibility:public modality:FINAL <> (x:kotlin.ULong) returnType:kotlin.ULong + VALUE_PARAMETER name:x index:0 type:kotlin.ULong + annotations: + ImplicitIntegerCoercion + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testLong (x: kotlin.ULong): kotlin.ULong declared in ' + TYPE_OP type=kotlin.ULong origin=CAST typeOperand=kotlin.ULong + GET_VAR 'x: kotlin.ULong declared in .testLong' type=kotlin.ULong origin=null diff --git a/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.fir.ir.txt b/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.fir.ir.txt index 7e261b32704..e0fad053166 100644 --- a/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.fir.ir.txt +++ b/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.fir.ir.txt @@ -3,11 +3,6 @@ FILE fqName: fileName:/recordWithCompanion.kt annotations: JvmRecord $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Tag - CONSTRUCTOR visibility:public <> (id:kotlin.String) returnType:.Tag [primary] - VALUE_PARAMETER name:id index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected/*protected and package*/ constructor () declared in java.lang.Record' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Tag modality:FINAL visibility:public [data] superTypes:[java.lang.Record]' PROPERTY name:id visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -38,6 +33,11 @@ FILE fqName: fileName:/recordWithCompanion.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> (id:kotlin.String) returnType:.Tag [primary] + VALUE_PARAMETER name:id index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected/*protected and package*/ constructor () declared in java.lang.Record' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Tag modality:FINAL visibility:public [data] superTypes:[java.lang.Record]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Tag) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.Tag BLOCK_BODY @@ -54,27 +54,6 @@ FILE fqName: fileName:/recordWithCompanion.kt RETURN type=kotlin.Nothing from='public final fun copy (id: kotlin.String): .Tag declared in .Tag' CONSTRUCTOR_CALL 'public constructor (id: kotlin.String) declared in .Tag' type=.Tag origin=null id: GET_VAR 'id: kotlin.String declared in .Tag.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Tag) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Tag - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Tag' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Tag(" - CONST String type=kotlin.String value="id=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Tag declared in .Tag.toString' type=.Tag origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Tag) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Tag - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Tag' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Tag declared in .Tag.hashCode' type=.Tag origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Tag, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -109,6 +88,27 @@ FILE fqName: fileName:/recordWithCompanion.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Tag' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Tag) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Tag + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Tag' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Tag declared in .Tag.hashCode' type=.Tag origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Tag) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Tag + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Tag' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Tag(" + CONST String type=kotlin.String value="id=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Tag declared in .Tag.toString' type=.Tag origin=null + CONST String type=kotlin.String value=")" 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 ' diff --git a/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.ir.txt b/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.ir.txt index fa1f1bdb69f..4d2ff83da3d 100644 --- a/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.ir.txt +++ b/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.ir.txt @@ -3,11 +3,6 @@ FILE fqName: fileName:/recordWithCompanion.kt annotations: JvmRecord $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Tag - CONSTRUCTOR visibility:public <> (id:kotlin.String) returnType:.Tag [primary] - VALUE_PARAMETER name:id index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected/*protected and package*/ constructor () declared in java.lang.Record' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Tag modality:FINAL visibility:public [data] superTypes:[java.lang.Record]' PROPERTY name:id visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -38,6 +33,11 @@ FILE fqName: fileName:/recordWithCompanion.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> (id:kotlin.String) returnType:.Tag [primary] + VALUE_PARAMETER name:id index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected/*protected and package*/ constructor () declared in java.lang.Record' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Tag modality:FINAL visibility:public [data] superTypes:[java.lang.Record]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Tag) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.Tag BLOCK_BODY @@ -54,27 +54,6 @@ FILE fqName: fileName:/recordWithCompanion.kt RETURN type=kotlin.Nothing from='public final fun copy (id: kotlin.String): .Tag declared in .Tag' CONSTRUCTOR_CALL 'public constructor (id: kotlin.String) declared in .Tag' type=.Tag origin=null id: GET_VAR 'id: kotlin.String declared in .Tag.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Tag) returnType:kotlin.String - overridden: - public abstract fun toString (): @[EnhancedNullability] kotlin.String declared in java.lang.Record - $this: VALUE_PARAMETER name: type:.Tag - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Tag' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Tag(" - CONST String type=kotlin.String value="id=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Tag declared in .Tag.toString' type=.Tag origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Tag) returnType:kotlin.Int - overridden: - public abstract fun hashCode (): kotlin.Int declared in java.lang.Record - $this: VALUE_PARAMETER name: type:.Tag - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Tag' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Tag declared in .Tag.hashCode' type=.Tag origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Tag, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public abstract fun equals (other: @[EnhancedNullability] kotlin.Any?): kotlin.Boolean declared in java.lang.Record @@ -109,6 +88,27 @@ FILE fqName: fileName:/recordWithCompanion.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Tag' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Tag) returnType:kotlin.Int + overridden: + public abstract fun hashCode (): kotlin.Int declared in java.lang.Record + $this: VALUE_PARAMETER name: type:.Tag + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Tag' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Tag declared in .Tag.hashCode' type=.Tag origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Tag) returnType:kotlin.String + overridden: + public abstract fun toString (): @[EnhancedNullability] kotlin.String declared in java.lang.Record + $this: VALUE_PARAMETER name: type:.Tag + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Tag' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Tag(" + CONST String type=kotlin.String value="id=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Tag declared in .Tag.toString' type=.Tag origin=null + CONST String type=kotlin.String value=")" 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 ' diff --git a/compiler/testData/codegen/script/destructuringDeclaration.fir.ir.txt b/compiler/testData/codegen/script/destructuringDeclaration.fir.ir.txt index 3d1579ea1f3..996b421aa13 100644 --- a/compiler/testData/codegen/script/destructuringDeclaration.fir.ir.txt +++ b/compiler/testData/codegen/script/destructuringDeclaration.fir.ir.txt @@ -40,16 +40,6 @@ FILE fqName: fileName:/destructuringDeclaration.kts BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:component1 visibility:public modality:FINAL <> ($this:..A) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:..A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in ..A' - CONST Int type=kotlin.Int value=123 - FUN name:component2 visibility:public modality:FINAL <> ($this:..A) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:..A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in ..A' - CONST Int type=kotlin.Int value=2 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 @@ -63,5 +53,15 @@ FILE fqName: fileName:/destructuringDeclaration.kts overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:component1 visibility:public modality:FINAL <> ($this:..A) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:..A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in ..A' + CONST Int type=kotlin.Int value=123 + FUN name:component2 visibility:public modality:FINAL <> ($this:..A) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:..A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in ..A' + CONST Int type=kotlin.Int value=2 VALUE_PARAMETER INSTANCE_RECEIVER name: type:kotlin.script.templates.standard.ScriptTemplateWithArgs VAR SCRIPT_CALL_PARAMETER name:args type:kotlin.Array [val] diff --git a/compiler/testData/ir/irText/classes/47424.ir.txt b/compiler/testData/ir/irText/classes/47424.ir.txt index 46d099e6a75..d800178370b 100644 --- a/compiler/testData/ir/irText/classes/47424.ir.txt +++ b/compiler/testData/ir/irText/classes/47424.ir.txt @@ -64,56 +64,8 @@ FILE fqName:com.example fileName:/47424.kt public open fun toString (): kotlin.String declared in com.example.Ab public open fun toString (): kotlin.String declared in com.example.Ba $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Ca modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:com.example.Ca - PROPERTY name:b visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:com.example.Ca) returnType:com.example.Ba - correspondingProperty: PROPERTY name:b visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:com.example.Ca - 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: 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 - CLASS INTERFACE name:Cb modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:com.example.Cb - PROPERTY name:b visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:com.example.Cb) returnType:com.example.Bb<*> - correspondingProperty: PROPERTY name:b visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:com.example.Cb - 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: 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 CLASS INTERFACE name:C modality:ABSTRACT visibility:public superTypes:[com.example.Cb; com.example.Ca] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:com.example.C - PROPERTY FAKE_OVERRIDE name:b visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract b: com.example.Bb<*> - public abstract b: com.example.Ba - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:com.example.Cb) returnType:com.example.Bb<*> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:b visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): com.example.Bb<*> declared in com.example.Cb - public abstract fun (): com.example.Ba declared in com.example.Ca - $this: VALUE_PARAMETER name: type:com.example.Cb 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 com.example.Cb @@ -130,3 +82,51 @@ FILE fqName:com.example fileName:/47424.kt public open fun toString (): kotlin.String declared in com.example.Cb public open fun toString (): kotlin.String declared in com.example.Ca $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:b visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract b: com.example.Bb<*> + public abstract b: com.example.Ba + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:com.example.Cb) returnType:com.example.Bb<*> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:b visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): com.example.Bb<*> declared in com.example.Cb + public abstract fun (): com.example.Ba declared in com.example.Ca + $this: VALUE_PARAMETER name: type:com.example.Cb + CLASS INTERFACE name:Ca modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:com.example.Ca + 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: 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 + PROPERTY name:b visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:com.example.Ca) returnType:com.example.Ba + correspondingProperty: PROPERTY name:b visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:com.example.Ca + CLASS INTERFACE name:Cb modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:com.example.Cb + 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: 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 + PROPERTY name:b visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:com.example.Cb) returnType:com.example.Bb<*> + correspondingProperty: PROPERTY name:b visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:com.example.Cb diff --git a/compiler/testData/ir/irText/classes/47424.kt.txt b/compiler/testData/ir/irText/classes/47424.kt.txt index 93851e6ddd2..094e04f42b0 100644 --- a/compiler/testData/ir/irText/classes/47424.kt.txt +++ b/compiler/testData/ir/irText/classes/47424.kt.txt @@ -12,6 +12,9 @@ interface Ba { interface Bb> : Ab, Ba { } +interface C : Ca, Cb { +} + interface Ca { abstract val b: Ba abstract get @@ -24,5 +27,3 @@ interface Cb { } -interface C : Cb, Ca { -} diff --git a/compiler/testData/ir/irText/classes/abstractMembers.ir.txt b/compiler/testData/ir/irText/classes/abstractMembers.ir.txt index 182fb6e64ef..b5a61021bc1 100644 --- a/compiler/testData/ir/irText/classes/abstractMembers.ir.txt +++ b/compiler/testData/ir/irText/classes/abstractMembers.ir.txt @@ -5,6 +5,19 @@ FILE fqName: fileName:/abstractMembers.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AbstractClass modality:ABSTRACT visibility:public 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 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:abstractFun visibility:public modality:ABSTRACT <> ($this:.AbstractClass) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.AbstractClass PROPERTY name:abstractVal visibility:public modality:ABSTRACT [val] @@ -19,6 +32,8 @@ FILE fqName: fileName:/abstractMembers.kt correspondingProperty: PROPERTY name:abstractVar visibility:public modality:ABSTRACT [var] $this: VALUE_PARAMETER name: type:.AbstractClass VALUE_PARAMETER name: index:0 type:kotlin.Int + CLASS INTERFACE name:Interface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Interface 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 @@ -32,8 +47,6 @@ FILE fqName: fileName:/abstractMembers.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Interface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Interface FUN name:abstractFun visibility:public modality:ABSTRACT <> ($this:.Interface) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Interface PROPERTY name:abstractVal visibility:public modality:ABSTRACT [val] @@ -48,16 +61,3 @@ FILE fqName: fileName:/abstractMembers.kt correspondingProperty: PROPERTY name:abstractVar visibility:public modality:ABSTRACT [var] $this: VALUE_PARAMETER name: type:.Interface VALUE_PARAMETER name: index:0 type:kotlin.Int - 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: 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 diff --git a/compiler/testData/ir/irText/classes/annotationClasses.ir.txt b/compiler/testData/ir/irText/classes/annotationClasses.ir.txt index 3094b055808..ba449bd9c18 100644 --- a/compiler/testData/ir/irText/classes/annotationClasses.ir.txt +++ b/compiler/testData/ir/irText/classes/annotationClasses.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/annotationClasses.kt CLASS ANNOTATION_CLASS name:Test1 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test1 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test1 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/annotationClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test1 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 declared in kotlin.Annotation @@ -32,13 +32,6 @@ FILE fqName: fileName:/annotationClasses.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:Test2 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test2 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -50,6 +43,13 @@ FILE fqName: fileName:/annotationClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test2' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test2 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 declared in kotlin.Annotation @@ -65,11 +65,6 @@ FILE fqName: fileName:/annotationClasses.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:Test3 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 - CONSTRUCTOR visibility:public <> (x:.Test1) returnType:.Test3 [primary] - VALUE_PARAMETER name:x index:0 type:.Test1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test3 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:.Test1 visibility:private [final] EXPRESSION_BODY @@ -81,6 +76,11 @@ FILE fqName: fileName:/annotationClasses.kt RETURN type=kotlin.Nothing from='public final fun (): .Test1 declared in .Test3' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:.Test1 visibility:private [final]' type=.Test1 origin=null receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + CONSTRUCTOR visibility:public <> (x:.Test1) returnType:.Test3 [primary] + VALUE_PARAMETER name:x index:0 type:.Test1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test3 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 declared in kotlin.Annotation @@ -96,11 +96,6 @@ FILE fqName: fileName:/annotationClasses.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:Test4 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test4 - CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:.Test4 [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test4 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.IntArray visibility:private [final] EXPRESSION_BODY @@ -112,6 +107,11 @@ FILE fqName: fileName:/annotationClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in .Test4' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null receiver: GET_VAR ': .Test4 declared in .Test4.' type=.Test4 origin=null + CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:.Test4 [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test4 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/classes/annotationClasses.kt.txt b/compiler/testData/ir/irText/classes/annotationClasses.kt.txt index bfac59e02a9..9f14b6e88f1 100644 --- a/compiler/testData/ir/irText/classes/annotationClasses.kt.txt +++ b/compiler/testData/ir/irText/classes/annotationClasses.kt.txt @@ -1,51 +1,52 @@ open annotation class Test1 : Annotation { + val x: Int + field = x + get + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } +} + +open annotation class Test2 : Annotation { val x: Int field = x get -} - -open annotation class Test2 : Annotation { constructor(x: Int = 0) /* primary */ { super/*Any*/() /* () */ } - val x: Int - field = x - get - } open annotation class Test3 : Annotation { + val x: Test1 + field = x + get + constructor(x: Test1) /* primary */ { super/*Any*/() /* () */ } - val x: Test1 - field = x - get - } open annotation class Test4 : Annotation { + val xs: IntArray + field = xs + get + constructor(vararg xs: Int) /* primary */ { super/*Any*/() /* () */ } - val xs: IntArray - field = xs - get - } + diff --git a/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.fir.ir.txt b/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.fir.ir.txt deleted file mode 100644 index 5090700b284..00000000000 --- a/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.fir.ir.txt +++ /dev/null @@ -1,131 +0,0 @@ -FILE fqName: fileName:/annotationsOnDelegatedMembers.kt - CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann - CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base - FUN name:func visibility:public modality:ABSTRACT <> ($this:.Base) returnType:kotlin.Unit - annotations: - Ann - $this: VALUE_PARAMETER name: type:.Base - PROPERTY name:prop visibility:public modality:ABSTRACT [val] - annotations: - Ann - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base) returnType:kotlin.Int - correspondingProperty: PROPERTY name:prop visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Base - PROPERTY name:propWithAccessors visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base) returnType:kotlin.Int - annotations: - Ann - correspondingProperty: PROPERTY name:propWithAccessors visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.Base - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base, :kotlin.Int) returnType:kotlin.Unit - annotations: - Ann - correspondingProperty: PROPERTY name:propWithAccessors visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.Base - VALUE_PARAMETER name: index:0 type:kotlin.Int - 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: 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 - CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegated - CONSTRUCTOR visibility:public <> (b:.Base) returnType:.Delegated [primary] - VALUE_PARAMETER name:b index:0 type:.Base - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.Base]' - FIELD DELEGATE name:$$delegate_0 type:.Base visibility:private [final] - EXPRESSION_BODY - GET_VAR 'b: .Base declared in .Delegated.' type=.Base origin=null - FUN DELEGATED_MEMBER name:func visibility:public modality:OPEN <> ($this:.Delegated) returnType:kotlin.Unit - annotations: - Ann - overridden: - public abstract fun func (): kotlin.Unit declared in .Base - $this: VALUE_PARAMETER name: type:.Delegated - BLOCK_BODY - CALL 'public abstract fun func (): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Base visibility:private [final]' type=.Base origin=null - receiver: GET_VAR ': .Delegated declared in .Delegated.func' type=.Delegated origin=null - PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] - overridden: - public abstract prop: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Delegated) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .Base - $this: VALUE_PARAMETER name: type:.Delegated - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Delegated' - CALL 'public abstract fun (): kotlin.Int declared in .Base' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Base visibility:private [final]' type=.Base origin=null - receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated origin=null - PROPERTY DELEGATED_MEMBER name:propWithAccessors visibility:public modality:OPEN [var] - overridden: - public abstract propWithAccessors: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Delegated) returnType:kotlin.Int - annotations: - Ann - correspondingProperty: PROPERTY DELEGATED_MEMBER name:propWithAccessors visibility:public modality:OPEN [var] - overridden: - public abstract fun (): kotlin.Int declared in .Base - $this: VALUE_PARAMETER name: type:.Delegated - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Delegated' - CALL 'public abstract fun (): kotlin.Int declared in .Base' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Base visibility:private [final]' type=.Base origin=null - receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated origin=null - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Delegated, :kotlin.Int) returnType:kotlin.Unit - annotations: - Ann - correspondingProperty: PROPERTY DELEGATED_MEMBER name:propWithAccessors visibility:public modality:OPEN [var] - overridden: - public abstract fun (: kotlin.Int): kotlin.Unit declared in .Base - $this: VALUE_PARAMETER name: type:.Delegated - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public abstract fun (: kotlin.Int): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Base visibility:private [final]' type=.Base origin=null - receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated origin=null - : GET_VAR ': kotlin.Int declared in .Delegated.' type=kotlin.Int 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 .Base - $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 .Base - $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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.fir.kt.txt b/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.fir.kt.txt deleted file mode 100644 index 638df3fbbcd..00000000000 --- a/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.fir.kt.txt +++ /dev/null @@ -1,54 +0,0 @@ -open annotation class Ann : Annotation { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -interface Base { - @Ann - abstract fun func() - - @Ann - abstract val prop: Int - abstract get - - abstract var propWithAccessors: Int - @Ann - abstract get - @Ann - abstract set - -} - -class Delegated : Base { - constructor(b: Base) /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Base = b - @Ann - override fun func() { - .#$$delegate_0.func() - } - - override val prop: Int - override get(): Int { - return .#$$delegate_0.() - } - - override var propWithAccessors: Int - @Ann - override get(): Int { - return .#$$delegate_0.() - } - @Ann - override set(: Int) { - .#$$delegate_0.( = ) - } - -} diff --git a/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.ir.txt b/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.ir.txt index 9f5c0b54408..04fa2128fbe 100644 --- a/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.ir.txt +++ b/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.ir.txt @@ -18,53 +18,39 @@ FILE fqName: fileName:/annotationsOnDelegatedMembers.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base - FUN name:func visibility:public modality:ABSTRACT <> ($this:.Base) returnType:kotlin.Unit - annotations: - Ann - $this: VALUE_PARAMETER name: type:.Base - PROPERTY name:prop visibility:public modality:ABSTRACT [val] - annotations: - Ann - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base) returnType:kotlin.Int - correspondingProperty: PROPERTY name:prop visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Base - PROPERTY name:propWithAccessors visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base) returnType:kotlin.Int - annotations: - Ann - correspondingProperty: PROPERTY name:propWithAccessors visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.Base - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base, :kotlin.Int) returnType:kotlin.Unit - annotations: - Ann - correspondingProperty: PROPERTY name:propWithAccessors visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.Base - VALUE_PARAMETER name: index:0 type:kotlin.Int - 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: 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 CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegated + FIELD DELEGATE name:$$delegate_0 type:.Base visibility:private [final] + EXPRESSION_BODY + GET_VAR 'b: .Base declared in .Delegated.' type=.Base origin=null CONSTRUCTOR visibility:public <> (b:.Base) returnType:.Delegated [primary] VALUE_PARAMETER name:b index:0 type:.Base BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.Base]' - FIELD DELEGATE name:$$delegate_0 type:.Base visibility:private [final] - EXPRESSION_BODY - GET_VAR 'b: .Base declared in .Delegated.' type=.Base origin=null + FUN DELEGATED_MEMBER name:func visibility:public modality:OPEN <> ($this:.Delegated) returnType:kotlin.Unit + annotations: + Ann + overridden: + public abstract fun func (): kotlin.Unit declared in .Base + $this: VALUE_PARAMETER name: type:.Delegated + BLOCK_BODY + CALL 'public abstract fun func (): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Base visibility:private [final]' type=.Base origin=null + receiver: GET_VAR ': .Delegated declared in .Delegated.func' type=.Delegated 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 .Base + $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 .Base + $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 .Base + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] overridden: public abstract prop: kotlin.Int @@ -106,26 +92,40 @@ FILE fqName: fileName:/annotationsOnDelegatedMembers.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Base visibility:private [final]' type=.Base origin=null receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated origin=null : GET_VAR ': kotlin.Int declared in .Delegated.' type=kotlin.Int origin=null - FUN DELEGATED_MEMBER name:func visibility:public modality:OPEN <> ($this:.Delegated) returnType:kotlin.Unit - annotations: - Ann - overridden: - public abstract fun func (): kotlin.Unit declared in .Base - $this: VALUE_PARAMETER name: type:.Delegated - BLOCK_BODY - CALL 'public abstract fun func (): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Base visibility:private [final]' type=.Base origin=null - receiver: GET_VAR ': .Delegated declared in .Delegated.func' type=.Delegated origin=null + CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base 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 .Base + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .Base + 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 .Base + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:func visibility:public modality:ABSTRACT <> ($this:.Base) returnType:kotlin.Unit + annotations: + Ann + $this: VALUE_PARAMETER name: type:.Base + PROPERTY name:prop visibility:public modality:ABSTRACT [val] + annotations: + Ann + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base) returnType:kotlin.Int + correspondingProperty: PROPERTY name:prop visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.Base + PROPERTY name:propWithAccessors visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base) returnType:kotlin.Int + annotations: + Ann + correspondingProperty: PROPERTY name:propWithAccessors visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.Base + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base, :kotlin.Int) returnType:kotlin.Unit + annotations: + Ann + correspondingProperty: PROPERTY name:propWithAccessors visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name: index:0 type:kotlin.Int diff --git a/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.kt b/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.kt index 30c4ecbad57..56b511be684 100644 --- a/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.kt +++ b/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // ISSUE: KT-64466 annotation class Ann diff --git a/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.kt.txt b/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.kt.txt index 88ebcabd006..5418c67922c 100644 --- a/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.kt.txt +++ b/compiler/testData/ir/irText/classes/annotationsOnDelegatedMembers.kt.txt @@ -7,6 +7,36 @@ open annotation class Ann : Annotation { } +class Delegated : Base { + private /* final field */ val $$delegate_0: Base = b + constructor(b: Base) /* primary */ { + super/*Any*/() + /* () */ + + } + + @Ann + override fun func() { + .#$$delegate_0.func() + } + + override val prop: Int + override get(): Int { + return .#$$delegate_0.() + } + + override var propWithAccessors: Int + @Ann + override get(): Int { + return .#$$delegate_0.() + } + @Ann + override set(: Int) { + .#$$delegate_0.( = ) + } + +} + interface Base { @Ann abstract fun func() @@ -23,32 +53,3 @@ interface Base { } -class Delegated : Base { - constructor(b: Base) /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Base = b - override val prop: Int - override get(): Int { - return .#$$delegate_0.() - } - - override var propWithAccessors: Int - @Ann - override get(): Int { - return .#$$delegate_0.() - } - @Ann - override set(: Int) { - .#$$delegate_0.( = ) - } - - @Ann - override fun func() { - .#$$delegate_0.func() - } - -} diff --git a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.ir.txt b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.ir.txt index 14d8f210dc5..08976fbfcdb 100644 --- a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.ir.txt +++ b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.ir.txt @@ -1,12 +1,6 @@ FILE fqName: fileName:/argumentReorderingInDelegatingConstructorCall.kt CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Base [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -29,6 +23,12 @@ FILE fqName: fileName:/argumentReorderingInDelegatingConstructorCall.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Base' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Base [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public 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 declared in kotlin.Any @@ -52,6 +52,19 @@ FILE fqName: fileName:/argumentReorderingInDelegatingConstructorCall.kt x: GET_VAR 'xx: kotlin.Int declared in .Test1.' type=kotlin.Int origin=null y: GET_VAR 'yy: kotlin.Int declared in .Test1.' type=kotlin.Int origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.Base]' + 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 .Base + $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 .Base + $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 .Base + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] overridden: public final x: kotlin.Int @@ -68,19 +81,6 @@ FILE fqName: fileName:/argumentReorderingInDelegatingConstructorCall.kt overridden: public final fun (): kotlin.Int declared in .Base $this: VALUE_PARAMETER name: type:.Base - 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 .Base - $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 .Base - $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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 CONSTRUCTOR visibility:public <> (xx:kotlin.Int, yy:kotlin.Int) returnType:.Test2 @@ -99,6 +99,19 @@ FILE fqName: fileName:/argumentReorderingInDelegatingConstructorCall.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor (xx: kotlin.Int, yy: kotlin.Int) declared in .Test2' xx: GET_VAR 'xxx: kotlin.Int declared in .Test2.' type=kotlin.Int origin=null yy: GET_VAR 'yyy: kotlin.Int declared in .Test2.' type=kotlin.Int 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 .Base + $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 .Base + $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 .Base + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] overridden: public final x: kotlin.Int @@ -115,16 +128,3 @@ FILE fqName: fileName:/argumentReorderingInDelegatingConstructorCall.kt overridden: public final fun (): kotlin.Int declared in .Base $this: VALUE_PARAMETER name: type:.Base - 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 .Base - $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 .Base - $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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.kt.txt b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.kt.txt index 0c4f697d5f2..554e191149c 100644 --- a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.kt.txt +++ b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.kt.txt @@ -1,10 +1,4 @@ open class Base { - constructor(x: Int, y: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x get @@ -13,6 +7,12 @@ open class Base { field = y get + constructor(x: Int, y: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + } class Test1 : Base { @@ -36,3 +36,4 @@ class Test2 : Base { } } + diff --git a/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.ir.txt b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.ir.txt index c4b40f7b92f..684d8265e5f 100644 --- a/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.ir.txt +++ b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.ir.txt @@ -6,6 +6,19 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public 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 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:foo visibility:public modality:FINAL <> ($this:.Base.Base>, x:T of .Base) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Base.Base> VALUE_PARAMETER name:x index:0 type:T of .Base @@ -30,6 +43,14 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Base' CONST Int type=kotlin.Int value=2 + CLASS CLASS name:BaseXY modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseXY.BaseXY, Y of .BaseXY> + TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:Y index:1 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.BaseXY.BaseXY, Y of .BaseXY> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseXY modality:OPEN visibility:public 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 declared in kotlin.Any @@ -43,132 +64,6 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Derived modality:OPEN visibility:public superTypes:[.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' - : kotlin.String - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:OPEN visibility:public superTypes:[.Base]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base, x:kotlin.String) returnType:kotlin.Unit [fake_override] - overridden: - public final fun foo (x: T of .Base): kotlin.Unit declared in .Base - $this: VALUE_PARAMETER name: type:.Base - VALUE_PARAMETER name:x index:0 type:kotlin.String - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base, y:kotlin.String) returnType:kotlin.Unit [fake_override] - overridden: - public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base - $this: VALUE_PARAMETER name: type:.Base - VALUE_PARAMETER name:y index:0 type:kotlin.String - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final bar: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Base - $this: VALUE_PARAMETER name: type:.Base - $receiver: VALUE_PARAMETER name: type:kotlin.String - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final bar: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Base - $this: VALUE_PARAMETER name: type:.Base - $receiver: VALUE_PARAMETER name: type:kotlin.String - 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 .Base - $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 .Base - $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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Derived] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived2 - CONSTRUCTOR visibility:public <> () returnType:.Derived2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Derived' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Derived]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base, x:kotlin.String) returnType:kotlin.Unit [fake_override] - overridden: - public final fun foo (x: kotlin.String): kotlin.Unit declared in .Derived - $this: VALUE_PARAMETER name: type:.Base - VALUE_PARAMETER name:x index:0 type:kotlin.String - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base, y:kotlin.String) returnType:kotlin.Unit [fake_override] - overridden: - public final fun foo (y: kotlin.String): kotlin.Unit declared in .Derived - $this: VALUE_PARAMETER name: type:.Base - VALUE_PARAMETER name:y index:0 type:kotlin.String - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final bar: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Derived - $this: VALUE_PARAMETER name: type:.Base - $receiver: VALUE_PARAMETER name: type:kotlin.String - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final bar: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Derived - $this: VALUE_PARAMETER name: type:.Base - $receiver: VALUE_PARAMETER name: type:kotlin.String - 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 .Derived - $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 .Derived - $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 .Derived - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test visibility:public modality:FINAL <> (b:.Base, d:.Derived, d2:.Derived2) returnType:kotlin.Unit - VALUE_PARAMETER name:b index:0 type:.Base - VALUE_PARAMETER name:d index:1 type:.Derived - VALUE_PARAMETER name:d2 index:2 type:.Derived2 - BLOCK_BODY - CALL 'public final fun foo (x: T of .Base): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null - $this: GET_VAR 'b: .Base declared in .test' type=.Base origin=null - x: CONST String type=kotlin.String value="" - CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null - $this: GET_VAR 'b: .Base declared in .test' type=.Base origin=null - y: CONST String type=kotlin.String value="" - CALL 'public final fun foo (x: kotlin.String): kotlin.Unit declared in .Derived' type=kotlin.Unit origin=null - $this: GET_VAR 'd: .Derived declared in .test' type=.Derived origin=null - x: CONST String type=kotlin.String value="" - CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .Derived' type=kotlin.Unit origin=null - $this: GET_VAR 'd: .Derived declared in .test' type=.Derived origin=null - y: CONST String type=kotlin.String value="" - CALL 'public final fun foo (x: kotlin.String): kotlin.Unit declared in .Derived2' type=kotlin.Unit origin=null - $this: GET_VAR 'd2: .Derived2 declared in .test' type=.Derived2 origin=null - x: CONST String type=kotlin.String value="" - CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .Derived2' type=kotlin.Unit origin=null - $this: GET_VAR 'd2: .Derived2 declared in .test' type=.Derived2 origin=null - y: CONST String type=kotlin.String value="" - CLASS CLASS name:BaseXY modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseXY.BaseXY, Y of .BaseXY> - TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:Y index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.BaseXY.BaseXY, Y of .BaseXY> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseXY modality:OPEN visibility:public superTypes:[kotlin.Any]' FUN name:foo visibility:public modality:FINAL <> ($this:.BaseXY.BaseXY, Y of .BaseXY>, x:X of .BaseXY, y:kotlin.String) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.BaseXY.BaseXY, Y of .BaseXY> VALUE_PARAMETER name:x index:0 type:X of .BaseXY @@ -179,19 +74,101 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt VALUE_PARAMETER name:x index:0 type:kotlin.String VALUE_PARAMETER name:y index:1 type:Y of .BaseXY BLOCK_BODY + CLASS CLASS name:Derived modality:OPEN visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:OPEN visibility:public superTypes:[.Base]' 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 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: T of .Base): kotlin.Unit declared in .Base + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name:y index:0 type:kotlin.String 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 + public open fun hashCode (): kotlin.Int declared in .Base $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 + public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final bar: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Base + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final bar: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Base + $receiver: VALUE_PARAMETER name: type:kotlin.String + CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Derived] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived2 + CONSTRUCTOR visibility:public <> () returnType:.Derived2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Derived' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Derived]' + 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 .Derived + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: kotlin.String): kotlin.Unit declared in .Derived + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .Derived + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name:y index:0 type:kotlin.String + 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 .Derived + $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 .Derived + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final bar: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Derived + $this: VALUE_PARAMETER name: type:.Base + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final bar: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Derived + $this: VALUE_PARAMETER name: type:.Base + $receiver: VALUE_PARAMETER name: type:kotlin.String CLASS CLASS name:DerivedXY modality:FINAL visibility:public superTypes:[.BaseXY] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DerivedXY CONSTRUCTOR visibility:public <> () returnType:.DerivedXY [primary] @@ -200,6 +177,11 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt : kotlin.String : kotlin.String INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedXY modality:FINAL visibility:public superTypes:[.BaseXY]' + 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 .BaseXY + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.BaseXY, x:kotlin.String, y:kotlin.String) returnType:kotlin.Unit [fake_override] overridden: public final fun foo (x: X of .BaseXY, y: kotlin.String): kotlin.Unit declared in .BaseXY @@ -212,11 +194,6 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt $this: VALUE_PARAMETER name: type:.BaseXY VALUE_PARAMETER name:x index:0 type:kotlin.String VALUE_PARAMETER name:y index:1 type:kotlin.String - 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 .BaseXY - $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 .BaseXY @@ -225,6 +202,105 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt overridden: public open fun toString (): kotlin.String declared in .BaseXY $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Outer modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer> + CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>) returnType:.Outer.Inner.Outer> [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Outer> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:OPEN visibility:public [inner] 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 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:foo visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer>, x:T of .Outer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer> + VALUE_PARAMETER name:x index:0 type:T of .Outer + BLOCK_BODY + FUN name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer>, y:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer> + VALUE_PARAMETER name:y index:0 type:kotlin.String + BLOCK_BODY + CONSTRUCTOR visibility:public <> () returnType:.Outer.Outer> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:OPEN visibility:public 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 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 + CLASS CLASS name:OuterDerived modality:FINAL visibility:public superTypes:[.Outer] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OuterDerived + CLASS CLASS name:InnerDerived modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OuterDerived.InnerDerived + CONSTRUCTOR visibility:public <> ($this:.OuterDerived) returnType:.OuterDerived.InnerDerived [primary] + $outer: VALUE_PARAMETER name: type:.OuterDerived + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Outer.Inner' + $this: GET_VAR ': .OuterDerived declared in .OuterDerived.InnerDerived.' type=.OuterDerived origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InnerDerived modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner]' + 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 .Outer.Inner + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: T of .Outer): kotlin.Unit declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:.Outer.Inner + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:.Outer.Inner + VALUE_PARAMETER name:y index:0 type:kotlin.String + 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 .Outer.Inner + $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 .Outer.Inner + $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.OuterDerived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Outer' + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OuterDerived modality:FINAL visibility:public superTypes:[.Outer]' + 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 .Outer + $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 .Outer + $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 .Outer + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:outerFun visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CLASS CLASS name:LocalBase modality:OPEN visibility:local superTypes:[kotlin.Any] @@ -234,6 +310,19 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LocalBase modality:OPEN visibility:local 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 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:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, x:T of .outerFun.LocalBase) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> VALUE_PARAMETER name:x index:0 type:T of .outerFun.LocalBase @@ -258,19 +347,6 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .outerFun.LocalBase' CONST Int type=kotlin.Int value=2 - 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: 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 CLASS CLASS name:LocalDerived modality:OPEN visibility:local superTypes:[.outerFun.LocalBase] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.outerFun.LocalDerived CONSTRUCTOR visibility:public <> () returnType:.outerFun.LocalDerived [primary] @@ -278,6 +354,11 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .outerFun.LocalBase' : kotlin.String INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LocalDerived modality:OPEN visibility:local superTypes:[.outerFun.LocalBase]' + 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 .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, x:kotlin.String) returnType:kotlin.Unit [fake_override] overridden: public final fun foo (x: T of .outerFun.LocalBase): kotlin.Unit declared in .outerFun.LocalBase @@ -288,29 +369,6 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt public final fun foo (y: kotlin.String): kotlin.Unit declared in .outerFun.LocalBase $this: VALUE_PARAMETER name: type:.outerFun.LocalBase VALUE_PARAMETER name:y index:0 type:kotlin.String - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final bar: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .outerFun.LocalBase - $this: VALUE_PARAMETER name: type:.outerFun.LocalBase - $receiver: VALUE_PARAMETER name: type:kotlin.String - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final bar: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .outerFun.LocalBase - $this: VALUE_PARAMETER name: type:.outerFun.LocalBase - $receiver: VALUE_PARAMETER name: type:kotlin.String - 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 .outerFun.LocalBase - $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 .outerFun.LocalBase @@ -319,12 +377,35 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt overridden: public open fun toString (): kotlin.String declared in .outerFun.LocalBase $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final bar: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final bar: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase + $receiver: VALUE_PARAMETER name: type:kotlin.String CLASS CLASS name:LocalDerived2 modality:FINAL visibility:local superTypes:[.outerFun.LocalDerived] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.outerFun.LocalDerived2 CONSTRUCTOR visibility:public <> () returnType:.outerFun.LocalDerived2 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .outerFun.LocalDerived' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LocalDerived2 modality:FINAL visibility:local superTypes:[.outerFun.LocalDerived]' + 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 .outerFun.LocalDerived + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, x:kotlin.String) returnType:kotlin.Unit [fake_override] overridden: public final fun foo (x: kotlin.String): kotlin.Unit declared in .outerFun.LocalDerived @@ -335,29 +416,6 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt public final fun foo (y: kotlin.String): kotlin.Unit declared in .outerFun.LocalDerived $this: VALUE_PARAMETER name: type:.outerFun.LocalBase VALUE_PARAMETER name:y index:0 type:kotlin.String - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final bar: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .outerFun.LocalDerived - $this: VALUE_PARAMETER name: type:.outerFun.LocalBase - $receiver: VALUE_PARAMETER name: type:kotlin.String - PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final bar: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .outerFun.LocalDerived - $this: VALUE_PARAMETER name: type:.outerFun.LocalBase - $receiver: VALUE_PARAMETER name: type:kotlin.String - 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 .outerFun.LocalDerived - $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 .outerFun.LocalDerived @@ -366,6 +424,24 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt overridden: public open fun toString (): kotlin.String declared in .outerFun.LocalDerived $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final bar: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .outerFun.LocalDerived + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final bar: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .outerFun.LocalDerived + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase + $receiver: VALUE_PARAMETER name: type:kotlin.String FUN LOCAL_FUNCTION name:test visibility:local modality:FINAL <> (b:.outerFun.LocalBase, d:.outerFun.LocalDerived, d2:.outerFun.LocalDerived2) returnType:kotlin.Unit VALUE_PARAMETER name:b index:0 type:.outerFun.LocalBase VALUE_PARAMETER name:d index:1 type:.outerFun.LocalDerived @@ -389,102 +465,26 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .outerFun.LocalDerived2' type=kotlin.Unit origin=null $this: GET_VAR 'd2: .outerFun.LocalDerived2 declared in .outerFun.test' type=.outerFun.LocalDerived2 origin=null y: CONST String type=kotlin.String value="" - CLASS CLASS name:Outer modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Outer.Outer> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:OPEN visibility:public superTypes:[kotlin.Any]' - CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer> - CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>) returnType:.Outer.Inner.Outer> [primary] - $outer: VALUE_PARAMETER name: type:.Outer.Outer> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer>, x:T of .Outer) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer> - VALUE_PARAMETER name:x index:0 type:T of .Outer - BLOCK_BODY - FUN name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer>, y:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer> - VALUE_PARAMETER name:y index:0 type:kotlin.String - BLOCK_BODY - 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: 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 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: 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 - CLASS CLASS name:OuterDerived modality:FINAL visibility:public superTypes:[.Outer] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OuterDerived - CONSTRUCTOR visibility:public <> () returnType:.OuterDerived [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Outer' - : kotlin.String - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OuterDerived modality:FINAL visibility:public superTypes:[.Outer]' - CLASS CLASS name:InnerDerived modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OuterDerived.InnerDerived - CONSTRUCTOR visibility:public <> ($this:.OuterDerived) returnType:.OuterDerived.InnerDerived [primary] - $outer: VALUE_PARAMETER name: type:.OuterDerived - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Outer.Inner' - $this: GET_VAR ': .OuterDerived declared in .OuterDerived.InnerDerived.' type=.OuterDerived origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InnerDerived modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner, x:kotlin.String) returnType:kotlin.Unit [fake_override] - overridden: - public final fun foo (x: T of .Outer): kotlin.Unit declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:.Outer.Inner - VALUE_PARAMETER name:x index:0 type:kotlin.String - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner, y:kotlin.String) returnType:kotlin.Unit [fake_override] - overridden: - public final fun foo (y: kotlin.String): kotlin.Unit declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:.Outer.Inner - VALUE_PARAMETER name:y index:0 type:kotlin.String - 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 .Outer.Inner - $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 .Outer.Inner - $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 .Outer.Inner - $this: VALUE_PARAMETER name: type: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 declared in .Outer - $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 .Outer - $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 .Outer - $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> (b:.Base, d:.Derived, d2:.Derived2) returnType:kotlin.Unit + VALUE_PARAMETER name:b index:0 type:.Base + VALUE_PARAMETER name:d index:1 type:.Derived + VALUE_PARAMETER name:d2 index:2 type:.Derived2 + BLOCK_BODY + CALL 'public final fun foo (x: T of .Base): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .Base declared in .test' type=.Base origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .Base declared in .test' type=.Base origin=null + y: CONST String type=kotlin.String value="" + CALL 'public final fun foo (x: kotlin.String): kotlin.Unit declared in .Derived' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .Derived declared in .test' type=.Derived origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .Derived' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .Derived declared in .test' type=.Derived origin=null + y: CONST String type=kotlin.String value="" + CALL 'public final fun foo (x: kotlin.String): kotlin.Unit declared in .Derived2' type=kotlin.Unit origin=null + $this: GET_VAR 'd2: .Derived2 declared in .test' type=.Derived2 origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .Derived2' type=kotlin.Unit origin=null + $this: GET_VAR 'd2: .Derived2 declared in .test' type=.Derived2 origin=null + y: CONST String type=kotlin.String value="" diff --git a/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt.txt b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt.txt index a2d4c878a57..945a1150124 100644 --- a/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt.txt +++ b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt.txt @@ -23,6 +23,21 @@ open class Base { } +open class BaseXY { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun foo(x: X, y: String) { + } + + fun foo(x: String, y: Y) { + } + +} + open class Derived : Base { constructor() /* primary */ { super/*Base*/() @@ -41,33 +56,51 @@ class Derived2 : Derived { } -fun test(b: Base, d: Derived, d2: Derived2) { - b.foo(x = "") - b.foo(y = "") - d.foo(x = "") - d.foo(y = "") - d2.foo(x = "") - d2.foo(y = "") +class DerivedXY : BaseXY { + constructor() /* primary */ { + super/*BaseXY*/() + /* () */ + + } + } -open class BaseXY { +open class Outer { + open inner class Inner { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun foo(x: T) { + } + + fun foo(y: String) { + } + + } + constructor() /* primary */ { super/*Any*/() /* () */ } - fun foo(x: X, y: String) { - } - - fun foo(x: String, y: Y) { - } - } -class DerivedXY : BaseXY { +class OuterDerived : Outer { + inner class InnerDerived : Inner { + constructor() /* primary */ { + .super/*Inner*/() + /* () */ + + } + + } + constructor() /* primary */ { - super/*BaseXY*/() + super/*Outer*/() /* () */ } @@ -129,44 +162,12 @@ fun outerFun() { } -open class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - open inner class Inner { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun foo(x: T) { - } - - fun foo(y: String) { - } - - } - +fun test(b: Base, d: Derived, d2: Derived2) { + b.foo(x = "") + b.foo(y = "") + d.foo(x = "") + d.foo(y = "") + d2.foo(x = "") + d2.foo(y = "") } -class OuterDerived : Outer { - constructor() /* primary */ { - super/*Outer*/() - /* () */ - - } - - inner class InnerDerived : Inner { - constructor() /* primary */ { - .super/*Inner*/() - /* () */ - - } - - } - -} diff --git a/compiler/testData/ir/irText/classes/classMembers.ir.txt b/compiler/testData/ir/irText/classes/classMembers.ir.txt index b6293f0b38a..b5d8ac9b257 100644 --- a/compiler/testData/ir/irText/classes/classMembers.ir.txt +++ b/compiler/testData/ir/irText/classes/classMembers.ir.txt @@ -1,15 +1,6 @@ FILE fqName: fileName:/classMembers.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int, z:kotlin.Int) returnType:.C [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - VALUE_PARAMETER name:z index:2 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:y visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -40,12 +31,6 @@ FILE fqName: fileName:/classMembers.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null - CONSTRUCTOR visibility:public <> () returnType:.C - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int, z: kotlin.Int) declared in .C' - x: CONST Int type=kotlin.Int value=0 - y: CONST Int type=kotlin.Int value=0 - z: CONST Int type=kotlin.Int value=0 PROPERTY name:property visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:property type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -57,6 +42,117 @@ FILE fqName: fileName:/classMembers.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:property type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CLASS CLASS name:NestedClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.NestedClass + CONSTRUCTOR visibility:public <> () returnType:.C.NestedClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:NestedClass modality:FINAL visibility:public 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 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:function visibility:public modality:FINAL <> ($this:.C.NestedClass) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C.NestedClass + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="3" + FUN name:memberExtensionFunction visibility:public modality:FINAL <> ($this:.C.NestedClass, $receiver:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C.NestedClass + $receiver: VALUE_PARAMETER name: type:kotlin.Int + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="4" + CLASS INTERFACE name:NestedInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.NestedInterface + 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: 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:bar visibility:public modality:OPEN <> ($this:.C.NestedInterface) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C.NestedInterface + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Unit declared in .C.NestedInterface' + CALL 'public abstract fun foo (): kotlin.Unit declared in .C.NestedInterface' type=kotlin.Unit origin=null + $this: GET_VAR ': .C.NestedInterface declared in .C.NestedInterface.bar' type=.C.NestedInterface origin=null + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.C.NestedInterface) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C.NestedInterface + CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.Companion + CONSTRUCTOR visibility:private <> () returnType:.C.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] 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 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 + CONSTRUCTOR visibility:public <> () returnType:.C + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int, z: kotlin.Int) declared in .C' + x: CONST Int type=kotlin.Int value=0 + y: CONST Int type=kotlin.Int value=0 + z: CONST Int type=kotlin.Int value=0 + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int, z:kotlin.Int) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + VALUE_PARAMETER name:z index:2 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 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:function visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="1" + FUN name:memberExtensionFunction visibility:public modality:FINAL <> ($this:.C, $receiver:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + $receiver: VALUE_PARAMETER name: type:kotlin.Int + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="2" PROPERTY name:propertyWithGet visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int correspondingProperty: PROPERTY name:propertyWithGet visibility:public modality:FINAL [val] @@ -80,99 +176,3 @@ FILE fqName: fileName:/classMembers.kt CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ $this: GET_VAR ': .C declared in .C.' type=.C origin=null : GET_VAR 'value: kotlin.Int declared in .C.' type=kotlin.Int origin=null - FUN name:function visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="1" - FUN name:memberExtensionFunction visibility:public modality:FINAL <> ($this:.C, $receiver:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="2" - CLASS CLASS name:NestedClass modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.NestedClass - CONSTRUCTOR visibility:public <> () returnType:.C.NestedClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:NestedClass modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:function visibility:public modality:FINAL <> ($this:.C.NestedClass) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C.NestedClass - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="3" - FUN name:memberExtensionFunction visibility:public modality:FINAL <> ($this:.C.NestedClass, $receiver:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C.NestedClass - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="4" - 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: 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 - CLASS INTERFACE name:NestedInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.NestedInterface - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.C.NestedInterface) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C.NestedInterface - FUN name:bar visibility:public modality:OPEN <> ($this:.C.NestedInterface) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C.NestedInterface - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Unit declared in .C.NestedInterface' - CALL 'public abstract fun foo (): kotlin.Unit declared in .C.NestedInterface' type=kotlin.Unit origin=null - $this: GET_VAR ': .C.NestedInterface declared in .C.NestedInterface.bar' type=.C.NestedInterface 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: 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 - CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.Companion - CONSTRUCTOR visibility:private <> () returnType:.C.Companion [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] 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 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 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: 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 diff --git a/compiler/testData/ir/irText/classes/classMembers.kt.txt b/compiler/testData/ir/irText/classes/classMembers.kt.txt index 61660f8492d..1ffe8d92ebc 100644 --- a/compiler/testData/ir/irText/classes/classMembers.kt.txt +++ b/compiler/testData/ir/irText/classes/classMembers.kt.txt @@ -1,10 +1,4 @@ class C { - constructor(x: Int, y: Int, z: Int = 1) /* primary */ { - super/*Any*/() - /* () */ - - } - val y: Int field = y get @@ -14,35 +8,10 @@ class C { get set - constructor() { - this/*C*/(x = 0, y = 0, z = 0) - } - val property: Int field = 0 get - val propertyWithGet: Int - get(): Int { - return 42 - } - - var propertyWithGetAndSet: Int - get(): Int { - return .() - } - set(value: Int) { - .( = value) - } - - fun function() { - println(message = "1") - } - - fun Int.memberExtensionFunction() { - println(message = "2") - } - class NestedClass { constructor() /* primary */ { super/*Any*/() @@ -61,12 +30,12 @@ class C { } interface NestedInterface { - abstract fun foo() - fun bar() { return .foo() } + abstract fun foo() + } companion object Companion { @@ -78,4 +47,36 @@ class C { } + constructor() { + this/*C*/(x = 0, y = 0, z = 0) + } + + constructor(x: Int, y: Int, z: Int = 1) /* primary */ { + super/*Any*/() + /* () */ + + } + + fun function() { + println(message = "1") + } + + fun Int.memberExtensionFunction() { + println(message = "2") + } + + val propertyWithGet: Int + get(): Int { + return 42 + } + + var propertyWithGetAndSet: Int + get(): Int { + return .() + } + set(value: Int) { + .( = value) + } + } + diff --git a/compiler/testData/ir/irText/classes/classes.fir.ir.txt b/compiler/testData/ir/irText/classes/classes.fir.ir.txt deleted file mode 100644 index d9163c8a247..00000000000 --- a/compiler/testData/ir/irText/classes/classes.fir.ir.txt +++ /dev/null @@ -1,125 +0,0 @@ -FILE fqName: fileName:/classes.kt - CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClass - CONSTRUCTOR visibility:public <> () returnType:.TestClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClass modality:FINAL visibility:public 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 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 - CLASS INTERFACE name:TestInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInterface - 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: 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 - CLASS OBJECT name:TestObject modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestObject - CONSTRUCTOR visibility:private <> () returnType:.TestObject [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:TestObject modality:FINAL visibility:public 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 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 - CLASS ANNOTATION_CLASS name:TestAnnotationClass modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnnotationClass - CONSTRUCTOR visibility:public <> () returnType:.TestAnnotationClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnnotationClass 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ENUM_CLASS name:TestEnumClass modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnumClass>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnumClass - CONSTRUCTOR visibility:private <> () returnType:.TestEnumClass [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnumClass - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnumClass modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnumClass>]' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnumClass> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnumClass - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnumClass> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>, other:.TestEnumClass) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> - VALUE_PARAMETER name:other index:0 type:.TestEnumClass - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestEnumClass>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> diff --git a/compiler/testData/ir/irText/classes/classes.fir.kt.txt b/compiler/testData/ir/irText/classes/classes.fir.kt.txt deleted file mode 100644 index 95a536a69e0..00000000000 --- a/compiler/testData/ir/irText/classes/classes.fir.kt.txt +++ /dev/null @@ -1,45 +0,0 @@ -class TestClass { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -interface TestInterface { -} - -object TestObject { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -open annotation class TestAnnotationClass : Annotation { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -enum class TestEnumClass : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): TestEnumClass /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} diff --git a/compiler/testData/ir/irText/classes/classes.ir.txt b/compiler/testData/ir/irText/classes/classes.ir.txt index caac4700321..73a35586a26 100644 --- a/compiler/testData/ir/irText/classes/classes.ir.txt +++ b/compiler/testData/ir/irText/classes/classes.ir.txt @@ -1,4 +1,23 @@ FILE fqName: fileName:/classes.kt + CLASS ANNOTATION_CLASS name:TestAnnotationClass modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnnotationClass + CONSTRUCTOR visibility:public <> () returnType:.TestAnnotationClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnnotationClass 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClass CONSTRUCTOR visibility:public <> () returnType:.TestClass [primary] @@ -18,6 +37,58 @@ FILE fqName: fileName:/classes.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_CLASS name:TestEnumClass modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnumClass>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnumClass + CONSTRUCTOR visibility:private <> () returnType:.TestEnumClass [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnumClass + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnumClass modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnumClass>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnumClass + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnumClass> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>, other:.TestEnumClass) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> + VALUE_PARAMETER name:other index:0 type:.TestEnumClass + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestEnumClass>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnumClass> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> CLASS INTERFACE name:TestInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInterface FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -52,74 +123,3 @@ FILE fqName: fileName:/classes.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:TestAnnotationClass modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnnotationClass - CONSTRUCTOR visibility:public <> () returnType:.TestAnnotationClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnnotationClass 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ENUM_CLASS name:TestEnumClass modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnumClass>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnumClass - CONSTRUCTOR visibility:private <> () returnType:.TestEnumClass [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnumClass - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnumClass modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnumClass>]' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>, other:.TestEnumClass) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> - VALUE_PARAMETER name:other index:0 type:.TestEnumClass - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnumClass>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestEnumClass>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnumClass> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnumClass> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnumClass - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnumClass> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES diff --git a/compiler/testData/ir/irText/classes/classes.kt b/compiler/testData/ir/irText/classes/classes.kt index d53e2610b76..f05af859029 100644 --- a/compiler/testData/ir/irText/classes/classes.kt +++ b/compiler/testData/ir/irText/classes/classes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class TestClass interface TestInterface diff --git a/compiler/testData/ir/irText/classes/classes.kt.txt b/compiler/testData/ir/irText/classes/classes.kt.txt index 95a536a69e0..03a0a7caab2 100644 --- a/compiler/testData/ir/irText/classes/classes.kt.txt +++ b/compiler/testData/ir/irText/classes/classes.kt.txt @@ -1,4 +1,4 @@ -class TestClass { +open annotation class TestAnnotationClass : Annotation { constructor() /* primary */ { super/*Any*/() /* () */ @@ -7,19 +7,7 @@ class TestClass { } -interface TestInterface { -} - -object TestObject { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -open annotation class TestAnnotationClass : Annotation { +class TestClass { constructor() /* primary */ { super/*Any*/() /* () */ @@ -35,11 +23,24 @@ enum class TestEnumClass : Enum { } - fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestEnumClass /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } + +interface TestInterface { +} + +object TestObject { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + diff --git a/compiler/testData/ir/irText/classes/cloneable.ir.txt b/compiler/testData/ir/irText/classes/cloneable.ir.txt index bb3009328c3..d242abb5c38 100644 --- a/compiler/testData/ir/irText/classes/cloneable.ir.txt +++ b/compiler/testData/ir/irText/classes/cloneable.ir.txt @@ -22,25 +22,6 @@ FILE fqName: fileName:/cloneable.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Cloneable $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Cloneable] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I - FUN FAKE_OVERRIDE name:clone visibility:protected modality:OPEN <> ($this:kotlin.Cloneable) returnType:kotlin.Any [fake_override] - overridden: - protected open fun clone (): kotlin.Any declared in kotlin.Cloneable - $this: VALUE_PARAMETER name: type:kotlin.Cloneable - 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.Cloneable - $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.Cloneable - $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.Cloneable - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] @@ -70,13 +51,6 @@ FILE fqName: fileName:/cloneable.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OC modality:FINAL visibility:public superTypes:[.I]' - FUN name:clone visibility:protected modality:OPEN <> ($this:.OC) returnType:.OC - overridden: - protected open fun clone (): kotlin.Any declared in .I - $this: VALUE_PARAMETER name: type:.OC - BLOCK_BODY - RETURN type=kotlin.Nothing from='protected open fun clone (): .OC declared in .OC' - CONSTRUCTOR_CALL 'public constructor () declared in .OC' type=.OC 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 .I @@ -90,3 +64,29 @@ FILE fqName: fileName:/cloneable.kt overridden: public open fun toString (): kotlin.String declared in .I $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:clone visibility:protected modality:OPEN <> ($this:.OC) returnType:.OC + overridden: + protected open fun clone (): kotlin.Any declared in .I + $this: VALUE_PARAMETER name: type:.OC + BLOCK_BODY + RETURN type=kotlin.Nothing from='protected open fun clone (): .OC declared in .OC' + CONSTRUCTOR_CALL 'public constructor () declared in .OC' type=.OC origin=null + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Cloneable] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I + FUN FAKE_OVERRIDE name:clone visibility:protected modality:OPEN <> ($this:kotlin.Cloneable) returnType:kotlin.Any [fake_override] + overridden: + protected open fun clone (): kotlin.Any declared in kotlin.Cloneable + $this: VALUE_PARAMETER name: type:kotlin.Cloneable + 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.Cloneable + $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.Cloneable + $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.Cloneable + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/cloneable.kt.txt b/compiler/testData/ir/irText/classes/cloneable.kt.txt index d08b7dff5d3..4df74224e41 100644 --- a/compiler/testData/ir/irText/classes/cloneable.kt.txt +++ b/compiler/testData/ir/irText/classes/cloneable.kt.txt @@ -7,9 +7,6 @@ class A : Cloneable { } -interface I : Cloneable { -} - class C : I { constructor() /* primary */ { super/*Any*/() @@ -31,3 +28,7 @@ class OC : I { } } + +interface I : Cloneable { +} + diff --git a/compiler/testData/ir/irText/classes/companionObject.ir.txt b/compiler/testData/ir/irText/classes/companionObject.ir.txt index efc7d78f56b..49dcb573038 100644 --- a/compiler/testData/ir/irText/classes/companionObject.ir.txt +++ b/compiler/testData/ir/irText/classes/companionObject.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/companionObject.kt CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 - CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1.Companion CONSTRUCTOR visibility:private <> () returnType:.Test1.Companion [primary] @@ -24,6 +20,10 @@ FILE fqName: fileName:/companionObject.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -39,10 +39,6 @@ FILE fqName: fileName:/companionObject.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:public <> () returnType:.Test2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS OBJECT name:Named modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2.Named CONSTRUCTOR visibility:private <> () returnType:.Test2.Named [primary] @@ -62,6 +58,10 @@ FILE fqName: fileName:/companionObject.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.Test2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/companionObject.kt.txt b/compiler/testData/ir/irText/classes/companionObject.kt.txt index 0d749bff43f..bc8d6354971 100644 --- a/compiler/testData/ir/irText/classes/companionObject.kt.txt +++ b/compiler/testData/ir/irText/classes/companionObject.kt.txt @@ -1,10 +1,4 @@ class Test1 { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - companion object Companion { private constructor() /* primary */ { super/*Any*/() @@ -14,15 +8,15 @@ class Test1 { } -} - -class Test2 { constructor() /* primary */ { super/*Any*/() /* () */ } +} + +class Test2 { companion object Named { private constructor() /* primary */ { super/*Any*/() @@ -32,4 +26,11 @@ class Test2 { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.ir.txt index 53f11180f50..0e814083d63 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.ir.txt @@ -1,19 +1,6 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 - CONSTRUCTOR visibility:public <> (stringArray:kotlin.Array, charArray:kotlin.CharArray, booleanArray:kotlin.BooleanArray, byteArray:kotlin.ByteArray, shortArray:kotlin.ShortArray, intArray:kotlin.IntArray, longArray:kotlin.LongArray, floatArray:kotlin.FloatArray, doubleArray:kotlin.DoubleArray) returnType:.Test1 [primary] - VALUE_PARAMETER name:stringArray index:0 type:kotlin.Array - VALUE_PARAMETER name:charArray index:1 type:kotlin.CharArray - VALUE_PARAMETER name:booleanArray index:2 type:kotlin.BooleanArray - VALUE_PARAMETER name:byteArray index:3 type:kotlin.ByteArray - VALUE_PARAMETER name:shortArray index:4 type:kotlin.ShortArray - VALUE_PARAMETER name:intArray index:5 type:kotlin.IntArray - VALUE_PARAMETER name:longArray index:6 type:kotlin.LongArray - VALUE_PARAMETER name:floatArray index:7 type:kotlin.FloatArray - VALUE_PARAMETER name:doubleArray index:8 type:kotlin.DoubleArray - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:stringArray visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:private [final] EXPRESSION_BODY @@ -113,6 +100,19 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.DoubleArray declared in .Test1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleArray type:kotlin.DoubleArray visibility:private [final]' type=kotlin.DoubleArray origin=null receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + CONSTRUCTOR visibility:public <> (stringArray:kotlin.Array, charArray:kotlin.CharArray, booleanArray:kotlin.BooleanArray, byteArray:kotlin.ByteArray, shortArray:kotlin.ShortArray, intArray:kotlin.IntArray, longArray:kotlin.LongArray, floatArray:kotlin.FloatArray, doubleArray:kotlin.DoubleArray) returnType:.Test1 [primary] + VALUE_PARAMETER name:stringArray index:0 type:kotlin.Array + VALUE_PARAMETER name:charArray index:1 type:kotlin.CharArray + VALUE_PARAMETER name:booleanArray index:2 type:kotlin.BooleanArray + VALUE_PARAMETER name:byteArray index:3 type:kotlin.ByteArray + VALUE_PARAMETER name:shortArray index:4 type:kotlin.ShortArray + VALUE_PARAMETER name:intArray index:5 type:kotlin.IntArray + VALUE_PARAMETER name:longArray index:6 type:kotlin.LongArray + VALUE_PARAMETER name:floatArray index:7 type:kotlin.FloatArray + VALUE_PARAMETER name:doubleArray index:8 type:kotlin.DoubleArray + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Array [operator] $this: VALUE_PARAMETER name: type:.Test1 BLOCK_BODY @@ -217,134 +217,6 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt longArray: GET_VAR 'longArray: kotlin.LongArray declared in .Test1.copy' type=kotlin.LongArray origin=null floatArray: GET_VAR 'floatArray: kotlin.FloatArray declared in .Test1.copy' type=kotlin.FloatArray origin=null doubleArray: GET_VAR 'doubleArray: kotlin.DoubleArray declared in .Test1.copy' type=kotlin.DoubleArray origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test1(" - CONST String type=kotlin.String value="stringArray=" - CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="charArray=" - CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charArray type:kotlin.CharArray visibility:private [final]' type=kotlin.CharArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="booleanArray=" - CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanArray type:kotlin.BooleanArray visibility:private [final]' type=kotlin.BooleanArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="byteArray=" - CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArray type:kotlin.ByteArray visibility:private [final]' type=kotlin.ByteArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="shortArray=" - CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortArray type:kotlin.ShortArray visibility:private [final]' type=kotlin.ShortArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="intArray=" - CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intArray type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="longArray=" - CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longArray type:kotlin.LongArray visibility:private [final]' type=kotlin.LongArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="floatArray=" - CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatArray type:kotlin.FloatArray visibility:private [final]' type=kotlin.FloatArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="doubleArray=" - CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleArray type:kotlin.DoubleArray visibility:private [final]' type=kotlin.DoubleArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test1 - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charArray type:kotlin.CharArray visibility:private [final]' type=kotlin.CharArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanArray type:kotlin.BooleanArray visibility:private [final]' type=kotlin.BooleanArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArray type:kotlin.ByteArray visibility:private [final]' type=kotlin.ByteArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortArray type:kotlin.ShortArray visibility:private [final]' type=kotlin.ShortArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intArray type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longArray type:kotlin.LongArray visibility:private [final]' type=kotlin.LongArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatArray type:kotlin.FloatArray visibility:private [final]' type=kotlin.FloatArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleArray type:kotlin.DoubleArray visibility:private [final]' type=kotlin.DoubleArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' - GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test1, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -459,14 +331,137 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charArray type:kotlin.CharArray visibility:private [final]' type=kotlin.CharArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanArray type:kotlin.BooleanArray visibility:private [final]' type=kotlin.BooleanArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArray type:kotlin.ByteArray visibility:private [final]' type=kotlin.ByteArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortArray type:kotlin.ShortArray visibility:private [final]' type=kotlin.ShortArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intArray type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longArray type:kotlin.LongArray visibility:private [final]' type=kotlin.LongArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatArray type:kotlin.FloatArray visibility:private [final]' type=kotlin.FloatArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleArray type:kotlin.DoubleArray visibility:private [final]' type=kotlin.DoubleArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Test1(" + CONST String type=kotlin.String value="stringArray=" + CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="charArray=" + CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charArray type:kotlin.CharArray visibility:private [final]' type=kotlin.CharArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="booleanArray=" + CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanArray type:kotlin.BooleanArray visibility:private [final]' type=kotlin.BooleanArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="byteArray=" + CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArray type:kotlin.ByteArray visibility:private [final]' type=kotlin.ByteArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="shortArray=" + CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortArray type:kotlin.ShortArray visibility:private [final]' type=kotlin.ShortArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="intArray=" + CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intArray type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="longArray=" + CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longArray type:kotlin.LongArray visibility:private [final]' type=kotlin.LongArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="floatArray=" + CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatArray type:kotlin.FloatArray visibility:private [final]' type=kotlin.FloatArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="doubleArray=" + CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleArray type:kotlin.DoubleArray visibility:private [final]' type=kotlin.DoubleArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2.Test2> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (genericArray:kotlin.Array.Test2>) returnType:.Test2.Test2> [primary] - VALUE_PARAMETER name:genericArray index:0 type:kotlin.Array.Test2> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:genericArray visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:genericArray type:kotlin.Array.Test2> visibility:private [final] EXPRESSION_BODY @@ -478,6 +473,11 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array.Test2> declared in .Test2' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:genericArray type:kotlin.Array.Test2> visibility:private [final]' type=kotlin.Array.Test2> origin=null receiver: GET_VAR ': .Test2.Test2> declared in .Test2.' type=.Test2.Test2> origin=null + CONSTRUCTOR visibility:public <> (genericArray:kotlin.Array.Test2>) returnType:.Test2.Test2> [primary] + VALUE_PARAMETER name:genericArray index:0 type:kotlin.Array.Test2> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Test2.Test2>) returnType:kotlin.Array.Test2> [operator] $this: VALUE_PARAMETER name: type:.Test2.Test2> BLOCK_BODY @@ -495,28 +495,6 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt CONSTRUCTOR_CALL 'public constructor (genericArray: kotlin.Array.Test2>) declared in .Test2' type=.Test2.Test2> origin=null : T of .Test2 genericArray: GET_VAR 'genericArray: kotlin.Array.Test2> declared in .Test2.copy' type=kotlin.Array.Test2> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test2.Test2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test2(" - CONST String type=kotlin.String value="genericArray=" - CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:genericArray type:kotlin.Array.Test2> visibility:private [final]' type=kotlin.Array.Test2> origin=null - receiver: GET_VAR ': .Test2.Test2> declared in .Test2.toString' type=.Test2.Test2> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test2.Test2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test2' - CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:genericArray type:kotlin.Array.Test2> visibility:private [final]' type=kotlin.Array.Test2> origin=null - receiver: GET_VAR ': .Test2.Test2> declared in .Test2.hashCode' type=.Test2.Test2> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test2.Test2>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -551,13 +529,30 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test2.Test2> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test2' + CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:genericArray type:kotlin.Array.Test2> visibility:private [final]' type=kotlin.Array.Test2> origin=null + receiver: GET_VAR ': .Test2.Test2> declared in .Test2.hashCode' type=.Test2.Test2> origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test2.Test2> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Test2(" + CONST String type=kotlin.String value="genericArray=" + CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:genericArray type:kotlin.Array.Test2> visibility:private [final]' type=kotlin.Array.Test2> origin=null + receiver: GET_VAR ': .Test2.Test2> declared in .Test2.toString' type=.Test2.Test2> origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 - CONSTRUCTOR visibility:public <> (anyArrayN:kotlin.Array?) returnType:.Test3 [primary] - VALUE_PARAMETER name:anyArrayN index:0 type:kotlin.Array? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:anyArrayN visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:anyArrayN type:kotlin.Array? visibility:private [final] EXPRESSION_BODY @@ -569,6 +564,11 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array? declared in .Test3' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anyArrayN type:kotlin.Array? visibility:private [final]' type=kotlin.Array? origin=null receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + CONSTRUCTOR visibility:public <> (anyArrayN:kotlin.Array?) returnType:.Test3 [primary] + VALUE_PARAMETER name:anyArrayN index:0 type:kotlin.Array? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.Array? [operator] $this: VALUE_PARAMETER name: type:.Test3 BLOCK_BODY @@ -585,37 +585,6 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt RETURN type=kotlin.Nothing from='public final fun copy (anyArrayN: kotlin.Array?): .Test3 declared in .Test3' CONSTRUCTOR_CALL 'public constructor (anyArrayN: kotlin.Array?) declared in .Test3' type=.Test3 origin=null anyArrayN: GET_VAR 'anyArrayN: kotlin.Array? declared in .Test3.copy' type=kotlin.Array? origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test3 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test3' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test3(" - CONST String type=kotlin.String value="anyArrayN=" - CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anyArrayN type:kotlin.Array? visibility:private [final]' type=kotlin.Array? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test3 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' - WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anyArrayN type:kotlin.Array? visibility:private [final]' type=kotlin.Array? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anyArrayN type:kotlin.Array? visibility:private [final]' type=kotlin.Array? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test3, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -650,3 +619,34 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' + WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anyArrayN type:kotlin.Array? visibility:private [final]' type=kotlin.Array? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anyArrayN type:kotlin.Array? visibility:private [final]' type=kotlin.Array? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test3' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Test3(" + CONST String type=kotlin.String value="anyArrayN=" + CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anyArrayN type:kotlin.Array? visibility:private [final]' type=kotlin.Array? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.kt.txt index edaa86ec783..82c106e6b99 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.kt.txt @@ -1,10 +1,4 @@ data class Test1 { - constructor(stringArray: Array, charArray: CharArray, booleanArray: BooleanArray, byteArray: ByteArray, shortArray: ShortArray, intArray: IntArray, longArray: LongArray, floatArray: FloatArray, doubleArray: DoubleArray) /* primary */ { - super/*Any*/() - /* () */ - - } - val stringArray: Array field = stringArray get @@ -41,6 +35,12 @@ data class Test1 { field = doubleArray get + constructor(stringArray: Array, charArray: CharArray, booleanArray: BooleanArray, byteArray: ByteArray, shortArray: ShortArray, intArray: IntArray, longArray: LongArray, floatArray: FloatArray, doubleArray: DoubleArray) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): Array { return .#stringArray } @@ -81,23 +81,6 @@ data class Test1 { return Test1(stringArray = stringArray, charArray = charArray, booleanArray = booleanArray, byteArray = byteArray, shortArray = shortArray, intArray = intArray, longArray = longArray, floatArray = floatArray, doubleArray = doubleArray) } - override fun toString(): String { - return "Test1(" + "stringArray=" + dataClassArrayMemberToString(arg0 = .#stringArray) + ", " + "charArray=" + dataClassArrayMemberToString(arg0 = .#charArray) + ", " + "booleanArray=" + dataClassArrayMemberToString(arg0 = .#booleanArray) + ", " + "byteArray=" + dataClassArrayMemberToString(arg0 = .#byteArray) + ", " + "shortArray=" + dataClassArrayMemberToString(arg0 = .#shortArray) + ", " + "intArray=" + dataClassArrayMemberToString(arg0 = .#intArray) + ", " + "longArray=" + dataClassArrayMemberToString(arg0 = .#longArray) + ", " + "floatArray=" + dataClassArrayMemberToString(arg0 = .#floatArray) + ", " + "doubleArray=" + dataClassArrayMemberToString(arg0 = .#doubleArray) + ")" - } - - override fun hashCode(): Int { - var result: Int = dataClassArrayMemberHashCode(arg0 = .#stringArray) - result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#charArray)) - result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#booleanArray)) - result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#byteArray)) - result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#shortArray)) - result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#intArray)) - result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#longArray)) - result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#floatArray)) - result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#doubleArray)) - return result - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -136,19 +119,36 @@ data class Test1 { return true } + override fun hashCode(): Int { + var result: Int = dataClassArrayMemberHashCode(arg0 = .#stringArray) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#charArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#booleanArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#byteArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#shortArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#intArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#longArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#floatArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = .#doubleArray)) + return result + } + + override fun toString(): String { + return "Test1(" + "stringArray=" + dataClassArrayMemberToString(arg0 = .#stringArray) + ", " + "charArray=" + dataClassArrayMemberToString(arg0 = .#charArray) + ", " + "booleanArray=" + dataClassArrayMemberToString(arg0 = .#booleanArray) + ", " + "byteArray=" + dataClassArrayMemberToString(arg0 = .#byteArray) + ", " + "shortArray=" + dataClassArrayMemberToString(arg0 = .#shortArray) + ", " + "intArray=" + dataClassArrayMemberToString(arg0 = .#intArray) + ", " + "longArray=" + dataClassArrayMemberToString(arg0 = .#longArray) + ", " + "floatArray=" + dataClassArrayMemberToString(arg0 = .#floatArray) + ", " + "doubleArray=" + dataClassArrayMemberToString(arg0 = .#doubleArray) + ")" + } + } data class Test2 { + val genericArray: Array + field = genericArray + get + constructor(genericArray: Array) /* primary */ { super/*Any*/() /* () */ } - val genericArray: Array - field = genericArray - get - operator fun component1(): Array { return .#genericArray } @@ -157,14 +157,6 @@ data class Test2 { return Test2(genericArray = genericArray) } - override fun toString(): String { - return "Test2(" + "genericArray=" + dataClassArrayMemberToString(arg0 = .#genericArray) + ")" - } - - override fun hashCode(): Int { - return dataClassArrayMemberHashCode(arg0 = .#genericArray) - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -179,19 +171,27 @@ data class Test2 { return true } + override fun hashCode(): Int { + return dataClassArrayMemberHashCode(arg0 = .#genericArray) + } + + override fun toString(): String { + return "Test2(" + "genericArray=" + dataClassArrayMemberToString(arg0 = .#genericArray) + ")" + } + } data class Test3 { + val anyArrayN: Array? + field = anyArrayN + get + constructor(anyArrayN: Array?) /* primary */ { super/*Any*/() /* () */ } - val anyArrayN: Array? - field = anyArrayN - get - operator fun component1(): Array? { return .#anyArrayN } @@ -200,17 +200,6 @@ data class Test3 { return Test3(anyArrayN = anyArrayN) } - override fun toString(): String { - return "Test3(" + "anyArrayN=" + dataClassArrayMemberToString(arg0 = .#anyArrayN) + ")" - } - - override fun hashCode(): Int { - return when { - EQEQ(arg0 = .#anyArrayN, arg1 = null) -> 0 - else -> dataClassArrayMemberHashCode(arg0 = .#anyArrayN) - } - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -225,4 +214,16 @@ data class Test3 { return true } + override fun hashCode(): Int { + return when { + EQEQ(arg0 = .#anyArrayN, arg1 = null) -> 0 + else -> dataClassArrayMemberHashCode(arg0 = .#anyArrayN) + } + } + + override fun toString(): String { + return "Test3(" + "anyArrayN=" + dataClassArrayMemberToString(arg0 = .#anyArrayN) + ")" + } + } + diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.ir.txt index 21c2c8d5bf4..6fd48544d1a 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.ir.txt @@ -1,13 +1,6 @@ FILE fqName: fileName:/dataClasses.kt CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String, z:kotlin.Any) returnType:.Test1 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.String - VALUE_PARAMETER name:z index:2 type:kotlin.Any - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -41,6 +34,13 @@ FILE fqName: fileName:/dataClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .Test1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String, z:kotlin.Any) returnType:.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.String + VALUE_PARAMETER name:z index:2 type:kotlin.Any + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.Test1 BLOCK_BODY @@ -79,53 +79,6 @@ FILE fqName: fileName:/dataClasses.kt x: GET_VAR 'x: kotlin.Int declared in .Test1.copy' type=kotlin.Int origin=null y: GET_VAR 'y: kotlin.String declared in .Test1.copy' type=kotlin.String origin=null z: GET_VAR 'z: kotlin.Any declared in .Test1.copy' type=kotlin.Any origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test1(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="y=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="z=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test1 - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' - GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test1, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -180,13 +133,55 @@ FILE fqName: fileName:/dataClasses.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + GET_VAR 'var result: kotlin.Int declared in .Test1.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Test1(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="y=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="z=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:public <> (x:kotlin.Any?) returnType:.Test2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Any? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final] EXPRESSION_BODY @@ -198,6 +193,11 @@ FILE fqName: fileName:/dataClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in .Test2' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final]' type=kotlin.Any? origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Any?) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Any? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Any? [operator] $this: VALUE_PARAMETER name: type:.Test2 BLOCK_BODY @@ -214,36 +214,6 @@ FILE fqName: fileName:/dataClasses.kt RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Any?): .Test2 declared in .Test2' CONSTRUCTOR_CALL 'public constructor (x: kotlin.Any?) declared in .Test2' type=.Test2 origin=null x: GET_VAR 'x: kotlin.Any? declared in .Test2.copy' type=kotlin.Any? origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test2(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final]' type=kotlin.Any? origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.toString' type=.Test2 origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test2' - WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final]' type=kotlin.Any? origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.hashCode' type=.Test2 origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final]' type=kotlin.Any? origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.hashCode' type=.Test2 origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test2, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -278,16 +248,38 @@ FILE fqName: fileName:/dataClasses.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test2' + WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final]' type=kotlin.Any? origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.hashCode' type=.Test2 origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final]' type=kotlin.Any? origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.hashCode' type=.Test2 origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Test2(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final]' type=kotlin.Any? origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.toString' type=.Test2 origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 - CONSTRUCTOR visibility:public <> (d:kotlin.Double, dn:kotlin.Double?, f:kotlin.Float, df:kotlin.Float?) returnType:.Test3 [primary] - VALUE_PARAMETER name:d index:0 type:kotlin.Double - VALUE_PARAMETER name:dn index:1 type:kotlin.Double? - VALUE_PARAMETER name:f index:2 type:kotlin.Float - VALUE_PARAMETER name:df index:3 type:kotlin.Float? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:d visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:private [final] EXPRESSION_BODY @@ -332,6 +324,14 @@ FILE fqName: fileName:/dataClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Float? declared in .Test3' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:private [final]' type=kotlin.Float? origin=null receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + CONSTRUCTOR visibility:public <> (d:kotlin.Double, dn:kotlin.Double?, f:kotlin.Float, df:kotlin.Float?) returnType:.Test3 [primary] + VALUE_PARAMETER name:d index:0 type:kotlin.Double + VALUE_PARAMETER name:dn index:1 type:kotlin.Double? + VALUE_PARAMETER name:f index:2 type:kotlin.Float + VALUE_PARAMETER name:df index:3 type:kotlin.Float? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.Double [operator] $this: VALUE_PARAMETER name: type:.Test3 BLOCK_BODY @@ -381,83 +381,6 @@ FILE fqName: fileName:/dataClasses.kt dn: GET_VAR 'dn: kotlin.Double? declared in .Test3.copy' type=kotlin.Double? origin=null f: GET_VAR 'f: kotlin.Float declared in .Test3.copy' type=kotlin.Float origin=null df: GET_VAR 'df: kotlin.Float? declared in .Test3.copy' type=kotlin.Float? origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test3 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test3' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test3(" - CONST String type=kotlin.String value="d=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:private [final]' type=kotlin.Double origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="dn=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="f=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:f type:kotlin.Float visibility:private [final]' type=kotlin.Float origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="df=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:private [final]' type=kotlin.Float? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test3 - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:private [final]' type=kotlin.Double origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:f type:kotlin.Float visibility:private [final]' type=kotlin.Float origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - SET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:private [final]' type=kotlin.Float? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:private [final]' type=kotlin.Float? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' - GET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test3, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -522,3 +445,80 @@ FILE fqName: fileName:/dataClasses.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:private [final]' type=kotlin.Double origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:f type:kotlin.Float visibility:private [final]' type=kotlin.Float origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + SET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:private [final]' type=kotlin.Float? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:private [final]' type=kotlin.Float? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' + GET_VAR 'var result: kotlin.Int declared in .Test3.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test3' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Test3(" + CONST String type=kotlin.String value="d=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:private [final]' type=kotlin.Double origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="dn=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="f=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:f type:kotlin.Float visibility:private [final]' type=kotlin.Float origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="df=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:private [final]' type=kotlin.Float? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.kt.txt index aa5451183d9..a52322897f9 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.kt.txt @@ -1,10 +1,4 @@ data class Test1 { - constructor(x: Int, y: String, z: Any) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x get @@ -17,6 +11,12 @@ data class Test1 { field = z get + constructor(x: Int, y: String, z: Any) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): Int { return .#x } @@ -33,17 +33,6 @@ data class Test1 { return Test1(x = x, y = y, z = z) } - override fun toString(): String { - return "Test1(" + "x=" + .#x + ", " + "y=" + .#y + ", " + "z=" + .#z + ")" - } - - override fun hashCode(): Int { - var result: Int = .#x.hashCode() - result = result.times(other = 31).plus(other = .#y.hashCode()) - result = result.times(other = 31).plus(other = .#z.hashCode()) - return result - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -64,19 +53,30 @@ data class Test1 { return true } + override fun hashCode(): Int { + var result: Int = .#x.hashCode() + result = result.times(other = 31).plus(other = .#y.hashCode()) + result = result.times(other = 31).plus(other = .#z.hashCode()) + return result + } + + override fun toString(): String { + return "Test1(" + "x=" + .#x + ", " + "y=" + .#y + ", " + "z=" + .#z + ")" + } + } data class Test2 { + val x: Any? + field = x + get + constructor(x: Any?) /* primary */ { super/*Any*/() /* () */ } - val x: Any? - field = x - get - operator fun component1(): Any? { return .#x } @@ -85,17 +85,6 @@ data class Test2 { return Test2(x = x) } - override fun toString(): String { - return "Test2(" + "x=" + .#x + ")" - } - - override fun hashCode(): Int { - return when { - EQEQ(arg0 = .#x, arg1 = null) -> 0 - else -> .#x.hashCode() - } - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -110,15 +99,20 @@ data class Test2 { return true } + override fun hashCode(): Int { + return when { + EQEQ(arg0 = .#x, arg1 = null) -> 0 + else -> .#x.hashCode() + } + } + + override fun toString(): String { + return "Test2(" + "x=" + .#x + ")" + } + } data class Test3 { - constructor(d: Double, dn: Double?, f: Float, df: Float?) /* primary */ { - super/*Any*/() - /* () */ - - } - val d: Double field = d get @@ -135,6 +129,12 @@ data class Test3 { field = df get + constructor(d: Double, dn: Double?, f: Float, df: Float?) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): Double { return .#d } @@ -155,24 +155,6 @@ data class Test3 { return Test3(d = d, dn = dn, f = f, df = df) } - override fun toString(): String { - return "Test3(" + "d=" + .#d + ", " + "dn=" + .#dn + ", " + "f=" + .#f + ", " + "df=" + .#df + ")" - } - - override fun hashCode(): Int { - var result: Int = .#d.hashCode() - result = result.times(other = 31).plus(other = when { - EQEQ(arg0 = .#dn, arg1 = null) -> 0 - else -> .#dn.hashCode() - }) - result = result.times(other = 31).plus(other = .#f.hashCode()) - result = result.times(other = 31).plus(other = when { - EQEQ(arg0 = .#df, arg1 = null) -> 0 - else -> .#df.hashCode() - }) - return result - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -196,4 +178,23 @@ data class Test3 { return true } + override fun hashCode(): Int { + var result: Int = .#d.hashCode() + result = result.times(other = 31).plus(other = when { + EQEQ(arg0 = .#dn, arg1 = null) -> 0 + else -> .#dn.hashCode() + }) + result = result.times(other = 31).plus(other = .#f.hashCode()) + result = result.times(other = 31).plus(other = when { + EQEQ(arg0 = .#df, arg1 = null) -> 0 + else -> .#df.hashCode() + }) + return result + } + + override fun toString(): String { + return "Test3(" + "d=" + .#d + ", " + "dn=" + .#dn + ", " + "f=" + .#f + ", " + "df=" + .#df + ")" + } + } + diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.ir.txt index c374994d3e3..2e799e78c8a 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/dataClassesGeneric.kt CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1.Test1> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T of .Test1) returnType:.Test1.Test1> [primary] - VALUE_PARAMETER name:x index:0 type:T of .Test1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test1 visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,11 @@ FILE fqName: fileName:/dataClassesGeneric.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Test1 declared in .Test1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test1 visibility:private [final]' type=T of .Test1 origin=null receiver: GET_VAR ': .Test1.Test1> declared in .Test1.' type=.Test1.Test1> origin=null + CONSTRUCTOR visibility:public <> (x:T of .Test1) returnType:.Test1.Test1> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Test1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Test1.Test1>) returnType:T of .Test1 [operator] $this: VALUE_PARAMETER name: type:.Test1.Test1> BLOCK_BODY @@ -35,36 +35,6 @@ FILE fqName: fileName:/dataClassesGeneric.kt CONSTRUCTOR_CALL 'public constructor (x: T of .Test1) declared in .Test1' type=.Test1.Test1> origin=null : T of .Test1 x: GET_VAR 'x: T of .Test1 declared in .Test1.copy' type=T of .Test1 origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test1.Test1>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test1.Test1> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test1(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test1 visibility:private [final]' type=T of .Test1 origin=null - receiver: GET_VAR ': .Test1.Test1> declared in .Test1.toString' type=.Test1.Test1> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test1.Test1>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test1.Test1> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' - WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test1 visibility:private [final]' type=T of .Test1 origin=null - receiver: GET_VAR ': .Test1.Test1> declared in .Test1.hashCode' type=.Test1.Test1> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test1 visibility:private [final]' type=T of .Test1 origin=null - receiver: GET_VAR ': .Test1.Test1> declared in .Test1.hashCode' type=.Test1.Test1> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test1.Test1>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -99,14 +69,39 @@ FILE fqName: fileName:/dataClassesGeneric.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test1.Test1>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test1.Test1> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test1 visibility:private [final]' type=T of .Test1 origin=null + receiver: GET_VAR ': .Test1.Test1> declared in .Test1.hashCode' type=.Test1.Test1> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test1 visibility:private [final]' type=T of .Test1 origin=null + receiver: GET_VAR ': .Test1.Test1> declared in .Test1.hashCode' type=.Test1.Test1> origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test1.Test1>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test1.Test1> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Test1(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test1 visibility:private [final]' type=T of .Test1 origin=null + receiver: GET_VAR ': .Test1.Test1> declared in .Test1.toString' type=.Test1.Test1> origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2.Test2> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Number] reified:false - CONSTRUCTOR visibility:public <> (x:T of .Test2) returnType:.Test2.Test2> [primary] - VALUE_PARAMETER name:x index:0 type:T of .Test2 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test2 visibility:private [final] EXPRESSION_BODY @@ -118,6 +113,11 @@ FILE fqName: fileName:/dataClassesGeneric.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Test2 declared in .Test2' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test2 visibility:private [final]' type=T of .Test2 origin=null receiver: GET_VAR ': .Test2.Test2> declared in .Test2.' type=.Test2.Test2> origin=null + CONSTRUCTOR visibility:public <> (x:T of .Test2) returnType:.Test2.Test2> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Test2 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Test2.Test2>) returnType:T of .Test2 [operator] $this: VALUE_PARAMETER name: type:.Test2.Test2> BLOCK_BODY @@ -135,27 +135,6 @@ FILE fqName: fileName:/dataClassesGeneric.kt CONSTRUCTOR_CALL 'public constructor (x: T of .Test2) declared in .Test2' type=.Test2.Test2> origin=null : T of .Test2 x: GET_VAR 'x: T of .Test2 declared in .Test2.copy' type=T of .Test2 origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test2.Test2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test2(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test2 visibility:private [final]' type=T of .Test2 origin=null - receiver: GET_VAR ': .Test2.Test2> declared in .Test2.toString' type=.Test2.Test2> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test2.Test2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test2' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Number' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test2 visibility:private [final]' type=T of .Test2 origin=null - receiver: GET_VAR ': .Test2.Test2> declared in .Test2.hashCode' type=.Test2.Test2> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test2.Test2>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -190,14 +169,30 @@ FILE fqName: fileName:/dataClassesGeneric.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test2.Test2> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test2' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Number' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test2 visibility:private [final]' type=T of .Test2 origin=null + receiver: GET_VAR ': .Test2.Test2> declared in .Test2.hashCode' type=.Test2.Test2> origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test2.Test2> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Test2(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test2 visibility:private [final]' type=T of .Test2 origin=null + receiver: GET_VAR ': .Test2.Test2> declared in .Test2.toString' type=.Test2.Test2> origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3.Test3> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:kotlin.collections.List.Test3>) returnType:.Test3.Test3> [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.collections.List.Test3> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List.Test3> visibility:private [final] EXPRESSION_BODY @@ -209,6 +204,11 @@ FILE fqName: fileName:/dataClassesGeneric.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.List.Test3> declared in .Test3' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List.Test3> visibility:private [final]' type=kotlin.collections.List.Test3> origin=null receiver: GET_VAR ': .Test3.Test3> declared in .Test3.' type=.Test3.Test3> origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.collections.List.Test3>) returnType:.Test3.Test3> [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.collections.List.Test3> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Test3.Test3>) returnType:kotlin.collections.List.Test3> [operator] $this: VALUE_PARAMETER name: type:.Test3.Test3> BLOCK_BODY @@ -226,27 +226,6 @@ FILE fqName: fileName:/dataClassesGeneric.kt CONSTRUCTOR_CALL 'public constructor (x: kotlin.collections.List.Test3>) declared in .Test3' type=.Test3.Test3> origin=null : T of .Test3 x: GET_VAR 'x: kotlin.collections.List.Test3> declared in .Test3.copy' type=kotlin.collections.List.Test3> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test3.Test3>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test3.Test3> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test3' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test3(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List.Test3> visibility:private [final]' type=kotlin.collections.List.Test3> origin=null - receiver: GET_VAR ': .Test3.Test3> declared in .Test3.toString' type=.Test3.Test3> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test3.Test3>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test3.Test3> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List.Test3> visibility:private [final]' type=kotlin.collections.List.Test3> origin=null - receiver: GET_VAR ': .Test3.Test3> declared in .Test3.hashCode' type=.Test3.Test3> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test3.Test3>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -281,13 +260,29 @@ FILE fqName: fileName:/dataClassesGeneric.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test3.Test3>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test3.Test3> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List.Test3> visibility:private [final]' type=kotlin.collections.List.Test3> origin=null + receiver: GET_VAR ': .Test3.Test3> declared in .Test3.hashCode' type=.Test3.Test3> origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test3.Test3>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test3.Test3> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test3' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Test3(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List.Test3> visibility:private [final]' type=kotlin.collections.List.Test3> origin=null + receiver: GET_VAR ': .Test3.Test3> declared in .Test3.toString' type=.Test3.Test3> origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:Test4 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test4 - CONSTRUCTOR visibility:public <> (x:kotlin.collections.List) returnType:.Test4 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.collections.List - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List visibility:private [final] EXPRESSION_BODY @@ -299,6 +294,11 @@ FILE fqName: fileName:/dataClassesGeneric.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.List declared in .Test4' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List visibility:private [final]' type=kotlin.collections.List origin=null receiver: GET_VAR ': .Test4 declared in .Test4.' type=.Test4 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.collections.List) returnType:.Test4 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.collections.List + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Test4) returnType:kotlin.collections.List [operator] $this: VALUE_PARAMETER name: type:.Test4 BLOCK_BODY @@ -315,27 +315,6 @@ FILE fqName: fileName:/dataClassesGeneric.kt RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.collections.List): .Test4 declared in .Test4' CONSTRUCTOR_CALL 'public constructor (x: kotlin.collections.List) declared in .Test4' type=.Test4 origin=null x: GET_VAR 'x: kotlin.collections.List declared in .Test4.copy' type=kotlin.collections.List origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test4) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test4 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test4' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test4(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List visibility:private [final]' type=kotlin.collections.List origin=null - receiver: GET_VAR ': .Test4 declared in .Test4.toString' type=.Test4 origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test4) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test4 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test4' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List visibility:private [final]' type=kotlin.collections.List origin=null - receiver: GET_VAR ': .Test4 declared in .Test4.hashCode' type=.Test4 origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test4, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -370,3 +349,24 @@ FILE fqName: fileName:/dataClassesGeneric.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test4' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test4) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test4' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List visibility:private [final]' type=kotlin.collections.List origin=null + receiver: GET_VAR ': .Test4 declared in .Test4.hashCode' type=.Test4 origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test4) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test4' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Test4(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List visibility:private [final]' type=kotlin.collections.List origin=null + receiver: GET_VAR ': .Test4 declared in .Test4.toString' type=.Test4 origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.kt.txt index f4f399be185..d9fc3247d2f 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.kt.txt @@ -1,14 +1,14 @@ data class Test1 { + val x: T + field = x + get + constructor(x: T) /* primary */ { super/*Any*/() /* () */ } - val x: T - field = x - get - operator fun component1(): T { return .#x } @@ -17,17 +17,6 @@ data class Test1 { return Test1(x = x) } - override fun toString(): String { - return "Test1(" + "x=" + .#x + ")" - } - - override fun hashCode(): Int { - return when { - EQEQ(arg0 = .#x, arg1 = null) -> 0 - else -> .#x.hashCode() - } - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -42,19 +31,30 @@ data class Test1 { return true } + override fun hashCode(): Int { + return when { + EQEQ(arg0 = .#x, arg1 = null) -> 0 + else -> .#x.hashCode() + } + } + + override fun toString(): String { + return "Test1(" + "x=" + .#x + ")" + } + } data class Test2 { + val x: T + field = x + get + constructor(x: T) /* primary */ { super/*Any*/() /* () */ } - val x: T - field = x - get - operator fun component1(): T { return .#x } @@ -63,14 +63,6 @@ data class Test2 { return Test2(x = x) } - override fun toString(): String { - return "Test2(" + "x=" + .#x + ")" - } - - override fun hashCode(): Int { - return .#x.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -85,19 +77,27 @@ data class Test2 { return true } + override fun hashCode(): Int { + return .#x.hashCode() + } + + override fun toString(): String { + return "Test2(" + "x=" + .#x + ")" + } + } data class Test3 { + val x: List + field = x + get + constructor(x: List) /* primary */ { super/*Any*/() /* () */ } - val x: List - field = x - get - operator fun component1(): List { return .#x } @@ -106,14 +106,6 @@ data class Test3 { return Test3(x = x) } - override fun toString(): String { - return "Test3(" + "x=" + .#x + ")" - } - - override fun hashCode(): Int { - return .#x.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -128,19 +120,27 @@ data class Test3 { return true } + override fun hashCode(): Int { + return .#x.hashCode() + } + + override fun toString(): String { + return "Test3(" + "x=" + .#x + ")" + } + } data class Test4 { + val x: List + field = x + get + constructor(x: List) /* primary */ { super/*Any*/() /* () */ } - val x: List - field = x - get - operator fun component1(): List { return .#x } @@ -149,14 +149,6 @@ data class Test4 { return Test4(x = x) } - override fun toString(): String { - return "Test4(" + "x=" + .#x + ")" - } - - override fun hashCode(): Int { - return .#x.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -171,4 +163,13 @@ data class Test4 { return true } + override fun hashCode(): Int { + return .#x.hashCode() + } + + override fun toString(): String { + return "Test4(" + "x=" + .#x + ")" + } + } + diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataObject.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/dataObject.ir.txt index 77d82391b54..01deff665da 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataObject.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataObject.ir.txt @@ -5,20 +5,6 @@ FILE fqName: fileName:/dataObject.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:DataObject modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.DataObject) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.DataObject - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .DataObject' - CONST String type=kotlin.String value="DataObject" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.DataObject) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.DataObject - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .DataObject' - CONST Int type=kotlin.Int value=-1155894359 FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.DataObject, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -43,3 +29,17 @@ FILE fqName: fileName:/dataObject.kt GET_VAR 'other: kotlin.Any? declared in .DataObject.equals' type=kotlin.Any? origin=null RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataObject' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.DataObject) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.DataObject + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .DataObject' + CONST Int type=kotlin.Int value=-1155894359 + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.DataObject) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.DataObject + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .DataObject' + CONST String type=kotlin.String value="DataObject" diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataObject.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataObject.kt.txt index 6691c2c2575..84025367eac 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataObject.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataObject.kt.txt @@ -5,14 +5,6 @@ data object DataObject { } - override fun toString(): String { - return "DataObject" - } - - override fun hashCode(): Int { - return -1155894359 - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -24,4 +16,13 @@ data object DataObject { return true } + override fun hashCode(): Int { + return -1155894359 + } + + override fun toString(): String { + return "DataObject" + } + } + diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt deleted file mode 100644 index 76c463b2557..00000000000 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt +++ /dev/null @@ -1,174 +0,0 @@ -FILE fqName: fileName:/delegationInSealed.kt - CLASS CLASS name:A modality:SEALED visibility:public superTypes:[kotlin.CharSequence] - sealedSubclasses: - CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[.A; kotlin.CharSequence] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:protected <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:SEALED visibility:public superTypes:[kotlin.CharSequence]' - CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[.A; kotlin.CharSequence] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.B - CONSTRUCTOR visibility:public <> (c:kotlin.CharSequence) returnType:.A.B [primary] - VALUE_PARAMETER name:c index:0 type:kotlin.CharSequence - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .A' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[.A; kotlin.CharSequence]' - PROPERTY name:c visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final] - EXPRESSION_BODY - GET_VAR 'c: kotlin.CharSequence declared in .A.B.' type=kotlin.CharSequence origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A.B) returnType:kotlin.CharSequence - correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.CharSequence declared in .A.B' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.' type=.A.B origin=null - FUN DELEGATED_MEMBER name:get visibility:public modality:OPEN <> ($this:.A.B, index:kotlin.Int) returnType:kotlin.Char [operator] - overridden: - public abstract fun get (index: kotlin.Int): kotlin.Char declared in .A - public abstract fun get (index: kotlin.Int): kotlin.Char declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:.A.B - VALUE_PARAMETER name:index index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun get (index: kotlin.Int): kotlin.Char declared in .A.B' - CALL 'public abstract fun get (index: kotlin.Int): kotlin.Char declared in kotlin.CharSequence' type=kotlin.Char origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.get' type=.A.B origin=null - index: GET_VAR 'index: kotlin.Int declared in .A.B.get' type=kotlin.Int origin=null - FUN DELEGATED_MEMBER name:subSequence visibility:public modality:OPEN <> ($this:.A.B, startIndex:kotlin.Int, endIndex:kotlin.Int) returnType:kotlin.CharSequence - overridden: - public abstract fun subSequence (startIndex: kotlin.Int, endIndex: kotlin.Int): kotlin.CharSequence declared in .A - public abstract fun subSequence (startIndex: kotlin.Int, endIndex: kotlin.Int): kotlin.CharSequence declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:.A.B - VALUE_PARAMETER name:startIndex index:0 type:kotlin.Int - VALUE_PARAMETER name:endIndex index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun subSequence (startIndex: kotlin.Int, endIndex: kotlin.Int): kotlin.CharSequence declared in .A.B' - CALL 'public abstract fun subSequence (startIndex: kotlin.Int, endIndex: kotlin.Int): kotlin.CharSequence declared in kotlin.CharSequence' type=kotlin.CharSequence origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.subSequence' type=.A.B origin=null - startIndex: GET_VAR 'startIndex: kotlin.Int declared in .A.B.subSequence' type=kotlin.Int origin=null - endIndex: GET_VAR 'endIndex: kotlin.Int declared in .A.B.subSequence' type=kotlin.Int origin=null - PROPERTY DELEGATED_MEMBER name:length visibility:public modality:OPEN [val] - overridden: - public abstract length: kotlin.Int - public abstract length: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:length visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .A - public abstract fun (): kotlin.Int declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:.A.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .A.B' - CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.' type=.A.B origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.A.B) returnType:kotlin.CharSequence [operator] - $this: VALUE_PARAMETER name: type:.A.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.CharSequence declared in .A.B' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.component1' type=.A.B origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:.A.B, c:kotlin.CharSequence) returnType:.A.B - $this: VALUE_PARAMETER name: type:.A.B - VALUE_PARAMETER name:c index:0 type:kotlin.CharSequence - EXPRESSION_BODY - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.copy' type=.A.B origin=null - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun copy (c: kotlin.CharSequence): .A.B declared in .A.B' - CONSTRUCTOR_CALL 'public constructor (c: kotlin.CharSequence) declared in .A.B' type=.A.B origin=null - c: GET_VAR 'c: kotlin.CharSequence declared in .A.B.copy' type=kotlin.CharSequence origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in .A - public open fun toString (): kotlin.String declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:.A.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A.B' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="B(" - CONST String type=kotlin.String value="c=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.toString' type=.A.B origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in .A - public open fun hashCode (): kotlin.Int declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:.A.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A.B' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.hashCode' type=.A.B origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A.B, other:kotlin.Any?) returnType:kotlin.Boolean [operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:.A.B - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - BLOCK_BODY - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ - arg0: GET_VAR ': .A.B declared in .A.B.equals' type=.A.B origin=null - arg1: GET_VAR 'other: kotlin.Any? declared in .A.B.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A.B' - CONST Boolean type=kotlin.Boolean value=true - WHEN type=kotlin.Unit origin=null - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.A.B - GET_VAR 'other: kotlin.Any? declared in .A.B.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A.B' - CONST Boolean type=kotlin.Boolean value=false - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A.B [val] - TYPE_OP type=.A.B origin=CAST typeOperand=.A.B - GET_VAR 'other: kotlin.Any? declared in .A.B.equals' type=kotlin.Any? origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean 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:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.equals' type=.A.B origin=null - arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR 'val tmp_0: .A.B declared in .A.B.equals' type=.A.B origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A.B' - CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A.B' - CONST Boolean type=kotlin.Boolean value=true - FUN FAKE_OVERRIDE name:get visibility:public modality:ABSTRACT <> ($this:kotlin.CharSequence, index:kotlin.Int) returnType:kotlin.Char [fake_override,operator] - overridden: - public abstract fun get (index: kotlin.Int): kotlin.Char declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:kotlin.CharSequence - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:subSequence visibility:public modality:ABSTRACT <> ($this:kotlin.CharSequence, startIndex:kotlin.Int, endIndex:kotlin.Int) returnType:kotlin.CharSequence [fake_override] - overridden: - public abstract fun subSequence (startIndex: kotlin.Int, endIndex: kotlin.Int): kotlin.CharSequence declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:kotlin.CharSequence - VALUE_PARAMETER name:startIndex index:0 type:kotlin.Int - VALUE_PARAMETER name:endIndex index:1 type:kotlin.Int - PROPERTY FAKE_OVERRIDE name:length visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract length: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlin.CharSequence) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:length visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.Int declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:kotlin.CharSequence - 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.CharSequence - $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.CharSequence - $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.CharSequence - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt deleted file mode 100644 index bd76190d66e..00000000000 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt +++ /dev/null @@ -1,65 +0,0 @@ -sealed class A : CharSequence { - protected constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - data class B : A, CharSequence { - constructor(c: CharSequence) /* primary */ { - super/*A*/() - /* () */ - - } - - val c: CharSequence - field = c - get - - override operator fun get(index: Int): Char { - return .#c.get(index = index) - } - - override fun subSequence(startIndex: Int, endIndex: Int): CharSequence { - return .#c.subSequence(startIndex = startIndex, endIndex = endIndex) - } - - override val length: Int - override get(): Int { - return .#c.() - } - - operator fun component1(): CharSequence { - return .#c - } - - fun copy(c: CharSequence = .#c): B { - return B(c = c) - } - - override fun toString(): String { - return "B(" + "c=" + .#c + ")" - } - - override fun hashCode(): Int { - return .#c.hashCode() - } - - override operator fun equals(other: Any?): Boolean { - when { - EQEQEQ(arg0 = , arg1 = other) -> return true - } - when { - other !is B -> return false - } - val tmp_0: B = other as B - when { - EQEQ(arg0 = .#c, arg1 = tmp_0.#c).not() -> return false - } - return true - } - - } - -} - diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.ir.txt index b0b629a4fe2..8c343945d1e 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.ir.txt @@ -3,17 +3,8 @@ FILE fqName: fileName:/delegationInSealed.kt sealedSubclasses: CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[.A; kotlin.CharSequence] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:protected <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:SEALED visibility:public superTypes:[kotlin.CharSequence]' CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[.A; kotlin.CharSequence] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.B - CONSTRUCTOR visibility:public <> (c:kotlin.CharSequence) returnType:.A.B [primary] - VALUE_PARAMETER name:c index:0 type:kotlin.CharSequence - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .A' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[.A; kotlin.CharSequence]' PROPERTY name:c visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final] EXPRESSION_BODY @@ -25,21 +16,11 @@ FILE fqName: fileName:/delegationInSealed.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.CharSequence declared in .A.B' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null receiver: GET_VAR ': .A.B declared in .A.B.' type=.A.B origin=null - PROPERTY DELEGATED_MEMBER name:length visibility:public modality:OPEN [val] - overridden: - public abstract length: kotlin.Int - public abstract length: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:length visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .A - public abstract fun (): kotlin.Int declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:.A.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .A.B' - CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.' type=.A.B origin=null + CONSTRUCTOR visibility:public <> (c:kotlin.CharSequence) returnType:.A.B [primary] + VALUE_PARAMETER name:c index:0 type:kotlin.CharSequence + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .A' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[.A; kotlin.CharSequence]' FUN DELEGATED_MEMBER name:get visibility:public modality:OPEN <> ($this:.A.B, index:kotlin.Int) returnType:kotlin.Char [operator] overridden: public abstract fun get (index: kotlin.Int): kotlin.Char declared in .A @@ -82,29 +63,6 @@ FILE fqName: fileName:/delegationInSealed.kt RETURN type=kotlin.Nothing from='public final fun copy (c: kotlin.CharSequence): .A.B declared in .A.B' CONSTRUCTOR_CALL 'public constructor (c: kotlin.CharSequence) declared in .A.B' type=.A.B origin=null c: GET_VAR 'c: kotlin.CharSequence declared in .A.B.copy' type=kotlin.CharSequence origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in .A - public open fun toString (): kotlin.String declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:.A.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A.B' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="B(" - CONST String type=kotlin.String value="c=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.toString' type=.A.B origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in .A - public open fun hashCode (): kotlin.Int declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:.A.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A.B' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.hashCode' type=.A.B origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A.B, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A @@ -140,14 +98,48 @@ FILE fqName: fileName:/delegationInSealed.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A.B' CONST Boolean type=kotlin.Boolean value=true - PROPERTY FAKE_OVERRIDE name:length visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract length: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlin.CharSequence) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:length visibility:public modality:ABSTRACT [fake_override,val] + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.Int overridden: - public abstract fun (): kotlin.Int declared in kotlin.CharSequence - $this: VALUE_PARAMETER name: type:kotlin.CharSequence + public open fun hashCode (): kotlin.Int declared in .A + public open fun hashCode (): kotlin.Int declared in kotlin.CharSequence + $this: VALUE_PARAMETER name: type:.A.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A.B' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null + receiver: GET_VAR ': .A.B declared in .A.B.hashCode' type=.A.B origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in .A + public open fun toString (): kotlin.String declared in kotlin.CharSequence + $this: VALUE_PARAMETER name: type:.A.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A.B' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="B(" + CONST String type=kotlin.String value="c=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null + receiver: GET_VAR ': .A.B declared in .A.B.toString' type=.A.B origin=null + CONST String type=kotlin.String value=")" + PROPERTY DELEGATED_MEMBER name:length visibility:public modality:OPEN [val] + overridden: + public abstract length: kotlin.Int + public abstract length: kotlin.Int + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.Int + correspondingProperty: PROPERTY DELEGATED_MEMBER name:length visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in .A + public abstract fun (): kotlin.Int declared in kotlin.CharSequence + $this: VALUE_PARAMETER name: type:.A.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .A.B' + CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null + receiver: GET_VAR ': .A.B declared in .A.B.' type=.A.B origin=null + CONSTRUCTOR visibility:protected <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:SEALED visibility:public superTypes:[kotlin.CharSequence]' 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.CharSequence @@ -172,3 +164,11 @@ FILE fqName: fileName:/delegationInSealed.kt overridden: public open fun toString (): kotlin.String declared in kotlin.CharSequence $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:length visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract length: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlin.CharSequence) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:length visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.Int declared in kotlin.CharSequence + $this: VALUE_PARAMETER name: type:kotlin.CharSequence diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.kt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.kt index 770a36f1a6a..e03dfe85954 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.kt +++ b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB // SKIP_KLIB_TEST // IGNORE_BACKEND_K1: JS_IR diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.kt.txt index 101307e53c6..a5ea6ce5203 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.kt.txt @@ -1,26 +1,15 @@ sealed class A : CharSequence { - protected constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - data class B : A, CharSequence { + val c: CharSequence + field = c + get + constructor(c: CharSequence) /* primary */ { super/*A*/() /* () */ } - val c: CharSequence - field = c - get - - override val length: Int - override get(): Int { - return .#c.() - } - override operator fun get(index: Int): Char { return .#c.get(index = index) } @@ -37,14 +26,6 @@ sealed class A : CharSequence { return B(c = c) } - override fun toString(): String { - return "B(" + "c=" + .#c + ")" - } - - override fun hashCode(): Int { - return .#c.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -59,6 +40,26 @@ sealed class A : CharSequence { return true } + override fun hashCode(): Int { + return .#c.hashCode() + } + + override fun toString(): String { + return "B(" + "c=" + .#c + ")" + } + + override val length: Int + override get(): Int { + return .#c.() + } + + } + + protected constructor() /* primary */ { + super/*Any*/() + /* () */ + } } + diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt31649.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/kt31649.ir.txt index c82a8f31212..04917271be2 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/kt31649.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/kt31649.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/kt31649.kt CLASS CLASS name:TestData modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestData - CONSTRUCTOR visibility:public <> (nn:kotlin.Nothing?) returnType:.TestData [primary] - VALUE_PARAMETER name:nn index:0 type:kotlin.Nothing? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestData modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:nn visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/kt31649.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Nothing? declared in .TestData' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null receiver: GET_VAR ': .TestData declared in .TestData.' type=.TestData origin=null + CONSTRUCTOR visibility:public <> (nn:kotlin.Nothing?) returnType:.TestData [primary] + VALUE_PARAMETER name:nn index:0 type:kotlin.Nothing? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestData modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.TestData) returnType:kotlin.Nothing? [operator] $this: VALUE_PARAMETER name: type:.TestData BLOCK_BODY @@ -33,36 +33,6 @@ FILE fqName: fileName:/kt31649.kt RETURN type=kotlin.Nothing from='public final fun copy (nn: kotlin.Nothing?): .TestData declared in .TestData' CONSTRUCTOR_CALL 'public constructor (nn: kotlin.Nothing?) declared in .TestData' type=.TestData origin=null nn: GET_VAR 'nn: kotlin.Nothing? declared in .TestData.copy' type=kotlin.Nothing? origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.TestData) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.TestData - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestData' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="TestData(" - CONST String type=kotlin.String value="nn=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null - receiver: GET_VAR ': .TestData declared in .TestData.toString' type=.TestData origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.TestData) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.TestData - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .TestData' - WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null - receiver: GET_VAR ': .TestData declared in .TestData.hashCode' type=.TestData origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null - receiver: GET_VAR ': .TestData declared in .TestData.hashCode' type=.TestData origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestData, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -97,13 +67,38 @@ FILE fqName: fileName:/kt31649.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestData' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.TestData) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.TestData + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .TestData' + WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null + receiver: GET_VAR ': .TestData declared in .TestData.hashCode' type=.TestData origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null + receiver: GET_VAR ': .TestData declared in .TestData.hashCode' type=.TestData origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.TestData) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.TestData + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestData' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="TestData(" + CONST String type=kotlin.String value="nn=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null + receiver: GET_VAR ': .TestData declared in .TestData.toString' type=.TestData origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:TestInline modality:FINAL visibility:public [value] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInline - CONSTRUCTOR visibility:public <> (nn:kotlin.Nothing?) returnType:.TestInline [primary] - VALUE_PARAMETER name:nn index:0 type:kotlin.Nothing? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInline modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' PROPERTY name:nn visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final] EXPRESSION_BODY @@ -115,36 +110,11 @@ FILE fqName: fileName:/kt31649.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Nothing? declared in .TestInline' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null receiver: GET_VAR ': .TestInline declared in .TestInline.' type=.TestInline origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.TestInline) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.TestInline + CONSTRUCTOR visibility:public <> (nn:kotlin.Nothing?) returnType:.TestInline [primary] + VALUE_PARAMETER name:nn index:0 type:kotlin.Nothing? BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestInline' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="TestInline(" - CONST String type=kotlin.String value="nn=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null - receiver: GET_VAR ': .TestInline declared in .TestInline.toString' type=.TestInline origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.TestInline) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.TestInline - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .TestInline' - WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null - receiver: GET_VAR ': .TestInline declared in .TestInline.hashCode' type=.TestInline origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null - receiver: GET_VAR ': .TestInline declared in .TestInline.hashCode' type=.TestInline origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInline modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestInline, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -172,3 +142,33 @@ FILE fqName: fileName:/kt31649.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestInline' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.TestInline) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.TestInline + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .TestInline' + WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null + receiver: GET_VAR ': .TestInline declared in .TestInline.hashCode' type=.TestInline origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null + receiver: GET_VAR ': .TestInline declared in .TestInline.hashCode' type=.TestInline origin=null + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.TestInline) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.TestInline + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestInline' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="TestInline(" + CONST String type=kotlin.String value="nn=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null + receiver: GET_VAR ': .TestInline declared in .TestInline.toString' type=.TestInline origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt31649.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/kt31649.kt.txt index f0717b4a01e..1ff2d0cabf5 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/kt31649.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/kt31649.kt.txt @@ -1,14 +1,14 @@ data class TestData { + val nn: Nothing? + field = nn + get + constructor(nn: Nothing?) /* primary */ { super/*Any*/() /* () */ } - val nn: Nothing? - field = nn - get - operator fun component1(): Nothing? { return .#nn } @@ -17,17 +17,6 @@ data class TestData { return TestData(nn = nn) } - override fun toString(): String { - return "TestData(" + "nn=" + .#nn + ")" - } - - override fun hashCode(): Int { - return when { - EQEQ(arg0 = .#nn, arg1 = null) -> 0 - else -> .#nn.hashCode() - } - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -42,23 +31,6 @@ data class TestData { return true } -} - -value class TestInline { - constructor(nn: Nothing?) /* primary */ { - super/*Any*/() - /* () */ - - } - - val nn: Nothing? - field = nn - get - - override fun toString(): String { - return "TestInline(" + "nn=" + .#nn + ")" - } - override fun hashCode(): Int { return when { EQEQ(arg0 = .#nn, arg1 = null) -> 0 @@ -66,6 +38,23 @@ value class TestInline { } } + override fun toString(): String { + return "TestData(" + "nn=" + .#nn + ")" + } + +} + +value class TestInline { + val nn: Nothing? + field = nn + get + + constructor(nn: Nothing?) /* primary */ { + super/*Any*/() + /* () */ + + } + override operator fun equals(other: Any?): Boolean { when { other !is TestInline -> return false @@ -77,4 +66,16 @@ value class TestInline { return true } + override fun hashCode(): Int { + return when { + EQEQ(arg0 = .#nn, arg1 = null) -> 0 + else -> .#nn.hashCode() + } + } + + override fun toString(): String { + return "TestInline(" + "nn=" + .#nn + ")" + } + } + diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt49936.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/kt49936.ir.txt index 5943030821f..42f5607d342 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/kt49936.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/kt49936.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/kt49936.kt CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.A [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -17,14 +12,11 @@ FILE fqName: fileName:/kt49936.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null - PROPERTY name:x visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.String) returnType:kotlin.String - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' - GET_VAR ': kotlin.String declared in .A.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.A BLOCK_BODY @@ -41,27 +33,6 @@ FILE fqName: fileName:/kt49936.kt RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int): .A declared in .A' CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) declared in .A' type=.A origin=null x: GET_VAR 'x: kotlin.Int declared in .A.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="A(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -96,3 +67,32 @@ FILE fqName: fileName:/kt49936.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="A(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null + CONST String type=kotlin.String value=")" + PROPERTY name:x visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.String) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' + GET_VAR ': kotlin.String declared in .A.' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt index a02b7192747..869ea43621f 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt @@ -1,6 +1,17 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + PROPERTY name:runA visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> + correspondingProperty: PROPERTY name:runA visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null CONSTRUCTOR visibility:public <> (runA:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) returnType:.A [primary] VALUE_PARAMETER name:runA index:0 type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> EXPRESSION_BODY @@ -14,17 +25,6 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' - PROPERTY name:runA visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> - correspondingProperty: PROPERTY name:runA visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null - receiver: GET_VAR ': .A declared in .A.' type=.A origin=null FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.A) returnType:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> [operator] $this: VALUE_PARAMETER name: type:.A BLOCK_BODY @@ -41,27 +41,6 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt RETURN type=kotlin.Nothing from='public final fun copy (runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>): .A declared in .A' CONSTRUCTOR_CALL 'public constructor (runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) declared in .A' type=.A origin=null runA: GET_VAR 'runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.copy' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="A(" - CONST String type=kotlin.String value="runA=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null - receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Function2' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null - receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -96,8 +75,40 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Function2' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="A(" + CONST String type=kotlin.String value="runA=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Any declared in .B.' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Any + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .B' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + receiver: GET_VAR ': .B declared in .B.' type=.B origin=null CONSTRUCTOR visibility:public <> (x:kotlin.Any) returnType:.B [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Any EXPRESSION_BODY @@ -125,17 +136,6 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.Any declared in .B.' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Any - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .B' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null - receiver: GET_VAR ': .B declared in .B.' type=.B origin=null FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Any [operator] $this: VALUE_PARAMETER name: type:.B BLOCK_BODY @@ -152,27 +152,6 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Any): .B declared in .B' CONSTRUCTOR_CALL 'public constructor (x: kotlin.Any) declared in .B' type=.B origin=null x: GET_VAR 'x: kotlin.Any declared in .B.copy' type=kotlin.Any origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .B' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="B(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null - receiver: GET_VAR ': .B declared in .B.toString' type=.B origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .B' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null - receiver: GET_VAR ': .B declared in .B.hashCode' type=.B origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.B, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -207,3 +186,24 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .B' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + receiver: GET_VAR ': .B declared in .B.hashCode' type=.B origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .B' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="B(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + receiver: GET_VAR ': .B declared in .B.toString' type=.B origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt index ade8c897d60..1bddb7c44ad 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt @@ -1,4 +1,8 @@ data class A { + val runA: @ExtensionFunctionType Function2 + field = runA + get + constructor(runA: @ExtensionFunctionType Function2 = local fun A.(it: String) { return Unit } @@ -8,10 +12,6 @@ data class A { } - val runA: @ExtensionFunctionType Function2 - field = runA - get - operator fun component1(): @ExtensionFunctionType Function2 { return .#runA } @@ -20,14 +20,6 @@ data class A { return A(runA = runA) } - override fun toString(): String { - return "A(" + "runA=" + .#runA + ")" - } - - override fun hashCode(): Int { - return .#runA.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -42,9 +34,21 @@ data class A { return true } + override fun hashCode(): Int { + return .#runA.hashCode() + } + + override fun toString(): String { + return "A(" + "runA=" + .#runA + ")" + } + } data class B { + val x: Any + field = x + get + constructor(x: Any = { // BLOCK local class { constructor() /* primary */ { @@ -62,10 +66,6 @@ data class B { } - val x: Any - field = x - get - operator fun component1(): Any { return .#x } @@ -74,14 +74,6 @@ data class B { return B(x = x) } - override fun toString(): String { - return "B(" + "x=" + .#x + ")" - } - - override fun hashCode(): Int { - return .#x.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -96,5 +88,13 @@ data class B { return true } + override fun hashCode(): Int { + return .#x.hashCode() + } + + override fun toString(): String { + return "B(" + "x=" + .#x + ")" + } + } diff --git a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.ir.txt index 3edce685316..05ab21e5add 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.ir.txt @@ -1,6 +1,17 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + PROPERTY name:runA visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> + correspondingProperty: PROPERTY name:runA visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null CONSTRUCTOR visibility:public <> (runA:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) returnType:.A [primary] VALUE_PARAMETER name:runA index:0 type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> EXPRESSION_BODY @@ -14,17 +25,6 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' - PROPERTY name:runA visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> - correspondingProperty: PROPERTY name:runA visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null - receiver: GET_VAR ': .A declared in .A.' type=.A origin=null FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.A) returnType:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> [operator] $this: VALUE_PARAMETER name: type:.A BLOCK_BODY @@ -41,27 +41,6 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt RETURN type=kotlin.Nothing from='public final fun copy (runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>): .A declared in .A' CONSTRUCTOR_CALL 'public constructor (runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) declared in .A' type=.A origin=null runA: GET_VAR 'runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.copy' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="A(" - CONST String type=kotlin.String value="runA=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null - receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Function2' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null - receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -96,8 +75,40 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Function2' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="A(" + CONST String type=kotlin.String value="runA=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Any declared in .B.' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Any + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .B' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + receiver: GET_VAR ': .B declared in .B.' type=.B origin=null CONSTRUCTOR visibility:public <> (x:kotlin.Any) returnType:.B [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Any EXPRESSION_BODY @@ -125,17 +136,6 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.Any declared in .B.' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Any - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .B' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null - receiver: GET_VAR ': .B declared in .B.' type=.B origin=null FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Any [operator] $this: VALUE_PARAMETER name: type:.B BLOCK_BODY @@ -152,27 +152,6 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Any): .B declared in .B' CONSTRUCTOR_CALL 'public constructor (x: kotlin.Any) declared in .B' type=.B origin=null x: GET_VAR 'x: kotlin.Any declared in .B.copy' type=kotlin.Any origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .B' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="B(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null - receiver: GET_VAR ': .B declared in .B.toString' type=.B origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .B' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null - receiver: GET_VAR ': .B declared in .B.hashCode' type=.B origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.B, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -207,3 +186,24 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .B' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + receiver: GET_VAR ': .B declared in .B.hashCode' type=.B origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .B' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="B(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + receiver: GET_VAR ': .B declared in .B.toString' type=.B origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.kt.txt index d4f809bedad..1bddb7c44ad 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.kt.txt @@ -1,4 +1,8 @@ data class A { + val runA: @ExtensionFunctionType Function2 + field = runA + get + constructor(runA: @ExtensionFunctionType Function2 = local fun A.(it: String) { return Unit } @@ -8,10 +12,6 @@ data class A { } - val runA: @ExtensionFunctionType Function2 - field = runA - get - operator fun component1(): @ExtensionFunctionType Function2 { return .#runA } @@ -20,14 +20,6 @@ data class A { return A(runA = runA) } - override fun toString(): String { - return "A(" + "runA=" + .#runA + ")" - } - - override fun hashCode(): Int { - return .#runA.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -42,9 +34,21 @@ data class A { return true } + override fun hashCode(): Int { + return .#runA.hashCode() + } + + override fun toString(): String { + return "A(" + "runA=" + .#runA + ")" + } + } data class B { + val x: Any + field = x + get + constructor(x: Any = { // BLOCK local class { constructor() /* primary */ { @@ -62,10 +66,6 @@ data class B { } - val x: Any - field = x - get - operator fun component1(): Any { return .#x } @@ -74,14 +74,6 @@ data class B { return B(x = x) } - override fun toString(): String { - return "B(" + "x=" + .#x + ")" - } - - override fun hashCode(): Int { - return .#x.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -96,4 +88,13 @@ data class B { return true } + override fun hashCode(): Int { + return .#x.hashCode() + } + + override fun toString(): String { + return "B(" + "x=" + .#x + ")" + } + } + diff --git a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.ir.txt index 2edc2bb799b..513a0ea31f0 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.ir.txt @@ -3,12 +3,6 @@ FILE fqName: fileName:/openDataClass.kt annotations: Suppress(names = ["INCOMPATIBLE_MODIFIERS"]) $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ValidatedProperties - CONSTRUCTOR visibility:public <> (test1:kotlin.String, test2:kotlin.String) returnType:.ValidatedProperties [primary] - VALUE_PARAMETER name:test1 index:0 type:kotlin.String - VALUE_PARAMETER name:test2 index:1 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ValidatedProperties modality:OPEN visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:test1 visibility:public modality:OPEN [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -31,6 +25,12 @@ FILE fqName: fileName:/openDataClass.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .ValidatedProperties' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.' type=.ValidatedProperties origin=null + CONSTRUCTOR visibility:public <> (test1:kotlin.String, test2:kotlin.String) returnType:.ValidatedProperties [primary] + VALUE_PARAMETER name:test1 index:0 type:kotlin.String + VALUE_PARAMETER name:test2 index:1 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ValidatedProperties modality:OPEN visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.ValidatedProperties) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.ValidatedProperties BLOCK_BODY @@ -58,41 +58,6 @@ FILE fqName: fileName:/openDataClass.kt CONSTRUCTOR_CALL 'public constructor (test1: kotlin.String, test2: kotlin.String) declared in .ValidatedProperties' type=.ValidatedProperties origin=null test1: GET_VAR 'test1: kotlin.String declared in .ValidatedProperties.copy' type=kotlin.String origin=null test2: GET_VAR 'test2: kotlin.String declared in .ValidatedProperties.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.ValidatedProperties) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.ValidatedProperties - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .ValidatedProperties' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="ValidatedProperties(" - CONST String type=kotlin.String value="test1=" - CALL 'public open fun (): kotlin.String declared in .ValidatedProperties' type=kotlin.String origin=null - $this: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.toString' type=.ValidatedProperties origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="test2=" - CALL 'public open fun (): kotlin.String declared in .ValidatedProperties' type=kotlin.String origin=null - $this: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.toString' type=.ValidatedProperties origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.ValidatedProperties) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.ValidatedProperties - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: CALL 'public open fun (): kotlin.String declared in .ValidatedProperties' type=kotlin.String origin=null - $this: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.hashCode' type=.ValidatedProperties origin=null - SET_VAR 'var result: kotlin.Int declared in .ValidatedProperties.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .ValidatedProperties.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: CALL 'public open fun (): kotlin.String declared in .ValidatedProperties' type=kotlin.String origin=null - $this: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.hashCode' type=.ValidatedProperties origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .ValidatedProperties' - GET_VAR 'var result: kotlin.Int declared in .ValidatedProperties.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.ValidatedProperties, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -137,3 +102,38 @@ FILE fqName: fileName:/openDataClass.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ValidatedProperties' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.ValidatedProperties) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.ValidatedProperties + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: CALL 'public open fun (): kotlin.String declared in .ValidatedProperties' type=kotlin.String origin=null + $this: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.hashCode' type=.ValidatedProperties origin=null + SET_VAR 'var result: kotlin.Int declared in .ValidatedProperties.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .ValidatedProperties.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: CALL 'public open fun (): kotlin.String declared in .ValidatedProperties' type=kotlin.String origin=null + $this: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.hashCode' type=.ValidatedProperties origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .ValidatedProperties' + GET_VAR 'var result: kotlin.Int declared in .ValidatedProperties.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.ValidatedProperties) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.ValidatedProperties + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .ValidatedProperties' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="ValidatedProperties(" + CONST String type=kotlin.String value="test1=" + CALL 'public open fun (): kotlin.String declared in .ValidatedProperties' type=kotlin.String origin=null + $this: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.toString' type=.ValidatedProperties origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="test2=" + CALL 'public open fun (): kotlin.String declared in .ValidatedProperties' type=kotlin.String origin=null + $this: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.toString' type=.ValidatedProperties origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.kt.txt index 684f90e0eb9..419e0755678 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.kt.txt @@ -1,11 +1,5 @@ @Suppress(names = ["INCOMPATIBLE_MODIFIERS"]) open data class ValidatedProperties { - constructor(test1: String, test2: String) /* primary */ { - super/*Any*/() - /* () */ - - } - open val test1: String field = test1 open get @@ -14,6 +8,12 @@ open data class ValidatedProperties { field = test2 open get + constructor(test1: String, test2: String) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): String { return .() } @@ -26,16 +26,6 @@ open data class ValidatedProperties { return ValidatedProperties(test1 = test1, test2 = test2) } - override fun toString(): String { - return "ValidatedProperties(" + "test1=" + .() + ", " + "test2=" + .() + ")" - } - - override fun hashCode(): Int { - var result: Int = .().hashCode() - result = result.times(other = 31).plus(other = .().hashCode()) - return result - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -53,4 +43,15 @@ open data class ValidatedProperties { return true } + override fun hashCode(): Int { + var result: Int = .().hashCode() + result = result.times(other = 31).plus(other = .().hashCode()) + return result + } + + override fun toString(): String { + return "ValidatedProperties(" + "test1=" + .() + ", " + "test2=" + .() + ")" + } + } + diff --git a/compiler/testData/ir/irText/classes/declarationOrder.ir.txt b/compiler/testData/ir/irText/classes/declarationOrder.ir.txt index fd7c4c00e7d..614925922ec 100644 --- a/compiler/testData/ir/irText/classes/declarationOrder.ir.txt +++ b/compiler/testData/ir/irText/classes/declarationOrder.ir.txt @@ -1,20 +1,6 @@ FILE fqName:test fileName:/declarationOrder.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.A - CONSTRUCTOR visibility:public <> () returnType:test.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:test.A - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in test.A' - FUN name:b visibility:public modality:FINAL <> ($this:test.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:test.A - BLOCK_BODY - FUN name:a visibility:public modality:FINAL <> ($this:test.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:test.A - BLOCK_BODY PROPERTY name:b visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -37,38 +23,22 @@ FILE fqName:test fileName:/declarationOrder.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': test.A declared in test.A.' type=test.A origin=null - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:test.A - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in test.A' - PROPERTY name:b visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:test.A, $receiver:kotlin.Int) returnType:kotlin.String - correspondingProperty: PROPERTY name:b visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:test.A - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in test.A' - CONST String type=kotlin.String value="b" - FUN name:b visibility:public modality:FINAL <> ($this:test.A, $receiver:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:test.A - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - PROPERTY name:a visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:test.A, $receiver:kotlin.Int) returnType:kotlin.String - correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:test.A - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in test.A' - CONST String type=kotlin.String value="a" - FUN name:a visibility:public modality:FINAL <> ($this:test.A, $receiver:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:test.A - $receiver: VALUE_PARAMETER name: type:kotlin.String + CONSTRUCTOR visibility:public <> () returnType:test.A [primary] BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' CONSTRUCTOR visibility:public <> (x:kotlin.Double) returnType:test.A VALUE_PARAMETER name:x index:0 type:kotlin.Double BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in test.A' + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:test.A + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in test.A' + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:test.A + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in test.A' 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 @@ -82,3 +52,33 @@ FILE fqName:test fileName:/declarationOrder.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:a visibility:public modality:FINAL <> ($this:test.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:test.A + BLOCK_BODY + FUN name:a visibility:public modality:FINAL <> ($this:test.A, $receiver:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:test.A + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + FUN name:b visibility:public modality:FINAL <> ($this:test.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:test.A + BLOCK_BODY + FUN name:b visibility:public modality:FINAL <> ($this:test.A, $receiver:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:test.A + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + PROPERTY name:a visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:test.A, $receiver:kotlin.Int) returnType:kotlin.String + correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:test.A + $receiver: VALUE_PARAMETER name: type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in test.A' + CONST String type=kotlin.String value="a" + PROPERTY name:b visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:test.A, $receiver:kotlin.Int) returnType:kotlin.String + correspondingProperty: PROPERTY name:b visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:test.A + $receiver: VALUE_PARAMETER name: type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in test.A' + CONST String type=kotlin.String value="b" diff --git a/compiler/testData/ir/irText/classes/declarationOrder.kt.txt b/compiler/testData/ir/irText/classes/declarationOrder.kt.txt index d4e277aabac..c85ac1b1ac2 100644 --- a/compiler/testData/ir/irText/classes/declarationOrder.kt.txt +++ b/compiler/testData/ir/irText/classes/declarationOrder.kt.txt @@ -1,22 +1,6 @@ package test class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - constructor(x: Int) { - this/*A*/() - } - - fun b() { - } - - fun a() { - } - val b: Int field = 1 get @@ -25,14 +9,32 @@ class A { field = 2 get + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + constructor(x: Double) { + this/*A*/() + } + + constructor(x: Int) { + this/*A*/() + } + constructor(x: String) { this/*A*/() } - val Int.b: String - get(): String { - return "b" - } + fun a() { + } + + fun String.a() { + } + + fun b() { + } fun String.b() { } @@ -42,12 +44,10 @@ class A { return "a" } - fun String.a() { - } - - constructor(x: Double) { - this/*A*/() - } + val Int.b: String + get(): String { + return "b" + } } diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt index 9b43148836c..77738742f3f 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt @@ -1,54 +1,15 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt - CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase.IBase> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:ABSTRACT ($this:.IBase.IBase>, a:A of .IBase, b:B of .IBase.foo) returnType:kotlin.Unit - TYPE_PARAMETER name:B index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.IBase.IBase> - VALUE_PARAMETER name:a index:0 type:A of .IBase - VALUE_PARAMETER name:b index:1 type:B of .IBase.foo - PROPERTY name:id visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:C of .IBase.) returnType:kotlin.collections.Map.IBase, C of .IBase.>? - correspondingProperty: PROPERTY name:id visibility:public modality:ABSTRACT [val] - TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.IBase.IBase> - $receiver: VALUE_PARAMETER name: type:C of .IBase. - PROPERTY name:x visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:kotlin.collections.List.IBase.>) returnType:D of .IBase.? - correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] - TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.IBase.IBase> - $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.IBase.> - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:kotlin.collections.List.IBase.>, :D of .IBase.?) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] - TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.IBase.IBase> - $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.IBase.> - VALUE_PARAMETER name: index:0 type:D of .IBase.? - 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: 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 CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase.Test1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1.Test1> TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false + FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'i: .IBase.Test1> declared in .Test1.' type=.IBase.Test1> origin=null CONSTRUCTOR visibility:public <> (i:.IBase.Test1>) returnType:.Test1.Test1> [primary] VALUE_PARAMETER name:i index:0 type:.IBase.Test1> BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase.Test1>]' - FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'i: .IBase.Test1> declared in .Test1.' type=.IBase.Test1> origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN ($this:.Test1.Test1>, a:E of .Test1, b:B of .Test1.foo) returnType:kotlin.Unit overridden: public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase @@ -63,6 +24,19 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt receiver: GET_VAR ': .Test1.Test1> declared in .Test1.foo' type=.Test1.Test1> origin=null a: GET_VAR 'a: E of .Test1 declared in .Test1.foo' type=E of .Test1 origin=null b: GET_VAR 'b: B of .Test1.foo declared in .Test1.foo' type=B of .Test1.foo 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 .IBase + $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 .IBase + $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 .IBase + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] overridden: public abstract id: kotlin.collections.Map.IBase, C of .IBase.>? @@ -112,26 +86,8 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt receiver: GET_VAR ': .Test1.Test1> declared in .Test1.' type=.Test1.Test1> origin=null $receiver: GET_VAR ': kotlin.collections.List.Test1.> declared in .Test1.' type=kotlin.collections.List.Test1.> origin=null : GET_VAR ': D of .Test1.? declared in .Test1.' type=D of .Test1.? 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 .IBase - $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 .IBase - $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 .IBase - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:public <> (j:.IBase) returnType:.Test2 [primary] - VALUE_PARAMETER name:j index:0 type:.IBase - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase]' PROPERTY name:j visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:j type:.IBase visibility:private EXPRESSION_BODY @@ -151,6 +107,11 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.IBase visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null value: GET_VAR ': .IBase declared in .Test2.' type=.IBase origin=null + CONSTRUCTOR visibility:public <> (j:.IBase) returnType:.Test2 [primary] + VALUE_PARAMETER name:j index:0 type:.IBase + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase]' FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN ($this:.Test2, a:kotlin.String, b:B of .Test2.foo) returnType:kotlin.Unit overridden: public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase @@ -165,6 +126,19 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt receiver: GET_VAR ': .Test2 declared in .Test2.foo' type=.Test2 origin=null a: GET_VAR 'a: kotlin.String declared in .Test2.foo' type=kotlin.String origin=null b: GET_VAR 'b: B of .Test2.foo declared in .Test2.foo' type=B of .Test2.foo 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 .IBase + $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 .IBase + $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 .IBase + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] overridden: public abstract id: kotlin.collections.Map.IBase, C of .IBase.>? @@ -214,16 +188,42 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null $receiver: GET_VAR ': kotlin.collections.List.Test2.> declared in .Test2.' type=kotlin.collections.List.Test2.> origin=null : GET_VAR ': D of .Test2.? declared in .Test2.' type=D of .Test2.? origin=null + CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase.IBase> + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false 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 .IBase + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .IBase + 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 .IBase + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT ($this:.IBase.IBase>, a:A of .IBase, b:B of .IBase.foo) returnType:kotlin.Unit + TYPE_PARAMETER name:B index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.IBase.IBase> + VALUE_PARAMETER name:a index:0 type:A of .IBase + VALUE_PARAMETER name:b index:1 type:B of .IBase.foo + PROPERTY name:id visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:C of .IBase.) returnType:kotlin.collections.Map.IBase, C of .IBase.>? + correspondingProperty: PROPERTY name:id visibility:public modality:ABSTRACT [val] + TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.IBase.IBase> + $receiver: VALUE_PARAMETER name: type:C of .IBase. + PROPERTY name:x visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:kotlin.collections.List.IBase.>) returnType:D of .IBase.? + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] + TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.IBase.IBase> + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.IBase.> + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:kotlin.collections.List.IBase.>, :D of .IBase.?) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] + TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.IBase.IBase> + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.IBase.> + VALUE_PARAMETER name: index:0 type:D of .IBase.? diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt index 2f45aae0f6c..0ba438d2da7 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt @@ -1,23 +1,11 @@ -interface IBase { - abstract fun foo(a: A, b: B) - - abstract val C.id: Map? - abstract get - - abstract var List.x: D? - abstract get - abstract set - -} - class Test1 : IBase { + private /* final field */ val $$delegate_0: IBase = i constructor(i: IBase) /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: IBase = i override fun foo(a: E, b: B) { .#$$delegate_0.foo(a = a, b = b) } @@ -38,17 +26,17 @@ class Test1 : IBase { } class Test2 : IBase { + var j: IBase + field = j + get + set + constructor(j: IBase) /* primary */ { super/*Any*/() /* () */ } - var j: IBase - field = j - get - set - override fun foo(a: String, b: B) { .#j.foo(a = a, b = b) } @@ -68,3 +56,15 @@ class Test2 : IBase { } +interface IBase { + abstract fun foo(a: A, b: B) + + abstract val C.id: Map? + abstract get + + abstract var List.x: D? + abstract get + abstract set + +} + diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.ir.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.ir.txt index a480b184f68..dfbc2640912 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.ir.txt @@ -1,54 +1,42 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt - CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase.IBase> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:ABSTRACT ($this:.IBase.IBase>, a:A of .IBase, b:B of .IBase.foo) returnType:kotlin.Unit - TYPE_PARAMETER name:B index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.IBase.IBase> - VALUE_PARAMETER name:a index:0 type:A of .IBase - VALUE_PARAMETER name:b index:1 type:B of .IBase.foo - PROPERTY name:id visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:C of .IBase.) returnType:kotlin.collections.Map.IBase, C of .IBase.>? - correspondingProperty: PROPERTY name:id visibility:public modality:ABSTRACT [val] - TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.IBase.IBase> - $receiver: VALUE_PARAMETER name: type:C of .IBase. - PROPERTY name:x visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:kotlin.collections.List.IBase.>) returnType:D of .IBase.? - correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] - TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.IBase.IBase> - $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.IBase.> - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:kotlin.collections.List.IBase.>, :D of .IBase.?) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] - TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.IBase.IBase> - $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.IBase.> - VALUE_PARAMETER name: index:0 type:D of .IBase.? - 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: 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 CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase.Test1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1.Test1> TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false + FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'i: .IBase.Test1> declared in .Test1.' type=.IBase.Test1> origin=null CONSTRUCTOR visibility:public <> (i:.IBase.Test1>) returnType:.Test1.Test1> [primary] VALUE_PARAMETER name:i index:0 type:.IBase.Test1> BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase.Test1>]' - FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'i: .IBase.Test1> declared in .Test1.' type=.IBase.Test1> origin=null + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN ($this:.Test1.Test1>, a:E of .Test1, b:B of .Test1.foo) returnType:kotlin.Unit + overridden: + public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase + TYPE_PARAMETER name:B index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.Test1.Test1> + VALUE_PARAMETER name:a index:0 type:E of .Test1 + VALUE_PARAMETER name:b index:1 type:B of .Test1.foo + BLOCK_BODY + CALL 'public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null + : B of .Test1.foo + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final]' type=.IBase.Test1> origin=null + receiver: GET_VAR ': .Test1.Test1> declared in .Test1.foo' type=.Test1.Test1> origin=null + a: GET_VAR 'a: E of .Test1 declared in .Test1.foo' type=E of .Test1 origin=null + b: GET_VAR 'b: B of .Test1.foo declared in .Test1.foo' type=B of .Test1.foo 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 .IBase + $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 .IBase + $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 .IBase + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] overridden: public abstract id: kotlin.collections.Map.IBase, C of .IBase.>? @@ -98,40 +86,8 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt receiver: GET_VAR ': .Test1.Test1> declared in .Test1.' type=.Test1.Test1> origin=null $receiver: GET_VAR ': kotlin.collections.List.Test1.> declared in .Test1.' type=kotlin.collections.List.Test1.> origin=null : GET_VAR ': D of .Test1.? declared in .Test1.' type=D of .Test1.? origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN ($this:.Test1.Test1>, a:E of .Test1, b:B of .Test1.foo) returnType:kotlin.Unit - overridden: - public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase - TYPE_PARAMETER name:B index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.Test1.Test1> - VALUE_PARAMETER name:a index:0 type:E of .Test1 - VALUE_PARAMETER name:b index:1 type:B of .Test1.foo - BLOCK_BODY - CALL 'public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null - : B of .Test1.foo - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final]' type=.IBase.Test1> origin=null - receiver: GET_VAR ': .Test1.Test1> declared in .Test1.foo' type=.Test1.Test1> origin=null - a: GET_VAR 'a: E of .Test1 declared in .Test1.foo' type=E of .Test1 origin=null - b: GET_VAR 'b: B of .Test1.foo declared in .Test1.foo' type=B of .Test1.foo 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 .IBase - $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 .IBase - $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 .IBase - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:public <> (j:.IBase) returnType:.Test2 [primary] - VALUE_PARAMETER name:j index:0 type:.IBase - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase]' PROPERTY name:j visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:j type:.IBase visibility:private EXPRESSION_BODY @@ -154,6 +110,38 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt FIELD DELEGATE name:$$delegate_0 type:.IBase visibility:private [final] EXPRESSION_BODY GET_VAR 'j: .IBase declared in .Test2.' type=.IBase origin=null + CONSTRUCTOR visibility:public <> (j:.IBase) returnType:.Test2 [primary] + VALUE_PARAMETER name:j index:0 type:.IBase + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase]' + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN ($this:.Test2, a:kotlin.String, b:B of .Test2.foo) returnType:kotlin.Unit + overridden: + public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase + TYPE_PARAMETER name:B index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.Test2 + VALUE_PARAMETER name:a index:0 type:kotlin.String + VALUE_PARAMETER name:b index:1 type:B of .Test2.foo + BLOCK_BODY + CALL 'public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null + : B of .Test2.foo + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase visibility:private [final]' type=.IBase origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.foo' type=.Test2 origin=null + a: GET_VAR 'a: kotlin.String declared in .Test2.foo' type=kotlin.String origin=null + b: GET_VAR 'b: B of .Test2.foo declared in .Test2.foo' type=B of .Test2.foo 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 .IBase + $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 .IBase + $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 .IBase + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] overridden: public abstract id: kotlin.collections.Map.IBase, C of .IBase.>? @@ -203,30 +191,42 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null $receiver: GET_VAR ': kotlin.collections.List.Test2.> declared in .Test2.' type=kotlin.collections.List.Test2.> origin=null : GET_VAR ': D of .Test2.? declared in .Test2.' type=D of .Test2.? origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN ($this:.Test2, a:kotlin.String, b:B of .Test2.foo) returnType:kotlin.Unit - overridden: - public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase - TYPE_PARAMETER name:B index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.Test2 - VALUE_PARAMETER name:a index:0 type:kotlin.String - VALUE_PARAMETER name:b index:1 type:B of .Test2.foo - BLOCK_BODY - CALL 'public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null - : B of .Test2.foo - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase visibility:private [final]' type=.IBase origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.foo' type=.Test2 origin=null - a: GET_VAR 'a: kotlin.String declared in .Test2.foo' type=kotlin.String origin=null - b: GET_VAR 'b: B of .Test2.foo declared in .Test2.foo' type=B of .Test2.foo origin=null + CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase.IBase> + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false 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 .IBase + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .IBase + 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 .IBase + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT ($this:.IBase.IBase>, a:A of .IBase, b:B of .IBase.foo) returnType:kotlin.Unit + TYPE_PARAMETER name:B index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.IBase.IBase> + VALUE_PARAMETER name:a index:0 type:A of .IBase + VALUE_PARAMETER name:b index:1 type:B of .IBase.foo + PROPERTY name:id visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:C of .IBase.) returnType:kotlin.collections.Map.IBase, C of .IBase.>? + correspondingProperty: PROPERTY name:id visibility:public modality:ABSTRACT [val] + TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.IBase.IBase> + $receiver: VALUE_PARAMETER name: type:C of .IBase. + PROPERTY name:x visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:kotlin.collections.List.IBase.>) returnType:D of .IBase.? + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] + TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.IBase.IBase> + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.IBase.> + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:kotlin.collections.List.IBase.>, :D of .IBase.?) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] + TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.IBase.IBase> + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.IBase.> + VALUE_PARAMETER name: index:0 type:D of .IBase.? diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt.txt index 877deaf4c88..093ba14d511 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt.txt @@ -1,23 +1,15 @@ -interface IBase { - abstract fun foo(a: A, b: B) - - abstract val C.id: Map? - abstract get - - abstract var List.x: D? - abstract get - abstract set - -} - class Test1 : IBase { + private /* final field */ val $$delegate_0: IBase = i constructor(i: IBase) /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: IBase = i + override fun foo(a: E, b: B) { + .#$$delegate_0.foo(a = a, b = b) + } + override val C.id: Map? override get(): Map? { return (.#$$delegate_0, ).() @@ -31,25 +23,25 @@ class Test1 : IBase { (.#$$delegate_0, ).( = ) } - override fun foo(a: E, b: B) { - .#$$delegate_0.foo(a = a, b = b) - } - } class Test2 : IBase { - constructor(j: IBase) /* primary */ { - super/*Any*/() - /* () */ - - } - var j: IBase field = j get set private /* final field */ val $$delegate_0: IBase = j + constructor(j: IBase) /* primary */ { + super/*Any*/() + /* () */ + + } + + override fun foo(a: String, b: B) { + .#$$delegate_0.foo(a = a, b = b) + } + override val C.id: Map? override get(): Map? { return (.#$$delegate_0, ).() @@ -63,8 +55,17 @@ class Test2 : IBase { (.#$$delegate_0, ).( = ) } - override fun foo(a: String, b: B) { - .#$$delegate_0.foo(a = a, b = b) - } +} + +interface IBase { + abstract fun foo(a: A, b: B) + + abstract val C.id: Map? + abstract get + + abstract var List.x: D? + abstract get + abstract set } + diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt deleted file mode 100644 index 3da78e24742..00000000000 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt +++ /dev/null @@ -1,398 +0,0 @@ -FILE fqName: fileName:/delegatedImplementation.kt - CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IBase, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IBase - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:s index:1 type:kotlin.String - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.IBase) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.IBase - FUN name:qux visibility:public modality:ABSTRACT <> ($this:.IBase, $receiver:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IBase - $receiver: VALUE_PARAMETER name: type:kotlin.String - 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: 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 - CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseImpl - CONSTRUCTOR visibility:private <> () returnType:.BaseImpl [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' - FUN name:foo visibility:public modality:OPEN <> ($this:.BaseImpl, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit - overridden: - public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER name: type:.BaseImpl - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:s index:1 type:kotlin.String - BLOCK_BODY - FUN name:bar visibility:public modality:OPEN <> ($this:.BaseImpl) returnType:kotlin.Int - overridden: - public abstract fun bar (): kotlin.Int declared in .IBase - $this: VALUE_PARAMETER name: type:.BaseImpl - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in .BaseImpl' - CONST Int type=kotlin.Int value=42 - FUN name:qux visibility:public modality:OPEN <> ($this:.BaseImpl, $receiver:kotlin.String) returnType:kotlin.Unit - overridden: - public abstract fun qux (): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER name: type:.BaseImpl - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - 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 .IBase - $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 .IBase - $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 .IBase - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IOther modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IOther - PROPERTY name:x visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther) returnType:kotlin.String - correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IOther - PROPERTY name:y visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther) returnType:kotlin.Int - correspondingProperty: PROPERTY name:y visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.IOther - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:y visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.IOther - VALUE_PARAMETER name: index:0 type:kotlin.Int - PROPERTY name:z1 visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, $receiver:kotlin.Byte) returnType:kotlin.Int - correspondingProperty: PROPERTY name:z1 visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IOther - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - PROPERTY name:z2 visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, $receiver:kotlin.Byte) returnType:kotlin.Int - correspondingProperty: PROPERTY name:z2 visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.IOther - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, $receiver:kotlin.Byte, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:z2 visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.IOther - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - VALUE_PARAMETER name: index:0 type:kotlin.Int - 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: 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:otherImpl visibility:public modality:FINAL <> (x0:kotlin.String, y0:kotlin.Int) returnType:.IOther - VALUE_PARAMETER name:x0 index:0 type:kotlin.String - VALUE_PARAMETER name:y0 index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun otherImpl (x0: kotlin.String, y0: kotlin.Int): .IOther declared in ' - BLOCK type=.otherImpl. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IOther] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.otherImpl. - CONSTRUCTOR visibility:public <> () returnType:.otherImpl. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IOther]' - PROPERTY name:x visibility:public modality:OPEN [val] - overridden: - public abstract x: kotlin.String - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x0: kotlin.String declared in .otherImpl' type=kotlin.String origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.otherImpl.) returnType:kotlin.String - correspondingProperty: PROPERTY name:x visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.String declared in .IOther - $this: VALUE_PARAMETER name: type:.otherImpl. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .otherImpl.' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null - PROPERTY name:y visibility:public modality:OPEN [var] - overridden: - public abstract y: kotlin.Int - FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private - EXPRESSION_BODY - GET_VAR 'y0: kotlin.Int declared in .otherImpl' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.otherImpl.) returnType:kotlin.Int - correspondingProperty: PROPERTY name:y visibility:public modality:OPEN [var] - overridden: - public abstract fun (): kotlin.Int declared in .IOther - $this: VALUE_PARAMETER name: type:.otherImpl. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .otherImpl.' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.otherImpl., :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:y visibility:public modality:OPEN [var] - overridden: - public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther - $this: VALUE_PARAMETER name: type:.otherImpl. - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null - value: GET_VAR ': kotlin.Int declared in .otherImpl..' type=kotlin.Int origin=null - PROPERTY name:z1 visibility:public modality:OPEN [val] - overridden: - public abstract z1: kotlin.Int - FUN name: visibility:public modality:OPEN <> ($this:.otherImpl., $receiver:kotlin.Byte) returnType:kotlin.Int - correspondingProperty: PROPERTY name:z1 visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .IOther - $this: VALUE_PARAMETER name: type:.otherImpl. - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .otherImpl.' - CONST Int type=kotlin.Int value=1 - PROPERTY name:z2 visibility:public modality:OPEN [var] - overridden: - public abstract z2: kotlin.Int - FUN name: visibility:public modality:OPEN <> ($this:.otherImpl., $receiver:kotlin.Byte) returnType:kotlin.Int - correspondingProperty: PROPERTY name:z2 visibility:public modality:OPEN [var] - overridden: - public abstract fun (): kotlin.Int declared in .IOther - $this: VALUE_PARAMETER name: type:.otherImpl. - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .otherImpl.' - CONST Int type=kotlin.Int value=2 - FUN name: visibility:public modality:OPEN <> ($this:.otherImpl., $receiver:kotlin.Byte, value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:z2 visibility:public modality:OPEN [var] - overridden: - public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther - $this: VALUE_PARAMETER name: type:.otherImpl. - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - 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 .IOther - $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 .IOther - $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 .IOther - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .otherImpl.' type=.otherImpl. origin=OBJECT_LITERAL - CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 - CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase]' - FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final] - EXPRESSION_BODY - GET_OBJECT 'CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' type=.BaseImpl - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Test1, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit - overridden: - public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER name: type:.Test1 - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:s index:1 type:kotlin.String - BLOCK_BODY - CALL 'public open fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .BaseImpl' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.foo' type=.Test1 origin=null - x: GET_VAR 'x: kotlin.Int declared in .Test1.foo' type=kotlin.Int origin=null - s: GET_VAR 's: kotlin.String declared in .Test1.foo' type=kotlin.String origin=null - FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.Int - overridden: - public abstract fun bar (): kotlin.Int declared in .IBase - $this: VALUE_PARAMETER name: type:.Test1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in .Test1' - CALL 'public open fun bar (): kotlin.Int declared in .BaseImpl' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.bar' type=.Test1 origin=null - FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN <> ($this:.Test1, $receiver:kotlin.String) returnType:kotlin.Unit - overridden: - public abstract fun qux (): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER name: type:.Test1 - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - CALL 'public open fun qux (): kotlin.Unit declared in .BaseImpl' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.qux' type=.Test1 origin=null - $receiver: GET_VAR ': kotlin.String declared in .Test1.qux' type=kotlin.String 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 .IBase - $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 .IBase - $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 .IBase - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase; .IOther] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:public <> () returnType:.Test2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase; .IOther]' - FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final] - EXPRESSION_BODY - GET_OBJECT 'CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' type=.BaseImpl - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Test2, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit - overridden: - public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER name: type:.Test2 - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:s index:1 type:kotlin.String - BLOCK_BODY - CALL 'public open fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .BaseImpl' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.foo' type=.Test2 origin=null - x: GET_VAR 'x: kotlin.Int declared in .Test2.foo' type=kotlin.Int origin=null - s: GET_VAR 's: kotlin.String declared in .Test2.foo' type=kotlin.String origin=null - FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.Int - overridden: - public abstract fun bar (): kotlin.Int declared in .IBase - $this: VALUE_PARAMETER name: type:.Test2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in .Test2' - CALL 'public open fun bar (): kotlin.Int declared in .BaseImpl' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.bar' type=.Test2 origin=null - FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN <> ($this:.Test2, $receiver:kotlin.String) returnType:kotlin.Unit - overridden: - public abstract fun qux (): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER name: type:.Test2 - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - CALL 'public open fun qux (): kotlin.Unit declared in .BaseImpl' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.qux' type=.Test2 origin=null - $receiver: GET_VAR ': kotlin.String declared in .Test2.qux' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun otherImpl (x0: kotlin.String, y0: kotlin.Int): .IOther declared in ' type=.IOther origin=null - x0: CONST String type=kotlin.String value="" - y0: CONST Int type=kotlin.Int value=42 - PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [val] - overridden: - public abstract x: kotlin.String - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.String declared in .IOther - $this: VALUE_PARAMETER name: type:.Test2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Test2' - CALL 'public abstract fun (): kotlin.String declared in .IOther' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final]' type=.IOther origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null - PROPERTY DELEGATED_MEMBER name:y visibility:public modality:OPEN [var] - overridden: - public abstract y: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:y visibility:public modality:OPEN [var] - overridden: - public abstract fun (): kotlin.Int declared in .IOther - $this: VALUE_PARAMETER name: type:.Test2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test2' - CALL 'public abstract fun (): kotlin.Int declared in .IOther' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final]' type=.IOther origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test2, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY DELEGATED_MEMBER name:y visibility:public modality:OPEN [var] - overridden: - public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther - $this: VALUE_PARAMETER name: type:.Test2 - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final]' type=.IOther origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null - : GET_VAR ': kotlin.Int declared in .Test2.' type=kotlin.Int origin=null - PROPERTY DELEGATED_MEMBER name:z1 visibility:public modality:OPEN [val] - overridden: - public abstract z1: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test2, $receiver:kotlin.Byte) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:z1 visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .IOther - $this: VALUE_PARAMETER name: type:.Test2 - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test2' - CALL 'public abstract fun (): kotlin.Int declared in .IOther' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final]' type=.IOther origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null - $receiver: GET_VAR ': kotlin.Byte declared in .Test2.' type=kotlin.Byte origin=null - PROPERTY DELEGATED_MEMBER name:z2 visibility:public modality:OPEN [var] - overridden: - public abstract z2: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test2, $receiver:kotlin.Byte) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:z2 visibility:public modality:OPEN [var] - overridden: - public abstract fun (): kotlin.Int declared in .IOther - $this: VALUE_PARAMETER name: type:.Test2 - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test2' - CALL 'public abstract fun (): kotlin.Int declared in .IOther' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final]' type=.IOther origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null - $receiver: GET_VAR ': kotlin.Byte declared in .Test2.' type=kotlin.Byte origin=null - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test2, $receiver:kotlin.Byte, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY DELEGATED_MEMBER name:z2 visibility:public modality:OPEN [var] - overridden: - public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther - $this: VALUE_PARAMETER name: type:.Test2 - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final]' type=.IOther origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null - $receiver: GET_VAR ': kotlin.Byte declared in .Test2.' type=kotlin.Byte origin=null - : GET_VAR ': kotlin.Int declared in .Test2.' type=kotlin.Int 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 .IBase - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IOther - $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 .IBase - public open fun hashCode (): kotlin.Int declared in .IOther - $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 .IBase - public open fun toString (): kotlin.String declared in .IOther - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt deleted file mode 100644 index f06f560b1b2..00000000000 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt +++ /dev/null @@ -1,152 +0,0 @@ -interface IBase { - abstract fun foo(x: Int, s: String) - - abstract fun bar(): Int - - abstract fun String.qux() - -} - -object BaseImpl : IBase { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun foo(x: Int, s: String) { - } - - override fun bar(): Int { - return 42 - } - - override fun String.qux() { - } - -} - -interface IOther { - abstract val x: String - abstract get - - abstract var y: Int - abstract get - abstract set - - abstract val Byte.z1: Int - abstract get - - abstract var Byte.z2: Int - abstract get - abstract set - -} - -fun otherImpl(x0: String, y0: Int): IOther { - return { // BLOCK - local class : IOther { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override val x: String - field = x0 - override get - - override var y: Int - field = y0 - override get - override set - - override val Byte.z1: Int - override get(): Int { - return 1 - } - - override var Byte.z2: Int - override get(): Int { - return 2 - } - override set(value: Int) { - } - - } - - () - } -} - -class Test1 : IBase { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: BaseImpl = BaseImpl - override fun foo(x: Int, s: String) { - .#$$delegate_0.foo(x = x, s = s) - } - - override fun bar(): Int { - return .#$$delegate_0.bar() - } - - override fun String.qux() { - (.#$$delegate_0, ).qux() - } - -} - -class Test2 : IBase, IOther { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: BaseImpl = BaseImpl - override fun foo(x: Int, s: String) { - .#$$delegate_0.foo(x = x, s = s) - } - - override fun bar(): Int { - return .#$$delegate_0.bar() - } - - override fun String.qux() { - (.#$$delegate_0, ).qux() - } - - private /* final field */ val $$delegate_1: IOther = otherImpl(x0 = "", y0 = 42) - override val x: String - override get(): String { - return .#$$delegate_1.() - } - - override var y: Int - override get(): Int { - return .#$$delegate_1.() - } - override set(: Int) { - .#$$delegate_1.( = ) - } - - override val Byte.z1: Int - override get(): Int { - return (.#$$delegate_1, ).() - } - - override var Byte.z2: Int - override get(): Int { - return (.#$$delegate_1, ).() - } - override set(: Int) { - (.#$$delegate_1, ).( = ) - } - -} - diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.ir.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.ir.txt index 8a813772f1d..450fef9da65 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.ir.txt @@ -1,216 +1,13 @@ FILE fqName: fileName:/delegatedImplementation.kt - CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IBase, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IBase - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:s index:1 type:kotlin.String - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.IBase) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.IBase - FUN name:qux visibility:public modality:ABSTRACT <> ($this:.IBase, $receiver:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IBase - $receiver: VALUE_PARAMETER name: type:kotlin.String - 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: 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 - CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseImpl - CONSTRUCTOR visibility:private <> () returnType:.BaseImpl [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' - FUN name:foo visibility:public modality:OPEN <> ($this:.BaseImpl, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit - overridden: - public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER name: type:.BaseImpl - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:s index:1 type:kotlin.String - BLOCK_BODY - FUN name:bar visibility:public modality:OPEN <> ($this:.BaseImpl) returnType:kotlin.Int - overridden: - public abstract fun bar (): kotlin.Int declared in .IBase - $this: VALUE_PARAMETER name: type:.BaseImpl - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in .BaseImpl' - CONST Int type=kotlin.Int value=42 - FUN name:qux visibility:public modality:OPEN <> ($this:.BaseImpl, $receiver:kotlin.String) returnType:kotlin.Unit - overridden: - public abstract fun qux (): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER name: type:.BaseImpl - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - 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 .IBase - $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 .IBase - $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 .IBase - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IOther modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IOther - PROPERTY name:x visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther) returnType:kotlin.String - correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IOther - PROPERTY name:y visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther) returnType:kotlin.Int - correspondingProperty: PROPERTY name:y visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.IOther - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:y visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.IOther - VALUE_PARAMETER name: index:0 type:kotlin.Int - PROPERTY name:z1 visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, $receiver:kotlin.Byte) returnType:kotlin.Int - correspondingProperty: PROPERTY name:z1 visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IOther - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - PROPERTY name:z2 visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, $receiver:kotlin.Byte) returnType:kotlin.Int - correspondingProperty: PROPERTY name:z2 visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.IOther - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, $receiver:kotlin.Byte, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:z2 visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.IOther - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - VALUE_PARAMETER name: index:0 type:kotlin.Int - 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: 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:otherImpl visibility:public modality:FINAL <> (x0:kotlin.String, y0:kotlin.Int) returnType:.IOther - VALUE_PARAMETER name:x0 index:0 type:kotlin.String - VALUE_PARAMETER name:y0 index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun otherImpl (x0: kotlin.String, y0: kotlin.Int): .IOther declared in ' - BLOCK type=.otherImpl. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IOther] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.otherImpl. - CONSTRUCTOR visibility:public <> () returnType:.otherImpl. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IOther]' - PROPERTY name:x visibility:public modality:OPEN [val] - overridden: - public abstract x: kotlin.String - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x0: kotlin.String declared in .otherImpl' type=kotlin.String origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.otherImpl.) returnType:kotlin.String - correspondingProperty: PROPERTY name:x visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.String declared in .IOther - $this: VALUE_PARAMETER name: type:.otherImpl. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .otherImpl.' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null - PROPERTY name:y visibility:public modality:OPEN [var] - overridden: - public abstract y: kotlin.Int - FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private - EXPRESSION_BODY - GET_VAR 'y0: kotlin.Int declared in .otherImpl' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.otherImpl.) returnType:kotlin.Int - correspondingProperty: PROPERTY name:y visibility:public modality:OPEN [var] - overridden: - public abstract fun (): kotlin.Int declared in .IOther - $this: VALUE_PARAMETER name: type:.otherImpl. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .otherImpl.' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.otherImpl., :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:y visibility:public modality:OPEN [var] - overridden: - public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther - $this: VALUE_PARAMETER name: type:.otherImpl. - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null - value: GET_VAR ': kotlin.Int declared in .otherImpl..' type=kotlin.Int origin=null - PROPERTY name:z1 visibility:public modality:OPEN [val] - overridden: - public abstract z1: kotlin.Int - FUN name: visibility:public modality:OPEN <> ($this:.otherImpl., $receiver:kotlin.Byte) returnType:kotlin.Int - correspondingProperty: PROPERTY name:z1 visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .IOther - $this: VALUE_PARAMETER name: type:.otherImpl. - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .otherImpl.' - CONST Int type=kotlin.Int value=1 - PROPERTY name:z2 visibility:public modality:OPEN [var] - overridden: - public abstract z2: kotlin.Int - FUN name: visibility:public modality:OPEN <> ($this:.otherImpl., $receiver:kotlin.Byte) returnType:kotlin.Int - correspondingProperty: PROPERTY name:z2 visibility:public modality:OPEN [var] - overridden: - public abstract fun (): kotlin.Int declared in .IOther - $this: VALUE_PARAMETER name: type:.otherImpl. - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .otherImpl.' - CONST Int type=kotlin.Int value=2 - FUN name: visibility:public modality:OPEN <> ($this:.otherImpl., $receiver:kotlin.Byte, value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:z2 visibility:public modality:OPEN [var] - overridden: - public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther - $this: VALUE_PARAMETER name: type:.otherImpl. - $receiver: VALUE_PARAMETER name: type:kotlin.Byte - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - 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 .IOther - $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 .IOther - $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 .IOther - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .otherImpl.' type=.otherImpl. origin=OBJECT_LITERAL CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final] + EXPRESSION_BODY + GET_OBJECT 'CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' type=.BaseImpl CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase]' - FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final] - EXPRESSION_BODY - GET_OBJECT 'CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' type=.BaseImpl FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.Int overridden: public abstract fun bar (): kotlin.Int declared in .IBase @@ -257,13 +54,18 @@ FILE fqName: fileName:/delegatedImplementation.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase; .IOther] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final] + EXPRESSION_BODY + GET_OBJECT 'CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' type=.BaseImpl + FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun otherImpl (x0: kotlin.String, y0: kotlin.Int): .IOther declared in ' type=.IOther origin=null + x0: CONST String type=kotlin.String value="" + y0: CONST Int type=kotlin.Int value=42 CONSTRUCTOR visibility:public <> () returnType:.Test2 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase; .IOther]' - FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final] - EXPRESSION_BODY - GET_OBJECT 'CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' type=.BaseImpl FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.Int overridden: public abstract fun bar (): kotlin.Int declared in .IBase @@ -295,11 +97,22 @@ FILE fqName: fileName:/delegatedImplementation.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl origin=null receiver: GET_VAR ': .Test2 declared in .Test2.qux' type=.Test2 origin=null $receiver: GET_VAR ': kotlin.String declared in .Test2.qux' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun otherImpl (x0: kotlin.String, y0: kotlin.Int): .IOther declared in ' type=.IOther origin=null - x0: CONST String type=kotlin.String value="" - y0: CONST Int type=kotlin.Int value=42 + 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 .IBase + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IOther + $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 .IBase + public open fun hashCode (): kotlin.Int declared in .IOther + $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 .IBase + public open fun toString (): kotlin.String declared in .IOther + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [val] overridden: public abstract x: kotlin.String @@ -380,19 +193,206 @@ FILE fqName: fileName:/delegatedImplementation.kt receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null $receiver: GET_VAR ': kotlin.Byte declared in .Test2.' type=kotlin.Byte origin=null : GET_VAR ': kotlin.Int declared in .Test2.' type=kotlin.Int origin=null + CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase + 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: 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:bar visibility:public modality:ABSTRACT <> ($this:.IBase) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.IBase + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IBase, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IBase + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:s index:1 type:kotlin.String + FUN name:qux visibility:public modality:ABSTRACT <> ($this:.IBase, $receiver:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IBase + $receiver: VALUE_PARAMETER name: type:kotlin.String + CLASS INTERFACE name:IOther modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IOther + 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: 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 + PROPERTY name:x visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.IOther + PROPERTY name:y visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.IOther + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:y visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.IOther + VALUE_PARAMETER name: index:0 type:kotlin.Int + PROPERTY name:z1 visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, $receiver:kotlin.Byte) returnType:kotlin.Int + correspondingProperty: PROPERTY name:z1 visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.IOther + $receiver: VALUE_PARAMETER name: type:kotlin.Byte + PROPERTY name:z2 visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, $receiver:kotlin.Byte) returnType:kotlin.Int + correspondingProperty: PROPERTY name:z2 visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.IOther + $receiver: VALUE_PARAMETER name: type:kotlin.Byte + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, $receiver:kotlin.Byte, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:z2 visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.IOther + $receiver: VALUE_PARAMETER name: type:kotlin.Byte + VALUE_PARAMETER name: index:0 type:kotlin.Int + CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseImpl + CONSTRUCTOR visibility:private <> () returnType:.BaseImpl [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' 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 .IBase - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IOther $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 .IBase - public open fun hashCode (): kotlin.Int declared in .IOther $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 .IBase - public open fun toString (): kotlin.String declared in .IOther $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:OPEN <> ($this:.BaseImpl) returnType:kotlin.Int + overridden: + public abstract fun bar (): kotlin.Int declared in .IBase + $this: VALUE_PARAMETER name: type:.BaseImpl + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in .BaseImpl' + CONST Int type=kotlin.Int value=42 + FUN name:foo visibility:public modality:OPEN <> ($this:.BaseImpl, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit + overridden: + public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .IBase + $this: VALUE_PARAMETER name: type:.BaseImpl + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:s index:1 type:kotlin.String + BLOCK_BODY + FUN name:qux visibility:public modality:OPEN <> ($this:.BaseImpl, $receiver:kotlin.String) returnType:kotlin.Unit + overridden: + public abstract fun qux (): kotlin.Unit declared in .IBase + $this: VALUE_PARAMETER name: type:.BaseImpl + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + FUN name:otherImpl visibility:public modality:FINAL <> (x0:kotlin.String, y0:kotlin.Int) returnType:.IOther + VALUE_PARAMETER name:x0 index:0 type:kotlin.String + VALUE_PARAMETER name:y0 index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun otherImpl (x0: kotlin.String, y0: kotlin.Int): .IOther declared in ' + BLOCK type=.otherImpl. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IOther] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.otherImpl. + PROPERTY name:x visibility:public modality:OPEN [val] + overridden: + public abstract x: kotlin.String + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x0: kotlin.String declared in .otherImpl' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.otherImpl.) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.String declared in .IOther + $this: VALUE_PARAMETER name: type:.otherImpl. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .otherImpl.' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null + PROPERTY name:y visibility:public modality:OPEN [var] + overridden: + public abstract y: kotlin.Int + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private + EXPRESSION_BODY + GET_VAR 'y0: kotlin.Int declared in .otherImpl' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.otherImpl.) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:OPEN [var] + overridden: + public abstract fun (): kotlin.Int declared in .IOther + $this: VALUE_PARAMETER name: type:.otherImpl. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .otherImpl.' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.otherImpl., :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:y visibility:public modality:OPEN [var] + overridden: + public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther + $this: VALUE_PARAMETER name: type:.otherImpl. + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null + value: GET_VAR ': kotlin.Int declared in .otherImpl..' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.otherImpl. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IOther]' + 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 .IOther + $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 .IOther + $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 .IOther + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:z1 visibility:public modality:OPEN [val] + overridden: + public abstract z1: kotlin.Int + FUN name: visibility:public modality:OPEN <> ($this:.otherImpl., $receiver:kotlin.Byte) returnType:kotlin.Int + correspondingProperty: PROPERTY name:z1 visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in .IOther + $this: VALUE_PARAMETER name: type:.otherImpl. + $receiver: VALUE_PARAMETER name: type:kotlin.Byte + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .otherImpl.' + CONST Int type=kotlin.Int value=1 + PROPERTY name:z2 visibility:public modality:OPEN [var] + overridden: + public abstract z2: kotlin.Int + FUN name: visibility:public modality:OPEN <> ($this:.otherImpl., $receiver:kotlin.Byte) returnType:kotlin.Int + correspondingProperty: PROPERTY name:z2 visibility:public modality:OPEN [var] + overridden: + public abstract fun (): kotlin.Int declared in .IOther + $this: VALUE_PARAMETER name: type:.otherImpl. + $receiver: VALUE_PARAMETER name: type:kotlin.Byte + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .otherImpl.' + CONST Int type=kotlin.Int value=2 + FUN name: visibility:public modality:OPEN <> ($this:.otherImpl., $receiver:kotlin.Byte, value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:z2 visibility:public modality:OPEN [var] + overridden: + public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther + $this: VALUE_PARAMETER name: type:.otherImpl. + $receiver: VALUE_PARAMETER name: type:kotlin.Byte + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .otherImpl.' type=.otherImpl. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.kt b/compiler/testData/ir/irText/classes/delegatedImplementation.kt index 5cdc30d8d0d..7a67c14b10c 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.kt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface IBase { fun foo(x: Int, s: String) fun bar(): Int diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.kt.txt index df5923eabab..d1a8ed0ecb2 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.kt.txt @@ -1,92 +1,11 @@ -interface IBase { - abstract fun foo(x: Int, s: String) - - abstract fun bar(): Int - - abstract fun String.qux() - -} - -object BaseImpl : IBase { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun foo(x: Int, s: String) { - } - - override fun bar(): Int { - return 42 - } - - override fun String.qux() { - } - -} - -interface IOther { - abstract val x: String - abstract get - - abstract var y: Int - abstract get - abstract set - - abstract val Byte.z1: Int - abstract get - - abstract var Byte.z2: Int - abstract get - abstract set - -} - -fun otherImpl(x0: String, y0: Int): IOther { - return { // BLOCK - local class : IOther { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override val x: String - field = x0 - override get - - override var y: Int - field = y0 - override get - override set - - override val Byte.z1: Int - override get(): Int { - return 1 - } - - override var Byte.z2: Int - override get(): Int { - return 2 - } - override set(value: Int) { - } - - } - - () - } -} - class Test1 : IBase { + private /* final field */ val $$delegate_0: BaseImpl = BaseImpl constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: BaseImpl = BaseImpl override fun bar(): Int { return .#$$delegate_0.bar() } @@ -102,13 +21,14 @@ class Test1 : IBase { } class Test2 : IBase, IOther { + private /* final field */ val $$delegate_0: BaseImpl = BaseImpl + private /* final field */ val $$delegate_1: IOther = otherImpl(x0 = "", y0 = 42) constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: BaseImpl = BaseImpl override fun bar(): Int { return .#$$delegate_0.bar() } @@ -121,7 +41,6 @@ class Test2 : IBase, IOther { (.#$$delegate_0, ).qux() } - private /* final field */ val $$delegate_1: IOther = otherImpl(x0 = "", y0 = 42) override val x: String override get(): String { return .#$$delegate_1.() @@ -149,3 +68,85 @@ class Test2 : IBase, IOther { } } + +interface IBase { + abstract fun bar(): Int + + abstract fun foo(x: Int, s: String) + + abstract fun String.qux() + +} + +interface IOther { + abstract val x: String + abstract get + + abstract var y: Int + abstract get + abstract set + + abstract val Byte.z1: Int + abstract get + + abstract var Byte.z2: Int + abstract get + abstract set + +} + +object BaseImpl : IBase { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override fun bar(): Int { + return 42 + } + + override fun foo(x: Int, s: String) { + } + + override fun String.qux() { + } + +} + +fun otherImpl(x0: String, y0: Int): IOther { + return { // BLOCK + local class : IOther { + override val x: String + field = x0 + override get + + override var y: Int + field = y0 + override get + override set + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override val Byte.z1: Int + override get(): Int { + return 1 + } + + override var Byte.z2: Int + override get(): Int { + return 2 + } + override set(value: Int) { + } + + } + + () + } +} + diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.ir.txt index ac91e8140af..cd71c5ef2dc 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/delegatedImplementationOfJavaInterface.kt CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.J] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test - CONSTRUCTOR visibility:public <> (j:.J) returnType:.Test [primary] - VALUE_PARAMETER name:j index:0 type:.J - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.J]' PROPERTY name:j visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final] EXPRESSION_BODY @@ -17,40 +12,11 @@ FILE fqName: fileName:/delegatedImplementationOfJavaInterface.kt RETURN type=kotlin.Nothing from='private final fun (): .J declared in .Test' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null - FUN DELEGATED_MEMBER name:takeNotNull visibility:public modality:OPEN <> ($this:.Test, x:@[EnhancedNullability] kotlin.String) returnType:kotlin.Unit - overridden: - public abstract fun takeNotNull (x: @[EnhancedNullability] kotlin.String): kotlin.Unit declared in .J - $this: VALUE_PARAMETER name: type:.Test - VALUE_PARAMETER name:x index:0 type:@[EnhancedNullability] kotlin.String - annotations: - NotNull(value = ) + CONSTRUCTOR visibility:public <> (j:.J) returnType:.Test [primary] + VALUE_PARAMETER name:j index:0 type:.J BLOCK_BODY - CALL 'public abstract fun takeNotNull (x: @[EnhancedNullability] kotlin.String): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null - receiver: GET_VAR ': .Test declared in .Test.takeNotNull' type=.Test origin=null - x: GET_VAR 'x: @[EnhancedNullability] kotlin.String declared in .Test.takeNotNull' type=@[EnhancedNullability] kotlin.String origin=null - FUN DELEGATED_MEMBER name:takeNullable visibility:public modality:OPEN <> ($this:.Test, x:kotlin.String?) returnType:kotlin.Unit - overridden: - public abstract fun takeNullable (x: kotlin.String?): kotlin.Unit declared in .J - $this: VALUE_PARAMETER name: type:.Test - VALUE_PARAMETER name:x index:0 type:kotlin.String? - annotations: - Nullable(value = ) - BLOCK_BODY - CALL 'public abstract fun takeNullable (x: kotlin.String?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null - receiver: GET_VAR ': .Test declared in .Test.takeNullable' type=.Test origin=null - x: GET_VAR 'x: kotlin.String? declared in .Test.takeNullable' type=kotlin.String? origin=null - FUN DELEGATED_MEMBER name:takeFlexible visibility:public modality:OPEN <> ($this:.Test, x:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit - overridden: - public abstract fun takeFlexible (x: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .J - $this: VALUE_PARAMETER name: type:.Test - VALUE_PARAMETER name:x index:0 type:@[FlexibleNullability] kotlin.String? - BLOCK_BODY - CALL 'public abstract fun takeFlexible (x: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null - receiver: GET_VAR ': .Test declared in .Test.takeFlexible' type=.Test origin=null - x: GET_VAR 'x: @[FlexibleNullability] kotlin.String? declared in .Test.takeFlexible' type=@[FlexibleNullability] kotlin.String? origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.J]' FUN DELEGATED_MEMBER name:returnNotNull visibility:public modality:OPEN <> ($this:.Test) returnType:@[EnhancedNullability] kotlin.String annotations: NotNull(value = ) @@ -83,6 +49,40 @@ FILE fqName: fileName:/delegatedImplementationOfJavaInterface.kt CALL 'public abstract fun returnsFlexible (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null receiver: GET_VAR ': .Test declared in .Test.returnsFlexible' type=.Test origin=null + FUN DELEGATED_MEMBER name:takeFlexible visibility:public modality:OPEN <> ($this:.Test, x:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit + overridden: + public abstract fun takeFlexible (x: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .J + $this: VALUE_PARAMETER name: type:.Test + VALUE_PARAMETER name:x index:0 type:@[FlexibleNullability] kotlin.String? + BLOCK_BODY + CALL 'public abstract fun takeFlexible (x: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.takeFlexible' type=.Test origin=null + x: GET_VAR 'x: @[FlexibleNullability] kotlin.String? declared in .Test.takeFlexible' type=@[FlexibleNullability] kotlin.String? origin=null + FUN DELEGATED_MEMBER name:takeNotNull visibility:public modality:OPEN <> ($this:.Test, x:@[EnhancedNullability] kotlin.String) returnType:kotlin.Unit + overridden: + public abstract fun takeNotNull (x: @[EnhancedNullability] kotlin.String): kotlin.Unit declared in .J + $this: VALUE_PARAMETER name: type:.Test + VALUE_PARAMETER name:x index:0 type:@[EnhancedNullability] kotlin.String + annotations: + NotNull(value = ) + BLOCK_BODY + CALL 'public abstract fun takeNotNull (x: @[EnhancedNullability] kotlin.String): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.takeNotNull' type=.Test origin=null + x: GET_VAR 'x: @[EnhancedNullability] kotlin.String declared in .Test.takeNotNull' type=@[EnhancedNullability] kotlin.String origin=null + FUN DELEGATED_MEMBER name:takeNullable visibility:public modality:OPEN <> ($this:.Test, x:kotlin.String?) returnType:kotlin.Unit + overridden: + public abstract fun takeNullable (x: kotlin.String?): kotlin.Unit declared in .J + $this: VALUE_PARAMETER name: type:.Test + VALUE_PARAMETER name:x index:0 type:kotlin.String? + annotations: + Nullable(value = ) + BLOCK_BODY + CALL 'public abstract fun takeNullable (x: kotlin.String?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.takeNullable' type=.Test origin=null + x: GET_VAR 'x: kotlin.String? declared in .Test.takeNullable' type=kotlin.String? 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 .J diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.kt.txt index b0242e148dd..2ca91cf5d97 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.kt.txt @@ -1,24 +1,12 @@ class Test : J { - constructor(j: J) /* primary */ { - super/*Any*/() - /* () */ - - } - private val j: J field = j private get - override fun takeNotNull(@NotNull x: @EnhancedNullability String) { - .#j.takeNotNull(x = x) - } + constructor(j: J) /* primary */ { + super/*Any*/() + /* () */ - override fun takeNullable(@Nullable x: String?) { - .#j.takeNullable(x = x) - } - - override fun takeFlexible(x: @FlexibleNullability String?) { - .#j.takeFlexible(x = x) } @NotNull @@ -35,5 +23,17 @@ class Test : J { return .#j.returnsFlexible() } + override fun takeFlexible(x: @FlexibleNullability String?) { + .#j.takeFlexible(x = x) + } + + override fun takeNotNull(@NotNull x: @EnhancedNullability String) { + .#j.takeNotNull(x = x) + } + + override fun takeNullable(@Nullable x: String?) { + .#j.takeNullable(x = x) + } + } diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.ir.txt b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.ir.txt index a420251c4e1..0e045a6dcf9 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/delegatedImplementationOfJavaInterface.kt CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.J] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test - CONSTRUCTOR visibility:public <> (j:.J) returnType:.Test [primary] - VALUE_PARAMETER name:j index:0 type:.J - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.J]' PROPERTY name:j visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/delegatedImplementationOfJavaInterface.kt RETURN type=kotlin.Nothing from='private final fun (): .J declared in .Test' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null + CONSTRUCTOR visibility:public <> (j:.J) returnType:.Test [primary] + VALUE_PARAMETER name:j index:0 type:.J + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.J]' FUN DELEGATED_MEMBER name:returnNotNull visibility:public modality:OPEN <> ($this:.Test) returnType:@[EnhancedNullability] kotlin.String annotations: NotNull(value = ) diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt.txt index 14304fec3fe..e895bea9703 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt.txt @@ -1,14 +1,14 @@ class Test : J { + private val j: J + field = j + private get + constructor(j: J) /* primary */ { super/*Any*/() /* () */ } - private val j: J - field = j - private get - @NotNull override fun returnNotNull(): @EnhancedNullability String { return .#j.returnNotNull() @@ -36,3 +36,4 @@ class Test : J { } } + diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.ir.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.ir.txt index 2215d6786ae..e864b1cb855 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.ir.txt @@ -1,10 +1,41 @@ FILE fqName: fileName:/delegatedImplementationWithExplicitOverride.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.IFooBar] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + FIELD DELEGATE name:$$delegate_0 type:.FooBarImpl visibility:private [final] + EXPRESSION_BODY + GET_OBJECT 'CLASS OBJECT name:FooBarImpl modality:FINAL visibility:public superTypes:[.IFooBar]' type=.FooBarImpl + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.IFooBar]' + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .IFooBar + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + CALL 'public open fun foo (): kotlin.Unit declared in .FooBarImpl' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.FooBarImpl visibility:private [final]' type=.FooBarImpl origin=null + receiver: GET_VAR ': .C declared in .C.foo' type=.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 declared in .IFooBar + $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 .IFooBar + $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 .IFooBar + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Unit + overridden: + public abstract fun bar (): kotlin.Unit declared in .IFooBar + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY CLASS INTERFACE name:IFooBar modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFooBar - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFooBar) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFooBar - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.IFooBar) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFooBar 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 @@ -18,67 +49,36 @@ FILE fqName: fileName:/delegatedImplementationWithExplicitOverride.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.IFooBar) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFooBar + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFooBar) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFooBar CLASS OBJECT name:FooBarImpl modality:FINAL visibility:public superTypes:[.IFooBar] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FooBarImpl CONSTRUCTOR visibility:private <> () returnType:.FooBarImpl [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:FooBarImpl modality:FINAL visibility:public superTypes:[.IFooBar]' - FUN name:foo visibility:public modality:OPEN <> ($this:.FooBarImpl) returnType:kotlin.Unit + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: - public abstract fun foo (): kotlin.Unit declared in .IFooBar - $this: VALUE_PARAMETER name: type:.FooBarImpl - BLOCK_BODY + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFooBar + $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 .IFooBar + $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 .IFooBar + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:bar visibility:public modality:OPEN <> ($this:.FooBarImpl) returnType:kotlin.Unit overridden: public abstract fun bar (): kotlin.Unit declared in .IFooBar $this: VALUE_PARAMETER name: type:.FooBarImpl BLOCK_BODY - 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 .IFooBar - $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 .IFooBar - $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 .IFooBar - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.IFooBar] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.IFooBar]' - FIELD DELEGATE name:$$delegate_0 type:.FooBarImpl visibility:private [final] - EXPRESSION_BODY - GET_OBJECT 'CLASS OBJECT name:FooBarImpl modality:FINAL visibility:public superTypes:[.IFooBar]' type=.FooBarImpl - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Unit + FUN name:foo visibility:public modality:OPEN <> ($this:.FooBarImpl) returnType:kotlin.Unit overridden: public abstract fun foo (): kotlin.Unit declared in .IFooBar - $this: VALUE_PARAMETER name: type:.C + $this: VALUE_PARAMETER name: type:.FooBarImpl BLOCK_BODY - CALL 'public open fun foo (): kotlin.Unit declared in .FooBarImpl' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.FooBarImpl visibility:private [final]' type=.FooBarImpl origin=null - receiver: GET_VAR ': .C declared in .C.foo' type=.C origin=null - FUN name:bar visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Unit - overridden: - public abstract fun bar (): kotlin.Unit declared in .IFooBar - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - 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 .IFooBar - $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 .IFooBar - $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 .IFooBar - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt.txt index 58b121838cd..3b48789a904 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt.txt @@ -1,8 +1,25 @@ -interface IFooBar { - abstract fun foo() +class C : IFooBar { + private /* final field */ val $$delegate_0: FooBarImpl = FooBarImpl + constructor() /* primary */ { + super/*Any*/() + /* () */ + } + + override fun foo() { + .#$$delegate_0.foo() + } + + override fun bar() { + } + +} + +interface IFooBar { abstract fun bar() + abstract fun foo() + } object FooBarImpl : IFooBar { @@ -12,27 +29,11 @@ object FooBarImpl : IFooBar { } - override fun foo() { + override fun bar() { } - override fun bar() { + override fun foo() { } } -class C : IFooBar { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: FooBarImpl = FooBarImpl - override fun foo() { - .#$$delegate_0.foo() - } - - override fun bar() { - } - -} diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.ir.txt b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.ir.txt index 07e4fcdfd3a..5cc36878c82 100644 --- a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.ir.txt @@ -1,12 +1,65 @@ FILE fqName: fileName:/delegatingConstructorCallToTypeAliasConstructor.kt + CLASS CLASS name:C1 modality:FINAL visibility:public superTypes:[.Cell] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C1 + CONSTRUCTOR visibility:public <> () returnType:.C1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (value: T of .Cell) declared in .Cell' + : kotlin.String + value: CONST String type=kotlin.String value="O" + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C1 modality:FINAL visibility:public superTypes:[.Cell]' + 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 .Cell + $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 .Cell + $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 .Cell + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,val] + overridden: + public final value: T of .Cell + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Cell) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): T of .Cell declared in .Cell + $this: VALUE_PARAMETER name: type:.Cell + CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.Cell] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C2 + CONSTRUCTOR visibility:public <> () returnType:.C2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (value: T of .Cell) declared in .Cell' + : kotlin.String + value: CONST String type=kotlin.String value="K" + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.Cell]' + 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 .Cell + $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 .Cell + $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 .Cell + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,val] + overridden: + public final value: T of .Cell + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Cell) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): T of .Cell declared in .Cell + $this: VALUE_PARAMETER name: type:.Cell CLASS CLASS name:Cell modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell.Cell> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .Cell) returnType:.Cell.Cell> [primary] - VALUE_PARAMETER name:value index:0 type:T of .Cell - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private [final] EXPRESSION_BODY @@ -18,6 +71,11 @@ FILE fqName: fileName:/delegatingConstructorCallToTypeAliasConstructor.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Cell declared in .Cell' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private [final]' type=T of .Cell origin=null receiver: GET_VAR ': .Cell.Cell> declared in .Cell.' type=.Cell.Cell> origin=null + CONSTRUCTOR visibility:public <> (value:T of .Cell) returnType:.Cell.Cell> [primary] + VALUE_PARAMETER name:value index:0 type:T of .Cell + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:OPEN visibility:public 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 declared in kotlin.Any @@ -31,64 +89,6 @@ FILE fqName: fileName:/delegatingConstructorCallToTypeAliasConstructor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + TYPEALIAS name:CStr visibility:public expandedType:.Cell TYPEALIAS name:CT visibility:public expandedType:.Cell.CT> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:CStr visibility:public expandedType:.Cell - CLASS CLASS name:C1 modality:FINAL visibility:public superTypes:[.Cell] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C1 - CONSTRUCTOR visibility:public <> () returnType:.C1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (value: T of .Cell) declared in .Cell' - : kotlin.String - value: CONST String type=kotlin.String value="O" - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C1 modality:FINAL visibility:public superTypes:[.Cell]' - PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,val] - overridden: - public final value: T of .Cell - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Cell) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): T of .Cell declared in .Cell - $this: VALUE_PARAMETER name: type:.Cell - 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 .Cell - $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 .Cell - $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 .Cell - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.Cell] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C2 - CONSTRUCTOR visibility:public <> () returnType:.C2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (value: T of .Cell) declared in .Cell' - : kotlin.String - value: CONST String type=kotlin.String value="K" - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.Cell]' - PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,val] - overridden: - public final value: T of .Cell - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Cell) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): T of .Cell declared in .Cell - $this: VALUE_PARAMETER name: type:.Cell - 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 .Cell - $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 .Cell - $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 .Cell - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt.txt b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt.txt index 128caac0260..749cb9f6a96 100644 --- a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt.txt @@ -1,18 +1,3 @@ -open class Cell { - constructor(value: T) /* primary */ { - super/*Any*/() - /* () */ - - } - - val value: T - field = value - get - -} - -typealias CT = Cell -typealias CStr = Cell class C1 : Cell { constructor() /* primary */ { super/*Cell*/(value = "O") @@ -30,3 +15,19 @@ class C2 : Cell { } } + +open class Cell { + val value: T + field = value + get + + constructor(value: T) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +typealias CStr = Cell +typealias CT = Cell diff --git a/compiler/testData/ir/irText/classes/enum.fir.ir.txt b/compiler/testData/ir/irText/classes/enum.fir.ir.txt index c2f80d7d1dd..0bcd261a02a 100644 --- a/compiler/testData/ir/irText/classes/enum.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/enum.fir.ir.txt @@ -1,26 +1,22 @@ FILE fqName: fileName:/enum.kt CLASS ENUM_CLASS name:TestEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum1 - CONSTRUCTOR visibility:private <> () returnType:.TestEnum1 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum1>]' ENUM_ENTRY name:TEST1 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum1' ENUM_ENTRY name:TEST2 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum1' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum1> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> () returnType:.TestEnum1 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum1>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum1 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum1> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum1> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum1>, other:.TestEnum1) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -39,6 +35,10 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum1> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum1> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -59,12 +59,6 @@ FILE fqName: fileName:/enum.kt $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum1> CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum2>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -88,15 +82,17 @@ FILE fqName: fileName:/enum.kt init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .TestEnum2' x: CONST Int type=kotlin.Int value=3 - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum2> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum2>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum2 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum2> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum2> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum2>, other:.TestEnum2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -115,6 +111,10 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum2> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum2> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -135,11 +135,6 @@ FILE fqName: fileName:/enum.kt $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum2> CLASS ENUM_CLASS name:TestEnum3 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum3>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum3 - CONSTRUCTOR visibility:private <> () returnType:.TestEnum3 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum3 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum3 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum3>]' ENUM_ENTRY name:TEST init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum3.TEST' @@ -149,13 +144,6 @@ FILE fqName: fileName:/enum.kt BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum3' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:private superTypes:[.TestEnum3]' - FUN name:foo visibility:public modality:OPEN <> ($this:.TestEnum3.TEST) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .TestEnum3 - $this: VALUE_PARAMETER name: type:.TestEnum3.TEST - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="Hello, world!" FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>, other:.TestEnum3) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .TestEnum3): kotlin.Int declared in .TestEnum3 @@ -174,6 +162,13 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in .TestEnum3 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> + FUN name:foo visibility:public modality:OPEN <> ($this:.TestEnum3.TEST) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .TestEnum3 + $this: VALUE_PARAMETER name: type:.TestEnum3.TEST + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="Hello, world!" PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -192,17 +187,16 @@ FILE fqName: fileName:/enum.kt overridden: public final fun (): kotlin.Int declared in .TestEnum3 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestEnum3) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TestEnum3 - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum3> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> () returnType:.TestEnum3 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum3 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum3 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum3>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum3 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum3> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum3> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>, other:.TestEnum3) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -221,6 +215,12 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestEnum3) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestEnum3 + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum3> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -241,12 +241,6 @@ FILE fqName: fileName:/enum.kt $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> CLASS ENUM_CLASS name:TestEnum4 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum4>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum4 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum4 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum4 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum4 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum4>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -268,21 +262,6 @@ FILE fqName: fileName:/enum.kt ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .TestEnum4' x: CONST Int type=kotlin.Int value=1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[.TestEnum4]' - FUN name:foo visibility:public modality:OPEN <> ($this:.TestEnum4.TEST1) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .TestEnum4 - $this: VALUE_PARAMETER name: type:.TestEnum4.TEST1 - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: GET_ENUM 'ENUM_ENTRY name:TEST1' type=.TestEnum4 - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum4 - $this: VALUE_PARAMETER name: type:.TestEnum4 FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>, other:.TestEnum4) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .TestEnum4): kotlin.Int declared in .TestEnum4 @@ -301,6 +280,13 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in .TestEnum4 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> + FUN name:foo visibility:public modality:OPEN <> ($this:.TestEnum4.TEST1) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST1 + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: GET_ENUM 'ENUM_ENTRY name:TEST1' type=.TestEnum4 PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -319,16 +305,19 @@ FILE fqName: fileName:/enum.kt overridden: public final fun (): kotlin.Int declared in .TestEnum4 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:.TestEnum4 ENUM_ENTRY name:TEST2 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum4.TEST2' class: CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[.TestEnum4] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum4.TEST2 - CONSTRUCTOR visibility:private <> () returnType:.TestEnum4.TEST2 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .TestEnum4' - x: CONST Int type=kotlin.Int value=2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[.TestEnum4]' PROPERTY name:z visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestEnum4.TEST2) returnType:kotlin.Int @@ -344,21 +333,11 @@ FILE fqName: fileName:/enum.kt receiver: GET_VAR ': .TestEnum4.TEST2 declared in .TestEnum4.TEST2' type=.TestEnum4.TEST2 origin=null value: CALL 'public final fun (): kotlin.Int declared in .TestEnum4.TEST2' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .TestEnum4.TEST2 declared in .TestEnum4.TEST2' type=.TestEnum4.TEST2 origin=null - FUN name:foo visibility:public modality:OPEN <> ($this:.TestEnum4.TEST2) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .TestEnum4 - $this: VALUE_PARAMETER name: type:.TestEnum4.TEST2 + CONSTRUCTOR visibility:private <> () returnType:.TestEnum4.TEST2 [primary] BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: GET_ENUM 'ENUM_ENTRY name:TEST2' type=.TestEnum4 - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum4 - $this: VALUE_PARAMETER name: type:.TestEnum4 + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .TestEnum4' + x: CONST Int type=kotlin.Int value=2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[.TestEnum4]' FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>, other:.TestEnum4) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .TestEnum4): kotlin.Int declared in .TestEnum4 @@ -377,6 +356,13 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in .TestEnum4 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> + FUN name:foo visibility:public modality:OPEN <> ($this:.TestEnum4.TEST2) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST2 + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: GET_ENUM 'ENUM_ENTRY name:TEST2' type=.TestEnum4 PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -395,17 +381,25 @@ FILE fqName: fileName:/enum.kt overridden: public final fun (): kotlin.Int declared in .TestEnum4 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestEnum4) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TestEnum4 - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum4> - SYNTHETIC_BODY kind=ENUM_VALUES + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:.TestEnum4 + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum4 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum4 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum4 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum4>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum4 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum4> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum4> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>, other:.TestEnum4) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -424,6 +418,12 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestEnum4) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestEnum4 + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum4> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -444,14 +444,6 @@ FILE fqName: fileName:/enum.kt $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum5>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum5 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum5 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum5 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum5>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -473,15 +465,19 @@ FILE fqName: fileName:/enum.kt init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .TestEnum5' x: CONST Int type=kotlin.Int value=0 - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum5> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum5 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum5 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum5>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum5 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum5> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum5> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum5>, other:.TestEnum5) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -500,6 +496,10 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum5> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum5> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -518,19 +518,8 @@ FILE fqName: fileName:/enum.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum5> - FUN name:f visibility:public modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=1 CLASS ENUM_CLASS name:TestEnum6 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum6>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum6 - CONSTRUCTOR visibility:private <> (x:kotlin.Int, y:kotlin.Int) returnType:.TestEnum6 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum6 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum6 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum6>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -563,15 +552,18 @@ FILE fqName: fileName:/enum.kt ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int, y: kotlin.Int) declared in .TestEnum6' x: GET_VAR 'val tmp_1: kotlin.Int declared in .TestEnum6' type=kotlin.Int origin=null y: GET_VAR 'val tmp_0: kotlin.Int declared in .TestEnum6' type=kotlin.Int origin=null - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum6> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> (x:kotlin.Int, y:kotlin.Int) returnType:.TestEnum6 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum6 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum6 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum6>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum6 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum6> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum6> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum6>, other:.TestEnum6) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -590,6 +582,10 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum6> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum6> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -608,3 +604,7 @@ FILE fqName: fileName:/enum.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum6> + FUN name:f visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/classes/enum.fir.kt.txt b/compiler/testData/ir/irText/classes/enum.fir.kt.txt index f135e25de4f..7c068267f17 100644 --- a/compiler/testData/ir/irText/classes/enum.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/enum.fir.kt.txt @@ -1,30 +1,24 @@ enum class TestEnum1 : Enum { + TEST1 = TestEnum1() + + TEST2 = TestEnum1() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - TEST1 = TestEnum1() - - TEST2 = TestEnum1() + fun valueOf(value: String): TestEnum1 /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestEnum1 /* Synthetic body for ENUM_VALUEOF */ - val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } enum class TestEnum2 : Enum { - private constructor(x: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -35,21 +29,22 @@ enum class TestEnum2 : Enum { TEST3 = TestEnum2(x = 3) - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): TestEnum2 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } abstract enum class TestEnum3 : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } TEST = TEST() private enum entry class TEST : TestEnum3 { @@ -65,11 +60,17 @@ abstract enum class TestEnum3 : Enum { } - abstract fun foo() + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } + + fun valueOf(value: String): TestEnum3 /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestEnum3 /* Synthetic body for ENUM_VALUEOF */ + abstract fun foo() val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ @@ -77,12 +78,6 @@ abstract enum class TestEnum3 : Enum { } abstract enum class TestEnum4 : Enum { - private constructor(x: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -103,12 +98,6 @@ abstract enum class TestEnum4 : Enum { TEST2 = TEST2() private enum entry class TEST2 : TestEnum4 { - private constructor() /* primary */ { - super/*TestEnum4*/(x = 2) - /* () */ - - } - val z: Int get @@ -116,17 +105,29 @@ abstract enum class TestEnum4 : Enum { .#z = .() } + private constructor() /* primary */ { + super/*TestEnum4*/(x = 2) + /* () */ + + } + override fun foo() { println(message = TestEnum4.TEST2) } } - abstract fun foo() + private constructor(x: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } + + fun valueOf(value: String): TestEnum4 /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestEnum4 /* Synthetic body for ENUM_VALUEOF */ + abstract fun foo() val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ @@ -134,12 +135,6 @@ abstract enum class TestEnum4 : Enum { } enum class TestEnum5 : Enum { - private constructor(x: Int = 0) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -150,26 +145,22 @@ enum class TestEnum5 : Enum { TEST3 = TestEnum5(x = 0) - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: Int = 0) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): TestEnum5 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } -fun f(): Int { - return 1 -} - enum class TestEnum6 : Enum { - private constructor(x: Int, y: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -184,12 +175,22 @@ enum class TestEnum6 : Enum { TestEnum6(x = tmp_1, y = tmp_0) } - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: Int, y: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): TestEnum6 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } +fun f(): Int { + return 1 +} + diff --git a/compiler/testData/ir/irText/classes/enum.ir.txt b/compiler/testData/ir/irText/classes/enum.ir.txt index 4be82b9e898..1b3a75ab103 100644 --- a/compiler/testData/ir/irText/classes/enum.ir.txt +++ b/compiler/testData/ir/irText/classes/enum.ir.txt @@ -1,35 +1,22 @@ FILE fqName: fileName:/enum.kt CLASS ENUM_CLASS name:TestEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum1 - CONSTRUCTOR visibility:private <> () returnType:.TestEnum1 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum1>]' ENUM_ENTRY name:TEST1 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum1' ENUM_ENTRY name:TEST2 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum1' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum1>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum1> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum1>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum1> + CONSTRUCTOR visibility:private <> () returnType:.TestEnum1 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum1>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum1 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum1> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum1>, other:.TestEnum1) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -48,23 +35,30 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum1> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum1> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum1 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum1> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum1>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum1> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum1>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum1> CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum2>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -88,24 +82,17 @@ FILE fqName: fileName:/enum.kt init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .TestEnum2' x: CONST Int type=kotlin.Int value=3 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum2>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum2> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum2>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum2> + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum2>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum2 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum2> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum2>, other:.TestEnum2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -124,22 +111,30 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum2> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum2> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum2 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum2> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum2>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum2> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum2>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum2> CLASS ENUM_CLASS name:TestEnum3 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum3>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum3 - CONSTRUCTOR visibility:private <> () returnType:.TestEnum3 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum3 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum3 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum3>]' ENUM_ENTRY name:TEST init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum3.TEST' @@ -150,6 +145,24 @@ FILE fqName: fileName:/enum.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum3' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:private superTypes:[.TestEnum3]' + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>, other:.TestEnum3) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: .TestEnum3): kotlin.Int declared in .TestEnum3 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> + VALUE_PARAMETER name:other index:0 type:.TestEnum3 + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestEnum3 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in .TestEnum3 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestEnum3>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .TestEnum3 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> FUN name:foo visibility:public modality:OPEN <> ($this:.TestEnum3.TEST) returnType:kotlin.Unit overridden: public abstract fun foo (): kotlin.Unit declared in .TestEnum3 @@ -175,44 +188,16 @@ FILE fqName: fileName:/enum.kt overridden: public final fun (): kotlin.Int declared in .TestEnum3 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>, other:.TestEnum3) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: .TestEnum3): kotlin.Int declared in .TestEnum3 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> - VALUE_PARAMETER name:other index:0 type:.TestEnum3 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestEnum3 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in .TestEnum3 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestEnum3>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .TestEnum3 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestEnum3) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TestEnum3 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> + CONSTRUCTOR visibility:private <> () returnType:.TestEnum3 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum3 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum3 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum3>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum3 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum3> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>, other:.TestEnum3) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -231,23 +216,32 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum3> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum3 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestEnum3) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestEnum3 PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum3> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum3>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum3> CLASS ENUM_CLASS name:TestEnum4 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum4>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum4 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum4 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum4 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum4 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum4>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -270,39 +264,6 @@ FILE fqName: fileName:/enum.kt ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .TestEnum4' x: CONST Int type=kotlin.Int value=1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[.TestEnum4]' - FUN name:foo visibility:public modality:OPEN <> ($this:.TestEnum4.TEST1) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .TestEnum4 - $this: VALUE_PARAMETER name: type:.TestEnum4.TEST1 - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: GET_ENUM 'ENUM_ENTRY name:TEST1' type=.TestEnum4 - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum4 - $this: VALUE_PARAMETER name: type:.TestEnum4 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .TestEnum4 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum4 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>, other:.TestEnum4) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .TestEnum4): kotlin.Int declared in .TestEnum4 @@ -321,17 +282,44 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in .TestEnum4 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> + FUN name:foo visibility:public modality:OPEN <> ($this:.TestEnum4.TEST1) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST1 + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: GET_ENUM 'ENUM_ENTRY name:TEST1' type=.TestEnum4 + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:.TestEnum4 ENUM_ENTRY name:TEST2 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum4.TEST2' class: CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[.TestEnum4] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum4.TEST2 - CONSTRUCTOR visibility:private <> () returnType:.TestEnum4.TEST2 [primary] - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .TestEnum4' - x: CONST Int type=kotlin.Int value=2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[.TestEnum4]' PROPERTY name:z visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestEnum4.TEST2) returnType:kotlin.Int @@ -347,39 +335,12 @@ FILE fqName: fileName:/enum.kt receiver: GET_VAR ': .TestEnum4.TEST2 declared in .TestEnum4.TEST2' type=.TestEnum4.TEST2 origin=null value: CALL 'public final fun (): kotlin.Int declared in .TestEnum4.TEST2' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .TestEnum4.TEST2 declared in .TestEnum4.TEST2' type=.TestEnum4.TEST2 origin=null - FUN name:foo visibility:public modality:OPEN <> ($this:.TestEnum4.TEST2) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .TestEnum4 - $this: VALUE_PARAMETER name: type:.TestEnum4.TEST2 + CONSTRUCTOR visibility:private <> () returnType:.TestEnum4.TEST2 [primary] BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: GET_ENUM 'ENUM_ENTRY name:TEST2' type=.TestEnum4 - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum4 - $this: VALUE_PARAMETER name: type:.TestEnum4 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .TestEnum4 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum4 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .TestEnum4' + x: CONST Int type=kotlin.Int value=2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[.TestEnum4]' FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>, other:.TestEnum4) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .TestEnum4): kotlin.Int declared in .TestEnum4 @@ -398,26 +359,50 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in .TestEnum4 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestEnum4) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TestEnum4 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> + FUN name:foo visibility:public modality:OPEN <> ($this:.TestEnum4.TEST2) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST2 + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: GET_ENUM 'ENUM_ENTRY name:TEST2' type=.TestEnum4 + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:.TestEnum4 + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum4 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum4 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum4 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum4>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum4 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum4> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>, other:.TestEnum4) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -436,25 +421,32 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum4> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum4 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestEnum4) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestEnum4 PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum4> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum4>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum4> CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum5>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum5 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum5 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum5 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum5>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -476,24 +468,19 @@ FILE fqName: fileName:/enum.kt init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .TestEnum5' x: CONST Int type=kotlin.Int value=0 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum5>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum5> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum5>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum5> + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum5 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum5 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum5>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum5 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum5> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum5>, other:.TestEnum5) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -512,28 +499,30 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum5> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum5> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum5 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum5> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN name:f visibility:public modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=1 + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum5>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum5> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum5>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum5> CLASS ENUM_CLASS name:TestEnum6 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum6>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum6 - CONSTRUCTOR visibility:private <> (x:kotlin.Int, y:kotlin.Int) returnType:.TestEnum6 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum6 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum6 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum6>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -566,24 +555,18 @@ FILE fqName: fileName:/enum.kt ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int, y: kotlin.Int) declared in .TestEnum6' x: GET_VAR 'val tmp_1: kotlin.Int declared in .TestEnum6' type=kotlin.Int origin=null y: GET_VAR 'val tmp_0: kotlin.Int declared in .TestEnum6' type=kotlin.Int origin=null - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum6>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum6> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum6>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum6> + CONSTRUCTOR visibility:private <> (x:kotlin.Int, y:kotlin.Int) returnType:.TestEnum6 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum6 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum6 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum6>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum6 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum6> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum6>, other:.TestEnum6) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -602,12 +585,29 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum6> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum6> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum6 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum6> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum6>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum6> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum6>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum6> + FUN name:f visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/classes/enum.kt.txt b/compiler/testData/ir/irText/classes/enum.kt.txt index 342bd1509cc..aa4f1530b7f 100644 --- a/compiler/testData/ir/irText/classes/enum.kt.txt +++ b/compiler/testData/ir/irText/classes/enum.kt.txt @@ -1,30 +1,24 @@ enum class TestEnum1 : Enum { + TEST1 = TestEnum1() + + TEST2 = TestEnum1() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - TEST1 = TestEnum1() - - TEST2 = TestEnum1() + fun valueOf(value: String): TestEnum1 /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestEnum1 /* Synthetic body for ENUM_VALUEOF */ - val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } enum class TestEnum2 : Enum { - private constructor(x: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -35,21 +29,22 @@ enum class TestEnum2 : Enum { TEST3 = TestEnum2(x = 3) - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): TestEnum2 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } abstract enum class TestEnum3 : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } TEST = TEST() private enum entry class TEST : TestEnum3 { @@ -65,11 +60,17 @@ abstract enum class TestEnum3 : Enum { } - abstract fun foo() + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } + + fun valueOf(value: String): TestEnum3 /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestEnum3 /* Synthetic body for ENUM_VALUEOF */ + abstract fun foo() val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ @@ -77,12 +78,6 @@ abstract enum class TestEnum3 : Enum { } abstract enum class TestEnum4 : Enum { - private constructor(x: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -103,12 +98,6 @@ abstract enum class TestEnum4 : Enum { TEST2 = TEST2() private enum entry class TEST2 : TestEnum4 { - private constructor() /* primary */ { - super/*TestEnum4*/(x = 2) /*~> Unit */ - /* () */ - - } - val z: Int get @@ -116,17 +105,29 @@ abstract enum class TestEnum4 : Enum { .#z = .() } + private constructor() /* primary */ { + super/*TestEnum4*/(x = 2) /*~> Unit */ + /* () */ + + } + override fun foo() { println(message = TestEnum4.TEST2) } } - abstract fun foo() + private constructor(x: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } + + fun valueOf(value: String): TestEnum4 /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestEnum4 /* Synthetic body for ENUM_VALUEOF */ + abstract fun foo() val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ @@ -134,12 +135,6 @@ abstract enum class TestEnum4 : Enum { } enum class TestEnum5 : Enum { - private constructor(x: Int = 0) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -150,26 +145,22 @@ enum class TestEnum5 : Enum { TEST3 = TestEnum5(x = 0) - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: Int = 0) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): TestEnum5 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } -fun f(): Int { - return 1 -} - enum class TestEnum6 : Enum { - private constructor(x: Int, y: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -184,12 +175,22 @@ enum class TestEnum6 : Enum { TestEnum6(x = tmp_1, y = tmp_0) } - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: Int, y: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): TestEnum6 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } +fun f(): Int { + return 1 +} + diff --git a/compiler/testData/ir/irText/classes/enumClassModality.fir.ir.txt b/compiler/testData/ir/irText/classes/enumClassModality.fir.ir.txt index 377c185d13e..d6bb7669b16 100644 --- a/compiler/testData/ir/irText/classes/enumClassModality.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/enumClassModality.fir.ir.txt @@ -1,23 +1,232 @@ FILE fqName: fileName:/enumClassModality.kt + CLASS ENUM_CLASS name:TestAbstractEnum1 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1 + ENUM_ENTRY name:X1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum1.X1' + class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum1] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1.X1 + CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum1.X1 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum1]' + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:.TestAbstractEnum1) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: .TestAbstractEnum1): kotlin.Int declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum1 + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + FUN name:foo visibility:public modality:OPEN <> ($this:.TestAbstractEnum1.X1) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:.TestAbstractEnum1.X1 + BLOCK_BODY + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum1 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestAbstractEnum1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum1 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestAbstractEnum1 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestAbstractEnum1> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:.TestAbstractEnum1) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum1 + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestAbstractEnum1) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestAbstractEnum1 + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestAbstractEnum1> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + CLASS ENUM_CLASS name:TestAbstractEnum2 modality:ABSTRACT visibility:public superTypes:[.IFoo; kotlin.Enum<.TestAbstractEnum2>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum2 + ENUM_ENTRY name:X1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum2.X1' + class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum2.X1 + CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum2.X1 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum2' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum2]' + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>, other:.TestAbstractEnum2) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: .TestAbstractEnum2): kotlin.Int declared in .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum2 + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in .TestAbstractEnum2 + $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 .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.TestAbstractEnum2.X1) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:.TestAbstractEnum2.X1 + BLOCK_BODY + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum2 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestAbstractEnum2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum2 modality:ABSTRACT visibility:public superTypes:[.IFoo; kotlin.Enum<.TestAbstractEnum2>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestAbstractEnum2 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestAbstractEnum2> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>, other:.TestAbstractEnum2) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum2 + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun foo (): kotlin.Unit declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in .IFoo + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $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 .IFoo + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestAbstractEnum2> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> CLASS ENUM_CLASS name:TestFinalEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum1 + ENUM_ENTRY name:X1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestFinalEnum1' CONSTRUCTOR visibility:private <> () returnType:.TestFinalEnum1 [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' : .TestFinalEnum1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum1>]' - ENUM_ENTRY name:X1 - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestFinalEnum1' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum1> - SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestFinalEnum1 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestFinalEnum1> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum1> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum1>, other:.TestFinalEnum1) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -36,6 +245,10 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum1> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestFinalEnum1> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -56,12 +269,6 @@ FILE fqName: fileName:/enumClassModality.kt $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum1> CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum2 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestFinalEnum2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestFinalEnum2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum2>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -77,15 +284,17 @@ FILE fqName: fileName:/enumClassModality.kt init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .TestFinalEnum2' x: CONST Int type=kotlin.Int value=1 - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum2> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestFinalEnum2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestFinalEnum2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum2>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestFinalEnum2 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestFinalEnum2> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum2> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum2>, other:.TestFinalEnum2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -104,6 +313,10 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum2> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestFinalEnum2> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -124,26 +337,19 @@ FILE fqName: fileName:/enumClassModality.kt $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum2> CLASS ENUM_CLASS name:TestFinalEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum3>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum3 + ENUM_ENTRY name:X1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestFinalEnum3' CONSTRUCTOR visibility:private <> () returnType:.TestFinalEnum3 [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' : .TestFinalEnum3 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum3>]' - ENUM_ENTRY name:X1 - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestFinalEnum3' - FUN name:doStuff visibility:public modality:FINAL <> ($this:.TestFinalEnum3) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TestFinalEnum3 - BLOCK_BODY - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum3> - SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestFinalEnum3 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestFinalEnum3> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum3> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum3>, other:.TestFinalEnum3) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -162,6 +368,13 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum3> + FUN name:doStuff visibility:public modality:FINAL <> ($this:.TestFinalEnum3) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestFinalEnum3 + BLOCK_BODY + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestFinalEnum3> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -182,11 +395,6 @@ FILE fqName: fileName:/enumClassModality.kt $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum3> CLASS ENUM_CLASS name:TestOpenEnum1 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum1 - CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum1 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestOpenEnum1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum1 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum1>]' ENUM_ENTRY name:X1 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestOpenEnum1.X1' @@ -196,13 +404,6 @@ FILE fqName: fileName:/enumClassModality.kt BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestOpenEnum1' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestOpenEnum1]' - FUN name:toString visibility:public modality:OPEN <> ($this:.TestOpenEnum1.X1) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in .TestOpenEnum1 - $this: VALUE_PARAMETER name: type:.TestOpenEnum1.X1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestOpenEnum1.X1' - CONST String type=kotlin.String value="X1" FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>, other:.TestOpenEnum1) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .TestOpenEnum1): kotlin.Int declared in .TestOpenEnum1 @@ -217,6 +418,13 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public final fun hashCode (): kotlin.Int declared in .TestOpenEnum1 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> + FUN name:toString visibility:public modality:OPEN <> ($this:.TestOpenEnum1.X1) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in .TestOpenEnum1 + $this: VALUE_PARAMETER name: type:.TestOpenEnum1.X1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestOpenEnum1.X1' + CONST String type=kotlin.String value="X1" PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -235,15 +443,16 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public final fun (): kotlin.Int declared in .TestOpenEnum1 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestOpenEnum1> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum1 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestOpenEnum1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum1 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum1>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestOpenEnum1 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestOpenEnum1> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestOpenEnum1> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>, other:.TestOpenEnum1) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -262,6 +471,10 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestOpenEnum1> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -282,11 +495,6 @@ FILE fqName: fileName:/enumClassModality.kt $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> CLASS ENUM_CLASS name:TestOpenEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum2 - CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum2 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestOpenEnum2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum2>]' ENUM_ENTRY name:X1 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestOpenEnum2.X1' @@ -296,11 +504,6 @@ FILE fqName: fileName:/enumClassModality.kt BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestOpenEnum2' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestOpenEnum2]' - FUN name:foo visibility:public modality:OPEN <> ($this:.TestOpenEnum2.X1) returnType:kotlin.Unit - overridden: - public open fun foo (): kotlin.Unit declared in .TestOpenEnum2 - $this: VALUE_PARAMETER name: type:.TestOpenEnum2.X1 - BLOCK_BODY FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>, other:.TestOpenEnum2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .TestOpenEnum2): kotlin.Int declared in .TestOpenEnum2 @@ -319,6 +522,11 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in .TestOpenEnum2 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> + FUN name:foo visibility:public modality:OPEN <> ($this:.TestOpenEnum2.X1) returnType:kotlin.Unit + overridden: + public open fun foo (): kotlin.Unit declared in .TestOpenEnum2 + $this: VALUE_PARAMETER name: type:.TestOpenEnum2.X1 + BLOCK_BODY PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -337,18 +545,16 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public final fun (): kotlin.Int declared in .TestOpenEnum2 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> - FUN name:foo visibility:public modality:OPEN <> ($this:.TestOpenEnum2) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TestOpenEnum2 + CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum2 [primary] BLOCK_BODY - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestOpenEnum2> - SYNTHETIC_BODY kind=ENUM_VALUES + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestOpenEnum2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum2>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestOpenEnum2 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestOpenEnum2> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestOpenEnum2> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>, other:.TestOpenEnum2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -367,6 +573,13 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> + FUN name:foo visibility:public modality:OPEN <> ($this:.TestOpenEnum2) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestOpenEnum2 + BLOCK_BODY + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestOpenEnum2> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -385,114 +598,8 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> - CLASS ENUM_CLASS name:TestAbstractEnum1 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1 - CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum1 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestAbstractEnum1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum1 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>]' - ENUM_ENTRY name:X1 - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum1.X1' - class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum1] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1.X1 - CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum1.X1 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum1' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum1]' - FUN name:foo visibility:public modality:OPEN <> ($this:.TestAbstractEnum1.X1) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:.TestAbstractEnum1.X1 - BLOCK_BODY - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:.TestAbstractEnum1) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: .TestAbstractEnum1): kotlin.Int declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum1 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestAbstractEnum1) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TestAbstractEnum1 - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestAbstractEnum1> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestAbstractEnum1 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestAbstractEnum1> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:.TestAbstractEnum1) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum1 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFoo 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 @@ -506,112 +613,5 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ENUM_CLASS name:TestAbstractEnum2 modality:ABSTRACT visibility:public superTypes:[.IFoo; kotlin.Enum<.TestAbstractEnum2>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum2 - CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum2 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestAbstractEnum2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum2 modality:ABSTRACT visibility:public superTypes:[.IFoo; kotlin.Enum<.TestAbstractEnum2>]' - ENUM_ENTRY name:X1 - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum2.X1' - class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum2] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum2.X1 - CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum2.X1 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum2' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum2]' - FUN name:foo visibility:public modality:OPEN <> ($this:.TestAbstractEnum2.X1) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:.TestAbstractEnum2.X1 - BLOCK_BODY - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in .TestAbstractEnum2 - $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 .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>, other:.TestAbstractEnum2) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: .TestAbstractEnum2): kotlin.Int declared in .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum2 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestAbstractEnum2> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestAbstractEnum2 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestAbstractEnum2> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (): kotlin.Unit declared in .IFoo + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.IFoo - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .IFoo - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $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 .IFoo - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>, other:.TestAbstractEnum2) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum2 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> diff --git a/compiler/testData/ir/irText/classes/enumClassModality.fir.kt.txt b/compiler/testData/ir/irText/classes/enumClassModality.fir.kt.txt index e06f8701907..830b4fcefae 100644 --- a/compiler/testData/ir/irText/classes/enumClassModality.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/enumClassModality.fir.kt.txt @@ -1,58 +1,120 @@ +abstract enum class TestAbstractEnum1 : Enum { + + X1 = X1() + private enum entry class X1 : TestAbstractEnum1 { + private constructor() /* primary */ { + super/*TestAbstractEnum1*/() + /* () */ + + } + + override fun foo() { + } + + } + + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } + + fun valueOf(value: String): TestAbstractEnum1 /* Synthetic body for ENUM_VALUEOF */ + + fun values(): Array /* Synthetic body for ENUM_VALUES */ + + abstract fun foo() + + val entries: EnumEntries + get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ + +} + +abstract enum class TestAbstractEnum2 : Enum, IFoo { + + X1 = X1() + private enum entry class X1 : TestAbstractEnum2 { + private constructor() /* primary */ { + super/*TestAbstractEnum2*/() + /* () */ + + } + + override fun foo() { + } + + } + + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } + + fun valueOf(value: String): TestAbstractEnum2 /* Synthetic body for ENUM_VALUEOF */ + + fun values(): Array /* Synthetic body for ENUM_VALUES */ + + val entries: EnumEntries + get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ + +} + enum class TestFinalEnum1 : Enum { + X1 = TestFinalEnum1() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - X1 = TestFinalEnum1() + fun valueOf(value: String): TestFinalEnum1 /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestFinalEnum1 /* Synthetic body for ENUM_VALUEOF */ - val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } enum class TestFinalEnum2 : Enum { - private constructor(x: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get X1 = TestFinalEnum2(x = 1) - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): TestFinalEnum2 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } enum class TestFinalEnum3 : Enum { + X1 = TestFinalEnum3() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - X1 = TestFinalEnum3() - - fun doStuff() { - } + fun valueOf(value: String): TestFinalEnum3 /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestFinalEnum3 /* Synthetic body for ENUM_VALUEOF */ + fun doStuff() { + } val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ @@ -60,11 +122,6 @@ enum class TestFinalEnum3 : Enum { } open enum class TestOpenEnum1 : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } X1 = X1() private enum entry class X1 : TestOpenEnum1 { @@ -80,21 +137,22 @@ open enum class TestOpenEnum1 : Enum { } - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): TestOpenEnum1 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } open enum class TestOpenEnum2 : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } X1 = X1() private enum entry class X1 : TestOpenEnum2 { @@ -109,46 +167,21 @@ open enum class TestOpenEnum2 : Enum { } - open fun foo() { - } - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): TestOpenEnum2 /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} - -abstract enum class TestAbstractEnum1 : Enum { private constructor() /* primary */ { - super/*Enum*/() + super/*Enum*/() /* () */ } - X1 = X1() - private enum entry class X1 : TestAbstractEnum1 { - private constructor() /* primary */ { - super/*TestAbstractEnum1*/() - /* () */ + fun valueOf(value: String): TestOpenEnum2 /* Synthetic body for ENUM_VALUEOF */ - } - - override fun foo() { - } + fun values(): Array /* Synthetic body for ENUM_VALUES */ + open fun foo() { } - abstract fun foo() - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): TestAbstractEnum1 /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ + val entries: EnumEntries + get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } @@ -157,32 +190,3 @@ interface IFoo { } -abstract enum class TestAbstractEnum2 : IFoo, Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - - X1 = X1() - private enum entry class X1 : TestAbstractEnum2 { - private constructor() /* primary */ { - super/*TestAbstractEnum2*/() - /* () */ - - } - - override fun foo() { - } - - } - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): TestAbstractEnum2 /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} - diff --git a/compiler/testData/ir/irText/classes/enumClassModality.ir.txt b/compiler/testData/ir/irText/classes/enumClassModality.ir.txt index f054cf8ba5f..e63f1a90484 100644 --- a/compiler/testData/ir/irText/classes/enumClassModality.ir.txt +++ b/compiler/testData/ir/irText/classes/enumClassModality.ir.txt @@ -1,32 +1,234 @@ FILE fqName: fileName:/enumClassModality.kt - CLASS ENUM_CLASS name:TestFinalEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum1>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum1 - CONSTRUCTOR visibility:private <> () returnType:.TestFinalEnum1 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestFinalEnum1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum1>]' + CLASS ENUM_CLASS name:TestAbstractEnum1 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1 ENUM_ENTRY name:X1 init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestFinalEnum1' + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum1.X1' + class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum1] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1.X1 + CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum1.X1 [primary] + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum1]' + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:.TestAbstractEnum1) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: .TestAbstractEnum1): kotlin.Int declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum1 + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + FUN name:foo visibility:public modality:OPEN <> ($this:.TestAbstractEnum1.X1) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:.TestAbstractEnum1.X1 + BLOCK_BODY + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .TestAbstractEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum1 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestAbstractEnum1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum1 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestAbstractEnum1 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestAbstractEnum1> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:.TestAbstractEnum1) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum1 + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestAbstractEnum1) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestAbstractEnum1 + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestAbstractEnum1> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation overridden: public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum1>) returnType:kotlin.String [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] overridden: public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum1> + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] overridden: public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum1>) returnType:kotlin.Int [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] overridden: public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum1> + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + CLASS ENUM_CLASS name:TestAbstractEnum2 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum2>; .IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum2 + ENUM_ENTRY name:X1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum2.X1' + class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum2.X1 + CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum2.X1 [primary] + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum2' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum2]' + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>, other:.TestAbstractEnum2) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: .TestAbstractEnum2): kotlin.Int declared in .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum2 + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + FUN name:foo visibility:public modality:OPEN <> ($this:.TestAbstractEnum2.X1) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:.TestAbstractEnum2.X1 + BLOCK_BODY + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .TestAbstractEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum2 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestAbstractEnum2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum2 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum2>; .IFoo]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestAbstractEnum2 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestAbstractEnum2> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>, other:.TestAbstractEnum2) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum2 + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun foo (): kotlin.Unit declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + public open fun hashCode (): kotlin.Int declared in .IFoo + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + public open fun toString (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestAbstractEnum2> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> + CLASS ENUM_CLASS name:TestFinalEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum1>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum1 + ENUM_ENTRY name:X1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestFinalEnum1' + CONSTRUCTOR visibility:private <> () returnType:.TestFinalEnum1 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestFinalEnum1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum1>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestFinalEnum1 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum1> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum1>, other:.TestFinalEnum1) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -45,23 +247,30 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum1> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum1> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestFinalEnum1 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestFinalEnum1> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum1>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum1> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum1>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum1> CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum2 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestFinalEnum2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestFinalEnum2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum2>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -77,24 +286,17 @@ FILE fqName: fileName:/enumClassModality.kt init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .TestFinalEnum2' x: CONST Int type=kotlin.Int value=1 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum2>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum2> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum2>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum2> + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestFinalEnum2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestFinalEnum2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum2>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestFinalEnum2 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum2> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum2>, other:.TestFinalEnum2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -113,46 +315,43 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum2> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum2> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestFinalEnum2 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestFinalEnum2> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES - CLASS ENUM_CLASS name:TestFinalEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum3>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum3 - CONSTRUCTOR visibility:private <> () returnType:.TestFinalEnum3 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestFinalEnum3 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum3>]' - ENUM_ENTRY name:X1 - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestFinalEnum3' - FUN name:doStuff visibility:public modality:FINAL <> ($this:.TestFinalEnum3) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TestFinalEnum3 - BLOCK_BODY PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation overridden: public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum3>) returnType:kotlin.String [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum2>) returnType:kotlin.String [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] overridden: public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum3> + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum2> PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] overridden: public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum3>) returnType:kotlin.Int [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum2>) returnType:kotlin.Int [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] overridden: public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum3> + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum2> + CLASS ENUM_CLASS name:TestFinalEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum3>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum3 + ENUM_ENTRY name:X1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestFinalEnum3' + CONSTRUCTOR visibility:private <> () returnType:.TestFinalEnum3 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestFinalEnum3 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum3>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestFinalEnum3 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum3> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum3>, other:.TestFinalEnum3) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -171,22 +370,33 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum3> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum3> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestFinalEnum3 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN name:doStuff visibility:public modality:FINAL <> ($this:.TestFinalEnum3) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestFinalEnum3 + BLOCK_BODY PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestFinalEnum3> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum3>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum3> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestFinalEnum3>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestFinalEnum3> CLASS ENUM_CLASS name:TestOpenEnum1 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum1 - CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum1 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestOpenEnum1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum1 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum1>]' ENUM_ENTRY name:X1 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestOpenEnum1.X1' @@ -197,6 +407,20 @@ FILE fqName: fileName:/enumClassModality.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestOpenEnum1' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestOpenEnum1]' + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>, other:.TestOpenEnum1) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: .TestOpenEnum1): kotlin.Int declared in .TestOpenEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> + VALUE_PARAMETER name:other index:0 type:.TestOpenEnum1 + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestOpenEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in .TestOpenEnum1 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> FUN name:toString visibility:public modality:OPEN <> ($this:.TestOpenEnum1.X1) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in .TestOpenEnum1 @@ -222,38 +446,16 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public final fun (): kotlin.Int declared in .TestOpenEnum1 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>, other:.TestOpenEnum1) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: .TestOpenEnum1): kotlin.Int declared in .TestOpenEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> - VALUE_PARAMETER name:other index:0 type:.TestOpenEnum1 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestOpenEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in .TestOpenEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> + CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum1 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestOpenEnum1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum1 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum1>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestOpenEnum1 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestOpenEnum1> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>, other:.TestOpenEnum1) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -272,22 +474,30 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestOpenEnum1> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestOpenEnum1 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestOpenEnum1> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum1>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum1> CLASS ENUM_CLASS name:TestOpenEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum2 - CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum2 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestOpenEnum2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum2>]' ENUM_ENTRY name:X1 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestOpenEnum2.X1' @@ -298,6 +508,24 @@ FILE fqName: fileName:/enumClassModality.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestOpenEnum2' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestOpenEnum2]' + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>, other:.TestOpenEnum2) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: .TestOpenEnum2): kotlin.Int declared in .TestOpenEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> + VALUE_PARAMETER name:other index:0 type:.TestOpenEnum2 + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestOpenEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in .TestOpenEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestOpenEnum2>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .TestOpenEnum2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> FUN name:foo visibility:public modality:OPEN <> ($this:.TestOpenEnum2.X1) returnType:kotlin.Unit overridden: public open fun foo (): kotlin.Unit declared in .TestOpenEnum2 @@ -321,45 +549,16 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public final fun (): kotlin.Int declared in .TestOpenEnum2 $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>, other:.TestOpenEnum2) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: .TestOpenEnum2): kotlin.Int declared in .TestOpenEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> - VALUE_PARAMETER name:other index:0 type:.TestOpenEnum2 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestOpenEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in .TestOpenEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestOpenEnum2>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .TestOpenEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> - FUN name:foo visibility:public modality:OPEN <> ($this:.TestOpenEnum2) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TestOpenEnum2 + CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum2 [primary] BLOCK_BODY - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestOpenEnum2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum2>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestOpenEnum2 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestOpenEnum2> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>, other:.TestOpenEnum2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -378,124 +577,33 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestOpenEnum2> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestOpenEnum2 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN name:foo visibility:public modality:OPEN <> ($this:.TestOpenEnum2) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestOpenEnum2 + BLOCK_BODY PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestOpenEnum2> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES - CLASS ENUM_CLASS name:TestAbstractEnum1 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1 - CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum1 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestAbstractEnum1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum1 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>]' - ENUM_ENTRY name:X1 - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum1.X1' - class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum1] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1.X1 - CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum1.X1 [primary] - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum1' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum1]' - FUN name:foo visibility:public modality:OPEN <> ($this:.TestAbstractEnum1.X1) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:.TestAbstractEnum1.X1 - BLOCK_BODY - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:.TestAbstractEnum1) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: .TestAbstractEnum1): kotlin.Int declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum1 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .TestAbstractEnum1 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestAbstractEnum1) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TestAbstractEnum1 PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation overridden: public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>) returnType:kotlin.String [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] overridden: public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] overridden: public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestOpenEnum2>) returnType:kotlin.Int [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] overridden: public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:.TestAbstractEnum1) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum1 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestAbstractEnum1>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum1> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestAbstractEnum1> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestAbstractEnum1 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestAbstractEnum1> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestOpenEnum2> CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFoo 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 @@ -509,113 +617,5 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ENUM_CLASS name:TestAbstractEnum2 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum2>; .IFoo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum2 - CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum2 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestAbstractEnum2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum2 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum2>; .IFoo]' - ENUM_ENTRY name:X1 - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum2.X1' - class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum2] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum2.X1 - CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum2.X1 [primary] - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestAbstractEnum2' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum2]' - FUN name:foo visibility:public modality:OPEN <> ($this:.TestAbstractEnum2.X1) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:.TestAbstractEnum2.X1 - BLOCK_BODY - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>, other:.TestAbstractEnum2) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: .TestAbstractEnum2): kotlin.Int declared in .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum2 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .TestAbstractEnum2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>, other:.TestAbstractEnum2) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - VALUE_PARAMETER name:other index:0 type:.TestAbstractEnum2 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - public open fun hashCode (): kotlin.Int declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestAbstractEnum2>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - public open fun toString (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestAbstractEnum2> - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (): kotlin.Unit declared in .IFoo + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.IFoo - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestAbstractEnum2> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestAbstractEnum2 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestAbstractEnum2> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES diff --git a/compiler/testData/ir/irText/classes/enumClassModality.kt.txt b/compiler/testData/ir/irText/classes/enumClassModality.kt.txt index ad443f06bb4..1e49272a2fc 100644 --- a/compiler/testData/ir/irText/classes/enumClassModality.kt.txt +++ b/compiler/testData/ir/irText/classes/enumClassModality.kt.txt @@ -1,58 +1,120 @@ +abstract enum class TestAbstractEnum1 : Enum { + + X1 = X1() + private enum entry class X1 : TestAbstractEnum1 { + private constructor() /* primary */ { + super/*TestAbstractEnum1*/() /*~> Unit */ + /* () */ + + } + + override fun foo() { + } + + } + + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } + + fun valueOf(value: String): TestAbstractEnum1 /* Synthetic body for ENUM_VALUEOF */ + + fun values(): Array /* Synthetic body for ENUM_VALUES */ + + abstract fun foo() + + val entries: EnumEntries + get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ + +} + +abstract enum class TestAbstractEnum2 : Enum, IFoo { + + X1 = X1() + private enum entry class X1 : TestAbstractEnum2 { + private constructor() /* primary */ { + super/*TestAbstractEnum2*/() /*~> Unit */ + /* () */ + + } + + override fun foo() { + } + + } + + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } + + fun valueOf(value: String): TestAbstractEnum2 /* Synthetic body for ENUM_VALUEOF */ + + fun values(): Array /* Synthetic body for ENUM_VALUES */ + + val entries: EnumEntries + get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ + +} + enum class TestFinalEnum1 : Enum { + X1 = TestFinalEnum1() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - X1 = TestFinalEnum1() + fun valueOf(value: String): TestFinalEnum1 /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestFinalEnum1 /* Synthetic body for ENUM_VALUEOF */ - val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } enum class TestFinalEnum2 : Enum { - private constructor(x: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get X1 = TestFinalEnum2(x = 1) - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): TestFinalEnum2 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } enum class TestFinalEnum3 : Enum { + X1 = TestFinalEnum3() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - X1 = TestFinalEnum3() - - fun doStuff() { - } + fun valueOf(value: String): TestFinalEnum3 /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestFinalEnum3 /* Synthetic body for ENUM_VALUEOF */ + fun doStuff() { + } val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ @@ -60,11 +122,6 @@ enum class TestFinalEnum3 : Enum { } open enum class TestOpenEnum1 : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } X1 = X1() private enum entry class X1 : TestOpenEnum1 { @@ -80,21 +137,22 @@ open enum class TestOpenEnum1 : Enum { } - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): TestOpenEnum1 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } open enum class TestOpenEnum2 : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } X1 = X1() private enum entry class X1 : TestOpenEnum2 { @@ -109,46 +167,21 @@ open enum class TestOpenEnum2 : Enum { } - open fun foo() { - } - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): TestOpenEnum2 /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} - -abstract enum class TestAbstractEnum1 : Enum { private constructor() /* primary */ { - super/*Enum*/() + super/*Enum*/() /* () */ } - X1 = X1() - private enum entry class X1 : TestAbstractEnum1 { - private constructor() /* primary */ { - super/*TestAbstractEnum1*/() /*~> Unit */ - /* () */ + fun valueOf(value: String): TestOpenEnum2 /* Synthetic body for ENUM_VALUEOF */ - } - - override fun foo() { - } + fun values(): Array /* Synthetic body for ENUM_VALUES */ + open fun foo() { } - abstract fun foo() - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): TestAbstractEnum1 /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ + val entries: EnumEntries + get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } @@ -157,31 +190,3 @@ interface IFoo { } -abstract enum class TestAbstractEnum2 : Enum, IFoo { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - - X1 = X1() - private enum entry class X1 : TestAbstractEnum2 { - private constructor() /* primary */ { - super/*TestAbstractEnum2*/() /*~> Unit */ - /* () */ - - } - - override fun foo() { - } - - } - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): TestAbstractEnum2 /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} diff --git a/compiler/testData/ir/irText/classes/enumEntries.fir.ir.txt b/compiler/testData/ir/irText/classes/enumEntries.fir.ir.txt deleted file mode 100644 index cef17709f7c..00000000000 --- a/compiler/testData/ir/irText/classes/enumEntries.fir.ir.txt +++ /dev/null @@ -1,63 +0,0 @@ -FILE fqName: fileName:/enumEntries.kt - CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum - CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .MyEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>]' - ENUM_ENTRY name:Ok - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum' - ENUM_ENTRY name:Nope - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyEnum - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyEnum> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>, other:.MyEnum) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - VALUE_PARAMETER name:other index:0 type:.MyEnum - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyEnum> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.enums.EnumEntries<.MyEnum> declared in ' - CALL 'public final fun (): kotlin.enums.EnumEntries<.MyEnum> declared in .MyEnum' type=kotlin.enums.EnumEntries<.MyEnum> origin=GET_PROPERTY diff --git a/compiler/testData/ir/irText/classes/enumEntries.fir.kt.txt b/compiler/testData/ir/irText/classes/enumEntries.fir.kt.txt deleted file mode 100644 index 3e261f3ae32..00000000000 --- a/compiler/testData/ir/irText/classes/enumEntries.fir.kt.txt +++ /dev/null @@ -1,23 +0,0 @@ -enum class MyEnum : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - - Ok = MyEnum() - - Nope = MyEnum() - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): MyEnum /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} - -fun box(): EnumEntries { - return () -} diff --git a/compiler/testData/ir/irText/classes/enumEntries.ir.txt b/compiler/testData/ir/irText/classes/enumEntries.ir.txt index 28e31898faf..36091cc7cc1 100644 --- a/compiler/testData/ir/irText/classes/enumEntries.ir.txt +++ b/compiler/testData/ir/irText/classes/enumEntries.ir.txt @@ -1,35 +1,22 @@ FILE fqName: fileName:/enumEntries.kt CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum - CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .MyEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>]' ENUM_ENTRY name:Ok init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum' ENUM_ENTRY name:Nope init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .MyEnum + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyEnum + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>, other:.MyEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -48,15 +35,28 @@ FILE fqName: fileName:/enumEntries.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyEnum - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyEnum> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyEnum> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun box (): kotlin.enums.EnumEntries<.MyEnum> declared in ' diff --git a/compiler/testData/ir/irText/classes/enumEntries.kt b/compiler/testData/ir/irText/classes/enumEntries.kt index 14463431cf6..c10db027ff0 100644 --- a/compiler/testData/ir/irText/classes/enumEntries.kt +++ b/compiler/testData/ir/irText/classes/enumEntries.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FULL_JDK // WITH_STDLIB diff --git a/compiler/testData/ir/irText/classes/enumEntries.kt.txt b/compiler/testData/ir/irText/classes/enumEntries.kt.txt index 3e261f3ae32..9e6dcab4451 100644 --- a/compiler/testData/ir/irText/classes/enumEntries.kt.txt +++ b/compiler/testData/ir/irText/classes/enumEntries.kt.txt @@ -1,18 +1,18 @@ enum class MyEnum : Enum { + Ok = MyEnum() + + Nope = MyEnum() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - Ok = MyEnum() - - Nope = MyEnum() + fun valueOf(value: String): MyEnum /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): MyEnum /* Synthetic body for ENUM_VALUEOF */ - val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ @@ -21,3 +21,4 @@ enum class MyEnum : Enum { fun box(): EnumEntries { return () } + diff --git a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.ir.txt b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.ir.txt index 2b7b1a15142..b311ec3f86d 100644 --- a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.ir.txt @@ -14,6 +14,24 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Y modality:FINAL visibility:private superTypes:[.A]' + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>, other:.A) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: .A): kotlin.Int declared in .A + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + VALUE_PARAMETER name:other index:0 type:.A + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in .A + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.A>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .A + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> FUN name:f visibility:public modality:OPEN <> ($this:.A.Y) returnType:kotlin.String overridden: public open fun f (): kotlin.String declared in .A @@ -24,6 +42,24 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt $this: CALL 'public open fun f (): kotlin.String declared in .A' superQualifier='CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<.A>]' type=kotlin.String origin=null $this: GET_VAR ': .A.Y declared in .A.Y.f' type=.A.Y origin=null other: CONST String type=kotlin.String value="#Y" + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .A + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .A + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> PROPERTY FAKE_OVERRIDE name:prop1 visibility:public modality:FINAL [fake_override,val] overridden: public final prop1: kotlin.String @@ -54,42 +90,6 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt public final fun (: kotlin.String): kotlin.Unit declared in .A $this: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name: index:0 type:kotlin.String - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>, other:.A) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: .A): kotlin.Int declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - VALUE_PARAMETER name:other index:0 type:.A - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.A>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> ENUM_ENTRY name:Z init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .A' @@ -133,15 +133,6 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop3 type:kotlin.String visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null value: GET_VAR ': kotlin.String declared in .A.' type=kotlin.String origin=null - CONSTRUCTOR visibility:private <> (arg:kotlin.String) returnType:.A - VALUE_PARAMETER name:arg index:0 type:kotlin.String - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .A - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<.A>]' - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop1 type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null - receiver: GET_VAR ': .A declared in .A' type=.A origin=null - value: GET_VAR 'arg: kotlin.String declared in .A.' type=kotlin.String origin=null CONSTRUCTOR visibility:private <> () returnType:.A BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' @@ -153,6 +144,15 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .A' type=kotlin.Unit origin=EQ $this: GET_VAR ': .A declared in .A' type=.A origin=null : CONST String type=kotlin.String value="empty" + CONSTRUCTOR visibility:private <> (arg:kotlin.String) returnType:.A + VALUE_PARAMETER name:arg index:0 type:kotlin.String + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .A + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<.A>]' + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop1 type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .A declared in .A' type=.A origin=null + value: GET_VAR 'arg: kotlin.String declared in .A.' type=kotlin.String origin=null CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.A VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY @@ -162,28 +162,11 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .A' type=kotlin.Unit origin=EQ $this: GET_VAR ': .A declared in .A' type=.A origin=null : CONST String type=kotlin.String value="int" - FUN name:f visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun f (): kotlin.String declared in .A' - STRING_CONCATENATION type=kotlin.String - CALL 'public final fun (): kotlin.String declared in .A' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .A declared in .A.f' type=.A origin=null - CONST String type=kotlin.String value="#" - CALL 'public final fun (): kotlin.String declared in .A' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .A declared in .A.f' type=.A origin=null - CONST String type=kotlin.String value="#" - CALL 'public final fun (): kotlin.String declared in .A' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .A declared in .A.f' type=.A origin=null - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.A> - SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.A VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.A> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.A> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>, other:.A) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -202,6 +185,23 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + FUN name:f visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun f (): kotlin.String declared in .A' + STRING_CONCATENATION type=kotlin.String + CALL 'public final fun (): kotlin.String declared in .A' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .A declared in .A.f' type=.A origin=null + CONST String type=kotlin.String value="#" + CALL 'public final fun (): kotlin.String declared in .A' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .A declared in .A.f' type=.A origin=null + CONST String type=kotlin.String value="#" + CALL 'public final fun (): kotlin.String declared in .A' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .A declared in .A.f' type=.A origin=null + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.A> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation diff --git a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.kt.txt b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.kt.txt index 69517ef58fd..37a17d0e512 100644 --- a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.kt.txt @@ -29,13 +29,6 @@ open enum class A : Enum { get set - private constructor(arg: String) { - super/*Enum*/() - /* () */ - - .#prop1 = arg - } - private constructor() { super/*Enum*/() /* () */ @@ -44,20 +37,28 @@ open enum class A : Enum { .( = "empty") } + private constructor(arg: String) { + super/*Enum*/() + /* () */ + + .#prop1 = arg + } + private constructor(x: Int) { this/*A*/(arg = x.toString()) .( = "int") } - open fun f(): String { - return .() + "#" + .() + "#" + .() - } + fun valueOf(value: String): A /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): A /* Synthetic body for ENUM_VALUEOF */ + open fun f(): String { + return .() + "#" + .() + "#" + .() + } val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } + diff --git a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.ir.txt b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.ir.txt index eed8ceb1c4c..3ad839af81a 100644 --- a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.ir.txt +++ b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.ir.txt @@ -15,6 +15,24 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Y modality:FINAL visibility:private superTypes:[.A]' + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>, other:.A) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: .A): kotlin.Int declared in .A + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + VALUE_PARAMETER name:other index:0 type:.A + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in .A + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.A>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .A + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> FUN name:f visibility:public modality:OPEN <> ($this:.A.Y) returnType:kotlin.String overridden: public open fun f (): kotlin.String declared in .A @@ -25,6 +43,24 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt $this: CALL 'public open fun f (): kotlin.String declared in .A' superQualifier='CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<.A>]' type=kotlin.String origin=null $this: GET_VAR ': .A.Y declared in .A.Y.f' type=.A.Y origin=null other: CONST String type=kotlin.String value="#Y" + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .A + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .A + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> PROPERTY FAKE_OVERRIDE name:prop1 visibility:public modality:FINAL [fake_override,val] overridden: public final prop1: kotlin.String @@ -55,42 +91,6 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt public final fun (: kotlin.String): kotlin.Unit declared in .A $this: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name: index:0 type:kotlin.String - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>, other:.A) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: .A): kotlin.Int declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - VALUE_PARAMETER name:other index:0 type:.A - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.A>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> ENUM_ENTRY name:Z init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .A' @@ -134,15 +134,6 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop3 type:kotlin.String visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null value: GET_VAR ': kotlin.String declared in .A.' type=kotlin.String origin=null - CONSTRUCTOR visibility:private <> (arg:kotlin.String) returnType:.A - VALUE_PARAMETER name:arg index:0 type:kotlin.String - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .A - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<.A>]' - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop1 type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null - receiver: GET_VAR ': .A declared in .A' type=.A origin=null - value: GET_VAR 'arg: kotlin.String declared in .A.' type=kotlin.String origin=null CONSTRUCTOR visibility:private <> () returnType:.A BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' @@ -154,6 +145,15 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .A' type=kotlin.Unit origin=EQ $this: GET_VAR ': .A declared in .A' type=.A origin=null : CONST String type=kotlin.String value="empty" + CONSTRUCTOR visibility:private <> (arg:kotlin.String) returnType:.A + VALUE_PARAMETER name:arg index:0 type:kotlin.String + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .A + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<.A>]' + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop1 type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .A declared in .A' type=.A origin=null + value: GET_VAR 'arg: kotlin.String declared in .A.' type=kotlin.String origin=null CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.A VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY @@ -163,37 +163,11 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .A' type=kotlin.Unit origin=EQ $this: GET_VAR ': .A declared in .A' type=.A origin=null : CONST String type=kotlin.String value="int" - FUN name:f visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun f (): kotlin.String declared in .A' - STRING_CONCATENATION type=kotlin.String - CALL 'public final fun (): kotlin.String declared in .A' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .A declared in .A.f' type=.A origin=null - CONST String type=kotlin.String value="#" - CALL 'public final fun (): kotlin.String declared in .A' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .A declared in .A.f' type=.A origin=null - CONST String type=kotlin.String value="#" - CALL 'public final fun (): kotlin.String declared in .A' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .A declared in .A.f' type=.A origin=null - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.A + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.A> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>, other:.A) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -212,12 +186,38 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.A> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.A - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN name:f visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun f (): kotlin.String declared in .A' + STRING_CONCATENATION type=kotlin.String + CALL 'public final fun (): kotlin.String declared in .A' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .A declared in .A.f' type=.A origin=null + CONST String type=kotlin.String value="#" + CALL 'public final fun (): kotlin.String declared in .A' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .A declared in .A.f' type=.A origin=null + CONST String type=kotlin.String value="#" + CALL 'public final fun (): kotlin.String declared in .A' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .A declared in .A.f' type=.A origin=null PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.A> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> diff --git a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt.txt b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt.txt index 1f60cbe9e32..0b7e7ea12a7 100644 --- a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt.txt +++ b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt.txt @@ -29,13 +29,6 @@ open enum class A : Enum { get set - private constructor(arg: String) { - super/*Enum*/() - /* () */ - - .#prop1 = arg - } - private constructor() { super/*Enum*/() /* () */ @@ -44,20 +37,28 @@ open enum class A : Enum { .( = "empty") } + private constructor(arg: String) { + super/*Enum*/() + /* () */ + + .#prop1 = arg + } + private constructor(x: Int) { this/*A*/(arg = x.toString()) .( = "int") } - open fun f(): String { - return .() + "#" + .() + "#" + .() - } + fun valueOf(value: String): A /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): A /* Synthetic body for ENUM_VALUEOF */ + open fun f(): String { + return .() + "#" + .() + "#" + .() + } val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } + diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.ir.txt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.ir.txt index 172aeabbcbc..ebf0c00d241 100644 --- a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.ir.txt @@ -1,12 +1,6 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test0>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test0 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test0 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .Test0 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test0>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -25,15 +19,17 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .Test0' x: CONST Int type=kotlin.Int value=0 - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test0> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test0 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .Test0 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test0>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Test0 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Test0> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test0> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test0>, other:.Test0) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -52,6 +48,10 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test0> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Test0> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -72,12 +72,6 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test0> CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test1 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .Test1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test1>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -100,15 +94,17 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .Test1' x: CONST Int type=kotlin.Int value=0 - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test1> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .Test1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test1>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Test1 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Test1> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test1> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test1>, other:.Test1) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -127,6 +123,10 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test1> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Test1> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -147,12 +147,6 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test1> CLASS ENUM_CLASS name:Test2 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.Test2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .Test2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test2 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.Test2>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -173,21 +167,6 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Test2' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:private superTypes:[.Test2]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Test2.ZERO) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .Test2 - $this: VALUE_PARAMETER name: type:.Test2.ZERO - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="ZERO" - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Test2 - $this: VALUE_PARAMETER name: type:.Test2 FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>, other:.Test2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .Test2): kotlin.Int declared in .Test2 @@ -206,6 +185,13 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in .Test2 $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + FUN name:foo visibility:public modality:OPEN <> ($this:.Test2.ZERO) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .Test2 + $this: VALUE_PARAMETER name: type:.Test2.ZERO + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="ZERO" PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -224,6 +210,14 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public final fun (): kotlin.Int declared in .Test2 $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Test2 + $this: VALUE_PARAMETER name: type:.Test2 ENUM_ENTRY name:ONE init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Test2.ONE' @@ -234,21 +228,6 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .Test2' x: CONST Int type=kotlin.Int value=1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:private superTypes:[.Test2]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Test2.ONE) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .Test2 - $this: VALUE_PARAMETER name: type:.Test2.ONE - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="ONE" - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Test2 - $this: VALUE_PARAMETER name: type:.Test2 FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>, other:.Test2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .Test2): kotlin.Int declared in .Test2 @@ -267,6 +246,13 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in .Test2 $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + FUN name:foo visibility:public modality:OPEN <> ($this:.Test2.ONE) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .Test2 + $this: VALUE_PARAMETER name: type:.Test2.ONE + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="ONE" PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -285,21 +271,29 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public final fun (): kotlin.Int declared in .Test2 $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Test2 + $this: VALUE_PARAMETER name: type:.Test2 CONSTRUCTOR visibility:private <> () returnType:.Test2 BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .Test2' x: CONST Int type=kotlin.Int value=0 - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Test2 - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test2> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .Test2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test2 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.Test2>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Test2 VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Test2> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test2> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>, other:.Test2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -318,6 +312,12 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Test2 + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Test2> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.kt.txt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.kt.txt index 6dfef1e32eb..0fc5241535c 100644 --- a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.kt.txt @@ -1,10 +1,4 @@ enum class Test0 : Enum { - private constructor(x: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -15,22 +9,22 @@ enum class Test0 : Enum { this/*Test0*/(x = 0) } - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): Test0 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } enum class Test1 : Enum { - private constructor(x: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -43,22 +37,22 @@ enum class Test1 : Enum { this/*Test1*/(x = 0) } - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): Test1 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } abstract enum class Test2 : Enum { - private constructor(x: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -95,11 +89,17 @@ abstract enum class Test2 : Enum { this/*Test2*/(x = 0) } - abstract fun foo() + private constructor(x: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } + + fun valueOf(value: String): Test2 /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): Test2 /* Synthetic body for ENUM_VALUEOF */ + abstract fun foo() val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.ir.txt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.ir.txt index 7c5ceb0b5e7..eddeafb928d 100644 --- a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.ir.txt +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.ir.txt @@ -1,12 +1,6 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test0>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test0 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test0 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .Test0 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test0>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -25,24 +19,17 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .Test0' x: CONST Int type=kotlin.Int value=0 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test0>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test0> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test0>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test0> + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test0 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .Test0 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test0>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Test0 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test0> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test0>, other:.Test0) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -61,23 +48,30 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test0> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test0> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Test0 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Test0> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test0>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test0> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test0>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test0> CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test1 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .Test1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test1>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -100,24 +94,17 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .Test1' x: CONST Int type=kotlin.Int value=0 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test1>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test1> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test1>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test1> + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .Test1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test1>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Test1 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test1> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test1>, other:.Test1) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -136,23 +123,30 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test1> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test1> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Test1 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Test1> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test1>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test1> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test1>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test1> CLASS ENUM_CLASS name:Test2 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.Test2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .Test2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test2 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.Test2>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -174,39 +168,6 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Test2' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:private superTypes:[.Test2]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Test2.ZERO) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .Test2 - $this: VALUE_PARAMETER name: type:.Test2.ZERO - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="ZERO" - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Test2 - $this: VALUE_PARAMETER name: type:.Test2 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Test2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Test2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>, other:.Test2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .Test2): kotlin.Int declared in .Test2 @@ -225,6 +186,39 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in .Test2 $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + FUN name:foo visibility:public modality:OPEN <> ($this:.Test2.ZERO) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .Test2 + $this: VALUE_PARAMETER name: type:.Test2.ZERO + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="ZERO" + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .Test2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Test2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Test2 + $this: VALUE_PARAMETER name: type:.Test2 ENUM_ENTRY name:ONE init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Test2.ONE' @@ -236,39 +230,6 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .Test2' x: CONST Int type=kotlin.Int value=1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:private superTypes:[.Test2]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Test2.ONE) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .Test2 - $this: VALUE_PARAMETER name: type:.Test2.ONE - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="ONE" - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Test2 - $this: VALUE_PARAMETER name: type:.Test2 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Test2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Test2 - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>, other:.Test2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .Test2): kotlin.Int declared in .Test2 @@ -287,30 +248,54 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in .Test2 $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + FUN name:foo visibility:public modality:OPEN <> ($this:.Test2.ONE) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .Test2 + $this: VALUE_PARAMETER name: type:.Test2.ONE + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="ONE" + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .Test2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Test2 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Test2 + $this: VALUE_PARAMETER name: type:.Test2 CONSTRUCTOR visibility:private <> () returnType:.Test2 BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .Test2' x: CONST Int type=kotlin.Int value=0 - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Test2 - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .Test2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test2 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.Test2>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Test2 + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test2> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>, other:.Test2) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -329,12 +314,27 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test2> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Test2 - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Test2 PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Test2> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test2>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Test2> diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt.txt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt.txt index 20b15eb8c15..b6936202ef2 100644 --- a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt.txt +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt.txt @@ -1,10 +1,4 @@ enum class Test0 : Enum { - private constructor(x: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -15,22 +9,22 @@ enum class Test0 : Enum { this/*Test0*/(x = 0) } - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): Test0 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } enum class Test1 : Enum { - private constructor(x: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -43,22 +37,22 @@ enum class Test1 : Enum { this/*Test1*/(x = 0) } - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): Test1 /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } abstract enum class Test2 : Enum { - private constructor(x: Int) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: Int field = x get @@ -95,11 +89,17 @@ abstract enum class Test2 : Enum { this/*Test2*/(x = 0) } - abstract fun foo() + private constructor(x: Int) /* primary */ { + super/*Enum*/() + /* () */ + + } + + fun valueOf(value: String): Test2 /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): Test2 /* Synthetic body for ENUM_VALUEOF */ + abstract fun foo() val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ diff --git a/compiler/testData/ir/irText/classes/fakeOverridesForAnyMembers.ir.txt b/compiler/testData/ir/irText/classes/fakeOverridesForAnyMembers.ir.txt index 5013e497ef4..1809f05e009 100644 --- a/compiler/testData/ir/irText/classes/fakeOverridesForAnyMembers.ir.txt +++ b/compiler/testData/ir/irText/classes/fakeOverridesForAnyMembers.ir.txt @@ -27,13 +27,6 @@ FILE fqName: fileName:/fakeOverridesForAnyMembers.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' : B_T of .B INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A.B>]' - FUN name:hashCode visibility:public modality:OPEN <> ($this:.B.B>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in .A - $this: VALUE_PARAMETER name: type:.B.B> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .B' - CONST Int type=kotlin.Int value=0 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 .A @@ -43,6 +36,13 @@ FILE fqName: fileName:/fakeOverridesForAnyMembers.kt overridden: public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:hashCode visibility:public modality:OPEN <> ($this:.B.B>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in .A + $this: VALUE_PARAMETER name: type:.B.B> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .B' + CONST Int type=kotlin.Int value=0 CLASS CLASS name:C modality:OPEN visibility:public superTypes:[.B.C>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> TYPE_PARAMETER name:C_T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -51,15 +51,15 @@ FILE fqName: fileName:/fakeOverridesForAnyMembers.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .B' : C_T of .C INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public superTypes:[.B.C>]' - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:.B.C>) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .B - $this: VALUE_PARAMETER name: type:.B.C> 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 .B $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:.B.C>) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in .B + $this: VALUE_PARAMETER name: type:.B.C> 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 .B @@ -72,15 +72,15 @@ FILE fqName: fileName:/fakeOverridesForAnyMembers.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .C' : D_T of .D INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:OPEN visibility:public superTypes:[.C.D>]' - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:.B.D>) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .C - $this: VALUE_PARAMETER name: type:.B.D> 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 .C $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:.B.D>) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in .C + $this: VALUE_PARAMETER name: type:.B.D> 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 .C diff --git a/compiler/testData/ir/irText/classes/fakeOverridesForJavaNonStaticMembers.fir.ir.txt b/compiler/testData/ir/irText/classes/fakeOverridesForJavaNonStaticMembers.fir.ir.txt index b829a01f8aa..68ab5a539ed 100644 --- a/compiler/testData/ir/irText/classes/fakeOverridesForJavaNonStaticMembers.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/fakeOverridesForJavaNonStaticMembers.fir.ir.txt @@ -5,18 +5,6 @@ FILE fqName:a fileName:/fakeOverridesForJavaNonStaticMembers.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in a.Base' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[a.Base]' - FUN FAKE_OVERRIDE name:publicMethod visibility:public modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] - overridden: - public open fun publicMethod (): kotlin.Unit declared in a.Base - $this: VALUE_PARAMETER name: type:a.Base - FUN FAKE_OVERRIDE name:protectedMethod visibility:protected/*protected and package*/ modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected and package*/ open fun protectedMethod (): kotlin.Unit declared in a.Base - $this: VALUE_PARAMETER name: type:a.Base - FUN FAKE_OVERRIDE name:packagePrivateMethod visibility:public/*package*/ modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] - overridden: - public/*package*/ open fun packagePrivateMethod (): kotlin.Unit declared in a.Base - $this: VALUE_PARAMETER name: type:a.Base 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 a.Base @@ -26,6 +14,18 @@ FILE fqName:a fileName:/fakeOverridesForJavaNonStaticMembers.kt overridden: public open fun hashCode (): kotlin.Int declared in a.Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:packagePrivateMethod visibility:public/*package*/ modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] + overridden: + public/*package*/ open fun packagePrivateMethod (): kotlin.Unit declared in a.Base + $this: VALUE_PARAMETER name: type:a.Base + FUN FAKE_OVERRIDE name:protectedMethod visibility:protected/*protected and package*/ modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun protectedMethod (): kotlin.Unit declared in a.Base + $this: VALUE_PARAMETER name: type:a.Base + FUN FAKE_OVERRIDE name:publicMethod visibility:public modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] + overridden: + public open fun publicMethod (): kotlin.Unit declared in a.Base + $this: VALUE_PARAMETER name: type:a.Base 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 a.Base @@ -37,14 +37,6 @@ FILE fqName: fileName:/fakeOverridesForJavaNonStaticMembers2.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in a.Base' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[a.Base]' - FUN FAKE_OVERRIDE name:publicMethod visibility:public modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] - overridden: - public open fun publicMethod (): kotlin.Unit declared in a.Base - $this: VALUE_PARAMETER name: type:a.Base - FUN FAKE_OVERRIDE name:protectedMethod visibility:protected/*protected and package*/ modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected and package*/ open fun protectedMethod (): kotlin.Unit declared in a.Base - $this: VALUE_PARAMETER name: type:a.Base 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 a.Base @@ -54,6 +46,14 @@ FILE fqName: fileName:/fakeOverridesForJavaNonStaticMembers2.kt overridden: public open fun hashCode (): kotlin.Int declared in a.Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:protectedMethod visibility:protected/*protected and package*/ modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun protectedMethod (): kotlin.Unit declared in a.Base + $this: VALUE_PARAMETER name: type:a.Base + FUN FAKE_OVERRIDE name:publicMethod visibility:public modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] + overridden: + public open fun publicMethod (): kotlin.Unit declared in a.Base + $this: VALUE_PARAMETER name: type:a.Base 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 a.Base diff --git a/compiler/testData/ir/irText/classes/fakeOverridesForJavaNonStaticMembers.ir.txt b/compiler/testData/ir/irText/classes/fakeOverridesForJavaNonStaticMembers.ir.txt index d99eb2a74db..68ab5a539ed 100644 --- a/compiler/testData/ir/irText/classes/fakeOverridesForJavaNonStaticMembers.ir.txt +++ b/compiler/testData/ir/irText/classes/fakeOverridesForJavaNonStaticMembers.ir.txt @@ -14,22 +14,22 @@ FILE fqName:a fileName:/fakeOverridesForJavaNonStaticMembers.kt overridden: public open fun hashCode (): kotlin.Int declared in a.Base $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + FUN FAKE_OVERRIDE name:packagePrivateMethod visibility:public/*package*/ modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] overridden: - public open fun toString (): kotlin.String declared in a.Base - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:publicMethod visibility:public modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] - overridden: - public open fun publicMethod (): kotlin.Unit declared in a.Base + public/*package*/ open fun packagePrivateMethod (): kotlin.Unit declared in a.Base $this: VALUE_PARAMETER name: type:a.Base FUN FAKE_OVERRIDE name:protectedMethod visibility:protected/*protected and package*/ modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] overridden: protected/*protected and package*/ open fun protectedMethod (): kotlin.Unit declared in a.Base $this: VALUE_PARAMETER name: type:a.Base - FUN FAKE_OVERRIDE name:packagePrivateMethod visibility:public/*package*/ modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] + FUN FAKE_OVERRIDE name:publicMethod visibility:public modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] overridden: - public/*package*/ open fun packagePrivateMethod (): kotlin.Unit declared in a.Base + public open fun publicMethod (): kotlin.Unit declared in a.Base $this: VALUE_PARAMETER name: type:a.Base + 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 a.Base + $this: VALUE_PARAMETER name: type:kotlin.Any FILE fqName: fileName:/fakeOverridesForJavaNonStaticMembers2.kt CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[a.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 @@ -46,15 +46,15 @@ FILE fqName: fileName:/fakeOverridesForJavaNonStaticMembers2.kt overridden: public open fun hashCode (): kotlin.Int declared in a.Base $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 a.Base - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:publicMethod visibility:public modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] - overridden: - public open fun publicMethod (): kotlin.Unit declared in a.Base - $this: VALUE_PARAMETER name: type:a.Base FUN FAKE_OVERRIDE name:protectedMethod visibility:protected/*protected and package*/ modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] overridden: protected/*protected and package*/ open fun protectedMethod (): kotlin.Unit declared in a.Base $this: VALUE_PARAMETER name: type:a.Base + FUN FAKE_OVERRIDE name:publicMethod visibility:public modality:OPEN <> ($this:a.Base) returnType:kotlin.Unit [fake_override] + overridden: + public open fun publicMethod (): kotlin.Unit declared in a.Base + $this: VALUE_PARAMETER name: type:a.Base + 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 a.Base + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/fakeOverridesForJavaStaticMembers.ir.txt b/compiler/testData/ir/irText/classes/fakeOverridesForJavaStaticMembers.ir.txt index e496e28e0d2..a29f635a04a 100644 --- a/compiler/testData/ir/irText/classes/fakeOverridesForJavaStaticMembers.ir.txt +++ b/compiler/testData/ir/irText/classes/fakeOverridesForJavaStaticMembers.ir.txt @@ -14,13 +14,13 @@ FILE fqName: fileName:/fakeOverridesForJavaStaticMembers.kt overridden: public open fun hashCode (): kotlin.Int declared in a.Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:protectedStaticMethod visibility:protected/*protected static*/ modality:OPEN <> () returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected static*/ open fun protectedStaticMethod (): kotlin.Unit declared in a.Base + FUN FAKE_OVERRIDE name:publicStaticMethod visibility:public modality:OPEN <> () returnType:kotlin.Unit [fake_override] + overridden: + public open fun publicStaticMethod (): kotlin.Unit declared in a.Base 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 a.Base $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:publicStaticMethod visibility:public modality:OPEN <> () returnType:kotlin.Unit [fake_override] - overridden: - public open fun publicStaticMethod (): kotlin.Unit declared in a.Base - FUN FAKE_OVERRIDE name:protectedStaticMethod visibility:protected/*protected static*/ modality:OPEN <> () returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected static*/ open fun protectedStaticMethod (): kotlin.Unit declared in a.Base diff --git a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.ir.txt b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.ir.txt index 7e3c918e106..4171a24b99f 100644 --- a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.ir.txt @@ -1,36 +1,19 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.IFoo - 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: 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 CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[.JFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K1 CONSTRUCTOR visibility:public <> () returnType:.K1 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JFoo' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[.JFoo]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.JFoo) returnType:@[EnhancedNullability] kotlin.String [fake_override] - overridden: - public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo - $this: VALUE_PARAMETER name: type:.JFoo 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 .JFoo $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.JFoo) returnType:@[EnhancedNullability] kotlin.String [fake_override] + overridden: + public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo + $this: VALUE_PARAMETER name: type:.JFoo 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 .JFoo @@ -45,15 +28,6 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JFoo' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K2 modality:FINAL visibility:public superTypes:[.JFoo]' - FUN name:foo visibility:public modality:OPEN <> ($this:.K2) returnType:kotlin.String - overridden: - public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo - $this: VALUE_PARAMETER name: type:.K2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .K2' - TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String - CALL 'public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:JFoo modality:OPEN visibility:public superTypes:[kotlin.Any; .IFoo]' type=@[EnhancedNullability] kotlin.String origin=null - $this: GET_VAR ': .K2 declared in .K2.foo' type=.K2 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 .JFoo @@ -67,23 +41,32 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt overridden: public open fun toString (): kotlin.String declared in .JFoo $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.K2) returnType:kotlin.String + overridden: + public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo + $this: VALUE_PARAMETER name: type:.K2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .K2' + TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String + CALL 'public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:JFoo modality:OPEN visibility:public superTypes:[kotlin.Any; .IFoo]' type=@[EnhancedNullability] kotlin.String origin=null + $this: GET_VAR ': .K2 declared in .K2.foo' type=.K2 origin=null CLASS CLASS name:K3 modality:FINAL visibility:public superTypes:[.JUnrelatedFoo; .IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K3 CONSTRUCTOR visibility:public <> () returnType:.K3 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JUnrelatedFoo' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K3 modality:FINAL visibility:public superTypes:[.JUnrelatedFoo; .IFoo]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String [fake_override] - overridden: - public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .JUnrelatedFoo - public abstract fun foo (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.IFoo 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 .JUnrelatedFoo public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String [fake_override] + overridden: + public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .JUnrelatedFoo + public abstract fun foo (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo 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 .JUnrelatedFoo @@ -100,15 +83,6 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JUnrelatedFoo' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K4 modality:FINAL visibility:public superTypes:[.JUnrelatedFoo; .IFoo]' - FUN name:foo visibility:public modality:OPEN <> ($this:.K4) returnType:@[FlexibleNullability] kotlin.String? - overridden: - public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .JUnrelatedFoo - public abstract fun foo (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.K4 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .K4' - CALL 'public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .JUnrelatedFoo' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:JUnrelatedFoo modality:OPEN visibility:public superTypes:[kotlin.Any]' type=@[FlexibleNullability] kotlin.String? origin=null - $this: GET_VAR ': .K4 declared in .K4.foo' type=.K4 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 .JUnrelatedFoo @@ -125,15 +99,24 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt public open fun toString (): kotlin.String declared in .JUnrelatedFoo public open fun toString (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.K4) returnType:@[FlexibleNullability] kotlin.String? + overridden: + public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .JUnrelatedFoo + public abstract fun foo (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.K4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .K4' + CALL 'public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .JUnrelatedFoo' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:JUnrelatedFoo modality:OPEN visibility:public superTypes:[kotlin.Any]' type=@[FlexibleNullability] kotlin.String? origin=null + $this: GET_VAR ': .K4 declared in .K4.foo' type=.K4 origin=null CLASS CLASS name:TestJFoo modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestJFoo + FIELD DELEGATE name:$$delegate_0 type:.JFoo visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .JFoo' type=.JFoo origin=null CONSTRUCTOR visibility:public <> () returnType:.TestJFoo [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestJFoo modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.JFoo visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .JFoo' type=.JFoo origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestJFoo) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -159,13 +142,13 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestK1 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK1 + FIELD DELEGATE name:$$delegate_0 type:.K1 visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .K1' type=.K1 origin=null CONSTRUCTOR visibility:public <> () returnType:.TestK1 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK1 modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.K1 visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .K1' type=.K1 origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK1) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -191,13 +174,13 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestK2 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK2 + FIELD DELEGATE name:$$delegate_0 type:.K2 visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .K2' type=.K2 origin=null CONSTRUCTOR visibility:public <> () returnType:.TestK2 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK2 modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.K2 visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .K2' type=.K2 origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK2) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -222,13 +205,13 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestK3 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK3 + FIELD DELEGATE name:$$delegate_0 type:.K3 visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .K3' type=.K3 origin=null CONSTRUCTOR visibility:public <> () returnType:.TestK3 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK3 modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.K3 visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .K3' type=.K3 origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK3) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -253,13 +236,13 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestK4 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK4 + FIELD DELEGATE name:$$delegate_0 type:.K4 visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .K4' type=.K4 origin=null CONSTRUCTOR visibility:public <> () returnType:.TestK4 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK4 modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.K4 visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .K4' type=.K4 origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK4) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -283,3 +266,20 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt overridden: public open fun toString (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.IFoo diff --git a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.kt.txt b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.kt.txt index e2d1ca61d26..8675a8baa71 100644 --- a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.kt.txt @@ -1,8 +1,3 @@ -interface IFoo { - abstract fun foo(): String - -} - class K1 : JFoo { constructor() /* primary */ { super/*JFoo*/() @@ -48,13 +43,13 @@ class K4 : JUnrelatedFoo, IFoo { } class TestJFoo : IFoo { + private /* final field */ val $$delegate_0: JFoo = JFoo() constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: JFoo = JFoo() override fun foo(): String { return .#$$delegate_0.foo() /*!! String */ } @@ -62,13 +57,13 @@ class TestJFoo : IFoo { } class TestK1 : IFoo { + private /* final field */ val $$delegate_0: K1 = K1() constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: K1 = K1() override fun foo(): String { return .#$$delegate_0.foo() /*!! String */ } @@ -76,13 +71,13 @@ class TestK1 : IFoo { } class TestK2 : IFoo { + private /* final field */ val $$delegate_0: K2 = K2() constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: K2 = K2() override fun foo(): String { return .#$$delegate_0.foo() } @@ -90,13 +85,13 @@ class TestK2 : IFoo { } class TestK3 : IFoo { + private /* final field */ val $$delegate_0: K3 = K3() constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: K3 = K3() override fun foo(): String { return .#$$delegate_0.foo() } @@ -104,16 +99,21 @@ class TestK3 : IFoo { } class TestK4 : IFoo { + private /* final field */ val $$delegate_0: K4 = K4() constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: K4 = K4() override fun foo(): String { return .#$$delegate_0.foo() /*!! String */ } } +interface IFoo { + abstract fun foo(): String + +} + diff --git a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.ir.txt b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.ir.txt index 129658a18b0..57adc2cb82b 100644 --- a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.ir.txt +++ b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.ir.txt @@ -1,36 +1,19 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.IFoo - 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: 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 CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[.JFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K1 CONSTRUCTOR visibility:public <> () returnType:.K1 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JFoo' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[.JFoo]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.JFoo) returnType:@[EnhancedNullability] kotlin.String [fake_override] - overridden: - public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo - $this: VALUE_PARAMETER name: type:.JFoo 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 .JFoo $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.JFoo) returnType:@[EnhancedNullability] kotlin.String [fake_override] + overridden: + public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo + $this: VALUE_PARAMETER name: type:.JFoo 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 .JFoo @@ -45,15 +28,6 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JFoo' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K2 modality:FINAL visibility:public superTypes:[.JFoo]' - FUN name:foo visibility:public modality:OPEN <> ($this:.K2) returnType:kotlin.String - overridden: - public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo - $this: VALUE_PARAMETER name: type:.K2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .K2' - TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String - CALL 'public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:JFoo modality:OPEN visibility:public superTypes:[.IFoo]' type=@[EnhancedNullability] kotlin.String origin=null - $this: GET_VAR ': .K2 declared in .K2.foo' type=.K2 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 .JFoo @@ -67,6 +41,15 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt overridden: public open fun toString (): kotlin.String declared in .JFoo $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.K2) returnType:kotlin.String + overridden: + public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo + $this: VALUE_PARAMETER name: type:.K2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .K2' + TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String + CALL 'public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:JFoo modality:OPEN visibility:public superTypes:[.IFoo]' type=@[EnhancedNullability] kotlin.String origin=null + $this: GET_VAR ': .K2 declared in .K2.foo' type=.K2 origin=null CLASS CLASS name:K3 modality:FINAL visibility:public superTypes:[.JUnrelatedFoo; .IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K3 CONSTRUCTOR visibility:public <> () returnType:.K3 [primary] @@ -79,6 +62,11 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String [fake_override] + overridden: + public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .JUnrelatedFoo + public abstract fun foo (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo 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 .JUnrelatedFoo @@ -89,26 +77,12 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt public open fun toString (): kotlin.String declared in .JUnrelatedFoo public open fun toString (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String [fake_override] - overridden: - public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .JUnrelatedFoo - public abstract fun foo (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.IFoo CLASS CLASS name:K4 modality:FINAL visibility:public superTypes:[.JUnrelatedFoo; .IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K4 CONSTRUCTOR visibility:public <> () returnType:.K4 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JUnrelatedFoo' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K4 modality:FINAL visibility:public superTypes:[.JUnrelatedFoo; .IFoo]' - FUN name:foo visibility:public modality:OPEN <> ($this:.K4) returnType:@[FlexibleNullability] kotlin.String? - overridden: - public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .JUnrelatedFoo - public abstract fun foo (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.K4 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .K4' - CALL 'public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .JUnrelatedFoo' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:JUnrelatedFoo modality:OPEN visibility:public superTypes:[kotlin.Any]' type=@[FlexibleNullability] kotlin.String? origin=null - $this: GET_VAR ': .K4 declared in .K4.foo' type=.K4 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 .JUnrelatedFoo @@ -125,15 +99,24 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt public open fun toString (): kotlin.String declared in .JUnrelatedFoo public open fun toString (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.K4) returnType:@[FlexibleNullability] kotlin.String? + overridden: + public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .JUnrelatedFoo + public abstract fun foo (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.K4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .K4' + CALL 'public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .JUnrelatedFoo' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:JUnrelatedFoo modality:OPEN visibility:public superTypes:[kotlin.Any]' type=@[FlexibleNullability] kotlin.String? origin=null + $this: GET_VAR ': .K4 declared in .K4.foo' type=.K4 origin=null CLASS CLASS name:TestJFoo modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestJFoo + FIELD DELEGATE name:$$delegate_0 type:.JFoo visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .JFoo' type=.JFoo origin=null CONSTRUCTOR visibility:public <> () returnType:.TestJFoo [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestJFoo modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.JFoo visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .JFoo' type=.JFoo origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestJFoo) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -159,13 +142,13 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestK1 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK1 + FIELD DELEGATE name:$$delegate_0 type:.K1 visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .K1' type=.K1 origin=null CONSTRUCTOR visibility:public <> () returnType:.TestK1 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK1 modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.K1 visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .K1' type=.K1 origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK1) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -191,13 +174,13 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestK2 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK2 + FIELD DELEGATE name:$$delegate_0 type:.K2 visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .K2' type=.K2 origin=null CONSTRUCTOR visibility:public <> () returnType:.TestK2 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK2 modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.K2 visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .K2' type=.K2 origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK2) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -222,13 +205,13 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestK3 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK3 + FIELD DELEGATE name:$$delegate_0 type:.K3 visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .K3' type=.K3 origin=null CONSTRUCTOR visibility:public <> () returnType:.TestK3 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK3 modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.K3 visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .K3' type=.K3 origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK3) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -253,13 +236,13 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestK4 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK4 + FIELD DELEGATE name:$$delegate_0 type:.K4 visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .K4' type=.K4 origin=null CONSTRUCTOR visibility:public <> () returnType:.TestK4 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK4 modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.K4 visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .K4' type=.K4 origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK4) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -283,3 +266,20 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt overridden: public open fun toString (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.IFoo diff --git a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.kt.txt b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.kt.txt index e2d1ca61d26..8675a8baa71 100644 --- a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.kt.txt +++ b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.kt.txt @@ -1,8 +1,3 @@ -interface IFoo { - abstract fun foo(): String - -} - class K1 : JFoo { constructor() /* primary */ { super/*JFoo*/() @@ -48,13 +43,13 @@ class K4 : JUnrelatedFoo, IFoo { } class TestJFoo : IFoo { + private /* final field */ val $$delegate_0: JFoo = JFoo() constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: JFoo = JFoo() override fun foo(): String { return .#$$delegate_0.foo() /*!! String */ } @@ -62,13 +57,13 @@ class TestJFoo : IFoo { } class TestK1 : IFoo { + private /* final field */ val $$delegate_0: K1 = K1() constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: K1 = K1() override fun foo(): String { return .#$$delegate_0.foo() /*!! String */ } @@ -76,13 +71,13 @@ class TestK1 : IFoo { } class TestK2 : IFoo { + private /* final field */ val $$delegate_0: K2 = K2() constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: K2 = K2() override fun foo(): String { return .#$$delegate_0.foo() } @@ -90,13 +85,13 @@ class TestK2 : IFoo { } class TestK3 : IFoo { + private /* final field */ val $$delegate_0: K3 = K3() constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: K3 = K3() override fun foo(): String { return .#$$delegate_0.foo() } @@ -104,16 +99,21 @@ class TestK3 : IFoo { } class TestK4 : IFoo { + private /* final field */ val $$delegate_0: K4 = K4() constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: K4 = K4() override fun foo(): String { return .#$$delegate_0.foo() /*!! String */ } } +interface IFoo { + abstract fun foo(): String + +} + diff --git a/compiler/testData/ir/irText/classes/initBlock.ir.txt b/compiler/testData/ir/irText/classes/initBlock.ir.txt index 9a9478d185c..9d788680c59 100644 --- a/compiler/testData/ir/irText/classes/initBlock.ir.txt +++ b/compiler/testData/ir/irText/classes/initBlock.ir.txt @@ -1,13 +1,13 @@ FILE fqName: fileName:/initBlock.kt CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + CALL 'public final fun println (): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any]' - ANONYMOUS_INITIALIZER isStatic=false - BLOCK_BODY - CALL 'public final fun println (): kotlin.Unit declared in kotlin.io' type=kotlin.Unit 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 @@ -23,11 +23,6 @@ FILE fqName: fileName:/initBlock.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -42,6 +37,11 @@ FILE fqName: fileName:/initBlock.kt ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun println (): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -83,14 +83,14 @@ FILE fqName: fileName:/initBlock.kt BLOCK_BODY CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value="1" - CONSTRUCTOR visibility:public <> () returnType:.Test4 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value="2" + CONSTRUCTOR visibility:public <> () returnType:.Test4 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -106,25 +106,21 @@ FILE fqName: fileName:/initBlock.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test5 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test5 - CONSTRUCTOR visibility:public <> () returnType:.Test5 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test5 modality:FINAL visibility:public superTypes:[kotlin.Any]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value="1" CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test5.TestInner + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="2" CONSTRUCTOR visibility:public <> ($this:.Test5) returnType:.Test5.TestInner [primary] $outer: VALUE_PARAMETER name: type:.Test5 BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - ANONYMOUS_INITIALIZER isStatic=false - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="2" 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 @@ -138,6 +134,10 @@ FILE fqName: fileName:/initBlock.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.Test5 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test5 modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/initBlock.kt.txt b/compiler/testData/ir/irText/classes/initBlock.kt.txt index 2e1a89dafda..53754e84508 100644 --- a/compiler/testData/ir/irText/classes/initBlock.kt.txt +++ b/compiler/testData/ir/irText/classes/initBlock.kt.txt @@ -1,23 +1,17 @@ class Test1 { + init { + println() + } + constructor() /* primary */ { super/*Any*/() /* () */ } - init { - println() - } - } class Test2 { - constructor(x: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x get @@ -26,6 +20,12 @@ class Test2 { println() } + constructor(x: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + } class Test3 { @@ -46,40 +46,41 @@ class Test4 { println(message = "1") } + init { + println(message = "2") + } + constructor() { super/*Any*/() /* () */ } - init { - println(message = "2") - } - } class Test5 { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - init { println(message = "1") } inner class TestInner { + init { + println(message = "2") + } + constructor() /* primary */ { super/*Any*/() /* () */ } - init { - println(message = "2") - } + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ } } + diff --git a/compiler/testData/ir/irText/classes/initVal.ir.txt b/compiler/testData/ir/irText/classes/initVal.ir.txt index 570fc33d8f6..c03af395e06 100644 --- a/compiler/testData/ir/irText/classes/initVal.ir.txt +++ b/compiler/testData/ir/irText/classes/initVal.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/initVal.kt CLASS CLASS name:TestInitValFromParameter modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitValFromParameter - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestInitValFromParameter [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValFromParameter modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/initVal.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitValFromParameter' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .TestInitValFromParameter declared in .TestInitValFromParameter.' type=.TestInitValFromParameter origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestInitValFromParameter [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValFromParameter modality:FINAL visibility:public 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 declared in kotlin.Any @@ -32,10 +32,6 @@ FILE fqName: fileName:/initVal.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestInitValInClass modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitValInClass - CONSTRUCTOR visibility:public <> () returnType:.TestInitValInClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValInClass modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -47,6 +43,10 @@ FILE fqName: fileName:/initVal.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitValInClass' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .TestInitValInClass declared in .TestInitValInClass.' type=.TestInitValInClass origin=null + CONSTRUCTOR visibility:public <> () returnType:.TestInitValInClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValInClass modality:FINAL visibility:public 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 declared in kotlin.Any @@ -62,10 +62,6 @@ FILE fqName: fileName:/initVal.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestInitValInInitBlock modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitValInInitBlock - CONSTRUCTOR visibility:public <> () returnType:.TestInitValInInitBlock [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValInInitBlock modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitValInInitBlock) returnType:kotlin.Int @@ -80,6 +76,10 @@ FILE fqName: fileName:/initVal.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .TestInitValInInitBlock declared in .TestInitValInInitBlock' type=.TestInitValInInitBlock origin=null value: CONST Int type=kotlin.Int value=0 + CONSTRUCTOR visibility:public <> () returnType:.TestInitValInInitBlock [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValInInitBlock modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/initVal.kt.txt b/compiler/testData/ir/irText/classes/initVal.kt.txt index 52d57d4031d..08f3cde565b 100644 --- a/compiler/testData/ir/irText/classes/initVal.kt.txt +++ b/compiler/testData/ir/irText/classes/initVal.kt.txt @@ -1,36 +1,30 @@ class TestInitValFromParameter { + val x: Int + field = x + get + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } - val x: Int - field = x - get - } class TestInitValInClass { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = 0 get -} - -class TestInitValInInitBlock { constructor() /* primary */ { super/*Any*/() /* () */ } +} + +class TestInitValInInitBlock { val x: Int get @@ -38,4 +32,11 @@ class TestInitValInInitBlock { .#x = 0 } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/classes/initValInLambda.ir.txt b/compiler/testData/ir/irText/classes/initValInLambda.ir.txt index a4ee1691bdc..a4f3dc3d913 100644 --- a/compiler/testData/ir/irText/classes/initValInLambda.ir.txt +++ b/compiler/testData/ir/irText/classes/initValInLambda.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/initValInLambda.kt CLASS CLASS name:TestInitValInLambdaCalledOnce modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitValInLambdaCalledOnce - CONSTRUCTOR visibility:public <> () returnType:.TestInitValInLambdaCalledOnce [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValInLambdaCalledOnce modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitValInLambdaCalledOnce) returnType:kotlin.Int @@ -27,6 +23,10 @@ FILE fqName: fileName:/initValInLambda.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .TestInitValInLambdaCalledOnce declared in .TestInitValInLambdaCalledOnce' type=.TestInitValInLambdaCalledOnce origin=null value: CONST Int type=kotlin.Int value=0 + CONSTRUCTOR visibility:public <> () returnType:.TestInitValInLambdaCalledOnce [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValInLambdaCalledOnce modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/initValInLambda.kt.txt b/compiler/testData/ir/irText/classes/initValInLambda.kt.txt index 727822427ed..b81b29a30ad 100644 --- a/compiler/testData/ir/irText/classes/initValInLambda.kt.txt +++ b/compiler/testData/ir/irText/classes/initValInLambda.kt.txt @@ -1,10 +1,4 @@ class TestInitValInLambdaCalledOnce { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int get @@ -15,4 +9,11 @@ class TestInitValInLambdaCalledOnce { ) } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/classes/initVar.ir.txt b/compiler/testData/ir/irText/classes/initVar.ir.txt index b87aa5353c6..b16661cfb84 100644 --- a/compiler/testData/ir/irText/classes/initVar.ir.txt +++ b/compiler/testData/ir/irText/classes/initVar.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/initVar.kt CLASS CLASS name:TestInitVarFromParameter modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitVarFromParameter - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestInitVarFromParameter [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarFromParameter modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private EXPRESSION_BODY @@ -25,6 +20,11 @@ FILE fqName: fileName:/initVar.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .TestInitVarFromParameter declared in .TestInitVarFromParameter.' type=.TestInitVarFromParameter origin=null value: GET_VAR ': kotlin.Int declared in .TestInitVarFromParameter.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestInitVarFromParameter [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarFromParameter modality:FINAL visibility:public 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 declared in kotlin.Any @@ -40,10 +40,6 @@ FILE fqName: fileName:/initVar.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestInitVarInClass modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitVarInClass - CONSTRUCTOR visibility:public <> () returnType:.TestInitVarInClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarInClass modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private EXPRESSION_BODY @@ -63,6 +59,10 @@ FILE fqName: fileName:/initVar.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .TestInitVarInClass declared in .TestInitVarInClass.' type=.TestInitVarInClass origin=null value: GET_VAR ': kotlin.Int declared in .TestInitVarInClass.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.TestInitVarInClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarInClass modality:FINAL visibility:public 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 declared in kotlin.Any @@ -78,10 +78,6 @@ FILE fqName: fileName:/initVar.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestInitVarInInitBlock modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitVarInInitBlock - CONSTRUCTOR visibility:public <> () returnType:.TestInitVarInInitBlock [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarInInitBlock modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitVarInInitBlock) returnType:kotlin.Int @@ -104,6 +100,10 @@ FILE fqName: fileName:/initVar.kt CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .TestInitVarInInitBlock' type=kotlin.Unit origin=EQ $this: GET_VAR ': .TestInitVarInInitBlock declared in .TestInitVarInInitBlock' type=.TestInitVarInInitBlock origin=null : CONST Int type=kotlin.Int value=0 + CONSTRUCTOR visibility:public <> () returnType:.TestInitVarInInitBlock [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarInInitBlock modality:FINAL visibility:public 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 declared in kotlin.Any @@ -119,10 +119,6 @@ FILE fqName: fileName:/initVar.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestInitVarWithCustomSetter modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitVarWithCustomSetter - CONSTRUCTOR visibility:public <> () returnType:.TestInitVarWithCustomSetter [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarWithCustomSetter modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private EXPRESSION_BODY @@ -142,6 +138,10 @@ FILE fqName: fileName:/initVar.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private' type=kotlin.Unit origin=EQ receiver: GET_VAR ': .TestInitVarWithCustomSetter declared in .TestInitVarWithCustomSetter.' type=.TestInitVarWithCustomSetter origin=null value: GET_VAR 'value: kotlin.Int declared in .TestInitVarWithCustomSetter.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.TestInitVarWithCustomSetter [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarWithCustomSetter modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/initVar.kt.txt b/compiler/testData/ir/irText/classes/initVar.kt.txt index 07babeb4243..864c42066c5 100644 --- a/compiler/testData/ir/irText/classes/initVar.kt.txt +++ b/compiler/testData/ir/irText/classes/initVar.kt.txt @@ -1,38 +1,32 @@ class TestInitVarFromParameter { + var x: Int + field = x + get + set + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } - var x: Int - field = x - get - set - } class TestInitVarInClass { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - var x: Int field = 0 get set -} - -class TestInitVarInInitBlock { constructor() /* primary */ { super/*Any*/() /* () */ } +} + +class TestInitVarInInitBlock { var x: Int get set @@ -41,15 +35,15 @@ class TestInitVarInInitBlock { .( = 0) } -} - -class TestInitVarWithCustomSetter { constructor() /* primary */ { super/*Any*/() /* () */ } +} + +class TestInitVarWithCustomSetter { var x: Int field = 0 get @@ -57,5 +51,11 @@ class TestInitVarWithCustomSetter { .#x = value } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } diff --git a/compiler/testData/ir/irText/classes/inlineClass.ir.txt b/compiler/testData/ir/irText/classes/inlineClass.ir.txt index 3a7d3fb8836..8c7926eb05f 100644 --- a/compiler/testData/ir/irText/classes/inlineClass.ir.txt +++ b/compiler/testData/ir/irText/classes/inlineClass.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/inlineClass.kt CLASS CLASS name:Test modality:FINAL visibility:public [value] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -17,27 +12,11 @@ FILE fqName: fileName:/inlineClass.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Test declared in .Test.toString' type=.Test origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Test declared in .Test.hashCode' type=.Test origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -65,3 +44,24 @@ FILE fqName: fileName:/inlineClass.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test declared in .Test.hashCode' type=.Test origin=null + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Test(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test declared in .Test.toString' type=.Test origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/inlineClass.kt.txt b/compiler/testData/ir/irText/classes/inlineClass.kt.txt index ee2a919ba47..b6dbf36b6ca 100644 --- a/compiler/testData/ir/irText/classes/inlineClass.kt.txt +++ b/compiler/testData/ir/irText/classes/inlineClass.kt.txt @@ -1,20 +1,12 @@ value class Test { - constructor(x: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x get - override fun toString(): String { - return "Test(" + "x=" + .#x + ")" - } + constructor(x: Int) /* primary */ { + super/*Any*/() + /* () */ - override fun hashCode(): Int { - return .#x.hashCode() } override operator fun equals(other: Any?): Boolean { @@ -28,4 +20,13 @@ value class Test { return true } + override fun hashCode(): Int { + return .#x.hashCode() + } + + override fun toString(): String { + return "Test(" + "x=" + .#x + ")" + } + } + diff --git a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.ir.txt b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.ir.txt index feaca93860f..d3818b5e3ad 100644 --- a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.ir.txt +++ b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/inlineClassSyntheticMethods.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (t:T of .C) returnType:.C.C> [primary] - VALUE_PARAMETER name:t index:0 type:T of .C - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () 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 .C visibility:private [final] EXPRESSION_BODY @@ -18,15 +13,11 @@ FILE fqName: fileName:/inlineClassSyntheticMethods.kt RETURN type=kotlin.Nothing from='public final fun (): T of .C declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:t type:T of .C visibility:private [final]' type=T of .C origin=null receiver: GET_VAR ': .C.C> declared in .C.' type=.C.C> origin=null - FUN name:hashCode visibility:public modality:OPEN <> ($this:.C.C>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.C.C> + CONSTRUCTOR visibility:public <> (t:T of .C) returnType:.C.C> [primary] + VALUE_PARAMETER name:t index:0 type:T of .C BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .C' - TYPE_OP type=kotlin.Int origin=CAST typeOperand=kotlin.Int - CALL 'public final fun (): T of .C declared in .C' type=T of .C origin=GET_PROPERTY - $this: GET_VAR ': .C.C> declared in .C.hashCode' type=.C.C> origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -36,14 +27,18 @@ FILE fqName: fileName:/inlineClassSyntheticMethods.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:hashCode visibility:public modality:OPEN <> ($this:.C.C>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.C.C> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .C' + TYPE_OP type=kotlin.Int origin=CAST typeOperand=kotlin.Int + CALL 'public final fun (): T of .C declared in .C' type=T of .C origin=GET_PROPERTY + $this: GET_VAR ': .C.C> declared in .C.hashCode' type=.C.C> origin=null CLASS CLASS name:IC modality:FINAL visibility:public [value] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IC.IC> TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (c:.C.IC>) returnType:.IC.IC> [primary] - VALUE_PARAMETER name:c index:0 type:.C.IC> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IC modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' PROPERTY name:c visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:c type:.C.IC> visibility:private [final] EXPRESSION_BODY @@ -55,34 +50,11 @@ FILE fqName: fileName:/inlineClassSyntheticMethods.kt RETURN type=kotlin.Nothing from='public final fun (): .C.IC> declared in .IC' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:.C.IC> visibility:private [final]' type=.C.IC> origin=null receiver: GET_VAR ': .IC.IC> declared in .IC.' type=.IC.IC> origin=null - FUN name:foo visibility:public modality:FINAL <> ($this:.IC.IC>) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.IC.IC> + CONSTRUCTOR visibility:public <> (c:.C.IC>) returnType:.IC.IC> [primary] + VALUE_PARAMETER name:c index:0 type:.C.IC> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in .IC' - CALL 'public open fun hashCode (): kotlin.Int declared in .C' type=kotlin.Int origin=null - $this: CALL 'public final fun (): .C.IC> declared in .IC' type=.C.IC> origin=GET_PROPERTY - $this: GET_VAR ': .IC.IC> declared in .IC.foo' type=.IC.IC> origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.IC.IC>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.IC.IC> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .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:.C.IC> visibility:private [final]' type=.C.IC> origin=null - receiver: GET_VAR ': .IC.IC> declared in .IC.toString' type=.IC.IC> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.IC.IC>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.IC.IC> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .IC' - CALL 'public open fun hashCode (): kotlin.Int declared in .C' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:.C.IC> visibility:private [final]' type=.C.IC> origin=null - receiver: GET_VAR ': .IC.IC> declared in .IC.hashCode' type=.IC.IC> origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IC modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.IC.IC>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -110,6 +82,34 @@ FILE fqName: fileName:/inlineClassSyntheticMethods.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IC' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.IC.IC>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.IC.IC> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .IC' + CALL 'public open fun hashCode (): kotlin.Int declared in .C' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:.C.IC> visibility:private [final]' type=.C.IC> origin=null + receiver: GET_VAR ': .IC.IC> declared in .IC.hashCode' type=.IC.IC> origin=null + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.IC.IC>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.IC.IC> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .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:.C.IC> visibility:private [final]' type=.C.IC> origin=null + receiver: GET_VAR ': .IC.IC> declared in .IC.toString' type=.IC.IC> origin=null + CONST String type=kotlin.String value=")" + FUN name:foo visibility:public modality:FINAL <> ($this:.IC.IC>) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.IC.IC> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in .IC' + CALL 'public open fun hashCode (): kotlin.Int declared in .C' type=kotlin.Int origin=null + $this: CALL 'public final fun (): .C.IC> declared in .IC' type=.C.IC> origin=GET_PROPERTY + $this: GET_VAR ': .IC.IC> declared in .IC.foo' type=.IC.IC> origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:ic type:.IC [val] diff --git a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt.txt b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt.txt index bb4ebd68b71..b070f2dc334 100644 --- a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt.txt +++ b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt.txt @@ -1,14 +1,14 @@ class C { + val t: T + field = t + get + constructor(t: T) /* primary */ { super/*Any*/() /* () */ } - val t: T - field = t - get - override fun hashCode(): Int { return .() as Int } @@ -16,26 +16,14 @@ class C { } value class IC { - constructor(c: C) /* primary */ { - super/*Any*/() - /* () */ - - } - val c: C field = c get - fun foo(): Int { - return .().hashCode() - } + constructor(c: C) /* primary */ { + super/*Any*/() + /* () */ - override fun toString(): String { - return "IC(" + "c=" + .#c + ")" - } - - override fun hashCode(): Int { - return .#c.hashCode() } override operator fun equals(other: Any?): Boolean { @@ -49,6 +37,18 @@ value class IC { return true } + override fun hashCode(): Int { + return .#c.hashCode() + } + + override fun toString(): String { + return "IC(" + "c=" + .#c + ")" + } + + fun foo(): Int { + return .().hashCode() + } + } fun box(): String { @@ -58,3 +58,4 @@ fun box(): String { } return "OK" } + diff --git a/compiler/testData/ir/irText/classes/innerClass.fir.ir.txt b/compiler/testData/ir/irText/classes/innerClass.fir.ir.txt index 3223d3d942d..312640dda8c 100644 --- a/compiler/testData/ir/irText/classes/innerClass.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/innerClass.fir.ir.txt @@ -1,30 +1,6 @@ FILE fqName: fileName:/innerClass.kt CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS CLASS name:TestInnerClass modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.TestInnerClass - CONSTRUCTOR visibility:public <> ($this:.Outer) returnType:.Outer.TestInnerClass [primary] - $outer: VALUE_PARAMETER name: type:.Outer - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInnerClass modality:OPEN visibility:public [inner] 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 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 CLASS CLASS name:DerivedInnerClass modality:FINAL visibility:public [inner] superTypes:[.Outer.TestInnerClass] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.DerivedInnerClass CONSTRUCTOR visibility:public <> ($this:.Outer) returnType:.Outer.DerivedInnerClass [primary] @@ -46,6 +22,30 @@ FILE fqName: fileName:/innerClass.kt overridden: public open fun toString (): kotlin.String declared in .Outer.TestInnerClass $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestInnerClass modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.TestInnerClass + CONSTRUCTOR visibility:public <> ($this:.Outer) returnType:.Outer.TestInnerClass [primary] + $outer: VALUE_PARAMETER name: type:.Outer + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInnerClass modality:OPEN visibility:public [inner] 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 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 + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/innerClass.fir.kt.txt b/compiler/testData/ir/irText/classes/innerClass.fir.kt.txt index 70489fb8082..7e434e5610a 100644 --- a/compiler/testData/ir/irText/classes/innerClass.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/innerClass.fir.kt.txt @@ -1,7 +1,10 @@ class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ + inner class DerivedInnerClass : TestInnerClass { + constructor() /* primary */ { + .super/*TestInnerClass*/() + /* () */ + + } } @@ -14,13 +17,11 @@ class Outer { } - inner class DerivedInnerClass : TestInnerClass { - constructor() /* primary */ { - .super/*TestInnerClass*/() - /* () */ - - } + constructor() /* primary */ { + super/*Any*/() + /* () */ } } + diff --git a/compiler/testData/ir/irText/classes/innerClass.ir.txt b/compiler/testData/ir/irText/classes/innerClass.ir.txt index 3d2d47e4943..46c373360da 100644 --- a/compiler/testData/ir/irText/classes/innerClass.ir.txt +++ b/compiler/testData/ir/irText/classes/innerClass.ir.txt @@ -1,30 +1,6 @@ FILE fqName: fileName:/innerClass.kt CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS CLASS name:TestInnerClass modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.TestInnerClass - CONSTRUCTOR visibility:public <> ($this:.Outer) returnType:.Outer.TestInnerClass [primary] - $outer: VALUE_PARAMETER name: type:.Outer - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInnerClass modality:OPEN visibility:public [inner] 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 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 CLASS CLASS name:DerivedInnerClass modality:FINAL visibility:public [inner] superTypes:[.Outer.TestInnerClass] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.DerivedInnerClass CONSTRUCTOR visibility:public <> ($this:.Outer) returnType:.Outer.DerivedInnerClass [primary] @@ -46,6 +22,30 @@ FILE fqName: fileName:/innerClass.kt overridden: public open fun toString (): kotlin.String declared in .Outer.TestInnerClass $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestInnerClass modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.TestInnerClass + CONSTRUCTOR visibility:public <> ($this:.Outer) returnType:.Outer.TestInnerClass [primary] + $outer: VALUE_PARAMETER name: type:.Outer + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInnerClass modality:OPEN visibility:public [inner] 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 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 + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/innerClass.kt.txt b/compiler/testData/ir/irText/classes/innerClass.kt.txt index 70489fb8082..7e434e5610a 100644 --- a/compiler/testData/ir/irText/classes/innerClass.kt.txt +++ b/compiler/testData/ir/irText/classes/innerClass.kt.txt @@ -1,7 +1,10 @@ class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ + inner class DerivedInnerClass : TestInnerClass { + constructor() /* primary */ { + .super/*TestInnerClass*/() + /* () */ + + } } @@ -14,13 +17,11 @@ class Outer { } - inner class DerivedInnerClass : TestInnerClass { - constructor() /* primary */ { - .super/*TestInnerClass*/() - /* () */ - - } + constructor() /* primary */ { + super/*Any*/() + /* () */ } } + diff --git a/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.ir.txt b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.ir.txt index 716ef5013be..67a79a3d08e 100644 --- a/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.ir.txt @@ -1,18 +1,8 @@ FILE fqName: fileName:/innerClassWithDelegatingConstructor.kt CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner - CONSTRUCTOR visibility:public <> ($this:.Outer, x:kotlin.Int) returnType:.Outer.Inner [primary] - $outer: VALUE_PARAMETER name: type:.Outer - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -30,6 +20,12 @@ FILE fqName: fileName:/innerClassWithDelegatingConstructor.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) declared in .Outer.Inner' $this: GET_VAR ': .Outer declared in .Outer' type=.Outer origin=null x: CONST Int type=kotlin.Int value=0 + CONSTRUCTOR visibility:public <> ($this:.Outer, x:kotlin.Int) returnType:.Outer.Inner [primary] + $outer: VALUE_PARAMETER name: type:.Outer + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] 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 declared in kotlin.Any @@ -43,6 +39,10 @@ FILE fqName: fileName:/innerClassWithDelegatingConstructor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.kt.txt b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.kt.txt index 67d9bb6242f..e4448966154 100644 --- a/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.kt.txt @@ -1,17 +1,5 @@ class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - inner class Inner { - constructor(x: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x get @@ -20,6 +8,19 @@ class Outer { .this/*Inner*/(x = 0) } + constructor(x: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + } } + diff --git a/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.ir.txt b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.ir.txt index 0f3ff67f744..6f53e8a2251 100644 --- a/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.ir.txt +++ b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.ir.txt @@ -1,18 +1,8 @@ FILE fqName: fileName:/innerClassWithDelegatingConstructor.kt CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner - CONSTRUCTOR visibility:public <> ($this:.Outer, x:kotlin.Int) returnType:.Outer.Inner [primary] - $outer: VALUE_PARAMETER name: type:.Outer - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -30,6 +20,12 @@ FILE fqName: fileName:/innerClassWithDelegatingConstructor.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) declared in .Outer.Inner' $this: GET_VAR ': .Outer declared in .Outer.Inner.' type=.Outer origin=null x: CONST Int type=kotlin.Int value=0 + CONSTRUCTOR visibility:public <> ($this:.Outer, x:kotlin.Int) returnType:.Outer.Inner [primary] + $outer: VALUE_PARAMETER name: type:.Outer + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] 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 declared in kotlin.Any @@ -43,6 +39,10 @@ FILE fqName: fileName:/innerClassWithDelegatingConstructor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.kt.txt b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.kt.txt index 67d9bb6242f..e4448966154 100644 --- a/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.kt.txt +++ b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.kt.txt @@ -1,17 +1,5 @@ class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - inner class Inner { - constructor(x: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x get @@ -20,6 +8,19 @@ class Outer { .this/*Inner*/(x = 0) } + constructor(x: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + } } + diff --git a/compiler/testData/ir/irText/classes/kt19306.ir.txt b/compiler/testData/ir/irText/classes/kt19306.ir.txt index 2e74373addd..d8b971e7814 100644 --- a/compiler/testData/ir/irText/classes/kt19306.ir.txt +++ b/compiler/testData/ir/irText/classes/kt19306.ir.txt @@ -1,10 +1,6 @@ FILE fqName:test1 fileName:/kt19306_test1.kt CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test1.A - CONSTRUCTOR visibility:public <> () returnType:test1.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' PROPERTY name:p visibility:protected modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.String visibility:private EXPRESSION_BODY @@ -24,6 +20,10 @@ FILE fqName:test1 fileName:/kt19306_test1.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.String visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': test1.A declared in test1.A.' type=test1.A origin=null value: GET_VAR ': kotlin.String declared in test1.A.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> () returnType:test1.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public 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 declared in kotlin.Any @@ -44,6 +44,19 @@ FILE fqName:test2 fileName:/kt19306_test2.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in test1.A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[test1.A]' + 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 test1.A + $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 test1.A + $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 test1.A + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:test visibility:public modality:FINAL <> ($this:test2.B) returnType:kotlin.Function0 $this: VALUE_PARAMETER name: type:test2.B BLOCK_BODY @@ -62,16 +75,3 @@ FILE fqName:test2 fileName:/kt19306_test2.kt overridden: protected final fun (): kotlin.String declared in test1.A $this: VALUE_PARAMETER name: type:test1.A - 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 test1.A - $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 test1.A - $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 test1.A - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/kt43217.fir.ir.txt b/compiler/testData/ir/irText/classes/kt43217.fir.ir.txt deleted file mode 100644 index 1b606f79c68..00000000000 --- a/compiler/testData/ir/irText/classes/kt43217.fir.ir.txt +++ /dev/null @@ -1,118 +0,0 @@ -FILE fqName: fileName:/kt43217.kt - CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:b visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:b type:.A.b. visibility:private [final] - EXPRESSION_BODY - BLOCK type=.A.b. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.DoubleExpression] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.b. - CONSTRUCTOR visibility:public <> () returnType:.A.b. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .DoubleExpression' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.DoubleExpression]' - FUN name:get visibility:public modality:OPEN <> ($this:.A.b.) returnType:kotlin.Double - overridden: - public abstract fun get (): @[EnhancedNullability] kotlin.Double declared in .DoubleExpression - $this: VALUE_PARAMETER name: type:.A.b. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun get (): kotlin.Double declared in .A.b.' - CONST Double type=kotlin.Double value=0.0 - FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.DoubleExpression, value:kotlin.Double) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - annotations: - NotNull(value = ) - Override - overridden: - public open fun isEqualTo (value: kotlin.Double): @[EnhancedNullability] kotlin.Any declared in .DoubleExpression - $this: VALUE_PARAMETER name: type:.DoubleExpression - VALUE_PARAMETER name:value index:0 type:kotlin.Double - FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.ObservableValue<@[FlexibleNullability] kotlin.Double?>, value:@[EnhancedNullability] kotlin.Double) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - annotations: - NotNull(value = ) - overridden: - public open fun isEqualTo (value: @[EnhancedNullability] kotlin.Double): @[EnhancedNullability] kotlin.Any declared in .DoubleExpression - $this: VALUE_PARAMETER name: type:.ObservableValue<@[FlexibleNullability] kotlin.Double?> - VALUE_PARAMETER name:value index:0 type:@[EnhancedNullability] kotlin.Double - annotations: - NotNull(value = ) - 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 .DoubleExpression - $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 .DoubleExpression - $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 .DoubleExpression - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .A.b.' type=.A.b. origin=OBJECT_LITERAL - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.A) returnType:.A.b. - correspondingProperty: PROPERTY name:b visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): .A.b. declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:.A.b. visibility:private [final]' type=.A.b. origin=null - receiver: GET_VAR ': .A declared in .A.' type=.A 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: 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 - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.DoubleExpression] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .DoubleExpression' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.DoubleExpression]' - FUN name:get visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Double - overridden: - public abstract fun get (): @[EnhancedNullability] kotlin.Double declared in .DoubleExpression - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun get (): kotlin.Double declared in .C' - CONST Double type=kotlin.Double value=0.0 - FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.DoubleExpression, value:kotlin.Double) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - annotations: - NotNull(value = ) - Override - overridden: - public open fun isEqualTo (value: kotlin.Double): @[EnhancedNullability] kotlin.Any declared in .DoubleExpression - $this: VALUE_PARAMETER name: type:.DoubleExpression - VALUE_PARAMETER name:value index:0 type:kotlin.Double - FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.ObservableValue<@[FlexibleNullability] kotlin.Double?>, value:@[EnhancedNullability] kotlin.Double) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - annotations: - NotNull(value = ) - overridden: - public open fun isEqualTo (value: @[EnhancedNullability] kotlin.Double): @[EnhancedNullability] kotlin.Any declared in .DoubleExpression - $this: VALUE_PARAMETER name: type:.ObservableValue<@[FlexibleNullability] kotlin.Double?> - VALUE_PARAMETER name:value index:0 type:@[EnhancedNullability] kotlin.Double - annotations: - NotNull(value = ) - 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 .DoubleExpression - $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 .DoubleExpression - $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 .DoubleExpression - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/kt43217.fir.kt.txt b/compiler/testData/ir/irText/classes/kt43217.fir.kt.txt deleted file mode 100644 index 5d82e859d36..00000000000 --- a/compiler/testData/ir/irText/classes/kt43217.fir.kt.txt +++ /dev/null @@ -1,40 +0,0 @@ -class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - private val b: - field = { // BLOCK - local class : DoubleExpression { - constructor() /* primary */ { - super/*DoubleExpression*/() - /* () */ - - } - - override fun get(): Double { - return 0.0 - } - - } - - () - } - private get - -} - -class C : DoubleExpression { - constructor() /* primary */ { - super/*DoubleExpression*/() - /* () */ - - } - - override fun get(): Double { - return 0.0 - } - -} diff --git a/compiler/testData/ir/irText/classes/kt43217.ir.txt b/compiler/testData/ir/irText/classes/kt43217.ir.txt index 7292bf376c8..a71e538f10f 100644 --- a/compiler/testData/ir/irText/classes/kt43217.ir.txt +++ b/compiler/testData/ir/irText/classes/kt43217.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/kt43217.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:b visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:b type:.A.b. visibility:private [final] EXPRESSION_BODY @@ -15,13 +11,6 @@ FILE fqName: fileName:/kt43217.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .DoubleExpression' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.DoubleExpression]' - FUN name:get visibility:public modality:OPEN <> ($this:.A.b.) returnType:kotlin.Double - overridden: - public abstract fun get (): @[EnhancedNullability] kotlin.Double declared in .DoubleExpression - $this: VALUE_PARAMETER name: type:.A.b. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun get (): kotlin.Double declared in .A.b.' - CONST Double type=kotlin.Double value=0.0 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 .DoubleExpression @@ -31,10 +20,6 @@ FILE fqName: fileName:/kt43217.kt overridden: public open fun hashCode (): kotlin.Int declared in .DoubleExpression $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 .DoubleExpression - $this: VALUE_PARAMETER name: type:kotlin.Any FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.DoubleExpression, value:kotlin.Double) returnType:@[EnhancedNullability] kotlin.Any [fake_override] annotations: NotNull(value = ) @@ -52,6 +37,17 @@ FILE fqName: fileName:/kt43217.kt VALUE_PARAMETER name:value index:0 type:@[EnhancedNullability] kotlin.Double annotations: NotNull(value = ) + 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 .DoubleExpression + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:get visibility:public modality:OPEN <> ($this:.A.b.) returnType:kotlin.Double + overridden: + public abstract fun get (): @[EnhancedNullability] kotlin.Double declared in .DoubleExpression + $this: VALUE_PARAMETER name: type:.A.b. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun get (): kotlin.Double declared in .A.b.' + CONST Double type=kotlin.Double value=0.0 CONSTRUCTOR_CALL 'public constructor () declared in .A.b.' type=.A.b. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.A) returnType:.A.b. correspondingProperty: PROPERTY name:b visibility:private modality:FINAL [val] @@ -60,6 +56,10 @@ FILE fqName: fileName:/kt43217.kt RETURN type=kotlin.Nothing from='private final fun (): .A.b. declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:.A.b. visibility:private [final]' type=.A.b. origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -79,13 +79,6 @@ FILE fqName: fileName:/kt43217.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .DoubleExpression' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.DoubleExpression]' - FUN name:get visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Double - overridden: - public abstract fun get (): @[EnhancedNullability] kotlin.Double declared in .DoubleExpression - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun get (): kotlin.Double declared in .C' - CONST Double type=kotlin.Double value=0.0 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 .DoubleExpression @@ -95,10 +88,6 @@ FILE fqName: fileName:/kt43217.kt overridden: public open fun hashCode (): kotlin.Int declared in .DoubleExpression $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 .DoubleExpression - $this: VALUE_PARAMETER name: type:kotlin.Any FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.DoubleExpression, value:kotlin.Double) returnType:@[EnhancedNullability] kotlin.Any [fake_override] annotations: NotNull(value = ) @@ -116,3 +105,14 @@ FILE fqName: fileName:/kt43217.kt VALUE_PARAMETER name:value index:0 type:@[EnhancedNullability] kotlin.Double annotations: NotNull(value = ) + 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 .DoubleExpression + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:get visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Double + overridden: + public abstract fun get (): @[EnhancedNullability] kotlin.Double declared in .DoubleExpression + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun get (): kotlin.Double declared in .C' + CONST Double type=kotlin.Double value=0.0 diff --git a/compiler/testData/ir/irText/classes/kt43217.kt b/compiler/testData/ir/irText/classes/kt43217.kt index 3d507de4cd0..7bca147bee5 100644 --- a/compiler/testData/ir/irText/classes/kt43217.kt +++ b/compiler/testData/ir/irText/classes/kt43217.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // TARGET_BACKEND: JVM // FILE: kt43217.kt diff --git a/compiler/testData/ir/irText/classes/kt43217.kt.txt b/compiler/testData/ir/irText/classes/kt43217.kt.txt index 5d82e859d36..f735070c99d 100644 --- a/compiler/testData/ir/irText/classes/kt43217.kt.txt +++ b/compiler/testData/ir/irText/classes/kt43217.kt.txt @@ -1,10 +1,4 @@ class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - private val b: field = { // BLOCK local class : DoubleExpression { @@ -24,6 +18,12 @@ class A { } private get + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } class C : DoubleExpression { @@ -38,3 +38,4 @@ class C : DoubleExpression { } } + diff --git a/compiler/testData/ir/irText/classes/kt45853.fir.ir.txt b/compiler/testData/ir/irText/classes/kt45853.fir.ir.txt index 7338acfdaf5..43a50cc10b2 100644 --- a/compiler/testData/ir/irText/classes/kt45853.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/kt45853.fir.ir.txt @@ -5,10 +5,6 @@ FILE fqName: fileName:/kt45853.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - PROPERTY name:a visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.A) returnType:.A? - correspondingProperty: PROPERTY name:a visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.A 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 @@ -22,12 +18,29 @@ FILE fqName: fileName:/kt45853.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:a visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.A) returnType:.A? + correspondingProperty: PROPERTY name:a visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.A CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.AX] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B CONSTRUCTOR visibility:public <> () returnType:.B [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .AX' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.AX]' + 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 .AX + $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 .AX + $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 .AX + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:getA visibility:public modality:OPEN <> ($this:.B) returnType:.X? overridden: public abstract fun getA (): @[FlexibleNullability] .X? declared in .AX @@ -46,16 +59,3 @@ FILE fqName: fileName:/kt45853.kt overridden: public open fun (): @[FlexibleNullability] .AX? declared in .AX $this: VALUE_PARAMETER name: type:.AX - 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 .AX - $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 .AX - $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 .AX - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/kt45853.ir.txt b/compiler/testData/ir/irText/classes/kt45853.ir.txt index a3e783d9916..8dfe7bd8c09 100644 --- a/compiler/testData/ir/irText/classes/kt45853.ir.txt +++ b/compiler/testData/ir/irText/classes/kt45853.ir.txt @@ -5,10 +5,6 @@ FILE fqName: fileName:/kt45853.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - PROPERTY name:a visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.A) returnType:.A? - correspondingProperty: PROPERTY name:a visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.A 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 @@ -22,20 +18,16 @@ FILE fqName: fileName:/kt45853.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:a visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.A) returnType:.A? + correspondingProperty: PROPERTY name:a visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.A CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.AX] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B CONSTRUCTOR visibility:public <> () returnType:.B [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .AX' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.AX]' - FUN name:getA visibility:public modality:OPEN <> ($this:.B) returnType:.X? - overridden: - public abstract fun getA (): @[FlexibleNullability] .X? declared in .AX - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getA (): .X? declared in .B' - CALL 'public open fun (): @[EnhancedNullability] .AX? declared in .AX' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:AX modality:ABSTRACT visibility:public superTypes:[.A; .X]' type=@[EnhancedNullability] .AX? origin=GET_PROPERTY - $this: GET_VAR ': .B declared in .B.getA' type=.B 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 .AX @@ -49,6 +41,14 @@ FILE fqName: fileName:/kt45853.kt overridden: public open fun toString (): kotlin.String declared in .AX $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getA visibility:public modality:OPEN <> ($this:.B) returnType:.X? + overridden: + public abstract fun getA (): @[FlexibleNullability] .X? declared in .AX + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getA (): .X? declared in .B' + CALL 'public open fun (): @[EnhancedNullability] .AX? declared in .AX' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:AX modality:ABSTRACT visibility:public superTypes:[.A; .X]' type=@[EnhancedNullability] .AX? origin=GET_PROPERTY + $this: GET_VAR ': .B declared in .B.getA' type=.B origin=null PROPERTY FAKE_OVERRIDE name:a visibility:public modality:OPEN [fake_override,val] overridden: public open a: @[EnhancedNullability] .AX? diff --git a/compiler/testData/ir/irText/classes/kt45934.fir.ir.txt b/compiler/testData/ir/irText/classes/kt45934.fir.ir.txt index 074c173a936..0b78972b7b1 100644 --- a/compiler/testData/ir/irText/classes/kt45934.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/kt45934.fir.ir.txt @@ -1,14 +1,14 @@ FILE fqName: fileName:/kt45934.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final] + EXPRESSION_BODY + GET_VAR 'client: .J declared in .C.' type=.J origin=null CONSTRUCTOR visibility:public <> (client:.J) returnType:.C [primary] VALUE_PARAMETER name:client index:0 type:.J BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I]' - FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final] - EXPRESSION_BODY - GET_VAR 'client: .J declared in .C.' type=.J origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN ($this:.C) returnType:@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[FlexibleNullability] C of .C.foo?>? overridden: public abstract fun foo (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[FlexibleNullability] C of .I.foo?>? declared in .I diff --git a/compiler/testData/ir/irText/classes/kt45934.ir.txt b/compiler/testData/ir/irText/classes/kt45934.ir.txt index 98f0665cc0d..aa48b7bc3cc 100644 --- a/compiler/testData/ir/irText/classes/kt45934.ir.txt +++ b/compiler/testData/ir/irText/classes/kt45934.ir.txt @@ -1,14 +1,14 @@ FILE fqName: fileName:/kt45934.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final] + EXPRESSION_BODY + GET_VAR 'client: .J declared in .C.' type=.J origin=null CONSTRUCTOR visibility:public <> (client:.J) returnType:.C [primary] VALUE_PARAMETER name:client index:0 type:.J BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I]' - FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final] - EXPRESSION_BODY - GET_VAR 'client: .J declared in .C.' type=.J 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 .I diff --git a/compiler/testData/ir/irText/classes/localClasses.ir.txt b/compiler/testData/ir/irText/classes/localClasses.ir.txt index 64f22b142d9..9d36255c3b2 100644 --- a/compiler/testData/ir/irText/classes/localClasses.ir.txt +++ b/compiler/testData/ir/irText/classes/localClasses.ir.txt @@ -7,9 +7,6 @@ FILE fqName: fileName:/localClasses.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LocalClass modality:FINAL visibility:local superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.outer.LocalClass) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.outer.LocalClass - BLOCK_BODY 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 @@ -23,5 +20,8 @@ FILE fqName: fileName:/localClasses.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.outer.LocalClass) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.outer.LocalClass + BLOCK_BODY CALL 'public final fun foo (): kotlin.Unit declared in .outer.LocalClass' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () declared in .outer.LocalClass' type=.outer.LocalClass origin=null diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.ir.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.ir.txt index 9bac669f0ed..244fc895e11 100644 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.ir.txt +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.ir.txt @@ -1,21 +1,4 @@ FILE fqName: fileName:/objectLiteralExpressions.kt - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFoo - 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: 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 PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Any visibility:private [final,static] EXPRESSION_BODY @@ -55,13 +38,6 @@ FILE fqName: fileName:/objectLiteralExpressions.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IFoo]' - FUN name:foo visibility:public modality:OPEN <> ($this:.test2.) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .IFoo - $this: VALUE_PARAMETER name: type:.test2. - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="foo" 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 .IFoo @@ -75,6 +51,13 @@ FILE fqName: fileName:/objectLiteralExpressions.kt overridden: public open fun toString (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.test2.) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .IFoo + $this: VALUE_PARAMETER name: type:.test2. + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="foo" CONSTRUCTOR_CALL 'public constructor () declared in .test2.' type=.test2. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.IFoo correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] @@ -83,10 +66,6 @@ FILE fqName: fileName:/objectLiteralExpressions.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:.IFoo visibility:private [final,static]' type=.IFoo origin=null CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:ABSTRACT visibility:public [inner] superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner CONSTRUCTOR visibility:public <> ($this:.Outer) returnType:.Outer.Inner [primary] @@ -94,15 +73,15 @@ FILE fqName: fileName:/objectLiteralExpressions.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:ABSTRACT visibility:public [inner] superTypes:[.IFoo]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (): kotlin.Unit declared in .IFoo - $this: VALUE_PARAMETER name: type:.IFoo 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 .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun foo (): kotlin.Unit declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo 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 .IFoo @@ -111,39 +90,10 @@ FILE fqName: fileName:/objectLiteralExpressions.kt overridden: public open fun toString (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test3 visibility:public modality:FINAL <> ($this:.Outer) returnType:.Outer.Inner - $this: VALUE_PARAMETER name: type:.Outer + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3 (): .Outer.Inner declared in .Outer' - BLOCK type=.Outer.test3. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.test3. - CONSTRUCTOR visibility:public <> () returnType:.Outer.test3. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Outer.Inner' - $this: GET_VAR ': .Outer declared in .Outer.test3' type=.Outer origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Outer.test3.) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:.Outer.test3. - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="foo" - 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 .Outer.Inner - $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 .Outer.Inner - $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 .Outer.Inner - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .Outer.test3.' type=.Outer.test3. origin=OBJECT_LITERAL + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any @@ -157,6 +107,56 @@ FILE fqName: fileName:/objectLiteralExpressions.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test3 visibility:public modality:FINAL <> ($this:.Outer) returnType:.Outer.Inner + $this: VALUE_PARAMETER name: type:.Outer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): .Outer.Inner declared in .Outer' + BLOCK type=.Outer.test3. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.test3. + CONSTRUCTOR visibility:public <> () returnType:.Outer.test3. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Outer.Inner' + $this: GET_VAR ': .Outer declared in .Outer.test3' type=.Outer origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' + 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 .Outer.Inner + $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 .Outer.Inner + $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 .Outer.Inner + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.Outer.test3.) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:.Outer.test3. + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="foo" + CONSTRUCTOR_CALL 'public constructor () declared in .Outer.test3.' type=.Outer.test3. origin=OBJECT_LITERAL + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFoo FUN name:test4 visibility:public modality:FINAL <> ($receiver:.Outer) returnType:.Outer.Inner $receiver: VALUE_PARAMETER name: type:.Outer BLOCK_BODY @@ -169,13 +169,6 @@ FILE fqName: fileName:/objectLiteralExpressions.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Outer.Inner' $this: GET_VAR ': .Outer declared in .test4' type=.Outer origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' - FUN name:foo visibility:public modality:OPEN <> ($this:.test4.) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:.test4. - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="foo" 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 .Outer.Inner @@ -189,4 +182,11 @@ FILE fqName: fileName:/objectLiteralExpressions.kt overridden: public open fun toString (): kotlin.String declared in .Outer.Inner $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.test4.) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:.test4. + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="foo" CONSTRUCTOR_CALL 'public constructor () declared in .test4.' type=.test4. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.kt.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.kt.txt index 2132d1a9043..67b2a2a498d 100644 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.kt.txt +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.kt.txt @@ -1,8 +1,3 @@ -interface IFoo { - abstract fun foo() - -} - val test1: Any field = { // BLOCK local class { @@ -38,12 +33,6 @@ val test2: IFoo get class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - abstract inner class Inner : IFoo { constructor() /* primary */ { super/*Any*/() @@ -53,6 +42,12 @@ class Outer { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + fun test3(): Inner { return { // BLOCK local class : Inner { @@ -74,6 +69,11 @@ class Outer { } +interface IFoo { + abstract fun foo() + +} + fun Outer.test4(): Inner { return { // BLOCK local class : Inner { @@ -92,3 +92,4 @@ fun Outer.test4(): Inner { () } } + diff --git a/compiler/testData/ir/irText/classes/objectWithInitializers.ir.txt b/compiler/testData/ir/irText/classes/objectWithInitializers.ir.txt index 2833f4d891c..911dabdb94e 100644 --- a/compiler/testData/ir/irText/classes/objectWithInitializers.ir.txt +++ b/compiler/testData/ir/irText/classes/objectWithInitializers.ir.txt @@ -20,10 +20,6 @@ FILE fqName: fileName:/objectWithInitializers.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS OBJECT name:Test modality:FINAL visibility:public superTypes:[.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test - CONSTRUCTOR visibility:private <> () returnType:.Test [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Test modality:FINAL visibility:public superTypes:[.Base]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -50,6 +46,10 @@ FILE fqName: fileName:/objectWithInitializers.kt receiver: GET_VAR ': .Test declared in .Test' type=.Test origin=null value: CALL 'public final fun (): kotlin.Int declared in .Test' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Test declared in .Test' type=.Test origin=null + CONSTRUCTOR visibility:private <> () returnType:.Test [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Test modality:FINAL visibility:public superTypes:[.Base]' 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 .Base diff --git a/compiler/testData/ir/irText/classes/objectWithInitializers.kt.txt b/compiler/testData/ir/irText/classes/objectWithInitializers.kt.txt index 2ea6b369681..1ae5c7e0a5f 100644 --- a/compiler/testData/ir/irText/classes/objectWithInitializers.kt.txt +++ b/compiler/testData/ir/irText/classes/objectWithInitializers.kt.txt @@ -8,12 +8,6 @@ abstract class Base { } object Test : Base { - private constructor() /* primary */ { - super/*Base*/() - /* () */ - - } - val x: Int field = 1 get @@ -25,4 +19,11 @@ object Test : Base { .#y = .() } + private constructor() /* primary */ { + super/*Base*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/classes/outerClassAccess.ir.txt b/compiler/testData/ir/irText/classes/outerClassAccess.ir.txt index c210e6c9178..9e12b7995c6 100644 --- a/compiler/testData/ir/irText/classes/outerClassAccess.ir.txt +++ b/compiler/testData/ir/irText/classes/outerClassAccess.ir.txt @@ -1,25 +1,8 @@ FILE fqName: fileName:/outerClassAccess.kt CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Outer) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Outer - BLOCK_BODY CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner - CONSTRUCTOR visibility:public <> ($this:.Outer) returnType:.Outer.Inner [primary] - $outer: VALUE_PARAMETER name: type:.Outer - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - FUN name:test visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Outer.Inner - BLOCK_BODY - CALL 'public final fun foo (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null - $this: GET_VAR ': .Outer declared in .Outer' type=.Outer origin=null CLASS CLASS name:Inner2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Inner2 CONSTRUCTOR visibility:public <> ($this:.Outer.Inner) returnType:.Outer.Inner.Inner2 [primary] @@ -27,19 +10,6 @@ FILE fqName: fileName:/outerClassAccess.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - FUN name:test2 visibility:public modality:FINAL <> ($this:.Outer.Inner.Inner2) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Outer.Inner.Inner2 - BLOCK_BODY - CALL 'public final fun test (): kotlin.Unit declared in .Outer.Inner' type=kotlin.Unit origin=null - $this: GET_VAR ': .Outer.Inner declared in .Outer.Inner' type=.Outer.Inner origin=null - CALL 'public final fun foo (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null - $this: GET_VAR ': .Outer declared in .Outer' type=.Outer origin=null - FUN name:test3 visibility:public modality:FINAL <> ($this:.Outer.Inner.Inner2, $receiver:.Outer) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Outer.Inner.Inner2 - $receiver: VALUE_PARAMETER name: type:.Outer - BLOCK_BODY - CALL 'public final fun foo (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null - $this: GET_VAR ': .Outer declared in .Outer.Inner.Inner2.test3' type=.Outer 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 @@ -53,6 +23,24 @@ FILE fqName: fileName:/outerClassAccess.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test2 visibility:public modality:FINAL <> ($this:.Outer.Inner.Inner2) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner.Inner2 + BLOCK_BODY + CALL 'public final fun test (): kotlin.Unit declared in .Outer.Inner' type=kotlin.Unit origin=null + $this: GET_VAR ': .Outer.Inner declared in .Outer.Inner' type=.Outer.Inner origin=null + CALL 'public final fun foo (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null + $this: GET_VAR ': .Outer declared in .Outer' type=.Outer origin=null + FUN name:test3 visibility:public modality:FINAL <> ($this:.Outer.Inner.Inner2, $receiver:.Outer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner.Inner2 + $receiver: VALUE_PARAMETER name: type:.Outer + BLOCK_BODY + CALL 'public final fun foo (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null + $this: GET_VAR ': .Outer declared in .Outer.Inner.Inner2.test3' type=.Outer origin=null + CONSTRUCTOR visibility:public <> ($this:.Outer) returnType:.Outer.Inner [primary] + $outer: VALUE_PARAMETER name: type:.Outer + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] 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 declared in kotlin.Any @@ -66,6 +54,15 @@ FILE fqName: fileName:/outerClassAccess.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner + BLOCK_BODY + CALL 'public final fun foo (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null + $this: GET_VAR ': .Outer declared in .Outer' type=.Outer origin=null + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any @@ -79,3 +76,6 @@ FILE fqName: fileName:/outerClassAccess.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.Outer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer + BLOCK_BODY diff --git a/compiler/testData/ir/irText/classes/outerClassAccess.kt.txt b/compiler/testData/ir/irText/classes/outerClassAccess.kt.txt index fbd78e96bb3..d942b0db88b 100644 --- a/compiler/testData/ir/irText/classes/outerClassAccess.kt.txt +++ b/compiler/testData/ir/irText/classes/outerClassAccess.kt.txt @@ -1,24 +1,5 @@ class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun foo() { - } - inner class Inner { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun test() { - .foo() - } - inner class Inner2 { constructor() /* primary */ { super/*Any*/() @@ -37,6 +18,26 @@ class Outer { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun test() { + .foo() + } + + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun foo() { } } + diff --git a/compiler/testData/ir/irText/classes/overriddenEquals.ir.txt b/compiler/testData/ir/irText/classes/overriddenEquals.ir.txt index d2e758916d6..b2c6f767f2e 100644 --- a/compiler/testData/ir/irText/classes/overriddenEquals.ir.txt +++ b/compiler/testData/ir/irText/classes/overriddenEquals.ir.txt @@ -5,6 +5,14 @@ FILE fqName: fileName:/overriddenEquals.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[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:equals visibility:public modality:OPEN <> ($this:.Base, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -15,29 +23,6 @@ FILE fqName: fileName:/overriddenEquals.kt CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Base declared in .Base.equals' type=.Base origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Base.equals' type=kotlin.Any? origin=null - 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 - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I - 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: 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 CLASS CLASS name:Child1 modality:FINAL visibility:public superTypes:[.Base; .I] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Child1 CONSTRUCTOR visibility:public <> () returnType:.Child1 [primary] @@ -82,3 +67,18 @@ FILE fqName: fileName:/overriddenEquals.kt public open fun toString (): kotlin.String declared in .I public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I + 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: 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 diff --git a/compiler/testData/ir/irText/classes/overriddenEquals.kt.txt b/compiler/testData/ir/irText/classes/overriddenEquals.kt.txt index 9e3d7620d42..031e612450c 100644 --- a/compiler/testData/ir/irText/classes/overriddenEquals.kt.txt +++ b/compiler/testData/ir/irText/classes/overriddenEquals.kt.txt @@ -11,9 +11,6 @@ open class Base { } -interface I { -} - class Child1 : Base, I { constructor() /* primary */ { super/*Base*/() @@ -23,7 +20,7 @@ class Child1 : Base, I { } -class Child2 : I, Base { +class Child2 : Base, I { constructor() /* primary */ { super/*Base*/() /* () */ @@ -31,3 +28,7 @@ class Child2 : I, Base { } } + +interface I { +} + diff --git a/compiler/testData/ir/irText/classes/primaryConstructor.ir.txt b/compiler/testData/ir/irText/classes/primaryConstructor.ir.txt index 9fa3343ff3b..d15a3b94d38 100644 --- a/compiler/testData/ir/irText/classes/primaryConstructor.ir.txt +++ b/compiler/testData/ir/irText/classes/primaryConstructor.ir.txt @@ -1,12 +1,6 @@ FILE fqName: fileName:/primaryConstructor.kt CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Test1 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -29,6 +23,12 @@ FILE fqName: fileName:/primaryConstructor.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -44,12 +44,6 @@ FILE fqName: fileName:/primaryConstructor.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Test2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:y visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -72,6 +66,12 @@ FILE fqName: fileName:/primaryConstructor.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test2' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -87,12 +87,6 @@ FILE fqName: fileName:/primaryConstructor.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Test3 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:y visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -118,6 +112,12 @@ FILE fqName: fileName:/primaryConstructor.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .Test3 declared in .Test3' type=.Test3 origin=null value: GET_VAR 'x: kotlin.Int declared in .Test3.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Test3 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/primaryConstructor.kt.txt b/compiler/testData/ir/irText/classes/primaryConstructor.kt.txt index f425e7236fa..fa0488fffdc 100644 --- a/compiler/testData/ir/irText/classes/primaryConstructor.kt.txt +++ b/compiler/testData/ir/irText/classes/primaryConstructor.kt.txt @@ -1,10 +1,4 @@ class Test1 { - constructor(x: Int, y: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x get @@ -13,15 +7,15 @@ class Test1 { field = y get + constructor(x: Int, y: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + } class Test2 { - constructor(x: Int, y: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val y: Int field = y get @@ -30,15 +24,15 @@ class Test2 { field = x get -} - -class Test3 { constructor(x: Int, y: Int) /* primary */ { super/*Any*/() /* () */ } +} + +class Test3 { val y: Int field = y get @@ -50,4 +44,11 @@ class Test3 { .#x = x } + constructor(x: Int, y: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.ir.txt b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.ir.txt index 716e095a425..31a30ab4586 100644 --- a/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.ir.txt +++ b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.ir.txt @@ -18,25 +18,6 @@ FILE fqName: fileName:/primaryConstructorWithSuperConstructorCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:TestImplicitPrimaryConstructor modality:FINAL visibility:public superTypes:[.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestImplicitPrimaryConstructor - CONSTRUCTOR visibility:public <> () returnType:.TestImplicitPrimaryConstructor [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestImplicitPrimaryConstructor modality:FINAL visibility:public superTypes:[.Base]' - 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 .Base - $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 .Base - $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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestExplicitPrimaryConstructor modality:FINAL visibility:public superTypes:[.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestExplicitPrimaryConstructor CONSTRUCTOR visibility:public <> () returnType:.TestExplicitPrimaryConstructor [primary] @@ -56,14 +37,27 @@ FILE fqName: fileName:/primaryConstructorWithSuperConstructorCall.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:TestWithDelegatingConstructor modality:FINAL visibility:public superTypes:[.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestWithDelegatingConstructor - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.TestWithDelegatingConstructor [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int + CLASS CLASS name:TestImplicitPrimaryConstructor modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestImplicitPrimaryConstructor + CONSTRUCTOR visibility:public <> () returnType:.TestImplicitPrimaryConstructor [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestWithDelegatingConstructor modality:FINAL visibility:public superTypes:[.Base]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestImplicitPrimaryConstructor modality:FINAL visibility:public superTypes:[.Base]' + 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 .Base + $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 .Base + $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 .Base + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestWithDelegatingConstructor modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestWithDelegatingConstructor PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -92,6 +86,12 @@ FILE fqName: fileName:/primaryConstructorWithSuperConstructorCall.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int) declared in .TestWithDelegatingConstructor' x: GET_VAR 'x: kotlin.Int declared in .TestWithDelegatingConstructor.' type=kotlin.Int origin=null y: CONST Int type=kotlin.Int value=0 + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.TestWithDelegatingConstructor [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestWithDelegatingConstructor modality:FINAL visibility:public superTypes:[.Base]' 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 .Base diff --git a/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.kt.txt b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.kt.txt index ad72db20377..54f03fdd202 100644 --- a/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.kt.txt +++ b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.kt.txt @@ -7,15 +7,6 @@ open class Base { } -class TestImplicitPrimaryConstructor : Base { - constructor() /* primary */ { - super/*Base*/() - /* () */ - - } - -} - class TestExplicitPrimaryConstructor : Base { constructor() /* primary */ { super/*Base*/() @@ -25,13 +16,16 @@ class TestExplicitPrimaryConstructor : Base { } -class TestWithDelegatingConstructor : Base { - constructor(x: Int, y: Int) /* primary */ { +class TestImplicitPrimaryConstructor : Base { + constructor() /* primary */ { super/*Base*/() /* () */ } +} + +class TestWithDelegatingConstructor : Base { val x: Int field = x get @@ -44,4 +38,11 @@ class TestWithDelegatingConstructor : Base { this/*TestWithDelegatingConstructor*/(x = x, y = 0) } + constructor(x: Int, y: Int) /* primary */ { + super/*Base*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/classes/privateInterface.ir.txt b/compiler/testData/ir/irText/classes/privateInterface.ir.txt index c050077d6e9..ef39d9391b9 100644 --- a/compiler/testData/ir/irText/classes/privateInterface.ir.txt +++ b/compiler/testData/ir/irText/classes/privateInterface.ir.txt @@ -1,69 +1,10 @@ FILE fqName: fileName:/privateInterface.kt - CLASS INTERFACE name:I modality:ABSTRACT visibility:private superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I - FUN name:fooString visibility:public modality:ABSTRACT <> ($this:.I) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.I - FUN name:barString visibility:public modality:OPEN <> ($this:.I) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.I - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun barString (): kotlin.String declared in .I' - CONST String type=kotlin.String value="bar@I" - FUN name:bazString visibility:public modality:OPEN <> ($this:.I) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.I - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun bazString (): kotlin.String declared in .I' - CONST String type=kotlin.String value="baz@I" - FUN name:fooUnit visibility:public modality:ABSTRACT <> ($this:.I) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.I - FUN name:barUnit visibility:public modality:OPEN <> ($this:.I) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.I - BLOCK_BODY - FUN name:bazUnit visibility:public modality:OPEN <> ($this:.I) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.I - BLOCK_BODY - 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: 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 CLASS CLASS name:C1 modality:OPEN visibility:public superTypes:[.I] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C1 CONSTRUCTOR visibility:public <> () returnType:.C1 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C1 modality:OPEN visibility:public superTypes:[.I]' - FUN name:fooString visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.String - overridden: - public abstract fun fooString (): kotlin.String declared in .I - $this: VALUE_PARAMETER name: type:.C1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun fooString (): kotlin.String declared in .C1' - CONST String type=kotlin.String value="foo@C1" - FUN name:barString visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.String - overridden: - public open fun barString (): kotlin.String declared in .I - $this: VALUE_PARAMETER name: type:.C1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun barString (): kotlin.String declared in .C1' - CONST String type=kotlin.String value="bar@C1" - FUN name:fooUnit visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.Unit - overridden: - public abstract fun fooUnit (): kotlin.Unit declared in .I - $this: VALUE_PARAMETER name: type:.C1 - BLOCK_BODY - FUN name:barUnit visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.Unit - overridden: - public open fun barUnit (): kotlin.Unit declared in .I - $this: VALUE_PARAMETER name: type:.C1 - BLOCK_BODY FUN FAKE_OVERRIDE name:bazString visibility:public modality:OPEN <> ($this:.I) returnType:kotlin.String [fake_override] overridden: public open fun bazString (): kotlin.String declared in .I @@ -85,24 +26,40 @@ FILE fqName: fileName:/privateInterface.kt overridden: public open fun toString (): kotlin.String declared in .I $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:barString visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.String + overridden: + public open fun barString (): kotlin.String declared in .I + $this: VALUE_PARAMETER name: type:.C1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun barString (): kotlin.String declared in .C1' + CONST String type=kotlin.String value="bar@C1" + FUN name:barUnit visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.Unit + overridden: + public open fun barUnit (): kotlin.Unit declared in .I + $this: VALUE_PARAMETER name: type:.C1 + BLOCK_BODY + FUN name:fooString visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.String + overridden: + public abstract fun fooString (): kotlin.String declared in .I + $this: VALUE_PARAMETER name: type:.C1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun fooString (): kotlin.String declared in .C1' + CONST String type=kotlin.String value="foo@C1" + FUN name:fooUnit visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.Unit + overridden: + public abstract fun fooUnit (): kotlin.Unit declared in .I + $this: VALUE_PARAMETER name: type:.C1 + BLOCK_BODY CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.C1] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C2 CONSTRUCTOR visibility:public <> () returnType:.C2 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .C1' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.C1]' - FUN FAKE_OVERRIDE name:fooString visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.String [fake_override] - overridden: - public open fun fooString (): kotlin.String declared in .C1 - $this: VALUE_PARAMETER name: type:.C1 FUN FAKE_OVERRIDE name:barString visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.String [fake_override] overridden: public open fun barString (): kotlin.String declared in .C1 $this: VALUE_PARAMETER name: type:.C1 - FUN FAKE_OVERRIDE name:fooUnit visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.Unit [fake_override] - overridden: - public open fun fooUnit (): kotlin.Unit declared in .C1 - $this: VALUE_PARAMETER name: type:.C1 FUN FAKE_OVERRIDE name:barUnit visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.Unit [fake_override] overridden: public open fun barUnit (): kotlin.Unit declared in .C1 @@ -120,6 +77,14 @@ FILE fqName: fileName:/privateInterface.kt public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .C1 $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:fooString visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.String [fake_override] + overridden: + public open fun fooString (): kotlin.String declared in .C1 + $this: VALUE_PARAMETER name: type:.C1 + FUN FAKE_OVERRIDE name:fooUnit visibility:public modality:OPEN <> ($this:.C1) returnType:kotlin.Unit [fake_override] + overridden: + public open fun fooUnit (): kotlin.Unit declared in .C1 + $this: VALUE_PARAMETER name: type:.C1 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 .C1 @@ -128,3 +93,38 @@ FILE fqName: fileName:/privateInterface.kt overridden: public open fun toString (): kotlin.String declared in .C1 $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:I modality:ABSTRACT visibility:private superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I + 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: 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:barString visibility:public modality:OPEN <> ($this:.I) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.I + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun barString (): kotlin.String declared in .I' + CONST String type=kotlin.String value="bar@I" + FUN name:barUnit visibility:public modality:OPEN <> ($this:.I) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.I + BLOCK_BODY + FUN name:bazString visibility:public modality:OPEN <> ($this:.I) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.I + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun bazString (): kotlin.String declared in .I' + CONST String type=kotlin.String value="baz@I" + FUN name:bazUnit visibility:public modality:OPEN <> ($this:.I) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.I + BLOCK_BODY + FUN name:fooString visibility:public modality:ABSTRACT <> ($this:.I) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.I + FUN name:fooUnit visibility:public modality:ABSTRACT <> ($this:.I) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.I diff --git a/compiler/testData/ir/irText/classes/privateInterface.kt.txt b/compiler/testData/ir/irText/classes/privateInterface.kt.txt index a8707ce3a02..7d300d6602f 100644 --- a/compiler/testData/ir/irText/classes/privateInterface.kt.txt +++ b/compiler/testData/ir/irText/classes/privateInterface.kt.txt @@ -1,24 +1,3 @@ -private interface I { - abstract fun fooString(): String - - fun barString(): String { - return "bar@I" - } - - fun bazString(): String { - return "baz@I" - } - - abstract fun fooUnit() - - fun barUnit() { - } - - fun bazUnit() { - } - -} - open class C1 : I { constructor() /* primary */ { super/*Any*/() @@ -26,18 +5,18 @@ open class C1 : I { } - override fun fooString(): String { - return "foo@C1" - } - override fun barString(): String { return "bar@C1" } - override fun fooUnit() { + override fun barUnit() { } - override fun barUnit() { + override fun fooString(): String { + return "foo@C1" + } + + override fun fooUnit() { } } @@ -51,3 +30,24 @@ class C2 : C1 { } +private interface I { + fun barString(): String { + return "bar@I" + } + + fun barUnit() { + } + + fun bazString(): String { + return "baz@I" + } + + fun bazUnit() { + } + + abstract fun fooString(): String + + abstract fun fooUnit() + +} + diff --git a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.ir.txt b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.ir.txt index 99d5f5826b0..2d8f44a9c6d 100644 --- a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.ir.txt +++ b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.ir.txt @@ -1,60 +1,26 @@ FILE fqName: fileName:/qualifiedSuperCalls.kt - CLASS INTERFACE name:ILeft modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ILeft - FUN name:foo visibility:public modality:OPEN <> ($this:.ILeft) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.ILeft - BLOCK_BODY - PROPERTY name:bar visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN <> ($this:.ILeft) returnType:kotlin.Int - correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.ILeft - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .ILeft' - CONST Int type=kotlin.Int value=1 - 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: 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 - CLASS INTERFACE name:IRight modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IRight - FUN name:foo visibility:public modality:OPEN <> ($this:.IRight) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IRight - BLOCK_BODY - PROPERTY name:bar visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN <> ($this:.IRight) returnType:kotlin.Int - correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.IRight - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .IRight' - CONST Int type=kotlin.Int value=2 - 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: 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 CLASS CLASS name:CBoth modality:FINAL visibility:public superTypes:[.ILeft; .IRight] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CBoth CONSTRUCTOR visibility:public <> () returnType:.CBoth [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CBoth modality:FINAL visibility:public superTypes:[.ILeft; .IRight]' + 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 .ILeft + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IRight + $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 .ILeft + public open fun hashCode (): kotlin.Int declared in .IRight + $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 .ILeft + public open fun toString (): kotlin.String declared in .IRight + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:foo visibility:public modality:OPEN <> ($this:.CBoth) returnType:kotlin.Unit overridden: public open fun foo (): kotlin.Unit declared in .ILeft @@ -82,19 +48,53 @@ FILE fqName: fileName:/qualifiedSuperCalls.kt $this: GET_VAR ': .CBoth declared in .CBoth.' type=.CBoth origin=null other: CALL 'public open fun (): kotlin.Int declared in .IRight' superQualifier='CLASS INTERFACE name:IRight modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .CBoth declared in .CBoth.' type=.CBoth origin=null + CLASS INTERFACE name:ILeft modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ILeft 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 .ILeft - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IRight + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .ILeft - public open fun hashCode (): kotlin.Int declared in .IRight + 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 .ILeft - public open fun toString (): kotlin.String declared in .IRight + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.ILeft) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.ILeft + BLOCK_BODY + PROPERTY name:bar visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.ILeft) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.ILeft + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .ILeft' + CONST Int type=kotlin.Int value=1 + CLASS INTERFACE name:IRight modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IRight + 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: 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:foo visibility:public modality:OPEN <> ($this:.IRight) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IRight + BLOCK_BODY + PROPERTY name:bar visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.IRight) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.IRight + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .IRight' + CONST Int type=kotlin.Int value=2 diff --git a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.kt.txt b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.kt.txt index 9f8f0e4a10d..ac540352159 100644 --- a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.kt.txt +++ b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.kt.txt @@ -1,3 +1,22 @@ +class CBoth : ILeft, IRight { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override fun foo() { + super.foo() + super.foo() + } + + override val bar: Int + override get(): Int { + return super.().plus(other = super.()) + } + +} + interface ILeft { fun foo() { } @@ -20,22 +39,3 @@ interface IRight { } -class CBoth : ILeft, IRight { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun foo() { - super.foo() - super.foo() - } - - override val bar: Int - override get(): Int { - return super.().plus(other = super.()) - } - -} - diff --git a/compiler/testData/ir/irText/classes/sealedClasses.ir.txt b/compiler/testData/ir/irText/classes/sealedClasses.ir.txt index 2903330fbf9..06fbe3258bf 100644 --- a/compiler/testData/ir/irText/classes/sealedClasses.ir.txt +++ b/compiler/testData/ir/irText/classes/sealedClasses.ir.txt @@ -5,17 +5,8 @@ FILE fqName: fileName:/sealedClasses.kt CLASS OBJECT name:NotANumber modality:FINAL visibility:public superTypes:[.Expr] CLASS CLASS name:Sum modality:FINAL visibility:public superTypes:[.Expr] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expr - CONSTRUCTOR visibility:protected <> () returnType:.Expr [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Expr modality:SEALED visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Const modality:FINAL visibility:public superTypes:[.Expr] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expr.Const - CONSTRUCTOR visibility:public <> (number:kotlin.Double) returnType:.Expr.Const [primary] - VALUE_PARAMETER name:number index:0 type:kotlin.Double - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .Expr' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Const modality:FINAL visibility:public superTypes:[.Expr]' PROPERTY name:number visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:number type:kotlin.Double visibility:private [final] EXPRESSION_BODY @@ -27,6 +18,11 @@ FILE fqName: fileName:/sealedClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Double declared in .Expr.Const' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:number type:kotlin.Double visibility:private [final]' type=kotlin.Double origin=null receiver: GET_VAR ': .Expr.Const declared in .Expr.Const.' type=.Expr.Const origin=null + CONSTRUCTOR visibility:public <> (number:kotlin.Double) returnType:.Expr.Const [primary] + VALUE_PARAMETER name:number index:0 type:kotlin.Double + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .Expr' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Const modality:FINAL visibility:public superTypes:[.Expr]' 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 .Expr @@ -42,12 +38,6 @@ FILE fqName: fileName:/sealedClasses.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Sum modality:FINAL visibility:public superTypes:[.Expr] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expr.Sum - CONSTRUCTOR visibility:public <> (e1:.Expr, e2:.Expr) returnType:.Expr.Sum [primary] - VALUE_PARAMETER name:e1 index:0 type:.Expr - VALUE_PARAMETER name:e2 index:1 type:.Expr - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .Expr' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Sum modality:FINAL visibility:public superTypes:[.Expr]' PROPERTY name:e1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:e1 type:.Expr visibility:private [final] EXPRESSION_BODY @@ -70,6 +60,12 @@ FILE fqName: fileName:/sealedClasses.kt RETURN type=kotlin.Nothing from='public final fun (): .Expr declared in .Expr.Sum' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:e2 type:.Expr visibility:private [final]' type=.Expr origin=null receiver: GET_VAR ': .Expr.Sum declared in .Expr.Sum.' type=.Expr.Sum origin=null + CONSTRUCTOR visibility:public <> (e1:.Expr, e2:.Expr) returnType:.Expr.Sum [primary] + VALUE_PARAMETER name:e1 index:0 type:.Expr + VALUE_PARAMETER name:e2 index:1 type:.Expr + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .Expr' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Sum modality:FINAL visibility:public superTypes:[.Expr]' 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 .Expr @@ -102,6 +98,10 @@ FILE fqName: fileName:/sealedClasses.kt overridden: public open fun toString (): kotlin.String declared in .Expr $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:protected <> () returnType:.Expr [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Expr modality:SEALED visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/sealedClasses.kt.txt b/compiler/testData/ir/irText/classes/sealedClasses.kt.txt index 4bb99510fdf..ba063e5afd8 100644 --- a/compiler/testData/ir/irText/classes/sealedClasses.kt.txt +++ b/compiler/testData/ir/irText/classes/sealedClasses.kt.txt @@ -1,30 +1,18 @@ sealed class Expr { - protected constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - class Const : Expr { + val number: Double + field = number + get + constructor(number: Double) /* primary */ { super/*Expr*/() /* () */ } - val number: Double - field = number - get - } class Sum : Expr { - constructor(e1: Expr, e2: Expr) /* primary */ { - super/*Expr*/() - /* () */ - - } - val e1: Expr field = e1 get @@ -33,6 +21,12 @@ sealed class Expr { field = e2 get + constructor(e1: Expr, e2: Expr) /* primary */ { + super/*Expr*/() + /* () */ + + } + } object NotANumber : Expr { @@ -44,4 +38,11 @@ sealed class Expr { } + protected constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.ir.txt b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.ir.txt index 0b408da3700..ca624c3f292 100644 --- a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.ir.txt +++ b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.ir.txt @@ -18,6 +18,48 @@ FILE fqName: fileName:/secondaryConstructorWithInitializersFromClassBody.k overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestInitBlock modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitBlock + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitBlock) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestInitBlock + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitBlock' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestInitBlock declared in .TestInitBlock.' type=.TestInitBlock origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .TestInitBlock declared in .TestInitBlock' type=.TestInitBlock origin=null + value: CONST Int type=kotlin.Int value=0 + CONSTRUCTOR visibility:public <> () returnType:.TestInitBlock + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitBlock modality:FINAL visibility:public superTypes:[.Base]' + CONSTRUCTOR visibility:public <> (y:kotlin.Int) returnType:.TestInitBlock + VALUE_PARAMETER name:y index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .TestInitBlock' + CONSTRUCTOR visibility:public <> (z:kotlin.Any) returnType:.TestInitBlock + VALUE_PARAMETER name:z index:0 type:kotlin.Any + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitBlock modality:FINAL visibility:public superTypes:[.Base]' + 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 .Base + $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 .Base + $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 .Base + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestProperty modality:FINAL visibility:public superTypes:[.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestProperty PROPERTY name:x visibility:public modality:FINAL [val] @@ -48,45 +90,3 @@ FILE fqName: fileName:/secondaryConstructorWithInitializersFromClassBody.k overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:TestInitBlock modality:FINAL visibility:public superTypes:[.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitBlock - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitBlock) returnType:kotlin.Int - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.TestInitBlock - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitBlock' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .TestInitBlock declared in .TestInitBlock.' type=.TestInitBlock origin=null - ANONYMOUS_INITIALIZER isStatic=false - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null - receiver: GET_VAR ': .TestInitBlock declared in .TestInitBlock' type=.TestInitBlock origin=null - value: CONST Int type=kotlin.Int value=0 - CONSTRUCTOR visibility:public <> () returnType:.TestInitBlock - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitBlock modality:FINAL visibility:public superTypes:[.Base]' - CONSTRUCTOR visibility:public <> (z:kotlin.Any) returnType:.TestInitBlock - VALUE_PARAMETER name:z index:0 type:kotlin.Any - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitBlock modality:FINAL visibility:public superTypes:[.Base]' - CONSTRUCTOR visibility:public <> (y:kotlin.Int) returnType:.TestInitBlock - VALUE_PARAMETER name:y index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .TestInitBlock' - 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 .Base - $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 .Base - $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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.kt.txt b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.kt.txt index 997168e114f..5ef3231949a 100644 --- a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.kt.txt +++ b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.kt.txt @@ -7,19 +7,6 @@ open class Base { } -class TestProperty : Base { - val x: Int - field = 0 - get - - constructor() { - super/*Base*/() - /* () */ - - } - -} - class TestInitBlock : Base { val x: Int get @@ -34,14 +21,28 @@ class TestInitBlock : Base { } + constructor(y: Int) { + this/*TestInitBlock*/() + } + constructor(z: Any) { super/*Base*/() /* () */ } - constructor(y: Int) { - this/*TestInitBlock*/() +} + +class TestProperty : Base { + val x: Int + field = 0 + get + + constructor() { + super/*Base*/() + /* () */ + } } + diff --git a/compiler/testData/ir/irText/classes/smartCastInValInitialization.ir.txt b/compiler/testData/ir/irText/classes/smartCastInValInitialization.ir.txt index 5bf91e7f820..7e5212d2d59 100644 --- a/compiler/testData/ir/irText/classes/smartCastInValInitialization.ir.txt +++ b/compiler/testData/ir/irText/classes/smartCastInValInitialization.ir.txt @@ -1,37 +1,6 @@ FILE fqName: fileName:/smartCastInValInitialization.kt - CLASS CLASS name:RootBus modality:FINAL visibility:public superTypes:[.MessageBusImpl] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.RootBus - CONSTRUCTOR visibility:public <> () returnType:.RootBus [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .MessageBusImpl' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:RootBus modality:FINAL visibility:public superTypes:[.MessageBusImpl]' - PROPERTY FAKE_OVERRIDE name:parentBus visibility:public modality:FINAL [fake_override,val] - overridden: - public final parentBus: kotlin.Any? - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.MessageBusImpl) returnType:kotlin.Any? [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:parentBus visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Any? declared in .MessageBusImpl - $this: VALUE_PARAMETER name: type:.MessageBusImpl - 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 .MessageBusImpl - $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 .MessageBusImpl - $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 .MessageBusImpl - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:MessageBusImpl modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MessageBusImpl - CONSTRUCTOR visibility:public <> () returnType:.MessageBusImpl [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MessageBusImpl modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:parentBus visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:parentBus type:kotlin.Any? visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MessageBusImpl) returnType:kotlin.Any? @@ -49,6 +18,10 @@ FILE fqName: fileName:/smartCastInValInitialization.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:parentBus type:kotlin.Any? visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .MessageBusImpl declared in .MessageBusImpl' type=.MessageBusImpl origin=null value: CONST Null type=kotlin.Nothing? value=null + CONSTRUCTOR visibility:public <> () returnType:.MessageBusImpl [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MessageBusImpl modality:OPEN visibility:public 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 declared in kotlin.Any @@ -62,3 +35,30 @@ FILE fqName: fileName:/smartCastInValInitialization.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:RootBus modality:FINAL visibility:public superTypes:[.MessageBusImpl] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.RootBus + CONSTRUCTOR visibility:public <> () returnType:.RootBus [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .MessageBusImpl' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:RootBus modality:FINAL visibility:public superTypes:[.MessageBusImpl]' + 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 .MessageBusImpl + $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 .MessageBusImpl + $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 .MessageBusImpl + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:parentBus visibility:public modality:FINAL [fake_override,val] + overridden: + public final parentBus: kotlin.Any? + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.MessageBusImpl) returnType:kotlin.Any? [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:parentBus visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Any? declared in .MessageBusImpl + $this: VALUE_PARAMETER name: type:.MessageBusImpl diff --git a/compiler/testData/ir/irText/classes/smartCastInValInitialization.kt.txt b/compiler/testData/ir/irText/classes/smartCastInValInitialization.kt.txt index 8e3bee2904b..68958e74e83 100644 --- a/compiler/testData/ir/irText/classes/smartCastInValInitialization.kt.txt +++ b/compiler/testData/ir/irText/classes/smartCastInValInitialization.kt.txt @@ -1,3 +1,20 @@ +open class MessageBusImpl { + val parentBus: Any? + get + + init { + as RootBus /*~> Unit */ + .#parentBus = null + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + class RootBus : MessageBusImpl { constructor() /* primary */ { super/*MessageBusImpl*/() @@ -7,19 +24,3 @@ class RootBus : MessageBusImpl { } -open class MessageBusImpl { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - val parentBus: Any? - get - - init { - as RootBus /*~> Unit */ - .#parentBus = null - } - -} diff --git a/compiler/testData/ir/irText/classes/superCalls.ir.txt b/compiler/testData/ir/irText/classes/superCalls.ir.txt index 8ee456b922b..17ae1eb8ad2 100644 --- a/compiler/testData/ir/irText/classes/superCalls.ir.txt +++ b/compiler/testData/ir/irText/classes/superCalls.ir.txt @@ -1,13 +1,6 @@ FILE fqName: fileName:/superCalls.kt CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base - CONSTRUCTOR visibility:public <> () returnType:.Base [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Base - BLOCK_BODY PROPERTY name:bar visibility:public modality:OPEN [val] FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -19,14 +12,10 @@ FILE fqName: fileName:/superCalls.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Base' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null - FUN name:hashCode visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Base + CONSTRUCTOR visibility:public <> () returnType:.Base [primary] BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Base' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' superQualifier='CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public superTypes:[]' type=kotlin.Int origin=null - $this: GET_VAR ': .Base declared in .Base.hashCode' type=.Base origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public 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 declared in kotlin.Any @@ -36,12 +25,36 @@ FILE fqName: fileName:/superCalls.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Base + BLOCK_BODY + FUN name:hashCode visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Base' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' superQualifier='CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public superTypes:[]' type=kotlin.Int origin=null + $this: GET_VAR ': .Base declared in .Base.hashCode' type=.Base origin=null CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base]' + 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 .Base + $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:.Base) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Base + 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 .Base + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:foo visibility:public modality:OPEN <> ($this:.Derived) returnType:kotlin.Unit overridden: public open fun foo (): kotlin.Unit declared in .Base @@ -61,16 +74,3 @@ FILE fqName: fileName:/superCalls.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Derived' CALL 'public open fun (): kotlin.String declared in .Base' superQualifier='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR ': .Derived declared in .Derived.' type=.Derived origin=null - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .Base - $this: VALUE_PARAMETER name: type:.Base - 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 .Base - $this: VALUE_PARAMETER name: 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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/superCalls.kt.txt b/compiler/testData/ir/irText/classes/superCalls.kt.txt index 86199dfb8ae..2aa9c8aafef 100644 --- a/compiler/testData/ir/irText/classes/superCalls.kt.txt +++ b/compiler/testData/ir/irText/classes/superCalls.kt.txt @@ -1,4 +1,8 @@ open class Base { + open val bar: String + field = "" + open get + constructor() /* primary */ { super/*Any*/() /* () */ @@ -8,10 +12,6 @@ open class Base { open fun foo() { } - open val bar: String - field = "" - open get - override fun hashCode(): Int { return super.hashCode() } diff --git a/compiler/testData/ir/irText/classes/superCallsComposed.ir.txt b/compiler/testData/ir/irText/classes/superCallsComposed.ir.txt index 6ba80f03339..c1f937c3b43 100644 --- a/compiler/testData/ir/irText/classes/superCallsComposed.ir.txt +++ b/compiler/testData/ir/irText/classes/superCallsComposed.ir.txt @@ -1,13 +1,6 @@ FILE fqName: fileName:/superCallsComposed.kt CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base - CONSTRUCTOR visibility:public <> () returnType:.Base [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Base - BLOCK_BODY PROPERTY name:bar visibility:public modality:OPEN [val] FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -19,6 +12,10 @@ FILE fqName: fileName:/superCallsComposed.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Base' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null + CONSTRUCTOR visibility:public <> () returnType:.Base [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public 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 declared in kotlin.Any @@ -32,33 +29,31 @@ FILE fqName: fileName:/superCallsComposed.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:BaseI modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseI - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.BaseI) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.BaseI - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.BaseI) returnType:kotlin.String - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.BaseI - 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: 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:foo visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Base + BLOCK_BODY CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base; .BaseI] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base; .BaseI]' + 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 .Base + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .BaseI + $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 .Base + public open fun hashCode (): kotlin.Int declared in .BaseI + $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 .Base + public open fun toString (): kotlin.String declared in .BaseI + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:foo visibility:public modality:OPEN <> ($this:.Derived) returnType:kotlin.Unit overridden: public open fun foo (): kotlin.Unit declared in .Base @@ -81,19 +76,24 @@ FILE fqName: fileName:/superCallsComposed.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Derived' CALL 'public open fun (): kotlin.String declared in .Base' superQualifier='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR ': .Derived declared in .Derived.' type=.Derived origin=null + CLASS INTERFACE name:BaseI modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseI 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 .Base - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .BaseI + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .Base - public open fun hashCode (): kotlin.Int declared in .BaseI + 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 .Base - public open fun toString (): kotlin.String declared in .BaseI + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.BaseI) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.BaseI + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.BaseI) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.BaseI diff --git a/compiler/testData/ir/irText/classes/superCallsComposed.kt.txt b/compiler/testData/ir/irText/classes/superCallsComposed.kt.txt index 46a30848d50..84473103253 100644 --- a/compiler/testData/ir/irText/classes/superCallsComposed.kt.txt +++ b/compiler/testData/ir/irText/classes/superCallsComposed.kt.txt @@ -1,4 +1,8 @@ open class Base { + open val bar: String + field = "" + open get + constructor() /* primary */ { super/*Any*/() /* () */ @@ -8,18 +12,6 @@ open class Base { open fun foo() { } - open val bar: String - field = "" - open get - -} - -interface BaseI { - abstract fun foo() - - abstract val bar: String - abstract get - } class Derived : Base, BaseI { @@ -40,3 +32,11 @@ class Derived : Base, BaseI { } +interface BaseI { + abstract fun foo() + + abstract val bar: String + abstract get + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationOnClassWithInitializer.ir.txt b/compiler/testData/ir/irText/declarations/annotations/annotationOnClassWithInitializer.ir.txt index ccf494c84d6..e30b3a7a51d 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationOnClassWithInitializer.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationOnClassWithInitializer.ir.txt @@ -22,14 +22,14 @@ FILE fqName: fileName:/annotationOnClassWithInitializer.kt annotations: SomeAnn $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.My - CONSTRUCTOR visibility:public <> () returnType:.My [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:My modality:FINAL visibility:public superTypes:[kotlin.Any]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY VAR name:x type:kotlin.Int [val] CONST Int type=kotlin.Int value=1 + CONSTRUCTOR visibility:public <> () returnType:.My [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:My modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationOnClassWithInitializer.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationOnClassWithInitializer.kt.txt index 6495ca8f2b5..d5dea5b4d4b 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationOnClassWithInitializer.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationOnClassWithInitializer.kt.txt @@ -9,14 +9,15 @@ open annotation class SomeAnn : Annotation { @SomeAnn class My { + init { + val x: Int = 1 + } + constructor() /* primary */ { super/*Any*/() /* () */ } - init { - val x: Int = 1 - } - } + diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.ir.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.ir.txt index d172de1239d..6db52a4f34c 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/annotationsInAnnotationArguments.kt CLASS ANNOTATION_CLASS name:A1 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A1 - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.A1 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A1 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/annotationsInAnnotationArguments.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A1 declared in .A1.' type=.A1 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.A1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A1 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 declared in kotlin.Annotation @@ -32,11 +32,6 @@ FILE fqName: fileName:/annotationsInAnnotationArguments.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:A2 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A2 - CONSTRUCTOR visibility:public <> (a:.A1) returnType:.A2 [primary] - VALUE_PARAMETER name:a index:0 type:.A1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A2 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:.A1 visibility:private [final] EXPRESSION_BODY @@ -48,6 +43,11 @@ FILE fqName: fileName:/annotationsInAnnotationArguments.kt RETURN type=kotlin.Nothing from='public final fun (): .A1 declared in .A2' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:.A1 visibility:private [final]' type=.A1 origin=null receiver: GET_VAR ': .A2 declared in .A2.' type=.A2 origin=null + CONSTRUCTOR visibility:public <> (a:.A1) returnType:.A2 [primary] + VALUE_PARAMETER name:a index:0 type:.A1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A2 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 declared in kotlin.Annotation @@ -63,11 +63,6 @@ FILE fqName: fileName:/annotationsInAnnotationArguments.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:AA modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AA - CONSTRUCTOR visibility:public <> (xs:kotlin.Array<.A1>) returnType:.AA [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.Array<.A1> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:AA modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<.A1> visibility:private [final] EXPRESSION_BODY @@ -79,6 +74,11 @@ FILE fqName: fileName:/annotationsInAnnotationArguments.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array<.A1> declared in .AA' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<.A1> visibility:private [final]' type=kotlin.Array<.A1> origin=null receiver: GET_VAR ': .AA declared in .AA.' type=.AA origin=null + CONSTRUCTOR visibility:public <> (xs:kotlin.Array<.A1>) returnType:.AA [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.Array<.A1> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:AA 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.kt.txt index c07cfe3b1de..6ee518fdcc8 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.kt.txt @@ -1,43 +1,44 @@ open annotation class A1 : Annotation { + val x: Int + field = x + get + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } - val x: Int - field = x - get - } open annotation class A2 : Annotation { + val a: A1 + field = a + get + constructor(a: A1) /* primary */ { super/*Any*/() /* () */ } - val a: A1 - field = a - get - } open annotation class AA : Annotation { + val xs: Array + field = xs + get + constructor(xs: Array) /* primary */ { super/*Any*/() /* () */ } - val xs: Array - field = xs - get - } @A2(a = A1(x = 42)) @AA(xs = [A1(x = 1), A1(x = 2)]) fun test() { } + diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.ir.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.ir.txt deleted file mode 100644 index b4c3f5e4f0a..00000000000 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.ir.txt +++ /dev/null @@ -1,130 +0,0 @@ -FILE fqName: fileName:/annotationsOnDelegatedMembers.kt - CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann - CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - PROPERTY name:testVal visibility:public modality:ABSTRACT [val] - annotations: - Ann - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.String - correspondingProperty: PROPERTY name:testVal visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IFoo - FUN name:testFun visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit - annotations: - Ann - $this: VALUE_PARAMETER name: type:.IFoo - PROPERTY name:testExtVal visibility:public modality:ABSTRACT [val] - annotations: - Ann - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String - correspondingProperty: PROPERTY name:testExtVal visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IFoo - $receiver: VALUE_PARAMETER name: type:kotlin.String - FUN name:testExtFun visibility:public modality:ABSTRACT <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.Unit - annotations: - Ann - $this: VALUE_PARAMETER name: type:.IFoo - $receiver: VALUE_PARAMETER name: type:kotlin.String - 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: 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 - CLASS CLASS name:DFoo modality:FINAL visibility:public superTypes:[.IFoo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DFoo - CONSTRUCTOR visibility:public <> (d:.IFoo) returnType:.DFoo [primary] - VALUE_PARAMETER name:d index:0 type:.IFoo - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DFoo modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final] - EXPRESSION_BODY - GET_VAR 'd: .IFoo declared in .DFoo.' type=.IFoo origin=null - FUN DELEGATED_MEMBER name:testFun visibility:public modality:OPEN <> ($this:.DFoo) returnType:kotlin.Unit - annotations: - Ann - overridden: - public abstract fun testFun (): kotlin.Unit declared in .IFoo - $this: VALUE_PARAMETER name: type:.DFoo - BLOCK_BODY - CALL 'public abstract fun testFun (): kotlin.Unit declared in .IFoo' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null - receiver: GET_VAR ': .DFoo declared in .DFoo.testFun' type=.DFoo origin=null - FUN DELEGATED_MEMBER name:testExtFun visibility:public modality:OPEN <> ($this:.DFoo, $receiver:kotlin.String) returnType:kotlin.Unit - annotations: - Ann - overridden: - public abstract fun testExtFun (): kotlin.Unit declared in .IFoo - $this: VALUE_PARAMETER name: type:.DFoo - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - CALL 'public abstract fun testExtFun (): kotlin.Unit declared in .IFoo' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null - receiver: GET_VAR ': .DFoo declared in .DFoo.testExtFun' type=.DFoo origin=null - $receiver: GET_VAR ': kotlin.String declared in .DFoo.testExtFun' type=kotlin.String origin=null - PROPERTY DELEGATED_MEMBER name:testVal visibility:public modality:OPEN [val] - overridden: - public abstract testVal: kotlin.String - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.DFoo) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:testVal visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.DFoo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .DFoo' - CALL 'public abstract fun (): kotlin.String declared in .IFoo' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null - receiver: GET_VAR ': .DFoo declared in .DFoo.' type=.DFoo origin=null - PROPERTY DELEGATED_MEMBER name:testExtVal visibility:public modality:OPEN [val] - overridden: - public abstract testExtVal: kotlin.String - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.DFoo, $receiver:kotlin.String) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:testExtVal visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.DFoo - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .DFoo' - CALL 'public abstract fun (): kotlin.String declared in .IFoo' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null - receiver: GET_VAR ': .DFoo declared in .DFoo.' type=.DFoo origin=null - $receiver: GET_VAR ': kotlin.String declared in .DFoo.' type=kotlin.String 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 .IFoo - $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 .IFoo - $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 .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt deleted file mode 100644 index 9041f2b8f6a..00000000000 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt +++ /dev/null @@ -1,56 +0,0 @@ -open annotation class Ann : Annotation { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -interface IFoo { - @Ann - abstract val testVal: String - abstract get - - @Ann - abstract fun testFun() - - @Ann - abstract val String.testExtVal: String - abstract get - - @Ann - abstract fun String.testExtFun() - -} - -class DFoo : IFoo { - constructor(d: IFoo) /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: IFoo = d - @Ann - override fun testFun() { - .#$$delegate_0.testFun() - } - - @Ann - override fun String.testExtFun() { - (.#$$delegate_0, ).testExtFun() - } - - override val testVal: String - override get(): String { - return .#$$delegate_0.() - } - - override val String.testExtVal: String - override get(): String { - return (.#$$delegate_0, ).() - } - -} - diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.ir.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.ir.txt index e32183ba01d..5cffe76c554 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.ir.txt @@ -18,66 +18,51 @@ FILE fqName: fileName:/annotationsOnDelegatedMembers.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - PROPERTY name:testVal visibility:public modality:ABSTRACT [val] - annotations: - Ann - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.String - correspondingProperty: PROPERTY name:testVal visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IFoo - FUN name:testFun visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit - annotations: - Ann - $this: VALUE_PARAMETER name: type:.IFoo - PROPERTY name:testExtVal visibility:public modality:ABSTRACT [val] - annotations: - Ann - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String - correspondingProperty: PROPERTY name:testExtVal visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IFoo - $receiver: VALUE_PARAMETER name: type:kotlin.String - FUN name:testExtFun visibility:public modality:ABSTRACT <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.Unit - annotations: - Ann - $this: VALUE_PARAMETER name: type:.IFoo - $receiver: VALUE_PARAMETER name: type:kotlin.String - 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: 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 CLASS CLASS name:DFoo modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DFoo + FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final] + EXPRESSION_BODY + GET_VAR 'd: .IFoo declared in .DFoo.' type=.IFoo origin=null CONSTRUCTOR visibility:public <> (d:.IFoo) returnType:.DFoo [primary] VALUE_PARAMETER name:d index:0 type:.IFoo BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DFoo modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final] - EXPRESSION_BODY - GET_VAR 'd: .IFoo declared in .DFoo.' type=.IFoo origin=null - PROPERTY DELEGATED_MEMBER name:testVal visibility:public modality:OPEN [val] + FUN DELEGATED_MEMBER name:testExtFun visibility:public modality:OPEN <> ($this:.DFoo, $receiver:kotlin.String) returnType:kotlin.Unit + annotations: + Ann overridden: - public abstract testVal: kotlin.String - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.DFoo) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:testVal visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.DFoo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .DFoo' - CALL 'public abstract fun (): kotlin.String declared in .IFoo' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null - receiver: GET_VAR ': .DFoo declared in .DFoo.' type=.DFoo origin=null + public abstract fun testExtFun (): kotlin.Unit declared in .IFoo + $this: VALUE_PARAMETER name: type:.DFoo + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + CALL 'public abstract fun testExtFun (): kotlin.Unit declared in .IFoo' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null + receiver: GET_VAR ': .DFoo declared in .DFoo.testExtFun' type=.DFoo origin=null + $receiver: GET_VAR ': kotlin.String declared in .DFoo.testExtFun' type=kotlin.String origin=null + FUN DELEGATED_MEMBER name:testFun visibility:public modality:OPEN <> ($this:.DFoo) returnType:kotlin.Unit + annotations: + Ann + overridden: + public abstract fun testFun (): kotlin.Unit declared in .IFoo + $this: VALUE_PARAMETER name: type:.DFoo + BLOCK_BODY + CALL 'public abstract fun testFun (): kotlin.Unit declared in .IFoo' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null + receiver: GET_VAR ': .DFoo declared in .DFoo.testFun' type=.DFoo 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 .IFoo + $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 .IFoo + $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 .IFoo + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY DELEGATED_MEMBER name:testExtVal visibility:public modality:OPEN [val] overridden: public abstract testExtVal: kotlin.String @@ -93,38 +78,53 @@ FILE fqName: fileName:/annotationsOnDelegatedMembers.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null receiver: GET_VAR ': .DFoo declared in .DFoo.' type=.DFoo origin=null $receiver: GET_VAR ': kotlin.String declared in .DFoo.' type=kotlin.String origin=null - FUN DELEGATED_MEMBER name:testFun visibility:public modality:OPEN <> ($this:.DFoo) returnType:kotlin.Unit - annotations: - Ann + PROPERTY DELEGATED_MEMBER name:testVal visibility:public modality:OPEN [val] overridden: - public abstract fun testFun (): kotlin.Unit declared in .IFoo - $this: VALUE_PARAMETER name: type:.DFoo - BLOCK_BODY - CALL 'public abstract fun testFun (): kotlin.Unit declared in .IFoo' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null - receiver: GET_VAR ': .DFoo declared in .DFoo.testFun' type=.DFoo origin=null - FUN DELEGATED_MEMBER name:testExtFun visibility:public modality:OPEN <> ($this:.DFoo, $receiver:kotlin.String) returnType:kotlin.Unit - annotations: - Ann - overridden: - public abstract fun testExtFun (): kotlin.Unit declared in .IFoo - $this: VALUE_PARAMETER name: type:.DFoo - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - CALL 'public abstract fun testExtFun (): kotlin.Unit declared in .IFoo' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null - receiver: GET_VAR ': .DFoo declared in .DFoo.testExtFun' type=.DFoo origin=null - $receiver: GET_VAR ': kotlin.String declared in .DFoo.testExtFun' type=kotlin.String origin=null + public abstract testVal: kotlin.String + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.DFoo) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:testVal visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.DFoo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .DFoo' + CALL 'public abstract fun (): kotlin.String declared in .IFoo' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null + receiver: GET_VAR ': .DFoo declared in .DFoo.' type=.DFoo origin=null + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo 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 .IFoo + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .IFoo + 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 .IFoo + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testExtFun visibility:public modality:ABSTRACT <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.Unit + annotations: + Ann + $this: VALUE_PARAMETER name: type:.IFoo + $receiver: VALUE_PARAMETER name: type:kotlin.String + FUN name:testFun visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit + annotations: + Ann + $this: VALUE_PARAMETER name: type:.IFoo + PROPERTY name:testExtVal visibility:public modality:ABSTRACT [val] + annotations: + Ann + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String + correspondingProperty: PROPERTY name:testExtVal visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.IFoo + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY name:testVal visibility:public modality:ABSTRACT [val] + annotations: + Ann + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.String + correspondingProperty: PROPERTY name:testVal visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.IFoo diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt index b0f44d19f44..e3587925599 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class Ann interface IFoo { diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt.txt index 337fff72795..163db75b6f8 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt.txt @@ -7,10 +7,39 @@ open annotation class Ann : Annotation { } +class DFoo : IFoo { + private /* final field */ val $$delegate_0: IFoo = d + constructor(d: IFoo) /* primary */ { + super/*Any*/() + /* () */ + + } + + @Ann + override fun String.testExtFun() { + (.#$$delegate_0, ).testExtFun() + } + + @Ann + override fun testFun() { + .#$$delegate_0.testFun() + } + + override val String.testExtVal: String + override get(): String { + return (.#$$delegate_0, ).() + } + + override val testVal: String + override get(): String { + return .#$$delegate_0.() + } + +} + interface IFoo { @Ann - abstract val testVal: String - abstract get + abstract fun String.testExtFun() @Ann abstract fun testFun() @@ -20,36 +49,8 @@ interface IFoo { abstract get @Ann - abstract fun String.testExtFun() + abstract val testVal: String + abstract get } -class DFoo : IFoo { - constructor(d: IFoo) /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: IFoo = d - override val testVal: String - override get(): String { - return .#$$delegate_0.() - } - - override val String.testExtVal: String - override get(): String { - return (.#$$delegate_0, ).() - } - - @Ann - override fun testFun() { - .#$$delegate_0.testFun() - } - - @Ann - override fun String.testExtFun() { - (.#$$delegate_0, ).testExtFun() - } - -} diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.ir.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.ir.txt index 4620372fb9a..4fe545f3a42 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.ir.txt @@ -1,16 +1,6 @@ FILE fqName: fileName:/annotationsWithDefaultParameterValues.kt CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (x:kotlin.String, y:kotlin.Int) returnType:.A [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - VALUE_PARAMETER name:y index:1 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=42 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -33,6 +23,16 @@ FILE fqName: fileName:/annotationsWithDefaultParameterValues.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String, y:kotlin.Int) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + VALUE_PARAMETER name:y index:1 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.kt.txt index 3c5c7b53536..2d45a254755 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.kt.txt @@ -1,10 +1,4 @@ open annotation class A : Annotation { - constructor(x: String = "", y: Int = 42) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: String field = x get @@ -13,6 +7,12 @@ open annotation class A : Annotation { field = y get + constructor(x: String = "", y: Int = 42) /* primary */ { + super/*Any*/() + /* () */ + + } + } @A(x = "abc", y = 123) @@ -34,3 +34,4 @@ fun test4() { @A fun test5() { } + diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.ir.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.ir.txt index ecd6266bbb5..b8bd4883ebf 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/annotationsWithVarargParameters.kt CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (xs:kotlin.Array) returnType:.A [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/annotationsWithVarargParameters.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (xs:kotlin.Array) returnType:.A [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.kt.txt index 27d76371cc6..f72c81eba55 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.kt.txt @@ -1,14 +1,14 @@ open annotation class A : Annotation { + val xs: Array + field = xs + get + constructor(vararg xs: String) /* primary */ { super/*Any*/() /* () */ } - val xs: Array - field = xs - get - } @A(xs = ["abc", "def"]) @@ -22,3 +22,4 @@ fun test2() { @A(xs = []) fun test3() { } + diff --git a/compiler/testData/ir/irText/declarations/annotations/argWithDefaultValueInAnnotationClass.ir.txt b/compiler/testData/ir/irText/declarations/annotations/argWithDefaultValueInAnnotationClass.ir.txt index 43deaeae34d..9c7cc0a2840 100644 --- a/compiler/testData/ir/irText/declarations/annotations/argWithDefaultValueInAnnotationClass.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/argWithDefaultValueInAnnotationClass.ir.txt @@ -1,13 +1,6 @@ FILE fqName: fileName:/main.kt CLASS ANNOTATION_CLASS name:ModuleInfo modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ModuleInfo - CONSTRUCTOR visibility:public <> (keyBind:kotlin.Int) returnType:.ModuleInfo [primary] - VALUE_PARAMETER name:keyBind index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1234 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:ModuleInfo modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:keyBind visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:keyBind type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -19,6 +12,13 @@ FILE fqName: fileName:/main.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .ModuleInfo' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:keyBind type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .ModuleInfo declared in .ModuleInfo.' type=.ModuleInfo origin=null + CONSTRUCTOR visibility:public <> (keyBind:kotlin.Int) returnType:.ModuleInfo [primary] + VALUE_PARAMETER name:keyBind index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1234 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:ModuleInfo 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/argWithDefaultValueInAnnotationClass.kt.txt b/compiler/testData/ir/irText/declarations/annotations/argWithDefaultValueInAnnotationClass.kt.txt index ca59a5f3d1f..38bd5ddf978 100644 --- a/compiler/testData/ir/irText/declarations/annotations/argWithDefaultValueInAnnotationClass.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/argWithDefaultValueInAnnotationClass.kt.txt @@ -1,12 +1,13 @@ open annotation class ModuleInfo : Annotation { + val keyBind: Int + field = keyBind + get + constructor(keyBind: Int = 1234) /* primary */ { super/*Any*/() /* () */ } - val keyBind: Int - field = keyBind - get - } + diff --git a/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.ir.txt b/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.ir.txt index da4cd583198..7ed22df813b 100644 --- a/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/arrayInAnnotationArguments.kt CLASS ANNOTATION_CLASS name:TestAnnWithIntArray modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnnWithIntArray - CONSTRUCTOR visibility:public <> (x:kotlin.IntArray) returnType:.TestAnnWithIntArray [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.IntArray - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnnWithIntArray modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/arrayInAnnotationArguments.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in .TestAnnWithIntArray' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null receiver: GET_VAR ': .TestAnnWithIntArray declared in .TestAnnWithIntArray.' type=.TestAnnWithIntArray origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.IntArray) returnType:.TestAnnWithIntArray [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.IntArray + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnnWithIntArray 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 declared in kotlin.Annotation @@ -32,11 +32,6 @@ FILE fqName: fileName:/arrayInAnnotationArguments.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:TestAnnWithStringArray modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnnWithStringArray - CONSTRUCTOR visibility:public <> (x:kotlin.Array) returnType:.TestAnnWithStringArray [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Array - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnnWithStringArray modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Array visibility:private [final] EXPRESSION_BODY @@ -48,6 +43,11 @@ FILE fqName: fileName:/arrayInAnnotationArguments.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in .TestAnnWithStringArray' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null receiver: GET_VAR ': .TestAnnWithStringArray declared in .TestAnnWithStringArray.' type=.TestAnnWithStringArray origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Array) returnType:.TestAnnWithStringArray [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Array + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnnWithStringArray 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.kt.txt b/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.kt.txt index b3350fd9b21..1f95b52924a 100644 --- a/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.kt.txt @@ -1,27 +1,27 @@ open annotation class TestAnnWithIntArray : Annotation { + val x: IntArray + field = x + get + constructor(x: IntArray) /* primary */ { super/*Any*/() /* () */ } - val x: IntArray - field = x - get - } open annotation class TestAnnWithStringArray : Annotation { + val x: Array + field = x + get + constructor(x: Array) /* primary */ { super/*Any*/() /* () */ } - val x: Array - field = x - get - } @TestAnnWithIntArray(x = [1, 2, 3]) @@ -33,3 +33,4 @@ fun test1() { @TestAnnWithStringArray(x = ["d", "e", "f"]) fun test2() { } + diff --git a/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.ir.txt b/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.ir.txt index ac7e998e427..978d006b05f 100644 --- a/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/classLiteralInAnnotation.kt CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (klass:kotlin.reflect.KClass<*>) returnType:.A [primary] - VALUE_PARAMETER name:klass index:0 type:kotlin.reflect.KClass<*> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:klass visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:klass type:kotlin.reflect.KClass<*> visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/classLiteralInAnnotation.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass<*> declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:klass type:kotlin.reflect.KClass<*> visibility:private [final]' type=kotlin.reflect.KClass<*> origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (klass:kotlin.reflect.KClass<*>) returnType:.A [primary] + VALUE_PARAMETER name:klass index:0 type:kotlin.reflect.KClass<*> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.kt.txt b/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.kt.txt index b3b87463e28..b39bcc42623 100644 --- a/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.kt.txt @@ -1,14 +1,14 @@ open annotation class A : Annotation { + val klass: KClass<*> + field = klass + get + constructor(klass: KClass<*>) /* primary */ { super/*Any*/() /* () */ } - val klass: KClass<*> - field = klass - get - } class C { @@ -23,3 +23,4 @@ class C { @A(klass = C::class) fun test1() { } + diff --git a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.ir.txt b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.ir.txt deleted file mode 100644 index 130b41fac55..00000000000 --- a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.ir.txt +++ /dev/null @@ -1,206 +0,0 @@ -FILE fqName: fileName:/classesWithAnnotations.kt - CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.String declared in .TestAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.String - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.TestAnn - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn 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.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any] - annotations: - TestAnn(x = "class") - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClass - CONSTRUCTOR visibility:public <> () returnType:.TestClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClass modality:FINAL visibility:public 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 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 - CLASS INTERFACE name:TestInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - annotations: - TestAnn(x = "interface") - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInterface - 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: 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 - CLASS OBJECT name:TestObject modality:FINAL visibility:public superTypes:[kotlin.Any] - annotations: - TestAnn(x = "object") - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestObject - CONSTRUCTOR visibility:private <> () returnType:.TestObject [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:TestObject modality:FINAL visibility:public 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 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 - CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:public <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS OBJECT name:TestCompanion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] - annotations: - TestAnn(x = "companion") - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.TestCompanion - CONSTRUCTOR visibility:private <> () returnType:.Host.TestCompanion [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:TestCompanion modality:FINAL visibility:public [companion] 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 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 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: 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 - CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum>] - annotations: - TestAnn(x = "enum") - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum - CONSTRUCTOR visibility:private <> () returnType:.TestEnum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum>]' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>, other:.TestEnum) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - VALUE_PARAMETER name:other index:0 type:.TestEnum - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - CLASS ANNOTATION_CLASS name:TestAnnotation modality:OPEN visibility:public superTypes:[kotlin.Annotation] - annotations: - TestAnn(x = "annotation") - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnnotation - CONSTRUCTOR visibility:public <> () returnType:.TestAnnotation [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnnotation 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.kt.txt deleted file mode 100644 index 2fd3880dc42..00000000000 --- a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.kt.txt +++ /dev/null @@ -1,82 +0,0 @@ -open annotation class TestAnn : Annotation { - constructor(x: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: String - field = x - get - -} - -@TestAnn(x = "class") -class TestClass { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -@TestAnn(x = "interface") -interface TestInterface { -} - -@TestAnn(x = "object") -object TestObject { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -class Host { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - @TestAnn(x = "companion") - companion object TestCompanion { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - } - -} - -@TestAnn(x = "enum") -enum class TestEnum : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): TestEnum /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} - -@TestAnn(x = "annotation") -open annotation class TestAnnotation : Annotation { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} diff --git a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.ir.txt index d035c885bfe..667e3076656 100644 --- a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/classesWithAnnotations.kt CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/classesWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn 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 declared in kotlin.Annotation @@ -30,6 +30,67 @@ FILE fqName: fileName:/classesWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:TestAnnotation modality:OPEN visibility:public superTypes:[kotlin.Annotation] + annotations: + TestAnn(x = "annotation") + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnnotation + CONSTRUCTOR visibility:public <> () returnType:.TestAnnotation [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnnotation 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CLASS OBJECT name:TestCompanion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + annotations: + TestAnn(x = "companion") + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.TestCompanion + CONSTRUCTOR visibility:private <> () returnType:.Host.TestCompanion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:TestCompanion modality:FINAL visibility:public [companion] 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 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 + CONSTRUCTOR visibility:public <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public 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 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 CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any] annotations: TestAnn(x = "class") @@ -51,6 +112,60 @@ FILE fqName: fileName:/classesWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum>] + annotations: + TestAnn(x = "enum") + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum + CONSTRUCTOR visibility:private <> () returnType:.TestEnum [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>, other:.TestEnum) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> + VALUE_PARAMETER name:other index:0 type:.TestEnum + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> CLASS INTERFACE name:TestInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] annotations: TestAnn(x = "interface") @@ -89,118 +204,3 @@ FILE fqName: fileName:/classesWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:public <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS OBJECT name:TestCompanion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] - annotations: - TestAnn(x = "companion") - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.TestCompanion - CONSTRUCTOR visibility:private <> () returnType:.Host.TestCompanion [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:TestCompanion modality:FINAL visibility:public [companion] 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 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 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: 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 - CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum>] - annotations: - TestAnn(x = "enum") - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum - CONSTRUCTOR visibility:private <> () returnType:.TestEnum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum>]' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>, other:.TestEnum) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - VALUE_PARAMETER name:other index:0 type:.TestEnum - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - CLASS ANNOTATION_CLASS name:TestAnnotation modality:OPEN visibility:public superTypes:[kotlin.Annotation] - annotations: - TestAnn(x = "annotation") - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnnotation - CONSTRUCTOR visibility:public <> () returnType:.TestAnnotation [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnnotation 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt index afcb63a1723..488e0745532 100644 --- a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class TestAnn(val x: String) @TestAnn("class") diff --git a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt.txt index 2fd3880dc42..b58ee498163 100644 --- a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt.txt @@ -1,13 +1,42 @@ open annotation class TestAnn : Annotation { + val x: String + field = x + get + constructor(x: String) /* primary */ { super/*Any*/() /* () */ } - val x: String - field = x - get +} + +@TestAnn(x = "annotation") +open annotation class TestAnnotation : Annotation { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class Host { + @TestAnn(x = "companion") + companion object TestCompanion { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } } @@ -21,6 +50,23 @@ class TestClass { } +@TestAnn(x = "enum") +enum class TestEnum : Enum { + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } + + fun valueOf(value: String): TestEnum /* Synthetic body for ENUM_VALUEOF */ + + fun values(): Array /* Synthetic body for ENUM_VALUES */ + + val entries: EnumEntries + get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ + +} + @TestAnn(x = "interface") interface TestInterface { } @@ -35,48 +81,3 @@ object TestObject { } -class Host { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - @TestAnn(x = "companion") - companion object TestCompanion { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - } - -} - -@TestAnn(x = "enum") -enum class TestEnum : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): TestEnum /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} - -@TestAnn(x = "annotation") -open annotation class TestAnnotation : Annotation { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} diff --git a/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.ir.txt b/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.ir.txt index fe184b92964..ff50fa7fbb4 100644 --- a/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.ir.txt @@ -1,20 +1,6 @@ FILE fqName: fileName:/constExpressionsInAnnotationArguments.kt - PROPERTY name:ONE visibility:public modality:FINAL [const,val] - FIELD PROPERTY_BACKING_FIELD name:ONE type:kotlin.Int visibility:public [final,static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:ONE visibility:public modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ONE type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.A [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -26,6 +12,11 @@ FILE fqName: fileName:/constExpressionsInAnnotationArguments.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A 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 declared in kotlin.Annotation @@ -47,3 +38,12 @@ FILE fqName: fileName:/constExpressionsInAnnotationArguments.kt annotations: A(x = 2) BLOCK_BODY + PROPERTY name:ONE visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:ONE type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:ONE visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ONE type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt.txt b/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt.txt index c1c090b743a..a29ea30fdfb 100644 --- a/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt.txt @@ -1,18 +1,14 @@ -const val ONE: Int - field = 1 - get - open annotation class A : Annotation { + val x: Int + field = x + get + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } - val x: Int - field = x - get - } @A(x = 1) @@ -22,3 +18,8 @@ fun test1() { @A(x = 2) fun test2() { } + +const val ONE: Int + field = 1 + get + diff --git a/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.ir.txt index 216490741a2..cefb909c1af 100644 --- a/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/constructorsWithAnnotations.kt CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/constructorsWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestAnn' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.kt.txt index 02398b45631..8bff17459ed 100644 --- a/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.kt.txt @@ -1,14 +1,14 @@ open annotation class TestAnn : Annotation { + val x: Int + field = x + get + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } - val x: Int - field = x - get - } class TestClass { @@ -25,3 +25,4 @@ class TestClass { } } + diff --git a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.ir.txt index 117ed70cd55..d9ec6b9462f 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.ir.txt @@ -1,23 +1,4 @@ FILE fqName: fileName:/delegateFieldWithAnnotations.kt - CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann - CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static] annotations: @@ -39,3 +20,22 @@ FILE fqName: fileName:/delegateFieldWithAnnotations.kt $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' type=kotlin.Lazy origin=null thisRef: CONST Null type=kotlin.Nothing? value=null property: PROPERTY_REFERENCE 'public final test1: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann + CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.kt.txt index fbc0c10f13b..a391b80713c 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.kt.txt @@ -1,3 +1,12 @@ +val test1: Int /* by */ + field = lazy(initializer = local fun (): Int { + return 42 + } +) + get(): Int { + return #test1$delegate.getValue(thisRef = null, property = ::test1) + } + open annotation class Ann : Annotation { constructor() /* primary */ { super/*Any*/() @@ -7,11 +16,3 @@ open annotation class Ann : Annotation { } -val test1: Int /* by */ - field = lazy(initializer = local fun (): Int { - return 42 - } -) - get(): Int { - return #test1$delegate.getValue(thisRef = null, property = ::test1) - } diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.ir.txt index 6a649622c72..6f88967da7c 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.ir.txt @@ -1,91 +1,4 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt - CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.A [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.String declared in .A.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .A declared in .A.' type=.A 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.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell - CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.Cell [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private - EXPRESSION_BODY - GET_VAR 'value: kotlin.Int declared in .Cell.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell) returnType:kotlin.Int - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Cell - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Cell' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .Cell declared in .Cell.' type=.Cell origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Cell - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Cell declared in .Cell.' type=.Cell origin=null - value: GET_VAR ': kotlin.Int declared in .Cell.' type=kotlin.Int origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:.Cell, thisRef:kotlin.Any?, kProp:kotlin.Any?) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.Cell - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Cell' - CALL 'public final fun (): kotlin.Int declared in .Cell' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Cell declared in .Cell.getValue' type=.Cell origin=null - FUN name:setValue visibility:public modality:FINAL <> ($this:.Cell, thisRef:kotlin.Any?, kProp:kotlin.Any?, newValue:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.Cell - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? - VALUE_PARAMETER name:newValue index:2 type:kotlin.Int - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .Cell declared in .Cell.setValue' type=.Cell origin=null - : GET_VAR 'newValue: kotlin.Int declared in .Cell.setValue' type=kotlin.Int 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: 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 PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:test1$delegate type:.Cell visibility:private [final,static] EXPRESSION_BODY @@ -130,3 +43,90 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt thisRef: CONST Null type=kotlin.Nothing? value=null kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE newValue: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .A.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell + PROPERTY name:value visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private + EXPRESSION_BODY + GET_VAR 'value: kotlin.Int declared in .Cell.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell) returnType:kotlin.Int + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Cell + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Cell' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .Cell declared in .Cell.' type=.Cell origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Cell + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Cell declared in .Cell.' type=.Cell origin=null + value: GET_VAR ': kotlin.Int declared in .Cell.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.Cell [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:FINAL visibility:public 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 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:getValue visibility:public modality:FINAL <> ($this:.Cell, thisRef:kotlin.Any?, kProp:kotlin.Any?) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.Cell + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Cell' + CALL 'public final fun (): kotlin.Int declared in .Cell' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Cell declared in .Cell.getValue' type=.Cell origin=null + FUN name:setValue visibility:public modality:FINAL <> ($this:.Cell, thisRef:kotlin.Any?, kProp:kotlin.Any?, newValue:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.Cell + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? + VALUE_PARAMETER name:newValue index:2 type:kotlin.Int + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .Cell declared in .Cell.setValue' type=.Cell origin=null + : GET_VAR 'newValue: kotlin.Int declared in .Cell.setValue' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt.txt index 2a9511c3c79..2a19e390f61 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt.txt @@ -1,38 +1,3 @@ -open annotation class A : Annotation { - constructor(x: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: String - field = x - get - -} - -class Cell { - constructor(value: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - - var value: Int - field = value - get - set - - operator fun getValue(thisRef: Any?, kProp: Any?): Int { - return .() - } - - operator fun setValue(thisRef: Any?, kProp: Any?, newValue: Int) { - .( = newValue) - } - -} - val test1: Int /* by */ field = Cell(value = 1) @A(x = "test1.get") @@ -50,3 +15,39 @@ var test2: Int /* by */ set(@A(x = "test2.set.param") : Int) { return #test2$delegate.setValue(thisRef = null, kProp = ::test2, newValue = ) } + +open annotation class A : Annotation { + val x: String + field = x + get + + constructor(x: String) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class Cell { + var value: Int + field = value + get + set + + constructor(value: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + + operator fun getValue(thisRef: Any?, kProp: Any?): Int { + return .() + } + + operator fun setValue(thisRef: Any?, kProp: Any?, newValue: Int) { + .( = newValue) + } + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.ir.txt b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.ir.txt index b1666669c8f..9d8d4d302e8 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn 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 declared in kotlin.Annotation @@ -32,11 +32,6 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ENUM_CLASS name:TestEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum - CONSTRUCTOR visibility:private <> () returnType:.TestEnum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum>]' ENUM_ENTRY name:ENTRY1 annotations: TestAnn(x = "ENTRY1") @@ -49,10 +44,6 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum.ENTRY2' class: CLASS ENUM_ENTRY name:ENTRY2 modality:FINAL visibility:private superTypes:[.TestEnum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum.ENTRY2 - CONSTRUCTOR visibility:private <> () returnType:.TestEnum.ENTRY2 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY2 modality:FINAL visibility:private superTypes:[.TestEnum]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -64,6 +55,10 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestEnum.ENTRY2' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .TestEnum.ENTRY2 declared in .TestEnum.ENTRY2.' type=.TestEnum.ENTRY2 origin=null + CONSTRUCTOR visibility:private <> () returnType:.TestEnum.ENTRY2 [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY2 modality:FINAL visibility:private superTypes:[.TestEnum]' FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>, other:.TestEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .TestEnum): kotlin.Int declared in .TestEnum @@ -100,15 +95,16 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt overridden: public final fun (): kotlin.Int declared in .TestEnum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> () returnType:.TestEnum [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>, other:.TestEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -127,6 +123,10 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation diff --git a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.kt.txt index 5627be26e78..606190393c8 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.kt.txt @@ -1,46 +1,47 @@ open annotation class TestAnn : Annotation { + val x: String + field = x + get + constructor(x: String) /* primary */ { super/*Any*/() /* () */ } - val x: String - field = x - get - } open enum class TestEnum : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - @TestAnn(x = "ENTRY1") ENTRY1 = TestEnum() @TestAnn(x = "ENTRY2") ENTRY2 = ENTRY2() private enum entry class ENTRY2 : TestEnum { + val x: Int + field = 42 + get + private constructor() /* primary */ { super/*TestEnum*/() /* () */ } - val x: Int - field = 42 - get + } + + private constructor() /* primary */ { + super/*Enum*/() + /* () */ } - fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestEnum /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } + diff --git a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.ir.txt index 65a8ea4e631..66a338c14d1 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn 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 declared in kotlin.Annotation @@ -32,11 +32,6 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ENUM_CLASS name:TestEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum - CONSTRUCTOR visibility:private <> () returnType:.TestEnum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .TestEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum>]' ENUM_ENTRY name:ENTRY1 annotations: TestAnn(x = "ENTRY1") @@ -51,11 +46,6 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt annotations: TestAnn(x = "ENTRY2") $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum.ENTRY2 - CONSTRUCTOR visibility:private <> () returnType:.TestEnum.ENTRY2 [primary] - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY2 modality:FINAL visibility:private superTypes:[.TestEnum]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -67,24 +57,11 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestEnum.ENTRY2' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .TestEnum.ENTRY2 declared in .TestEnum.ENTRY2.' type=.TestEnum.ENTRY2 origin=null - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .TestEnum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> + CONSTRUCTOR visibility:private <> () returnType:.TestEnum.ENTRY2 [primary] + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .TestEnum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY2 modality:FINAL visibility:private superTypes:[.TestEnum]' FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>, other:.TestEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .TestEnum): kotlin.Int declared in .TestEnum @@ -103,24 +80,34 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in .TestEnum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .TestEnum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> + CONSTRUCTOR visibility:private <> () returnType:.TestEnum [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .TestEnum + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>, other:.TestEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -139,12 +126,25 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.TestEnum> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.TestEnum>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.TestEnum> diff --git a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.kt.txt index 8f45a4e6258..59da66af683 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.kt.txt @@ -1,23 +1,17 @@ open annotation class TestAnn : Annotation { + val x: String + field = x + get + constructor(x: String) /* primary */ { super/*Any*/() /* () */ } - val x: String - field = x - get - } open enum class TestEnum : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - @TestAnn(x = "ENTRY1") ENTRY1 = TestEnum() @@ -25,23 +19,30 @@ open enum class TestEnum : Enum { ENTRY2 = ENTRY2() @TestAnn(x = "ENTRY2") private enum entry class ENTRY2 : TestEnum { + val x: Int + field = 42 + get + private constructor() /* primary */ { super/*TestEnum*/() /*~> Unit */ /* () */ } - val x: Int - field = 42 - get + } + + private constructor() /* primary */ { + super/*Enum*/() + /* () */ } - fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): TestEnum /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } + diff --git a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.ir.txt b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.ir.txt deleted file mode 100644 index 5e94071dd40..00000000000 --- a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.ir.txt +++ /dev/null @@ -1,100 +0,0 @@ -FILE fqName: fileName:/enumsInAnnotationArguments.kt - CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En - CONSTRUCTOR visibility:private <> () returnType:.En [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .En - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' - ENUM_ENTRY name:A - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' - ENUM_ENTRY name:B - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' - ENUM_ENTRY name:C - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' - ENUM_ENTRY name:D - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.En> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:.En) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - VALUE_PARAMETER name:other index:0 type:.En - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:.En) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:.En - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:.En visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: .En declared in .TestAnn.' type=.En origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:.En - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.TestAnn - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .En declared in .TestAnn' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:.En visibility:private [final]' type=.En origin=null - receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn 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.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit - annotations: - TestAnn(x = GET_ENUM 'ENUM_ENTRY name:A' type=.En) - BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.kt.txt deleted file mode 100644 index 76eb2065083..00000000000 --- a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.kt.txt +++ /dev/null @@ -1,40 +0,0 @@ -enum class En : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - - A = En() - - B = En() - - C = En() - - D = En() - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): En /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} - -open annotation class TestAnn : Annotation { - constructor(x: En) /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: En - field = x - get - -} - -@TestAnn(x = En.A) -fun test1() { -} diff --git a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.ir.txt b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.ir.txt index 1f44357ca57..0a757c8f03a 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.ir.txt @@ -1,11 +1,37 @@ FILE fqName: fileName:/enumsInAnnotationArguments.kt + CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:.En visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: .En declared in .TestAnn.' type=.En origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:.En + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .En declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:.En visibility:private [final]' type=.En origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + CONSTRUCTOR visibility:public <> (x:.En) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:.En + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En - CONSTRUCTOR visibility:private <> () returnType:.En [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .En - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' ENUM_ENTRY name:A init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' @@ -18,24 +44,16 @@ FILE fqName: fileName:/enumsInAnnotationArguments.kt ENUM_ENTRY name:D init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + CONSTRUCTOR visibility:private <> () returnType:.En [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .En + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:.En) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -54,46 +72,28 @@ FILE fqName: fileName:/enumsInAnnotationArguments.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.En> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES - CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:.En) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:.En - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:.En visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: .En declared in .TestAnn.' type=.En origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:.En - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.TestAnn - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .En declared in .TestAnn' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:.En visibility:private [final]' type=.En origin=null - receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Annotation - $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] + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit annotations: TestAnn(x = GET_ENUM 'ENUM_ENTRY name:A' type=.En) diff --git a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt index bf6414420b3..08ba1150b1e 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt +++ b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class En { A, B, C, D } annotation class TestAnn(val x: En) diff --git a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt.txt b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt.txt index 76eb2065083..43efbb351e9 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt.txt @@ -1,10 +1,17 @@ -enum class En : Enum { - private constructor() /* primary */ { - super/*Enum*/() +open annotation class TestAnn : Annotation { + val x: En + field = x + get + + constructor(x: En) /* primary */ { + super/*Any*/() /* () */ } +} + +enum class En : Enum { A = En() B = En() @@ -13,28 +20,22 @@ enum class En : Enum { D = En() - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): En /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } -open annotation class TestAnn : Annotation { - constructor(x: En) /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: En - field = x - get - -} - @TestAnn(x = En.A) fun test1() { } + diff --git a/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.ir.txt index 0fea6c102aa..9ded6ec40ab 100644 --- a/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.ir.txt @@ -1,35 +1,4 @@ FILE fqName: fileName:/fieldsWithAnnotations.kt - CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.String declared in .TestAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.String - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.TestAnn - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn 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.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:testVal visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:private [final,static] annotations: @@ -58,3 +27,34 @@ FILE fqName: fileName:/fieldsWithAnnotations.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testVar type:kotlin.String visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.String declared in .' type=kotlin.String origin=null + CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .TestAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt.txt index cf4b9242f62..cce39dbb6b5 100644 --- a/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt.txt @@ -1,16 +1,3 @@ -open annotation class TestAnn : Annotation { - constructor(x: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: String - field = x - get - -} - val testVal: String field = "a val" get @@ -19,3 +6,17 @@ var testVar: String field = "a var" get set + +open annotation class TestAnn : Annotation { + val x: String + field = x + get + + constructor(x: String) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.ir.txt index 11e34a757e9..9d370aee1be 100644 --- a/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.ir.txt @@ -5,11 +5,6 @@ FILE fqName:test fileName:/fileAnnotations.kt annotations: Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FILE' type=kotlin.annotation.AnnotationTarget]) $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.A - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:test.A [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -21,6 +16,11 @@ FILE fqName:test fileName:/fileAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in test.A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': test.A declared in test.A.' type=test.A origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:test.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.kt.txt index a67427fee4d..c781e8991c0 100644 --- a/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.kt.txt @@ -3,14 +3,15 @@ package test @Target(allowedTargets = [AnnotationTarget.FILE]) open annotation class A : Annotation { + val x: String + field = x + get + constructor(x: String) /* primary */ { super/*Any*/() /* () */ } - val x: String - field = x - get - } + diff --git a/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.ir.txt index 959ffd2564d..5cf61bc3cfe 100644 --- a/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/functionsWithAnnotations.kt CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/functionsWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestAnn' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.kt.txt index 0b9af9f0381..778ebdbd6a7 100644 --- a/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.kt.txt @@ -1,16 +1,17 @@ open annotation class TestAnn : Annotation { + val x: Int + field = x + get + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } - val x: Int - field = x - get - } @TestAnn(x = 42) fun testSimpleFunction() { } + diff --git a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.ir.txt b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.ir.txt index 1615bc4612a..2e93da36d9f 100644 --- a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.ir.txt @@ -2,11 +2,6 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt CLASS ANNOTATION_CLASS name:Test1 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test1 TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:ann.Test1 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test1 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,11 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ann.Test1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': ann.Test1 declared in ann.Test1.' type=ann.Test1 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:ann.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test1 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 declared in kotlin.Annotation @@ -35,13 +35,6 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test2 TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any] reified:false TYPE_PARAMETER name:T2 index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:ann.Test2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test2 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -53,6 +46,13 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ann.Test2' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': ann.Test2 declared in ann.Test2.' type=ann.Test2 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:ann.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test2 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 declared in kotlin.Annotation @@ -66,31 +66,10 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.I - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - 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: 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 CLASS ANNOTATION_CLASS name:Test3 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test3 TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:T2 index:1 variance: superTypes:[ann.I] reified:false - CONSTRUCTOR visibility:public <> (x:ann.Test1>) returnType:ann.Test3 [primary] - VALUE_PARAMETER name:x index:0 type:ann.Test1> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test3 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:ann.Test1> visibility:private [final] EXPRESSION_BODY @@ -102,6 +81,11 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt RETURN type=kotlin.Nothing from='public final fun (): ann.Test1> declared in ann.Test3' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:ann.Test1> visibility:private [final]' type=ann.Test1> origin=null receiver: GET_VAR ': ann.Test3 declared in ann.Test3.' type=ann.Test3 origin=null + CONSTRUCTOR visibility:public <> (x:ann.Test1>) returnType:ann.Test3 [primary] + VALUE_PARAMETER name:x index:0 type:ann.Test1> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test3 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 declared in kotlin.Annotation @@ -115,33 +99,8 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[ann.I] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.C - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:ann.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[ann.I]' - 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 ann.I - $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 ann.I - $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 ann.I - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:Test4 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test4 - CONSTRUCTOR visibility:public <> (x:kotlin.Array>>) returnType:ann.Test4 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Array>> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test4 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Array>> visibility:private [final] EXPRESSION_BODY @@ -153,6 +112,43 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array>> declared in ann.Test4' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Array>> visibility:private [final]' type=kotlin.Array>> origin=null receiver: GET_VAR ': ann.Test4 declared in ann.Test4.' type=ann.Test4 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Array>>) returnType:ann.Test4 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Array>> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test4 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Test5 modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test5 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:xs visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array>> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'xs: kotlin.Array>> declared in ann.Test5.' type=kotlin.Array>> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test5) returnType:kotlin.Array>> + correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:ann.Test5 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array>> declared in ann.Test5' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array>> visibility:private [final]' type=kotlin.Array>> origin=null + receiver: GET_VAR ': ann.Test5 declared in ann.Test5.' type=ann.Test5 origin=null + CONSTRUCTOR visibility:public <> (xs:kotlin.Array>>) returnType:ann.Test5 [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.Array>> varargElementType:ann.Test3> [vararg] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test5 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 declared in kotlin.Annotation @@ -185,37 +181,25 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:Test5 modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test5 + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[ann.I] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.C TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (xs:kotlin.Array>>) returnType:ann.Test5 [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.Array>> varargElementType:ann.Test3> [vararg] + CONSTRUCTOR visibility:public <> () returnType:ann.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test5 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:xs visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array>> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'xs: kotlin.Array>> declared in ann.Test5.' type=kotlin.Array>> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test5) returnType:kotlin.Array>> - correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:ann.Test5 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array>> declared in ann.Test5' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array>> visibility:private [final]' type=kotlin.Array>> origin=null - receiver: GET_VAR ': ann.Test5 declared in ann.Test5.' type=ann.Test5 origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[ann.I]' 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.Annotation + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in ann.I $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.Annotation + public open fun hashCode (): kotlin.Int declared in ann.I $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.Annotation + public open fun toString (): kotlin.String declared in ann.I $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:CC modality:FINAL visibility:public superTypes:[kotlin.Any] annotations: @@ -242,3 +226,19 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.I + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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 diff --git a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.kt.txt index 574265bc5a1..5a05fd6dfbd 100644 --- a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.kt.txt @@ -1,49 +1,37 @@ package ann open annotation class Test1 : Annotation { + val x: Int + field = x + get + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } +} + +open annotation class Test2 : Annotation { val x: Int field = x get -} - -open annotation class Test2 : Annotation { constructor(x: Int = 0) /* primary */ { super/*Any*/() /* () */ } - val x: Int - field = x - get - -} - -interface I { } open annotation class Test3> : Annotation { - constructor(x: Test1>) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Test1> field = x get -} - -class C : I { - constructor() /* primary */ { + constructor(x: Test1>) /* primary */ { super/*Any*/() /* () */ @@ -52,16 +40,29 @@ class C : I { } open annotation class Test4 : Annotation { + val x: Array>> + field = x + get + constructor(x: Array>>) /* primary */ { super/*Any*/() /* () */ } - val x: Array>> - field = x +} + +open annotation class Test5 : Annotation { + val xs: Array>> + field = xs get + constructor(vararg xs: Test3>) /* primary */ { + super/*Any*/() + /* () */ + + } + } class ARG { @@ -73,17 +74,13 @@ class ARG { } -open annotation class Test5 : Annotation { - constructor(vararg xs: Test3>) /* primary */ { +class C : I { + constructor() /* primary */ { super/*Any*/() /* () */ } - val xs: Array>> - field = xs - get - } @Test1(x = 42) @@ -99,3 +96,7 @@ class CC { } } + +interface I { +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.ir.txt b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.ir.txt index dd051aa75e8..7026fac3854 100644 --- a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.ir.txt @@ -2,11 +2,6 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt CLASS ANNOTATION_CLASS name:Test1 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test1 TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:ann.Test1 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test1 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,11 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ann.Test1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': ann.Test1 declared in ann.Test1.' type=ann.Test1 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:ann.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test1 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 declared in kotlin.Annotation @@ -35,13 +35,6 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test2 TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any] reified:false TYPE_PARAMETER name:T2 index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:ann.Test2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test2 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -53,6 +46,13 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ann.Test2' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': ann.Test2 declared in ann.Test2.' type=ann.Test2 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:ann.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test2 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 declared in kotlin.Annotation @@ -66,31 +66,10 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.I - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - 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: 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 CLASS ANNOTATION_CLASS name:Test3 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test3 TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:T2 index:1 variance: superTypes:[ann.I] reified:false - CONSTRUCTOR visibility:public <> (x:ann.Test1>) returnType:ann.Test3 [primary] - VALUE_PARAMETER name:x index:0 type:ann.Test1> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test3 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:ann.Test1> visibility:private [final] EXPRESSION_BODY @@ -102,6 +81,11 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt RETURN type=kotlin.Nothing from='public final fun (): ann.Test1> declared in ann.Test3' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:ann.Test1> visibility:private [final]' type=ann.Test1> origin=null receiver: GET_VAR ': ann.Test3 declared in ann.Test3.' type=ann.Test3 origin=null + CONSTRUCTOR visibility:public <> (x:ann.Test1>) returnType:ann.Test3 [primary] + VALUE_PARAMETER name:x index:0 type:ann.Test1> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test3 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 declared in kotlin.Annotation @@ -115,33 +99,8 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[ann.I] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.C - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:ann.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[ann.I]' - 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 ann.I - $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 ann.I - $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 ann.I - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:Test4 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test4 - CONSTRUCTOR visibility:public <> (x:kotlin.Array>>) returnType:ann.Test4 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Array>> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test4 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Array>> visibility:private [final] EXPRESSION_BODY @@ -153,6 +112,43 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array>> declared in ann.Test4' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Array>> visibility:private [final]' type=kotlin.Array>> origin=null receiver: GET_VAR ': ann.Test4 declared in ann.Test4.' type=ann.Test4 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Array>>) returnType:ann.Test4 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Array>> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test4 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Test5 modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test5 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:xs visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array>> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'xs: kotlin.Array>> declared in ann.Test5.' type=kotlin.Array>> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test5) returnType:kotlin.Array>> + correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:ann.Test5 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array>> declared in ann.Test5' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array>> visibility:private [final]' type=kotlin.Array>> origin=null + receiver: GET_VAR ': ann.Test5 declared in ann.Test5.' type=ann.Test5 origin=null + CONSTRUCTOR visibility:public <> (xs:kotlin.Array>>) returnType:ann.Test5 [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.Array>> varargElementType:ann.Test3> [vararg] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test5 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 declared in kotlin.Annotation @@ -185,37 +181,25 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:Test5 modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test5 + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[ann.I] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.C TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (xs:kotlin.Array>>) returnType:ann.Test5 [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.Array>> varargElementType:ann.Test3> [vararg] + CONSTRUCTOR visibility:public <> () returnType:ann.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test5 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:xs visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array>> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'xs: kotlin.Array>> declared in ann.Test5.' type=kotlin.Array>> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test5) returnType:kotlin.Array>> - correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:ann.Test5 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array>> declared in ann.Test5' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array>> visibility:private [final]' type=kotlin.Array>> origin=null - receiver: GET_VAR ': ann.Test5 declared in ann.Test5.' type=ann.Test5 origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[ann.I]' 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.Annotation + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in ann.I $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.Annotation + public open fun hashCode (): kotlin.Int declared in ann.I $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.Annotation + public open fun toString (): kotlin.String declared in ann.I $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:CC modality:FINAL visibility:public superTypes:[kotlin.Any] annotations: @@ -242,3 +226,19 @@ FILE fqName:ann fileName:/genericAnnotationClasses.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.I + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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 diff --git a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt.txt b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt.txt index 6676e6aeef6..375415ffa9d 100644 --- a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt.txt @@ -1,49 +1,37 @@ package ann open annotation class Test1 : Annotation { + val x: Int + field = x + get + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } +} + +open annotation class Test2 : Annotation { val x: Int field = x get -} - -open annotation class Test2 : Annotation { constructor(x: Int = 0) /* primary */ { super/*Any*/() /* () */ } - val x: Int - field = x - get - -} - -interface I { } open annotation class Test3> : Annotation { - constructor(x: Test1>) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Test1> field = x get -} - -class C : I { - constructor() /* primary */ { + constructor(x: Test1>) /* primary */ { super/*Any*/() /* () */ @@ -52,16 +40,29 @@ class C : I { } open annotation class Test4 : Annotation { + val x: Array>> + field = x + get + constructor(x: Array>>) /* primary */ { super/*Any*/() /* () */ } - val x: Array>> - field = x +} + +open annotation class Test5 : Annotation { + val xs: Array>> + field = xs get + constructor(vararg xs: Test3>) /* primary */ { + super/*Any*/() + /* () */ + + } + } class ARG { @@ -73,17 +74,13 @@ class ARG { } -open annotation class Test5 : Annotation { - constructor(vararg xs: Test3>) /* primary */ { +class C : I { + constructor() /* primary */ { super/*Any*/() /* () */ } - val xs: Array>> - field = xs - get - } @Test1(x = 42) @@ -99,3 +96,7 @@ class CC { } } + +interface I { +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.ir.txt b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.ir.txt index d308fe7619e..6c1b243973f 100644 --- a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.ir.txt @@ -1,61 +1,67 @@ FILE fqName: fileName:/inheritingDeprecation.kt - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - PROPERTY name:prop visibility:public modality:OPEN [val] - annotations: - Deprecated(message = "", replaceWith = , level = ) - FUN name: visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String - correspondingProperty: PROPERTY name:prop visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.IFoo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .IFoo' - CONST String type=kotlin.String value="" - PROPERTY name:extProp visibility:public modality:OPEN [val] - annotations: - Deprecated(message = "", replaceWith = , level = ) - FUN name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String - correspondingProperty: PROPERTY name:extProp visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.IFoo - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .IFoo' - CONST String type=kotlin.String value="" + CLASS CLASS name:DefaultImpl modality:FINAL visibility:public superTypes:[.IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DefaultImpl + CONSTRUCTOR visibility:public <> () returnType:.DefaultImpl [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DefaultImpl modality:FINAL visibility:public superTypes:[.IFoo]' 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 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo $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 + public open fun hashCode (): kotlin.Int declared in .IFoo $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 + public open fun toString (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:extProp visibility:public modality:OPEN [fake_override,val] + annotations: + Deprecated(message = "", replaceWith = , level = ) + overridden: + public open extProp: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:extProp visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:prop visibility:public modality:OPEN [fake_override,val] + annotations: + Deprecated(message = "", replaceWith = , level = ) + overridden: + public open prop: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegated + FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final] + EXPRESSION_BODY + GET_VAR 'foo: .IFoo declared in .Delegated.' type=.IFoo origin=null CONSTRUCTOR visibility:public <> (foo:.IFoo) returnType:.Delegated [primary] VALUE_PARAMETER name:foo index:0 type:.IFoo BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final] - EXPRESSION_BODY - GET_VAR 'foo: .IFoo declared in .Delegated.' type=.IFoo origin=null - PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: - public open prop: kotlin.String - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Delegated) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] - overridden: - public open fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.Delegated - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Delegated' - CALL 'public open fun (): kotlin.String declared in .IFoo' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null - receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated origin=null + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo + $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 .IFoo + $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 .IFoo + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY DELEGATED_MEMBER name:extProp visibility:public modality:OPEN [val] overridden: public open extProp: kotlin.String @@ -71,76 +77,38 @@ FILE fqName: fileName:/inheritingDeprecation.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated origin=null $receiver: GET_VAR ': kotlin.String declared in .Delegated.' type=kotlin.String 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 .IFoo - $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 .IFoo - $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 .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:DefaultImpl modality:FINAL visibility:public superTypes:[.IFoo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DefaultImpl - CONSTRUCTOR visibility:public <> () returnType:.DefaultImpl [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DefaultImpl modality:FINAL visibility:public superTypes:[.IFoo]' - PROPERTY FAKE_OVERRIDE name:prop visibility:public modality:OPEN [fake_override,val] - annotations: - Deprecated(message = "", replaceWith = , level = ) + PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] overridden: public open prop: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop visibility:public modality:OPEN [fake_override,val] + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Delegated) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] overridden: public open fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.IFoo - PROPERTY FAKE_OVERRIDE name:extProp visibility:public modality:OPEN [fake_override,val] - annotations: - Deprecated(message = "", replaceWith = , level = ) - overridden: - public open extProp: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:extProp visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.IFoo - $receiver: VALUE_PARAMETER name: type:kotlin.String - 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 .IFoo - $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 .IFoo - $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 .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.Delegated + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Delegated' + CALL 'public open fun (): kotlin.String declared in .IFoo' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null + receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated origin=null CLASS CLASS name:ExplicitOverride modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ExplicitOverride CONSTRUCTOR visibility:public <> () returnType:.ExplicitOverride [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ExplicitOverride modality:FINAL visibility:public superTypes:[.IFoo]' - PROPERTY name:prop visibility:public modality:OPEN [val] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: - public open prop: kotlin.String - FUN name: visibility:public modality:OPEN <> ($this:.ExplicitOverride) returnType:kotlin.String - correspondingProperty: PROPERTY name:prop visibility:public modality:OPEN [val] - overridden: - public open fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.ExplicitOverride - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .ExplicitOverride' - CONST String type=kotlin.String value="" + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo + $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 .IFoo + $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 .IFoo + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:extProp visibility:public modality:OPEN [val] overridden: public open extProp: kotlin.String @@ -153,16 +121,48 @@ FILE fqName: fileName:/inheritingDeprecation.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .ExplicitOverride' CONST String type=kotlin.String value="" + PROPERTY name:prop visibility:public modality:OPEN [val] + overridden: + public open prop: kotlin.String + FUN name: visibility:public modality:OPEN <> ($this:.ExplicitOverride) returnType:kotlin.String + correspondingProperty: PROPERTY name:prop visibility:public modality:OPEN [val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.ExplicitOverride + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .ExplicitOverride' + CONST String type=kotlin.String value="" + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo 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 .IFoo + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .IFoo + 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 .IFoo + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:extProp visibility:public modality:OPEN [val] + annotations: + Deprecated(message = "", replaceWith = , level = ) + FUN name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String + correspondingProperty: PROPERTY name:extProp visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.IFoo + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .IFoo' + CONST String type=kotlin.String value="" + PROPERTY name:prop visibility:public modality:OPEN [val] + annotations: + Deprecated(message = "", replaceWith = , level = ) + FUN name: visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String + correspondingProperty: PROPERTY name:prop visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.IFoo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .IFoo' + CONST String type=kotlin.String value="" diff --git a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt.txt b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt.txt index 522aec39904..120543a172e 100644 --- a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt.txt @@ -1,38 +1,3 @@ -interface IFoo { - @Deprecated(message = "") - val prop: String - get(): String { - return "" - } - - @Deprecated(message = "") - val String.extProp: String - get(): String { - return "" - } - -} - -class Delegated : IFoo { - constructor(foo: IFoo) /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: IFoo = foo - override val prop: String - override get(): String { - return .#$$delegate_0.() - } - - override val String.extProp: String - override get(): String { - return (.#$$delegate_0, ).() - } - -} - class DefaultImpl : IFoo { constructor() /* primary */ { super/*Any*/() @@ -42,6 +7,26 @@ class DefaultImpl : IFoo { } +class Delegated : IFoo { + private /* final field */ val $$delegate_0: IFoo = foo + constructor(foo: IFoo) /* primary */ { + super/*Any*/() + /* () */ + + } + + override val String.extProp: String + override get(): String { + return (.#$$delegate_0, ).() + } + + override val prop: String + override get(): String { + return .#$$delegate_0.() + } + +} + class ExplicitOverride : IFoo { constructor() /* primary */ { super/*Any*/() @@ -49,14 +34,30 @@ class ExplicitOverride : IFoo { } - override val prop: String - override get(): String { - return "" - } - override val String.extProp: String override get(): String { return "" } + override val prop: String + override get(): String { + return "" + } + } + +interface IFoo { + @Deprecated(message = "") + val String.extProp: String + get(): String { + return "" + } + + @Deprecated(message = "") + val prop: String + get(): String { + return "" + } + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/javaAnnotationWithSingleArrayArgument.fir.ir.txt b/compiler/testData/ir/irText/declarations/annotations/javaAnnotationWithSingleArrayArgument.fir.ir.txt index 2342d6fab99..20a2ef6cee9 100644 --- a/compiler/testData/ir/irText/declarations/annotations/javaAnnotationWithSingleArrayArgument.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/javaAnnotationWithSingleArrayArgument.fir.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/C.kt CLASS ANNOTATION_CLASS name:Anno modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Anno - CONSTRUCTOR visibility:public <> (token:kotlin.String) returnType:.Anno [primary] - VALUE_PARAMETER name:token index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Anno modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:token visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:token type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/C.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Anno' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:token type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Anno declared in .Anno.' type=.Anno origin=null + CONSTRUCTOR visibility:public <> (token:kotlin.String) returnType:.Anno [primary] + VALUE_PARAMETER name:token index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Anno 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 declared in kotlin.Annotation @@ -30,68 +30,8 @@ FILE fqName: fileName:/C.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.E - CONSTRUCTOR visibility:private <> () returnType:.E [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .E - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>]' - ENUM_ENTRY name:EA - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .E' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.E> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.E - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.E> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>, other:.E) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> - VALUE_PARAMETER name:other index:0 type:.E - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.E>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> CLASS ANNOTATION_CLASS name:Annos modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Annos - CONSTRUCTOR visibility:public <> (value:kotlin.Array<.Anno>) returnType:.Annos [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Array<.Anno> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Annos modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array<.Anno> visibility:private [final] EXPRESSION_BODY @@ -103,99 +43,11 @@ FILE fqName: fileName:/C.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array<.Anno> declared in .Annos' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array<.Anno> visibility:private [final]' type=kotlin.Array<.Anno> origin=null receiver: GET_VAR ': .Annos declared in .Annos.' type=.Annos 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.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:Strings modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Strings - CONSTRUCTOR visibility:public <> (value:kotlin.Array) returnType:.Strings [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Array + CONSTRUCTOR visibility:public <> (value:kotlin.Array<.Anno>) returnType:.Annos [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Array<.Anno> BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Strings modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.Array declared in .Strings.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Strings) returnType:kotlin.Array - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Strings - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in .Strings' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null - receiver: GET_VAR ': .Strings declared in .Strings.' type=.Strings 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.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:Ints modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ints - CONSTRUCTOR visibility:public <> (value:kotlin.IntArray) returnType:.Ints [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.IntArray - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ints modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.IntArray visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.IntArray declared in .Ints.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Ints) returnType:kotlin.IntArray - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Ints - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in .Ints' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null - receiver: GET_VAR ': .Ints declared in .Ints.' type=.Ints 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.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:Enums modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Enums - CONSTRUCTOR visibility:public <> (value:kotlin.Array<.E>) returnType:.Enums [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Array<.E> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Enums modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array<.E> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.Array<.E> declared in .Enums.' type=kotlin.Array<.E> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Enums) returnType:kotlin.Array<.E> - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Enums - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array<.E> declared in .Enums' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array<.E> visibility:private [final]' type=kotlin.Array<.E> origin=null - receiver: GET_VAR ': .Enums declared in .Enums.' type=.Enums origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Annos 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 declared in kotlin.Annotation @@ -211,11 +63,6 @@ FILE fqName: fileName:/C.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:Classes modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Classes - CONSTRUCTOR visibility:public <> (value:kotlin.Array>) returnType:.Classes [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Array> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Classes modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array> visibility:private [final] EXPRESSION_BODY @@ -227,6 +74,104 @@ FILE fqName: fileName:/C.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array> declared in .Classes' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array> visibility:private [final]' type=kotlin.Array> origin=null receiver: GET_VAR ': .Classes declared in .Classes.' type=.Classes origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.Array>) returnType:.Classes [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Array> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Classes 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Enums modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Enums + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array<.E> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.Array<.E> declared in .Enums.' type=kotlin.Array<.E> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Enums) returnType:kotlin.Array<.E> + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Enums + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array<.E> declared in .Enums' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array<.E> visibility:private [final]' type=kotlin.Array<.E> origin=null + receiver: GET_VAR ': .Enums declared in .Enums.' type=.Enums origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.Array<.E>) returnType:.Enums [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Array<.E> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Enums 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Ints modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ints + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.IntArray visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.IntArray declared in .Ints.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Ints) returnType:kotlin.IntArray + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Ints + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in .Ints' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null + receiver: GET_VAR ': .Ints declared in .Ints.' type=.Ints origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.IntArray) returnType:.Ints [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.IntArray + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ints 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Strings modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Strings + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.Array declared in .Strings.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Strings) returnType:kotlin.Array + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Strings + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in .Strings' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null + receiver: GET_VAR ': .Strings declared in .Strings.' type=.Strings origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.Array) returnType:.Strings [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Array + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Strings 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 declared in kotlin.Annotation @@ -246,6 +191,15 @@ FILE fqName: fileName:/C.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A]' + 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 .A + $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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any FUN FAKE_OVERRIDE name:test visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override] annotations: Annos(value = Anno(token = "OK")) @@ -256,16 +210,62 @@ FILE fqName: fileName:/C.kt overridden: public open fun test (): kotlin.Unit declared in .A $this: VALUE_PARAMETER name: type:.A - 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 .A - $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 .A - $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 .A $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.E + ENUM_ENTRY name:EA + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .E' + CONSTRUCTOR visibility:private <> () returnType:.E [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .E + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.E + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.E> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>, other:.E) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + VALUE_PARAMETER name:other index:0 type:.E + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.E>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.E> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> diff --git a/compiler/testData/ir/irText/declarations/annotations/javaAnnotationWithSingleArrayArgument.ir.txt b/compiler/testData/ir/irText/declarations/annotations/javaAnnotationWithSingleArrayArgument.ir.txt index c754835f07c..323776df7f5 100644 --- a/compiler/testData/ir/irText/declarations/annotations/javaAnnotationWithSingleArrayArgument.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/javaAnnotationWithSingleArrayArgument.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/C.kt CLASS ANNOTATION_CLASS name:Anno modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Anno - CONSTRUCTOR visibility:public <> (token:kotlin.String) returnType:.Anno [primary] - VALUE_PARAMETER name:token index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Anno modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:token visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:token type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/C.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Anno' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:token type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Anno declared in .Anno.' type=.Anno origin=null + CONSTRUCTOR visibility:public <> (token:kotlin.String) returnType:.Anno [primary] + VALUE_PARAMETER name:token index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Anno 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 declared in kotlin.Annotation @@ -30,68 +30,8 @@ FILE fqName: fileName:/C.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.E - CONSTRUCTOR visibility:private <> () returnType:.E [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .E - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>]' - ENUM_ENTRY name:EA - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .E' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>, other:.E) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> - VALUE_PARAMETER name:other index:0 type:.E - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.E>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.E> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.E - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.E> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES CLASS ANNOTATION_CLASS name:Annos modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Annos - CONSTRUCTOR visibility:public <> (value:kotlin.Array<.Anno>) returnType:.Annos [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Array<.Anno> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Annos modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array<.Anno> visibility:private [final] EXPRESSION_BODY @@ -103,99 +43,11 @@ FILE fqName: fileName:/C.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array<.Anno> declared in .Annos' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array<.Anno> visibility:private [final]' type=kotlin.Array<.Anno> origin=null receiver: GET_VAR ': .Annos declared in .Annos.' type=.Annos 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.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:Strings modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Strings - CONSTRUCTOR visibility:public <> (value:kotlin.Array) returnType:.Strings [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Array + CONSTRUCTOR visibility:public <> (value:kotlin.Array<.Anno>) returnType:.Annos [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Array<.Anno> BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Strings modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.Array declared in .Strings.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Strings) returnType:kotlin.Array - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Strings - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in .Strings' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null - receiver: GET_VAR ': .Strings declared in .Strings.' type=.Strings 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.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:Ints modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ints - CONSTRUCTOR visibility:public <> (value:kotlin.IntArray) returnType:.Ints [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.IntArray - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ints modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.IntArray visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.IntArray declared in .Ints.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Ints) returnType:kotlin.IntArray - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Ints - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in .Ints' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null - receiver: GET_VAR ': .Ints declared in .Ints.' type=.Ints 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.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ANNOTATION_CLASS name:Enums modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Enums - CONSTRUCTOR visibility:public <> (value:kotlin.Array<.E>) returnType:.Enums [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Array<.E> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Enums modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array<.E> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.Array<.E> declared in .Enums.' type=kotlin.Array<.E> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Enums) returnType:kotlin.Array<.E> - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Enums - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array<.E> declared in .Enums' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array<.E> visibility:private [final]' type=kotlin.Array<.E> origin=null - receiver: GET_VAR ': .Enums declared in .Enums.' type=.Enums origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Annos 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 declared in kotlin.Annotation @@ -211,11 +63,6 @@ FILE fqName: fileName:/C.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:Classes modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Classes - CONSTRUCTOR visibility:public <> (value:kotlin.Array>) returnType:.Classes [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Array> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Classes modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array> visibility:private [final] EXPRESSION_BODY @@ -227,6 +74,104 @@ FILE fqName: fileName:/C.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array> declared in .Classes' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array> visibility:private [final]' type=kotlin.Array> origin=null receiver: GET_VAR ': .Classes declared in .Classes.' type=.Classes origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.Array>) returnType:.Classes [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Array> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Classes 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Enums modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Enums + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array<.E> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.Array<.E> declared in .Enums.' type=kotlin.Array<.E> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Enums) returnType:kotlin.Array<.E> + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Enums + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array<.E> declared in .Enums' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array<.E> visibility:private [final]' type=kotlin.Array<.E> origin=null + receiver: GET_VAR ': .Enums declared in .Enums.' type=.Enums origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.Array<.E>) returnType:.Enums [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Array<.E> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Enums 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Ints modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ints + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.IntArray visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.IntArray declared in .Ints.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Ints) returnType:kotlin.IntArray + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Ints + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in .Ints' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null + receiver: GET_VAR ': .Ints declared in .Ints.' type=.Ints origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.IntArray) returnType:.Ints [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.IntArray + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ints 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Strings modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Strings + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.Array declared in .Strings.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Strings) returnType:kotlin.Array + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Strings + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in .Strings' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null + receiver: GET_VAR ': .Strings declared in .Strings.' type=.Strings origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.Array) returnType:.Strings [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Array + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Strings 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 declared in kotlin.Annotation @@ -255,10 +200,6 @@ FILE fqName: fileName:/C.kt overridden: public open fun hashCode (): kotlin.Int declared in .A $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 .A - $this: VALUE_PARAMETER name: type:kotlin.Any FUN FAKE_OVERRIDE name:test visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override] annotations: Annos(value = [Anno(token = "OK")]) @@ -269,3 +210,62 @@ FILE fqName: fileName:/C.kt overridden: public open fun test (): kotlin.Unit declared in .A $this: VALUE_PARAMETER name: type:.A + 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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.E + ENUM_ENTRY name:EA + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .E' + CONSTRUCTOR visibility:private <> () returnType:.E [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .E + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.E + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.E> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>, other:.E) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + VALUE_PARAMETER name:other index:0 type:.E + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.E>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.E> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> diff --git a/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.ir.txt index b5d6eab46e2..42d5adb34e1 100644 --- a/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/localDelegatedPropertiesWithAnnotations.kt CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.A [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/localDelegatedPropertiesWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.kt.txt index 9c5cfa0c531..166b40fb50f 100644 --- a/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.kt.txt @@ -1,14 +1,14 @@ open annotation class A : Annotation { + val x: String + field = x + get + constructor(x: String) /* primary */ { super/*Any*/() /* () */ } - val x: String - field = x - get - } fun foo(m: Map) { @@ -23,3 +23,4 @@ fun foo(m: Map) { } } + diff --git a/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.ir.txt index 5d2043b7354..333500bd6c3 100644 --- a/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.ir.txt @@ -20,13 +20,6 @@ FILE fqName: fileName:/primaryConstructorParameterWithAnnotations.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - annotations: - Ann - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -38,6 +31,13 @@ FILE fqName: fileName:/primaryConstructorParameterWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + annotations: + Ann + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.kt.txt index e58a3dbc829..26100ad9ac9 100644 --- a/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.kt.txt @@ -8,14 +8,15 @@ open annotation class Ann : Annotation { } class Test { + val x: Int + field = x + get + constructor(@Ann x: Int) /* primary */ { super/*Any*/() /* () */ } - val x: Int - field = x - get - } + diff --git a/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.ir.txt index f37540520c4..df03f6e16e0 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.ir.txt @@ -1,11 +1,17 @@ FILE fqName: fileName:/propertiesWithAnnotations.kt + PROPERTY name:testVal visibility:public modality:FINAL [val] + annotations: + TestAnn(x = "testVal.property") + FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:private [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:testVal visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +23,11 @@ FILE fqName: fileName:/propertiesWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn 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 declared in kotlin.Annotation @@ -30,14 +41,3 @@ FILE fqName: fileName:/propertiesWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:testVal visibility:public modality:FINAL [val] - annotations: - TestAnn(x = "testVal.property") - FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:private [final,static] - EXPRESSION_BODY - CONST String type=kotlin.String value="" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String - correspondingProperty: PROPERTY name:testVal visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt.txt index 15ae5cfee05..e898e903198 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt.txt @@ -1,17 +1,18 @@ +@TestAnn(x = "testVal.property") +val testVal: String + field = "" + get + open annotation class TestAnn : Annotation { + val x: String + field = x + get + constructor(x: String) /* primary */ { super/*Any*/() /* () */ } - val x: String - field = x - get - } -@TestAnn(x = "testVal.property") -val testVal: String - field = "" - get diff --git a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.ir.txt index c26b5136cae..e7ea8d89605 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/propertyAccessorsFromClassHeaderWithAnnotations.kt CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.A [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/propertyAccessorsFromClassHeaderWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A 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 declared in kotlin.Annotation @@ -32,12 +32,6 @@ FILE fqName: fileName:/propertyAccessorsFromClassHeaderWithAnnotations.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.C [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -74,6 +68,12 @@ FILE fqName: fileName:/propertyAccessorsFromClassHeaderWithAnnotations.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.kt.txt index d8410cf5bde..826e31f8cf9 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.kt.txt @@ -1,23 +1,17 @@ open annotation class A : Annotation { + val x: String + field = x + get + constructor(x: String) /* primary */ { super/*Any*/() /* () */ } - val x: String - field = x - get - } class C { - constructor(x: Int, y: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x @A(x = "C.x.get") @@ -30,4 +24,11 @@ class C { @A(x = "C.y.set") set + constructor(x: Int, y: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.ir.txt index 3e985d04078..3ac15f3f9ec 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.ir.txt @@ -1,11 +1,36 @@ FILE fqName: fileName:/propertyAccessorsWithAnnotations.kt + PROPERTY name:test3 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.String visibility:private [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + annotations: + TestAnn(x = "test3.get") + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null + PROPERTY name:test4 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:private [static] + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + annotations: + TestAnn(x = "test4.get") + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:private [static]' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.String) returnType:kotlin.Unit + annotations: + TestAnn(x = "test4.set") + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.String + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.String declared in .' type=kotlin.String origin=null CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +42,11 @@ FILE fqName: fileName:/propertyAccessorsWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn 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 declared in kotlin.Annotation @@ -52,33 +82,3 @@ FILE fqName: fileName:/propertyAccessorsWithAnnotations.kt correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] VALUE_PARAMETER name:value index:0 type:kotlin.String BLOCK_BODY - PROPERTY name:test3 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.String visibility:private [final,static] - EXPRESSION_BODY - CONST String type=kotlin.String value="" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String - annotations: - TestAnn(x = "test3.get") - correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null - PROPERTY name:test4 visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:private [static] - EXPRESSION_BODY - CONST String type=kotlin.String value="" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String - annotations: - TestAnn(x = "test4.get") - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:private [static]' type=kotlin.String origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.String) returnType:kotlin.Unit - annotations: - TestAnn(x = "test4.set") - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.String - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.String declared in .' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt.txt index aa1b30a46a1..49578e661ca 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt.txt @@ -1,14 +1,26 @@ +val test3: String + field = "" + @TestAnn(x = "test3.get") + get + +var test4: String + field = "" + @TestAnn(x = "test4.get") + get + @TestAnn(x = "test4.set") + set + open annotation class TestAnn : Annotation { + val x: String + field = x + get + constructor(x: String) /* primary */ { super/*Any*/() /* () */ } - val x: String - field = x - get - } val test1: String @@ -26,14 +38,3 @@ var test2: String set(value: String) { } -val test3: String - field = "" - @TestAnn(x = "test3.get") - get - -var test4: String - field = "" - @TestAnn(x = "test4.get") - get - @TestAnn(x = "test4.set") - set diff --git a/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.ir.txt index 53a8bad1b42..25d6a155b42 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.ir.txt @@ -1,4 +1,21 @@ FILE fqName: fileName:/propertySetterParameterWithAnnotations.kt + PROPERTY name:p visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + annotations: + AnnParam + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null CLASS ANNOTATION_CLASS name:AnnParam modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnParam CONSTRUCTOR visibility:public <> () returnType:.AnnParam [primary] @@ -18,30 +35,8 @@ FILE fqName: fileName:/propertySetterParameterWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:p visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Int - annotations: - AnnParam - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (p:kotlin.Int) returnType:.C [primary] - VALUE_PARAMETER name:p index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:p visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private EXPRESSION_BODY @@ -63,6 +58,11 @@ FILE fqName: fileName:/propertySetterParameterWithAnnotations.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (p:kotlin.Int) returnType:.C [primary] + VALUE_PARAMETER name:p index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt.txt index 669fcd29eec..3da7507e4f4 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt.txt @@ -1,3 +1,8 @@ +var p: Int + field = 0 + get + set + open annotation class AnnParam : Annotation { constructor() /* primary */ { super/*Any*/() @@ -7,21 +12,17 @@ open annotation class AnnParam : Annotation { } -var p: Int - field = 0 - get - set - class C { + var p: Int + field = p + get + set + constructor(p: Int) /* primary */ { super/*Any*/() /* () */ } - var p: Int - field = p - get - set - } + diff --git a/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.ir.txt index a25ad3073d0..37347a3ecca 100644 --- a/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.ir.txt @@ -24,6 +24,19 @@ FILE fqName: fileName:/receiverParameterWithAnnotations.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 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:f visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.String) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.A $receiver: VALUE_PARAMETER name: type:kotlin.String @@ -42,19 +55,6 @@ FILE fqName: fileName:/receiverParameterWithAnnotations.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' CONST String type=kotlin.String value="" - 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: 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:topLevelF visibility:public modality:FINAL <> ($receiver:kotlin.String?) returnType:kotlin.String $receiver: VALUE_PARAMETER name: type:kotlin.String? annotations: diff --git a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.ir.txt b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.ir.txt index 4b4e87606a3..12e32cc9c8e 100644 --- a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/spreadOperatorInAnnotationArguments.kt CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (xs:kotlin.Array) returnType:.A [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/spreadOperatorInAnnotationArguments.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (xs:kotlin.Array) returnType:.A [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.kt.txt index 792f0c2e61d..0a537533eb3 100644 --- a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.kt.txt @@ -1,16 +1,17 @@ open annotation class A : Annotation { + val xs: Array + field = xs + get + constructor(vararg xs: String) /* primary */ { super/*Any*/() /* () */ } - val xs: Array - field = xs - get - } @A(xs = ["a", "b"]) fun test() { } + diff --git a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.ir.txt b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.ir.txt index f389cec3e3c..8a3bf3b9852 100644 --- a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/spreadOperatorInAnnotationArguments.kt CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (xs:kotlin.Array) returnType:.A [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/spreadOperatorInAnnotationArguments.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (xs:kotlin.Array) returnType:.A [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.kt.txt b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.kt.txt index 7f8c257a5fe..0ad1abd3246 100644 --- a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.kt.txt @@ -1,16 +1,17 @@ open annotation class A : Annotation { + val xs: Array + field = xs + get + constructor(vararg xs: String) /* primary */ { super/*Any*/() /* () */ } - val xs: Array - field = xs - get - } @A(xs = [["a"], ["b"]]) fun test() { } + diff --git a/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.ir.txt index e3c4057b4ab..d98633dc54c 100644 --- a/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.ir.txt @@ -3,11 +3,6 @@ FILE fqName: fileName:/typeAliasesWithAnnotations.kt annotations: Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPEALIAS' type=kotlin.annotation.AnnotationTarget]) $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -19,6 +14,11 @@ FILE fqName: fileName:/typeAliasesWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.kt.txt index 7c210eb936e..60ad0de7ccf 100644 --- a/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.kt.txt @@ -1,15 +1,15 @@ @Target(allowedTargets = [AnnotationTarget.TYPEALIAS]) open annotation class TestAnn : Annotation { + val x: String + field = x + get + constructor(x: String) /* primary */ { super/*Any*/() /* () */ } - val x: String - field = x - get - } @TestAnn(x = "TestTypeAlias") diff --git a/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.ir.txt index a17a4acfac0..6f4dc239f5e 100644 --- a/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/valueParametersWithAnnotations.kt CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/valueParametersWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn 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 declared in kotlin.Annotation @@ -30,20 +30,8 @@ FILE fqName: fileName:/valueParametersWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testFun visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:kotlin.Int - annotations: - TestAnn(x = "testFun.x") - BLOCK_BODY CLASS CLASS name:TestClassConstructor1 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClassConstructor1 - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestClassConstructor1 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - annotations: - TestAnn(x = "TestClassConstructor1.x") - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClassConstructor1 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:xx visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -55,6 +43,13 @@ FILE fqName: fileName:/valueParametersWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestClassConstructor1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .TestClassConstructor1 declared in .TestClassConstructor1.' type=.TestClassConstructor1 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestClassConstructor1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + annotations: + TestAnn(x = "TestClassConstructor1.x") + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClassConstructor1 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -68,3 +63,8 @@ FILE fqName: fileName:/valueParametersWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testFun visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Int + annotations: + TestAnn(x = "testFun.x") + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.kt.txt index 081cf455943..bdffbe17cfd 100644 --- a/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.kt.txt @@ -1,28 +1,29 @@ open annotation class TestAnn : Annotation { + val x: String + field = x + get + constructor(x: String) /* primary */ { super/*Any*/() /* () */ } - val x: String - field = x - get - -} - -fun testFun(@TestAnn(x = "testFun.x") x: Int) { } class TestClassConstructor1 { + val xx: Int + field = x + get + constructor(@TestAnn(x = "TestClassConstructor1.x") x: Int) /* primary */ { super/*Any*/() /* () */ } - val xx: Int - field = x - get - } + +fun testFun(@TestAnn(x = "testFun.x") x: Int) { +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.ir.txt b/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.ir.txt index 0e8bf738c62..114dc5a92fc 100644 --- a/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/varargsInAnnotationArguments.kt CLASS ANNOTATION_CLASS name:A1 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A1 - CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:.A1 [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A1 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.IntArray visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/varargsInAnnotationArguments.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in .A1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null receiver: GET_VAR ': .A1 declared in .A1.' type=.A1 origin=null + CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:.A1 [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A1 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 declared in kotlin.Annotation @@ -32,11 +32,6 @@ FILE fqName: fileName:/varargsInAnnotationArguments.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:A2 modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A2 - CONSTRUCTOR visibility:public <> (xs:kotlin.Array) returnType:.A2 [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A2 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final] EXPRESSION_BODY @@ -48,6 +43,11 @@ FILE fqName: fileName:/varargsInAnnotationArguments.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in .A2' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null receiver: GET_VAR ': .A2 declared in .A2.' type=.A2 origin=null + CONSTRUCTOR visibility:public <> (xs:kotlin.Array) returnType:.A2 [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A2 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 declared in kotlin.Annotation @@ -63,11 +63,6 @@ FILE fqName: fileName:/varargsInAnnotationArguments.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:AA modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AA - CONSTRUCTOR visibility:public <> (xs:kotlin.Array.A1>) returnType:.AA [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.Array.A1> varargElementType:.A1 [vararg] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:AA modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array.A1> visibility:private [final] EXPRESSION_BODY @@ -79,6 +74,11 @@ FILE fqName: fileName:/varargsInAnnotationArguments.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array.A1> declared in .AA' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array.A1> visibility:private [final]' type=kotlin.Array.A1> origin=null receiver: GET_VAR ': .AA declared in .AA.' type=.AA origin=null + CONSTRUCTOR visibility:public <> (xs:kotlin.Array.A1>) returnType:.AA [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.Array.A1> varargElementType:.A1 [vararg] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:AA 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.kt.txt b/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.kt.txt index 487d5addbaa..e2fb7470807 100644 --- a/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.kt.txt @@ -1,40 +1,40 @@ open annotation class A1 : Annotation { + val xs: IntArray + field = xs + get + constructor(vararg xs: Int) /* primary */ { super/*Any*/() /* () */ } - val xs: IntArray - field = xs - get - } open annotation class A2 : Annotation { + val xs: Array + field = xs + get + constructor(vararg xs: String) /* primary */ { super/*Any*/() /* () */ } - val xs: Array - field = xs - get - } open annotation class AA : Annotation { + val xs: Array + field = xs + get + constructor(vararg xs: A1) /* primary */ { super/*Any*/() /* () */ } - val xs: Array - field = xs - get - } @A1(xs = [1, 2, 3]) @@ -48,3 +48,4 @@ fun test1() { @AA(xs = []) fun test2() { } + diff --git a/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.ir.txt index 2521a0d3d3f..bad75d329a1 100644 --- a/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/variablesWithAnnotations.kt CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/variablesWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.kt.txt index 095fccbc585..87f3a2b8a77 100644 --- a/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.kt.txt @@ -1,14 +1,14 @@ open annotation class TestAnn : Annotation { + val x: String + field = x + get + constructor(x: String) /* primary */ { super/*Any*/() /* () */ } - val x: String - field = x - get - } fun foo() { @@ -17,3 +17,4 @@ fun foo() { @TestAnn(x = "foo/testVar") var testVar: String = "testVar" } + diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.ir.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.ir.txt index a7203987831..372a60fedfd 100644 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.ir.txt +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/classLevelProperties.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -16,13 +12,6 @@ FILE fqName: fileName:/classLevelProperties.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - PROPERTY name:test2 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - CONST Int type=kotlin.Int value=0 PROPERTY name:test3 visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private EXPRESSION_BODY @@ -143,6 +132,10 @@ FILE fqName: fileName:/classLevelProperties.kt thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null property: PROPERTY_REFERENCE 'public final test8: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in .C' setter='public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -156,3 +149,10 @@ FILE fqName: fileName:/classLevelProperties.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:test2 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + CONST Int type=kotlin.Int value=0 diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.kt.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.kt.txt index 7febedbcc3e..fd23ccbbe7f 100644 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.kt.txt +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.kt.txt @@ -1,19 +1,8 @@ class C { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val test1: Int field = 0 get - val test2: Int - get(): Int { - return 0 - } - var test3: Int field = 0 get @@ -53,4 +42,16 @@ class C { return .#test8$delegate.setValue(thisRef = , property = C::test8, value = ) } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + val test2: Int + get(): Int { + return 0 + } + } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt index 9f231c00f93..939920c6ba0 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt @@ -1,11 +1,21 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt + PROPERTY name:operationScore visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyContainer - CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.MyContainer [primary] - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:i visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private EXPRESSION_BODY @@ -25,6 +35,11 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .MyContainer declared in .MyContainer.' type=.MyContainer origin=null value: GET_VAR ': kotlin.Int declared in .MyContainer.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.MyContainer [primary] + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.MyContainer) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.MyContainer BLOCK_BODY @@ -41,27 +56,6 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): .MyContainer declared in .MyContainer' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .MyContainer' type=.MyContainer origin=null i: GET_VAR 'i: kotlin.Int declared in .MyContainer.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.MyContainer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyContainer' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="MyContainer(" - CONST String type=kotlin.String value="i=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .MyContainer declared in .MyContainer.toString' type=.MyContainer origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.MyContainer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyContainer' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .MyContainer declared in .MyContainer.hashCode' type=.MyContainer origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.MyContainer, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -96,74 +90,27 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=true - PROPERTY name:operationScore visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.MyContainer BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Int + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyContainer' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .MyContainer declared in .MyContainer.hashCode' type=.MyContainer origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.MyContainer BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.Int [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:index index:1 type:kotlin.Int - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .get' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int declared in ' - WHEN type=kotlin.Int origin=IF - 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 'index: kotlin.Int declared in .get' type=kotlin.Int origin=null - arg1: CONST Int type=kotlin.Int value=0 - then: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .MyContainer declared in .get' type=.MyContainer origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Int type=kotlin.Int value=-1 - FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, other:.MyContainer) returnType:kotlin.Unit [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.MyContainer - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyContainer' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .MyContainer declared in .plusAssign' type=.MyContainer origin=null - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .MyContainer declared in .plusAssign' type=.MyContainer origin=null - other: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .MyContainer declared in .plusAssign' type=.MyContainer origin=null - FUN name:inc visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int) returnType:.MyContainer [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun inc ($context_receiver_0: kotlin.Int): .MyContainer declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .MyContainer' type=.MyContainer origin=null - i: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .MyContainer declared in .inc' type=.MyContainer origin=null - other: CONST Int type=kotlin.Int value=1 + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyContainer' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="MyContainer(" + CONST String type=kotlin.String value="i=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .MyContainer declared in .MyContainer.toString' type=.MyContainer origin=null + CONST String type=kotlin.String value=")" FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:myContainer type:.MyContainer [var] @@ -211,3 +158,56 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="fail" + FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.Int [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.MyContainer + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:index index:1 type:kotlin.Int + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .get' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int declared in ' + WHEN type=kotlin.Int origin=IF + 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 'index: kotlin.Int declared in .get' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .MyContainer declared in .get' type=.MyContainer origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Int type=kotlin.Int value=-1 + FUN name:inc visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int) returnType:.MyContainer [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.MyContainer + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun inc ($context_receiver_0: kotlin.Int): .MyContainer declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .MyContainer' type=.MyContainer origin=null + i: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .MyContainer declared in .inc' type=.MyContainer origin=null + other: CONST Int type=kotlin.Int value=1 + FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, other:.MyContainer) returnType:kotlin.Unit [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.MyContainer + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.MyContainer + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyContainer' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .MyContainer declared in .plusAssign' type=.MyContainer origin=null + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .MyContainer declared in .plusAssign' type=.MyContainer origin=null + other: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .MyContainer declared in .plusAssign' type=.MyContainer origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt index b23c19e295d..bce2f5e64ad 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt @@ -1,15 +1,20 @@ +var operationScore: Int + field = 0 + get + set + data class MyContainer { + var i: Int + field = i + get + set + constructor(i: Int) /* primary */ { super/*Any*/() /* () */ } - var i: Int - field = i - get - set - operator fun component1(): Int { return .#i } @@ -18,14 +23,6 @@ data class MyContainer { return MyContainer(i = i) } - override fun toString(): String { - return "MyContainer(" + "i=" + .#i + ")" - } - - override fun hashCode(): Int { - return .#i.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -40,29 +37,14 @@ data class MyContainer { return true } -} - -var operationScore: Int - field = 0 - get - set - -operator fun MyContainer.get($context_receiver_0: Int, index: Int): Int { - ( = ().plus(other = $context_receiver_0)) - return when { - EQEQ(arg0 = index, arg1 = 0) -> .() - else -> -1 + override fun hashCode(): Int { + return .#i.hashCode() } -} -operator fun MyContainer.plusAssign($context_receiver_0: Int, other: MyContainer) { - ( = ().plus(other = $context_receiver_0)) - .( = .().plus(other = other.())) -} + override fun toString(): String { + return "MyContainer(" + "i=" + .#i + ")" + } -operator fun MyContainer.inc($context_receiver_0: Int): MyContainer { - ( = ().plus(other = $context_receiver_0)) - return MyContainer(i = .().plus(other = 1)) } fun box(): String { @@ -84,3 +66,21 @@ fun box(): String { } } +operator fun MyContainer.get($context_receiver_0: Int, index: Int): Int { + ( = ().plus(other = $context_receiver_0)) + return when { + EQEQ(arg0 = index, arg1 = 0) -> .() + else -> -1 + } +} + +operator fun MyContainer.inc($context_receiver_0: Int): MyContainer { + ( = ().plus(other = $context_receiver_0)) + return MyContainer(i = .().plus(other = 1)) +} + +operator fun MyContainer.plusAssign($context_receiver_0: Int, other: MyContainer) { + ( = ().plus(other = $context_receiver_0)) + .( = .().plus(other = other.())) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.ir.txt index 81ef6f3ffc0..2a03960ebfa 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.ir.txt @@ -1,11 +1,21 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt + PROPERTY name:operationScore visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyContainer - CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.MyContainer [primary] - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:i visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private EXPRESSION_BODY @@ -25,6 +35,11 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .MyContainer declared in .MyContainer.' type=.MyContainer origin=null value: GET_VAR ': kotlin.Int declared in .MyContainer.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.MyContainer [primary] + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.MyContainer) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.MyContainer BLOCK_BODY @@ -41,27 +56,6 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): .MyContainer declared in .MyContainer' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .MyContainer' type=.MyContainer origin=null i: GET_VAR 'i: kotlin.Int declared in .MyContainer.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.MyContainer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyContainer' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="MyContainer(" - CONST String type=kotlin.String value="i=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .MyContainer declared in .MyContainer.toString' type=.MyContainer origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.MyContainer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyContainer' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .MyContainer declared in .MyContainer.hashCode' type=.MyContainer origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.MyContainer, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -96,21 +90,74 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=true - PROPERTY name:operationScore visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.MyContainer BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Int + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyContainer' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .MyContainer declared in .MyContainer.hashCode' type=.MyContainer origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.MyContainer BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyContainer' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="MyContainer(" + CONST String type=kotlin.String value="i=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .MyContainer declared in .MyContainer.toString' type=.MyContainer origin=null + CONST String type=kotlin.String value=")" + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:myContainer type:.MyContainer [var] + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .MyContainer' type=.MyContainer origin=null + i: CONST Int type=kotlin.Int value=0 + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.Unit origin=null + : kotlin.Int + : kotlin.Unit + receiver: CONST Int type=kotlin.Int value=1 + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int + BLOCK_BODY + CALL 'public final fun plusAssign ($context_receiver_0: kotlin.Int, other: .MyContainer): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + $receiver: GET_VAR 'var myContainer: .MyContainer declared in .box' type=.MyContainer origin=PLUSEQ + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + other: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .MyContainer' type=.MyContainer origin=null + i: CALL 'public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=GET_ARRAY_ELEMENT + $receiver: BLOCK type=.MyContainer origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.MyContainer [val] + GET_VAR 'var myContainer: .MyContainer declared in .box' type=.MyContainer origin=POSTFIX_INCR + SET_VAR 'var myContainer: .MyContainer declared in .box' type=kotlin.Unit origin=POSTFIX_INCR + CALL 'public final fun inc ($context_receiver_0: kotlin.Int): .MyContainer declared in ' type=.MyContainer origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_1: .MyContainer declared in .box.' type=.MyContainer origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + GET_VAR 'val tmp_1: .MyContainer declared in .box.' type=.MyContainer origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + index: CONST Int type=kotlin.Int value=0 + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + WHEN type=kotlin.String origin=IF + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + 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: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'var myContainer: .MyContainer declared in .box' type=.MyContainer origin=null + arg1: CONST Int type=kotlin.Int value=1 + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + arg1: CONST Int type=kotlin.Int value=3 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CONST String type=kotlin.String value="OK" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST String type=kotlin.String value="fail" FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.Int [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer @@ -133,27 +180,6 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Int type=kotlin.Int value=-1 - FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, other:.MyContainer) returnType:kotlin.Unit [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.MyContainer - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null - BLOCK type=kotlin.Unit origin=PLUSEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.MyContainer [val] - GET_VAR ': .MyContainer declared in .plusAssign' type=.MyContainer origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyContainer' type=kotlin.Unit origin=PLUSEQ - $this: GET_VAR 'val tmp_1: .MyContainer declared in .plusAssign' type=.MyContainer origin=null - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=PLUSEQ - $this: GET_VAR 'val tmp_1: .MyContainer declared in .plusAssign' type=.MyContainer origin=null - other: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .MyContainer declared in .plusAssign' type=.MyContainer origin=null FUN name:inc visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int) returnType:.MyContainer [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer @@ -170,50 +196,24 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt $this: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .MyContainer declared in .inc' type=.MyContainer origin=null other: CONST Int type=kotlin.Int value=1 - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, other:.MyContainer) returnType:kotlin.Unit [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.MyContainer + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.MyContainer BLOCK_BODY - VAR name:myContainer type:.MyContainer [var] - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .MyContainer' type=.MyContainer origin=null - i: CONST Int type=kotlin.Int value=0 - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.Unit origin=null - : kotlin.Int - : kotlin.Unit - receiver: CONST Int type=kotlin.Int value=1 - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int - BLOCK_BODY - CALL 'public final fun plusAssign ($context_receiver_0: kotlin.Int, other: .MyContainer): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - $receiver: GET_VAR 'var myContainer: .MyContainer declared in .box' type=.MyContainer origin=PLUSEQ - $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - other: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .MyContainer' type=.MyContainer origin=null - i: CALL 'public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=GET_ARRAY_ELEMENT - $receiver: BLOCK type=.MyContainer origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.MyContainer [val] - GET_VAR 'var myContainer: .MyContainer declared in .box' type=.MyContainer origin=POSTFIX_INCR - SET_VAR 'var myContainer: .MyContainer declared in .box' type=kotlin.Unit origin=POSTFIX_INCR - CALL 'public final fun inc ($context_receiver_0: kotlin.Int): .MyContainer declared in ' type=.MyContainer origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_2: .MyContainer declared in .box.' type=.MyContainer origin=null - $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - GET_VAR 'val tmp_2: .MyContainer declared in .box.' type=.MyContainer origin=null - $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - index: CONST Int type=kotlin.Int value=0 - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' - WHEN type=kotlin.String origin=IF - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - 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: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'var myContainer: .MyContainer declared in .box' type=.MyContainer origin=null - arg1: CONST Int type=kotlin.Int value=1 - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - arg1: CONST Int type=kotlin.Int value=3 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CONST String type=kotlin.String value="OK" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST String type=kotlin.String value="fail" + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null + BLOCK type=kotlin.Unit origin=PLUSEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.MyContainer [val] + GET_VAR ': .MyContainer declared in .plusAssign' type=.MyContainer origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyContainer' type=kotlin.Unit origin=PLUSEQ + $this: GET_VAR 'val tmp_2: .MyContainer declared in .plusAssign' type=.MyContainer origin=null + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=PLUSEQ + $this: GET_VAR 'val tmp_2: .MyContainer declared in .plusAssign' type=.MyContainer origin=null + other: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .MyContainer declared in .plusAssign' type=.MyContainer origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt.txt index 5bfcb4d2d13..9a7eba6c885 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt.txt @@ -1,15 +1,20 @@ +var operationScore: Int + field = 0 + get + set + data class MyContainer { + var i: Int + field = i + get + set + constructor(i: Int) /* primary */ { super/*Any*/() /* () */ } - var i: Int - field = i - get - set - operator fun component1(): Int { return .#i } @@ -18,14 +23,6 @@ data class MyContainer { return MyContainer(i = i) } - override fun toString(): String { - return "MyContainer(" + "i=" + .#i + ")" - } - - override fun hashCode(): Int { - return .#i.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -40,47 +37,23 @@ data class MyContainer { return true } -} + override fun hashCode(): Int { + return .#i.hashCode() + } -var operationScore: Int - field = 0 - get - set + override fun toString(): String { + return "MyContainer(" + "i=" + .#i + ")" + } -operator fun MyContainer.get($context_receiver_0: Int, index: Int): Int { - { // BLOCK - ( = ().plus(other = $context_receiver_0)) - } - return when { - EQEQ(arg0 = index, arg1 = 0) -> .() - else -> -1 - } -} - -operator fun MyContainer.plusAssign($context_receiver_0: Int, other: MyContainer) { - { // BLOCK - ( = ().plus(other = $context_receiver_0)) - } - { // BLOCK - val tmp_1: MyContainer = - tmp_1.( = tmp_1.().plus(other = other.())) - } -} - -operator fun MyContainer.inc($context_receiver_0: Int): MyContainer { - { // BLOCK - ( = ().plus(other = $context_receiver_0)) - } - return MyContainer(i = .().plus(other = 1)) } fun box(): String { var myContainer: MyContainer = MyContainer(i = 0) with(receiver = 1, block = local fun Int.() { myContainer.plusAssign($context_receiver_0 = $this$with, other = MyContainer(i = { // BLOCK - val tmp_2: MyContainer = myContainer - myContainer = tmp_2.inc($context_receiver_0 = $this$with) - tmp_2 + val tmp_1: MyContainer = myContainer + myContainer = tmp_1.inc($context_receiver_0 = $this$with) + tmp_1 }.get($context_receiver_0 = $this$with, index = 0))) } ) @@ -92,3 +65,31 @@ fun box(): String { else -> "fail" } } + +operator fun MyContainer.get($context_receiver_0: Int, index: Int): Int { + { // BLOCK + ( = ().plus(other = $context_receiver_0)) + } + return when { + EQEQ(arg0 = index, arg1 = 0) -> .() + else -> -1 + } +} + +operator fun MyContainer.inc($context_receiver_0: Int): MyContainer { + { // BLOCK + ( = ().plus(other = $context_receiver_0)) + } + return MyContainer(i = .().plus(other = 1)) +} + +operator fun MyContainer.plusAssign($context_receiver_0: Int, other: MyContainer) { + { // BLOCK + ( = ().plus(other = $context_receiver_0)) + } + { // BLOCK + val tmp_2: MyContainer = + tmp_2.( = tmp_2.().plus(other = other.())) + } +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt index 858fc573665..741788eec78 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/arrayAccessOperators.kt CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyContainer - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.MyContainer [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private EXPRESSION_BODY @@ -25,6 +20,11 @@ FILE fqName: fileName:/arrayAccessOperators.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .MyContainer declared in .MyContainer.' type=.MyContainer origin=null value: GET_VAR ': kotlin.String declared in .MyContainer.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.MyContainer [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.MyContainer) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.MyContainer BLOCK_BODY @@ -41,27 +41,6 @@ FILE fqName: fileName:/arrayAccessOperators.kt RETURN type=kotlin.Nothing from='public final fun copy (s: kotlin.String): .MyContainer declared in .MyContainer' CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in .MyContainer' type=.MyContainer origin=null s: GET_VAR 's: kotlin.String declared in .MyContainer.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.MyContainer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyContainer' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="MyContainer(" - CONST String type=kotlin.String value="s=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null - receiver: GET_VAR ': .MyContainer declared in .MyContainer.toString' type=.MyContainer origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.MyContainer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyContainer' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null - receiver: GET_VAR ': .MyContainer declared in .MyContainer.hashCode' type=.MyContainer origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.MyContainer, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -96,6 +75,62 @@ FILE fqName: fileName:/arrayAccessOperators.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.MyContainer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyContainer' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null + receiver: GET_VAR ': .MyContainer declared in .MyContainer.hashCode' type=.MyContainer origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.MyContainer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyContainer' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="MyContainer(" + CONST String type=kotlin.String value="s=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null + receiver: GET_VAR ': .MyContainer declared in .MyContainer.toString' type=.MyContainer origin=null + CONST String type=kotlin.String value=")" + 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 ' + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.String origin=null + : kotlin.Int + : kotlin.String + receiver: CONST Int type=kotlin.Int value=42 + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.String + $receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int + BLOCK_BODY + VAR name:myContainer type:.MyContainer [val] + CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in .MyContainer' type=.MyContainer origin=null + s: CONST String type=kotlin.String value="fail" + CALL 'public final fun set ($context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $receiver: GET_VAR 'val myContainer: .MyContainer declared in .box.' type=.MyContainer origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + index: CONST Int type=kotlin.Int value=0 + value: CONST String type=kotlin.String value="OK" + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' + BLOCK type=kotlin.String origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] + CALL 'public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? declared in ' type=kotlin.String? origin=GET_ARRAY_ELEMENT + $receiver: GET_VAR 'val myContainer: .MyContainer declared in .box.' type=.MyContainer origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + index: CONST Int type=kotlin.Int value=0 + 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_1: kotlin.String? declared in .box.' type=kotlin.String? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST String type=kotlin.String value="fail" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_1: kotlin.String? declared in .box.' type=kotlin.String? origin=null FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.String? [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer @@ -148,38 +183,3 @@ FILE fqName: fileName:/arrayAccessOperators.kt CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .MyContainer' type=kotlin.Unit origin=EQ $this: GET_VAR ': .MyContainer declared in .set' type=.MyContainer origin=null : GET_VAR 'value: kotlin.String declared in .set' type=kotlin.String 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 ' - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.String origin=null - : kotlin.Int - : kotlin.String - receiver: CONST Int type=kotlin.Int value=42 - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.String - $receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int - BLOCK_BODY - VAR name:myContainer type:.MyContainer [val] - CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in .MyContainer' type=.MyContainer origin=null - s: CONST String type=kotlin.String value="fail" - CALL 'public final fun set ($context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'val myContainer: .MyContainer declared in .box.' type=.MyContainer origin=null - $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - index: CONST Int type=kotlin.Int value=0 - value: CONST String type=kotlin.String value="OK" - RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' - BLOCK type=kotlin.String origin=ELVIS - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] - CALL 'public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? declared in ' type=kotlin.String? origin=GET_ARRAY_ELEMENT - $receiver: GET_VAR 'val myContainer: .MyContainer declared in .box.' type=.MyContainer origin=null - $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - index: CONST Int type=kotlin.Int value=0 - 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_1: kotlin.String? declared in .box.' type=kotlin.String? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST String type=kotlin.String value="fail" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_1: kotlin.String? declared in .box.' type=kotlin.String? origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt index ff25da40ff3..f5b3fad3311 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt @@ -1,15 +1,15 @@ data class MyContainer { + var s: String + field = s + get + set + constructor(s: String) /* primary */ { super/*Any*/() /* () */ } - var s: String - field = s - get - set - operator fun component1(): String { return .#s } @@ -18,14 +18,6 @@ data class MyContainer { return MyContainer(s = s) } - override fun toString(): String { - return "MyContainer(" + "s=" + .#s + ")" - } - - override fun hashCode(): Int { - return .#s.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -40,6 +32,29 @@ data class MyContainer { return true } + override fun hashCode(): Int { + return .#s.hashCode() + } + + override fun toString(): String { + return "MyContainer(" + "s=" + .#s + ")" + } + +} + +fun box(): String { + return with(receiver = 42, block = local fun Int.(): String { + val myContainer: MyContainer = MyContainer(s = "fail") + myContainer.set($context_receiver_0 = $this$with, index = 0, value = "OK") + return { // BLOCK + val tmp_1: String? = myContainer.get($context_receiver_0 = $this$with, index = 0) + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> "fail" + else -> tmp_1 + } + } + } +) } operator fun MyContainer.get($context_receiver_0: Int, index: Int): String? { @@ -62,18 +77,3 @@ operator fun MyContainer.set($context_receiver_0: Int, index: Int, value: String .( = value) } -fun box(): String { - return with(receiver = 42, block = local fun Int.(): String { - val myContainer: MyContainer = MyContainer(s = "fail") - myContainer.set($context_receiver_0 = $this$with, index = 0, value = "OK") - return { // BLOCK - val tmp_1: String? = myContainer.get($context_receiver_0 = $this$with, index = 0) - when { - EQEQ(arg0 = tmp_1, arg1 = null) -> "fail" - else -> tmp_1 - } - } - } -) -} - diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.ir.txt index 3ab318a5454..de2210dec2f 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/arrayAccessOperators.kt CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyContainer - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.MyContainer [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private EXPRESSION_BODY @@ -25,6 +20,11 @@ FILE fqName: fileName:/arrayAccessOperators.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .MyContainer declared in .MyContainer.' type=.MyContainer origin=null value: GET_VAR ': kotlin.String declared in .MyContainer.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.MyContainer [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.MyContainer) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.MyContainer BLOCK_BODY @@ -41,27 +41,6 @@ FILE fqName: fileName:/arrayAccessOperators.kt RETURN type=kotlin.Nothing from='public final fun copy (s: kotlin.String): .MyContainer declared in .MyContainer' CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in .MyContainer' type=.MyContainer origin=null s: GET_VAR 's: kotlin.String declared in .MyContainer.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.MyContainer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyContainer' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="MyContainer(" - CONST String type=kotlin.String value="s=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null - receiver: GET_VAR ': .MyContainer declared in .MyContainer.toString' type=.MyContainer origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.MyContainer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyContainer' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null - receiver: GET_VAR ': .MyContainer declared in .MyContainer.hashCode' type=.MyContainer origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.MyContainer, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -96,6 +75,62 @@ FILE fqName: fileName:/arrayAccessOperators.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.MyContainer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyContainer' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null + receiver: GET_VAR ': .MyContainer declared in .MyContainer.hashCode' type=.MyContainer origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.MyContainer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyContainer' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="MyContainer(" + CONST String type=kotlin.String value="s=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null + receiver: GET_VAR ': .MyContainer declared in .MyContainer.toString' type=.MyContainer origin=null + CONST String type=kotlin.String value=")" + 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 ' + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.String origin=null + : kotlin.Int + : kotlin.String + receiver: CONST Int type=kotlin.Int value=42 + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.String + $receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int + BLOCK_BODY + VAR name:myContainer type:.MyContainer [val] + CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in .MyContainer' type=.MyContainer origin=null + s: CONST String type=kotlin.String value="fail" + CALL 'public final fun set ($context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + $receiver: GET_VAR 'val myContainer: .MyContainer declared in .box.' type=.MyContainer origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + index: CONST Int type=kotlin.Int value=0 + value: CONST String type=kotlin.String value="OK" + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' + BLOCK type=kotlin.String origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] + CALL 'public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? declared in ' type=kotlin.String? origin=GET_ARRAY_ELEMENT + $receiver: GET_VAR 'val myContainer: .MyContainer declared in .box.' type=.MyContainer origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + index: CONST Int type=kotlin.Int value=0 + 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_1: kotlin.String? declared in .box.' type=kotlin.String? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST String type=kotlin.String value="fail" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_1: kotlin.String? declared in .box.' type=kotlin.String? origin=null FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.String? [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer @@ -148,38 +183,3 @@ FILE fqName: fileName:/arrayAccessOperators.kt CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .MyContainer' type=kotlin.Unit origin=EQ $this: GET_VAR ': .MyContainer declared in .set' type=.MyContainer origin=null : GET_VAR 'value: kotlin.String declared in .set' type=kotlin.String 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 ' - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.String origin=null - : kotlin.Int - : kotlin.String - receiver: CONST Int type=kotlin.Int value=42 - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.String - $receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int - BLOCK_BODY - VAR name:myContainer type:.MyContainer [val] - CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in .MyContainer' type=.MyContainer origin=null - s: CONST String type=kotlin.String value="fail" - CALL 'public final fun set ($context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - $receiver: GET_VAR 'val myContainer: .MyContainer declared in .box.' type=.MyContainer origin=null - $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - index: CONST Int type=kotlin.Int value=0 - value: CONST String type=kotlin.String value="OK" - RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' - BLOCK type=kotlin.String origin=ELVIS - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] - CALL 'public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? declared in ' type=kotlin.String? origin=GET_ARRAY_ELEMENT - $receiver: GET_VAR 'val myContainer: .MyContainer declared in .box.' type=.MyContainer origin=null - $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - index: CONST Int type=kotlin.Int value=0 - 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_1: kotlin.String? declared in .box.' type=kotlin.String? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST String type=kotlin.String value="fail" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_1: kotlin.String? declared in .box.' type=kotlin.String? origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt.txt index c40a058ad0f..f5b3fad3311 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt.txt @@ -1,15 +1,15 @@ data class MyContainer { + var s: String + field = s + get + set + constructor(s: String) /* primary */ { super/*Any*/() /* () */ } - var s: String - field = s - get - set - operator fun component1(): String { return .#s } @@ -18,14 +18,6 @@ data class MyContainer { return MyContainer(s = s) } - override fun toString(): String { - return "MyContainer(" + "s=" + .#s + ")" - } - - override fun hashCode(): Int { - return .#s.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -40,6 +32,29 @@ data class MyContainer { return true } + override fun hashCode(): Int { + return .#s.hashCode() + } + + override fun toString(): String { + return "MyContainer(" + "s=" + .#s + ")" + } + +} + +fun box(): String { + return with(receiver = 42, block = local fun Int.(): String { + val myContainer: MyContainer = MyContainer(s = "fail") + myContainer.set($context_receiver_0 = $this$with, index = 0, value = "OK") + return { // BLOCK + val tmp_1: String? = myContainer.get($context_receiver_0 = $this$with, index = 0) + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> "fail" + else -> tmp_1 + } + } + } +) } operator fun MyContainer.get($context_receiver_0: Int, index: Int): String? { @@ -62,17 +77,3 @@ operator fun MyContainer.set($context_receiver_0: Int, index: Int, value: String .( = value) } -fun box(): String { - return with(receiver = 42, block = local fun Int.(): String { - val myContainer: MyContainer = MyContainer(s = "fail") - myContainer.set($context_receiver_0 = $this$with, index = 0, value = "OK") - return { // BLOCK - val tmp_1: String? = myContainer.get($context_receiver_0 = $this$with, index = 0) - when { - EQEQ(arg0 = tmp_1, arg1 = null) -> "fail" - else -> tmp_1 - } - } - } -) -} diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/class.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/class.ir.txt index 5fce9958982..00d722e0a59 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/class.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/class.ir.txt @@ -1,21 +1,16 @@ FILE fqName: fileName:/class.kt - CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + CLASS CLASS name:Inner modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Inner + FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.Outer visibility:private [final] + CONSTRUCTOR visibility:public <> ($context_receiver_0:.Outer, arg:kotlin.Any) returnType:.Inner [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Outer + VALUE_PARAMETER name:arg index:1 type:kotlin.Any BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer) returnType:kotlin.Int - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Outer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Outer' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Outer declared in .Outer.' type=.Outer origin=null + SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.Outer visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Inner declared in .Inner' type=.Inner origin=null + value: GET_VAR '$context_receiver_0: .Outer declared in .Inner.' type=.Outer origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public 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 declared in kotlin.Any @@ -29,18 +24,6 @@ FILE fqName: fileName:/class.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Inner modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Inner - FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.Outer visibility:private [final] - CONSTRUCTOR visibility:public <> ($context_receiver_0:.Outer, arg:kotlin.Any) returnType:.Inner [primary] - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Outer - VALUE_PARAMETER name:arg index:1 type:kotlin.Any - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.Outer visibility:private [final]' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Inner declared in .Inner' type=.Inner origin=null - value: GET_VAR '$context_receiver_0: .Outer declared in .Inner.' type=.Outer origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public superTypes:[kotlin.Any]' FUN name:bar visibility:public modality:FINAL <> ($this:.Inner) returnType:kotlin.Int $this: VALUE_PARAMETER name: type:.Inner BLOCK_BODY @@ -48,6 +31,23 @@ FILE fqName: fileName:/class.kt CALL 'public final fun (): kotlin.Int declared in .Outer' type=kotlin.Int origin=GET_PROPERTY $this: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.Outer visibility:private [final]' type=.Outer origin=null receiver: GET_VAR ': .Inner declared in .Inner.bar' type=.Inner origin=null + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Outer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Outer' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Outer declared in .Outer.' type=.Outer origin=null + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/class.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/class.kt.txt index e34d8bde129..1d38e891447 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/class.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/class.kt.txt @@ -1,16 +1,3 @@ -class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: Int - field = 1 - get - -} - class Inner { private /* final field */ val contextReceiverField0: Outer constructor($context_receiver_0: Outer, arg: Any) /* primary */ { @@ -26,9 +13,23 @@ class Inner { } +class Outer { + val x: Int + field = 1 + get + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + fun f(outer: Outer) { with(receiver = outer, block = local fun Outer.(): Inner { return Inner($context_receiver_0 = $this$with, arg = 3) } ) /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt index 1b38af09a45..060beba0f67 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt @@ -1,11 +1,21 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt + PROPERTY name:operationScore visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Result - CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.Result [primary] - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:i visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private EXPRESSION_BODY @@ -25,6 +35,11 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null value: GET_VAR ': kotlin.Int declared in .Result.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.Result [primary] + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Result) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY @@ -41,27 +56,6 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): .Result declared in .Result' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null i: GET_VAR 'i: kotlin.Int declared in .Result.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Result - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Result' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Result(" - CONST String type=kotlin.String value="i=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .Result declared in .Result.toString' type=.Result origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Result - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Result' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .Result declared in .Result.hashCode' type=.Result origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Result, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -96,157 +90,27 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Result' CONST Boolean type=kotlin.Boolean value=true - PROPERTY name:operationScore visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Int + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Result' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .Result declared in .Result.hashCode' type=.Result origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - FUN name:plus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun plus ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .plus' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .plus' type=.Result origin=null - FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .Result declared in .plusAssign' type=.Result origin=null - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .plusAssign' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .plusAssign' type=.Result origin=null - FUN name:minus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .minus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun minus ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUS - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .minus' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .minus' type=.Result origin=null - FUN name:minusAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .minusAssign' type=kotlin.Int origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .Result declared in .minusAssign' type=.Result origin=null - : CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .minusAssign' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .minusAssign' type=.Result origin=null - FUN name:times visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .times' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun times ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MUL - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .times' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .times' type=.Result origin=null - FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .timesAssign' type=kotlin.Int origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .Result declared in .timesAssign' type=.Result origin=null - : CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .timesAssign' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .timesAssign' type=.Result origin=null - FUN name:div visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .div' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun div ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=DIV - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .div' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .div' type=.Result origin=null - FUN name:divAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .divAssign' type=kotlin.Int origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .Result declared in .divAssign' type=.Result origin=null - : CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .divAssign' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .divAssign' type=.Result origin=null + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Result' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Result(" + CONST String type=kotlin.String value="i=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .Result declared in .Result.toString' type=.Result origin=null + CONST String type=kotlin.String value=")" FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:result type:.Result [val] @@ -315,3 +179,139 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="fail" + FUN name:div visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .div' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun div ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=DIV + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .div' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .div' type=.Result origin=null + FUN name:divAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .divAssign' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .Result declared in .divAssign' type=.Result origin=null + : CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .divAssign' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .divAssign' type=.Result origin=null + FUN name:minus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .minus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun minus ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUS + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .minus' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .minus' type=.Result origin=null + FUN name:minusAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .minusAssign' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .Result declared in .minusAssign' type=.Result origin=null + : CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .minusAssign' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .minusAssign' type=.Result origin=null + FUN name:plus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun plus ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .plus' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .plus' type=.Result origin=null + FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .Result declared in .plusAssign' type=.Result origin=null + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .plusAssign' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .plusAssign' type=.Result origin=null + FUN name:times visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .times' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun times ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MUL + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .times' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .times' type=.Result origin=null + FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .timesAssign' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .Result declared in .timesAssign' type=.Result origin=null + : CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .timesAssign' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .timesAssign' type=.Result origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt index 43a14ae8900..77a58731977 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt @@ -1,15 +1,20 @@ +var operationScore: Int + field = 0 + get + set + data class Result { + var i: Int + field = i + get + set + constructor(i: Int) /* primary */ { super/*Any*/() /* () */ } - var i: Int - field = i - get - set - operator fun component1(): Int { return .#i } @@ -18,14 +23,6 @@ data class Result { return Result(i = i) } - override fun toString(): String { - return "Result(" + "i=" + .#i + ")" - } - - override fun hashCode(): Int { - return .#i.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -40,51 +37,14 @@ data class Result { return true } -} + override fun hashCode(): Int { + return .#i.hashCode() + } -var operationScore: Int - field = 0 - get - set + override fun toString(): String { + return "Result(" + "i=" + .#i + ")" + } -operator fun Result.plus($context_receiver_0: Int, other: Result): Result { - ( = ().plus(other = $context_receiver_0)) - return Result(i = .().plus(other = other.())) -} - -operator fun Result.plusAssign($context_receiver_0: Int, other: Result) { - ( = ().plus(other = $context_receiver_0)) - .( = .().plus(other = other.())) -} - -operator fun Result.minus($context_receiver_0: Int, other: Result): Result { - ( = ().plus(other = $context_receiver_0)) - return Result(i = .().minus(other = other.())) -} - -operator fun Result.minusAssign($context_receiver_0: Int, other: Result) { - ( = ().plus(other = $context_receiver_0)) - .( = .().minus(other = other.())) -} - -operator fun Result.times($context_receiver_0: Int, other: Result): Result { - ( = ().plus(other = $context_receiver_0)) - return Result(i = .().times(other = other.())) -} - -operator fun Result.timesAssign($context_receiver_0: Int, other: Result) { - ( = ().plus(other = $context_receiver_0)) - .( = .().times(other = other.())) -} - -operator fun Result.div($context_receiver_0: Int, other: Result): Result { - ( = ().plus(other = $context_receiver_0)) - return Result(i = .().div(other = other.())) -} - -operator fun Result.divAssign($context_receiver_0: Int, other: Result) { - ( = ().plus(other = $context_receiver_0)) - .( = .().div(other = other.())) } fun box(): String { @@ -105,3 +65,43 @@ fun box(): String { } } +operator fun Result.div($context_receiver_0: Int, other: Result): Result { + ( = ().plus(other = $context_receiver_0)) + return Result(i = .().div(other = other.())) +} + +operator fun Result.divAssign($context_receiver_0: Int, other: Result) { + ( = ().plus(other = $context_receiver_0)) + .( = .().div(other = other.())) +} + +operator fun Result.minus($context_receiver_0: Int, other: Result): Result { + ( = ().plus(other = $context_receiver_0)) + return Result(i = .().minus(other = other.())) +} + +operator fun Result.minusAssign($context_receiver_0: Int, other: Result) { + ( = ().plus(other = $context_receiver_0)) + .( = .().minus(other = other.())) +} + +operator fun Result.plus($context_receiver_0: Int, other: Result): Result { + ( = ().plus(other = $context_receiver_0)) + return Result(i = .().plus(other = other.())) +} + +operator fun Result.plusAssign($context_receiver_0: Int, other: Result) { + ( = ().plus(other = $context_receiver_0)) + .( = .().plus(other = other.())) +} + +operator fun Result.times($context_receiver_0: Int, other: Result): Result { + ( = ().plus(other = $context_receiver_0)) + return Result(i = .().times(other = other.())) +} + +operator fun Result.timesAssign($context_receiver_0: Int, other: Result) { + ( = ().plus(other = $context_receiver_0)) + .( = .().times(other = other.())) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.ir.txt index 4bd754562fb..19c308509a3 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.ir.txt @@ -1,11 +1,21 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt + PROPERTY name:operationScore visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Result - CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.Result [primary] - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:i visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private EXPRESSION_BODY @@ -25,6 +35,11 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null value: GET_VAR ': kotlin.Int declared in .Result.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.Result [primary] + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Result) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY @@ -41,27 +56,6 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): .Result declared in .Result' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null i: GET_VAR 'i: kotlin.Int declared in .Result.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Result - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Result' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Result(" - CONST String type=kotlin.String value="i=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .Result declared in .Result.toString' type=.Result origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Result - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Result' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .Result declared in .Result.hashCode' type=.Result origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Result, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -96,177 +90,27 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Result' CONST Boolean type=kotlin.Boolean value=true - PROPERTY name:operationScore visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Int + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Result' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .Result declared in .Result.hashCode' type=.Result origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - FUN name:plus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun plus ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .plus' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .plus' type=.Result origin=null - FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null - BLOCK type=kotlin.Unit origin=PLUSEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.Result [val] - GET_VAR ': .Result declared in .plusAssign' type=.Result origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=PLUSEQ - $this: GET_VAR 'val tmp_1: .Result declared in .plusAssign' type=.Result origin=null - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=PLUSEQ - $this: GET_VAR 'val tmp_1: .Result declared in .plusAssign' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .plusAssign' type=.Result origin=null - FUN name:minus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .minus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun minus ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUS - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .minus' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .minus' type=.Result origin=null - FUN name:minusAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .minusAssign' type=kotlin.Int origin=null - BLOCK type=kotlin.Unit origin=MINUSEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.Result [val] - GET_VAR ': .Result declared in .minusAssign' type=.Result origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=MINUSEQ - $this: GET_VAR 'val tmp_2: .Result declared in .minusAssign' type=.Result origin=null - : CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=MINUSEQ - $this: GET_VAR 'val tmp_2: .Result declared in .minusAssign' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .minusAssign' type=.Result origin=null - FUN name:times visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .times' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun times ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MUL - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .times' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .times' type=.Result origin=null - FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .timesAssign' type=kotlin.Int origin=null - BLOCK type=kotlin.Unit origin=MULTEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.Result [val] - GET_VAR ': .Result declared in .timesAssign' type=.Result origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=MULTEQ - $this: GET_VAR 'val tmp_3: .Result declared in .timesAssign' type=.Result origin=null - : CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MULTEQ - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=MULTEQ - $this: GET_VAR 'val tmp_3: .Result declared in .timesAssign' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .timesAssign' type=.Result origin=null - FUN name:div visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .div' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun div ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=DIV - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .div' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .div' type=.Result origin=null - FUN name:divAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:other index:1 type:.Result - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .divAssign' type=kotlin.Int origin=null - BLOCK type=kotlin.Unit origin=DIVEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.Result [val] - GET_VAR ': .Result declared in .divAssign' type=.Result origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=DIVEQ - $this: GET_VAR 'val tmp_4: .Result declared in .divAssign' type=.Result origin=null - : CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=DIVEQ - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=DIVEQ - $this: GET_VAR 'val tmp_4: .Result declared in .divAssign' type=.Result origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'other: .Result declared in .divAssign' type=.Result origin=null + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Result' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Result(" + CONST String type=kotlin.String value="i=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .Result declared in .Result.toString' type=.Result origin=null + CONST String type=kotlin.String value=")" FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:result type:.Result [val] @@ -335,3 +179,159 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="fail" + FUN name:div visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .div' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun div ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=DIV + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .div' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .div' type=.Result origin=null + FUN name:divAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .divAssign' type=kotlin.Int origin=null + BLOCK type=kotlin.Unit origin=DIVEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.Result [val] + GET_VAR ': .Result declared in .divAssign' type=.Result origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=DIVEQ + $this: GET_VAR 'val tmp_1: .Result declared in .divAssign' type=.Result origin=null + : CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=DIVEQ + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=DIVEQ + $this: GET_VAR 'val tmp_1: .Result declared in .divAssign' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .divAssign' type=.Result origin=null + FUN name:minus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .minus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun minus ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUS + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .minus' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .minus' type=.Result origin=null + FUN name:minusAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .minusAssign' type=kotlin.Int origin=null + BLOCK type=kotlin.Unit origin=MINUSEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.Result [val] + GET_VAR ': .Result declared in .minusAssign' type=.Result origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=MINUSEQ + $this: GET_VAR 'val tmp_2: .Result declared in .minusAssign' type=.Result origin=null + : CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=MINUSEQ + $this: GET_VAR 'val tmp_2: .Result declared in .minusAssign' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .minusAssign' type=.Result origin=null + FUN name:plus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun plus ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .plus' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .plus' type=.Result origin=null + FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null + BLOCK type=kotlin.Unit origin=PLUSEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.Result [val] + GET_VAR ': .Result declared in .plusAssign' type=.Result origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=PLUSEQ + $this: GET_VAR 'val tmp_3: .Result declared in .plusAssign' type=.Result origin=null + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=PLUSEQ + $this: GET_VAR 'val tmp_3: .Result declared in .plusAssign' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .plusAssign' type=.Result origin=null + FUN name:times visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .times' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun times ($context_receiver_0: kotlin.Int, other: .Result): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MUL + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .times' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .times' type=.Result origin=null + FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:other index:1 type:.Result + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .timesAssign' type=kotlin.Int origin=null + BLOCK type=kotlin.Unit origin=MULTEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.Result [val] + GET_VAR ': .Result declared in .timesAssign' type=.Result origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=MULTEQ + $this: GET_VAR 'val tmp_4: .Result declared in .timesAssign' type=.Result origin=null + : CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MULTEQ + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=MULTEQ + $this: GET_VAR 'val tmp_4: .Result declared in .timesAssign' type=.Result origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'other: .Result declared in .timesAssign' type=.Result origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt.txt index 7aae1fb07ea..5a08f2f308f 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt.txt @@ -1,15 +1,20 @@ +var operationScore: Int + field = 0 + get + set + data class Result { + var i: Int + field = i + get + set + constructor(i: Int) /* primary */ { super/*Any*/() /* () */ } - var i: Int - field = i - get - set - operator fun component1(): Int { return .#i } @@ -18,14 +23,6 @@ data class Result { return Result(i = i) } - override fun toString(): String { - return "Result(" + "i=" + .#i + ")" - } - - override fun hashCode(): Int { - return .#i.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -40,27 +37,48 @@ data class Result { return true } + override fun hashCode(): Int { + return .#i.hashCode() + } + + override fun toString(): String { + return "Result(" + "i=" + .#i + ")" + } + } -var operationScore: Int - field = 0 - get - set +fun box(): String { + val result: Result = Result(i = 0) + with(receiver = 1, block = local fun Int.() { + result.plusAssign($context_receiver_0 = $this$with, other = Result(i = 1).plus($context_receiver_0 = $this$with, other = Result(i = 1))) + result.minusAssign($context_receiver_0 = $this$with, other = Result(i = 1).minus($context_receiver_0 = $this$with, other = Result(i = 0))) + result.timesAssign($context_receiver_0 = $this$with, other = Result(i = 1).times($context_receiver_0 = $this$with, other = Result(i = 2))) + result.divAssign($context_receiver_0 = $this$with, other = Result(i = 4).div($context_receiver_0 = $this$with, other = Result(i = 2))) + } +) + return when { + when { + EQEQ(arg0 = result.(), arg1 = 1) -> EQEQ(arg0 = (), arg1 = 8) + else -> false + } -> "OK" + else -> "fail" + } +} -operator fun Result.plus($context_receiver_0: Int, other: Result): Result { +operator fun Result.div($context_receiver_0: Int, other: Result): Result { { // BLOCK ( = ().plus(other = $context_receiver_0)) } - return Result(i = .().plus(other = other.())) + return Result(i = .().div(other = other.())) } -operator fun Result.plusAssign($context_receiver_0: Int, other: Result) { +operator fun Result.divAssign($context_receiver_0: Int, other: Result) { { // BLOCK ( = ().plus(other = $context_receiver_0)) } { // BLOCK val tmp_1: Result = - tmp_1.( = tmp_1.().plus(other = other.())) + tmp_1.( = tmp_1.().div(other = other.())) } } @@ -81,6 +99,23 @@ operator fun Result.minusAssign($context_receiver_0: Int, other: Result) { } } +operator fun Result.plus($context_receiver_0: Int, other: Result): Result { + { // BLOCK + ( = ().plus(other = $context_receiver_0)) + } + return Result(i = .().plus(other = other.())) +} + +operator fun Result.plusAssign($context_receiver_0: Int, other: Result) { + { // BLOCK + ( = ().plus(other = $context_receiver_0)) + } + { // BLOCK + val tmp_3: Result = + tmp_3.( = tmp_3.().plus(other = other.())) + } +} + operator fun Result.times($context_receiver_0: Int, other: Result): Result { { // BLOCK ( = ().plus(other = $context_receiver_0)) @@ -89,46 +124,12 @@ operator fun Result.times($context_receiver_0: Int, other: Result): Result { } operator fun Result.timesAssign($context_receiver_0: Int, other: Result) { - { // BLOCK - ( = ().plus(other = $context_receiver_0)) - } - { // BLOCK - val tmp_3: Result = - tmp_3.( = tmp_3.().times(other = other.())) - } -} - -operator fun Result.div($context_receiver_0: Int, other: Result): Result { - { // BLOCK - ( = ().plus(other = $context_receiver_0)) - } - return Result(i = .().div(other = other.())) -} - -operator fun Result.divAssign($context_receiver_0: Int, other: Result) { { // BLOCK ( = ().plus(other = $context_receiver_0)) } { // BLOCK val tmp_4: Result = - tmp_4.( = tmp_4.().div(other = other.())) + tmp_4.( = tmp_4.().times(other = other.())) } } -fun box(): String { - val result: Result = Result(i = 0) - with(receiver = 1, block = local fun Int.() { - result.plusAssign($context_receiver_0 = $this$with, other = Result(i = 1).plus($context_receiver_0 = $this$with, other = Result(i = 1))) - result.minusAssign($context_receiver_0 = $this$with, other = Result(i = 1).minus($context_receiver_0 = $this$with, other = Result(i = 0))) - result.timesAssign($context_receiver_0 = $this$with, other = Result(i = 1).times($context_receiver_0 = $this$with, other = Result(i = 2))) - result.divAssign($context_receiver_0 = $this$with, other = Result(i = 4).div($context_receiver_0 = $this$with, other = Result(i = 2))) - } -) - return when { - when { - EQEQ(arg0 = result.(), arg1 = 1) -> EQEQ(arg0 = (), arg1 = 8) - else -> false - } -> "OK" - else -> "fail" - } -} diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.ir.txt index 3c27d613f69..5f3934d434a 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.ir.txt @@ -5,11 +5,6 @@ FILE fqName: fileName:/contextReceiverMethod.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Context modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Context) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.Context - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in .Context' - CONST Int type=kotlin.Int value=1 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 @@ -23,6 +18,11 @@ FILE fqName: fileName:/contextReceiverMethod.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.Context) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.Context + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in .Context' + CONST Int type=kotlin.Int value=1 CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.Context visibility:private [final] @@ -34,18 +34,6 @@ FILE fqName: fileName:/contextReceiverMethod.kt receiver: GET_VAR ': .Test declared in .Test' type=.Test origin=null value: GET_VAR '$context_receiver_0: .Context declared in .Test.' type=.Context origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.Test - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in .Test' - CONST Int type=kotlin.Int value=2 - FUN name:bar visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Test - BLOCK_BODY - VAR name:x type:kotlin.Int [val] - CALL 'public final fun foo (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.Context visibility:private [final]' type=.Context origin=null - receiver: GET_VAR ': .Test declared in .Test.bar' type=.Test 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 @@ -59,3 +47,15 @@ FILE fqName: fileName:/contextReceiverMethod.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + VAR name:x type:kotlin.Int [val] + CALL 'public final fun foo (): kotlin.Int declared in .Context' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.Context visibility:private [final]' type=.Context origin=null + receiver: GET_VAR ': .Test declared in .Test.bar' type=.Test origin=null + FUN name:foo visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in .Test' + CONST Int type=kotlin.Int value=2 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt.txt index d737723cbb8..672b804ac63 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt.txt @@ -20,12 +20,13 @@ class Test { } - fun foo(): Int { - return 2 - } - fun bar() { val x: Int = .#contextReceiverField0.foo() } + fun foo(): Int { + return 2 + } + } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.fir.ir.txt index c72881910f1..5874d8e57c6 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.fir.ir.txt @@ -1,17 +1,4 @@ FILE fqName: fileName:/contextualFunctionConversion.kt - FUN name:withContext visibility:public modality:FINAL <> (f:kotlin.Function1) returnType:kotlin.String - VALUE_PARAMETER name:f index:0 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withContext (f: kotlin.Function1): kotlin.String declared in ' - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE - $this: GET_VAR 'f: kotlin.Function1 declared in .withContext' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION - p1: CONST String type=kotlin.String value="OK" - FUN name:callWithContext visibility:public modality:FINAL <> (f:kotlin.Function1) returnType:kotlin.String - VALUE_PARAMETER name:f index:0 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun callWithContext (f: kotlin.Function1): kotlin.String declared in ' - CALL 'public final fun withContext (f: kotlin.Function1): kotlin.String declared in ' type=kotlin.String origin=null - f: GET_VAR 'f: kotlin.Function1 declared in .callWithContext' type=kotlin.Function1 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 ' @@ -22,3 +9,16 @@ FILE fqName: fileName:/contextualFunctionConversion.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (s: kotlin.String): kotlin.String declared in .box' GET_VAR 's: kotlin.String declared in .box.' type=kotlin.String origin=null + FUN name:callWithContext visibility:public modality:FINAL <> (f:kotlin.Function1) returnType:kotlin.String + VALUE_PARAMETER name:f index:0 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun callWithContext (f: kotlin.Function1): kotlin.String declared in ' + CALL 'public final fun withContext (f: kotlin.Function1): kotlin.String declared in ' type=kotlin.String origin=null + f: GET_VAR 'f: kotlin.Function1 declared in .callWithContext' type=kotlin.Function1 origin=null + FUN name:withContext visibility:public modality:FINAL <> (f:kotlin.Function1) returnType:kotlin.String + VALUE_PARAMETER name:f index:0 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun withContext (f: kotlin.Function1): kotlin.String declared in ' + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE + $this: GET_VAR 'f: kotlin.Function1 declared in .withContext' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + p1: CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.fir.kt.txt index ea81883475c..3fb488100a1 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.fir.kt.txt @@ -1,14 +1,15 @@ -fun withContext(f: Function1): String { - return f.invoke(p1 = "OK") -} - -fun callWithContext(f: Function1): String { - return withContext(f = f) -} - fun box(): String { return callWithContext(f = local fun (s: String): String { return s } ) } + +fun callWithContext(f: Function1): String { + return withContext(f = f) +} + +fun withContext(f: Function1): String { + return f.invoke(p1 = "OK") +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.ir.txt index 4b8a32b0362..0957b7a8ac8 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.ir.txt @@ -1,17 +1,4 @@ FILE fqName: fileName:/contextualFunctionConversion.kt - FUN name:withContext visibility:public modality:FINAL <> (f:@[ContextFunctionTypeParams(count = 1)] kotlin.Function1) returnType:kotlin.String - VALUE_PARAMETER name:f index:0 type:@[ContextFunctionTypeParams(count = 1)] kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withContext (f: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1): kotlin.String declared in ' - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE - $this: GET_VAR 'f: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1 declared in .withContext' type=@[ContextFunctionTypeParams(count = 1)] kotlin.Function1 origin=VARIABLE_AS_FUNCTION - p1: CONST String type=kotlin.String value="OK" - FUN name:callWithContext visibility:public modality:FINAL <> (f:kotlin.Function1) returnType:kotlin.String - VALUE_PARAMETER name:f index:0 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun callWithContext (f: kotlin.Function1): kotlin.String declared in ' - CALL 'public final fun withContext (f: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1): kotlin.String declared in ' type=kotlin.String origin=null - f: GET_VAR 'f: kotlin.Function1 declared in .callWithContext' type=kotlin.Function1 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 ' @@ -22,3 +9,16 @@ FILE fqName: fileName:/contextualFunctionConversion.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (s: kotlin.String): kotlin.String declared in .box' GET_VAR 's: kotlin.String declared in .box.' type=kotlin.String origin=null + FUN name:callWithContext visibility:public modality:FINAL <> (f:kotlin.Function1) returnType:kotlin.String + VALUE_PARAMETER name:f index:0 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun callWithContext (f: kotlin.Function1): kotlin.String declared in ' + CALL 'public final fun withContext (f: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1): kotlin.String declared in ' type=kotlin.String origin=null + f: GET_VAR 'f: kotlin.Function1 declared in .callWithContext' type=kotlin.Function1 origin=null + FUN name:withContext visibility:public modality:FINAL <> (f:@[ContextFunctionTypeParams(count = 1)] kotlin.Function1) returnType:kotlin.String + VALUE_PARAMETER name:f index:0 type:@[ContextFunctionTypeParams(count = 1)] kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun withContext (f: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1): kotlin.String declared in ' + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE + $this: GET_VAR 'f: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1 declared in .withContext' type=@[ContextFunctionTypeParams(count = 1)] kotlin.Function1 origin=VARIABLE_AS_FUNCTION + p1: CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.kt.txt index 178bc5e4b51..5339e878e91 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.kt.txt @@ -1,14 +1,15 @@ -fun withContext(f: @ContextFunctionTypeParams(count = 1) Function1): String { - return f.invoke(p1 = "OK") -} - -fun callWithContext(f: Function1): String { - return withContext(f = f) -} - fun box(): String { return callWithContext(f = local fun (s: String): String { return s } ) } + +fun callWithContext(f: Function1): String { + return withContext(f = f) +} + +fun withContext(f: @ContextFunctionTypeParams(count = 1) Function1): String { + return f.invoke(p1 = "OK") +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.ir.txt index 2c09041341e..3d07aec3131 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.ir.txt @@ -1,81 +1,6 @@ FILE fqName: fileName:/contextualInlineCall.kt - CLASS CLASS name:Context modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Context - CONSTRUCTOR visibility:public <> () returnType:.Context [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Context modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:c visibility:public modality:FINAL <> ($this:.Context) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.Context - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun c (): kotlin.Int declared in .Context' - CONST Int type=kotlin.Int value=1 - 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: 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:testInline visibility:public modality:FINAL <> ($context_receiver_0:.Context) returnType:kotlin.Int [inline] - contextReceiverParametersCount: 1 - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInline ($context_receiver_0: .Context): kotlin.Int declared in ' - CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '$context_receiver_0: .Context declared in .testInline' type=.Context origin=null - FUN name:testInlineWithArg visibility:public modality:FINAL <> ($context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] - contextReceiverParametersCount: 1 - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context - VALUE_PARAMETER name:i index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR 'i: kotlin.Int declared in .testInlineWithArg' type=kotlin.Int origin=null - other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithArg' type=.Context origin=null - FUN name:testInlineWithExtensionAndArg visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context - VALUE_PARAMETER name:i index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndArg' type=kotlin.Int origin=null - other: GET_VAR 'i: kotlin.Int declared in .testInlineWithExtensionAndArg' type=kotlin.Int origin=null - other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndArg' type=.Context origin=null - FUN name:testInlineWithExtensionAndMultipleArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context - VALUE_PARAMETER name:i1 index:1 type:kotlin.Int - VALUE_PARAMETER name:i2 index:2 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleArgs ($context_receiver_0: .Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null - other: GET_VAR 'i1: kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null - other: GET_VAR 'i2: kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null - other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleArgs' type=.Context origin=null CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (a:kotlin.Any?) returnType:.A [primary] - VALUE_PARAMETER name:a index:0 type:kotlin.Any? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Any? visibility:private [final] EXPRESSION_BODY @@ -87,6 +12,11 @@ FILE fqName: fileName:/contextualInlineCall.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Any? visibility:private [final]' type=kotlin.Any? origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (a:kotlin.Any?) returnType:.A [primary] + VALUE_PARAMETER name:a index:0 type:kotlin.Any? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -100,38 +30,30 @@ FILE fqName: fileName:/contextualInlineCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testInlineWithExtensionAndMultipleContextsAndArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, $context_receiver_1:.A, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] - contextReceiverParametersCount: 2 - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context - VALUE_PARAMETER name:$context_receiver_1 index:1 type:.A - VALUE_PARAMETER name:i1 index:2 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - VALUE_PARAMETER name:i2 index:3 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleContextsAndArgs ($context_receiver_0: .Context, $context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null - other: GET_VAR 'i1: kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null - other: GET_VAR 'i2: kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null - other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.Context origin=null - other: WHEN type=kotlin.Int origin=IF - 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: CALL 'public final fun (): kotlin.Any? declared in .A' type=kotlin.Any? origin=GET_PROPERTY - $this: GET_VAR '$context_receiver_1: .A declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.A origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Int type=kotlin.Int value=1 + CLASS CLASS name:Context modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Context + CONSTRUCTOR visibility:public <> () returnType:.Context [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Context modality:FINAL visibility:public 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 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:c visibility:public modality:FINAL <> ($this:.Context) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.Context + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun c (): kotlin.Int declared in .Context' + CONST Int type=kotlin.Int value=1 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 ' @@ -206,3 +128,81 @@ FILE fqName: fileName:/contextualInlineCall.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="fail" + FUN name:testInline visibility:public modality:FINAL <> ($context_receiver_0:.Context) returnType:kotlin.Int [inline] + contextReceiverParametersCount: 1 + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInline ($context_receiver_0: .Context): kotlin.Int declared in ' + CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInline' type=.Context origin=null + FUN name:testInlineWithArg visibility:public modality:FINAL <> ($context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] + contextReceiverParametersCount: 1 + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:i index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInlineWithArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: GET_VAR 'i: kotlin.Int declared in .testInlineWithArg' type=kotlin.Int origin=null + other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithArg' type=.Context origin=null + FUN name:testInlineWithExtensionAndArg visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:i index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndArg' type=kotlin.Int origin=null + other: GET_VAR 'i: kotlin.Int declared in .testInlineWithExtensionAndArg' type=kotlin.Int origin=null + other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndArg' type=.Context origin=null + FUN name:testInlineWithExtensionAndMultipleArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:i1 index:1 type:kotlin.Int + VALUE_PARAMETER name:i2 index:2 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleArgs ($context_receiver_0: .Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null + other: GET_VAR 'i1: kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null + other: GET_VAR 'i2: kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null + other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleArgs' type=.Context origin=null + FUN name:testInlineWithExtensionAndMultipleContextsAndArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, $context_receiver_1:.A, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] + contextReceiverParametersCount: 2 + $receiver: VALUE_PARAMETER name: type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_1 index:1 type:.A + VALUE_PARAMETER name:i1 index:2 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + VALUE_PARAMETER name:i2 index:3 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleContextsAndArgs ($context_receiver_0: .Context, $context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null + other: GET_VAR 'i1: kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null + other: GET_VAR 'i2: kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null + other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.Context origin=null + other: WHEN type=kotlin.Int origin=IF + 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: CALL 'public final fun (): kotlin.Any? declared in .A' type=kotlin.Any? origin=GET_PROPERTY + $this: GET_VAR '$context_receiver_1: .A declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.A origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.kt.txt index 136b3945943..a06137781af 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.kt.txt @@ -1,3 +1,16 @@ +class A { + val a: Any? + field = a + get + + constructor(a: Any?) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + class Context { constructor() /* primary */ { super/*Any*/() @@ -11,42 +24,6 @@ class Context { } -inline fun testInline($context_receiver_0: Context): Int { - return $context_receiver_0.c() -} - -inline fun testInlineWithArg($context_receiver_0: Context, i: Int): Int { - return i.plus(other = $context_receiver_0.c()) -} - -inline fun Int.testInlineWithExtensionAndArg($context_receiver_0: Context, i: Int): Int { - return .plus(other = i).plus(other = $context_receiver_0.c()) -} - -inline fun Int.testInlineWithExtensionAndMultipleArgs($context_receiver_0: Context, i1: Int, i2: Int): Int { - return .plus(other = i1).plus(other = i2).plus(other = $context_receiver_0.c()) -} - -class A { - constructor(a: Any?) /* primary */ { - super/*Any*/() - /* () */ - - } - - val a: Any? - field = a - get - -} - -inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs($context_receiver_0: Context, $context_receiver_1: A, i1: Int = 1, i2: Int = 2): Int { - return .plus(other = i1).plus(other = i2).plus(other = $context_receiver_0.c()).plus(other = when { - EQEQ(arg0 = $context_receiver_1.(), arg1 = null) -> 0 - else -> 1 - }) -} - fun box(): String { return with(receiver = Context(), block = local fun Context.(): Nothing { var result: Int = 0 @@ -67,3 +44,26 @@ fun box(): String { ) } +inline fun testInline($context_receiver_0: Context): Int { + return $context_receiver_0.c() +} + +inline fun testInlineWithArg($context_receiver_0: Context, i: Int): Int { + return i.plus(other = $context_receiver_0.c()) +} + +inline fun Int.testInlineWithExtensionAndArg($context_receiver_0: Context, i: Int): Int { + return .plus(other = i).plus(other = $context_receiver_0.c()) +} + +inline fun Int.testInlineWithExtensionAndMultipleArgs($context_receiver_0: Context, i1: Int, i2: Int): Int { + return .plus(other = i1).plus(other = i2).plus(other = $context_receiver_0.c()) +} + +inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs($context_receiver_0: Context, $context_receiver_1: A, i1: Int = 1, i2: Int = 2): Int { + return .plus(other = i1).plus(other = i2).plus(other = $context_receiver_0.c()).plus(other = when { + EQEQ(arg0 = $context_receiver_1.(), arg1 = null) -> 0 + else -> 1 + }) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.ir.txt index d2293f924c6..c97c9f7d51e 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.ir.txt @@ -1,81 +1,6 @@ FILE fqName: fileName:/contextualInlineCall.kt - CLASS CLASS name:Context modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Context - CONSTRUCTOR visibility:public <> () returnType:.Context [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Context modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:c visibility:public modality:FINAL <> ($this:.Context) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.Context - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun c (): kotlin.Int declared in .Context' - CONST Int type=kotlin.Int value=1 - 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: 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:testInline visibility:public modality:FINAL <> ($context_receiver_0:.Context) returnType:kotlin.Int [inline] - contextReceiverParametersCount: 1 - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInline ($context_receiver_0: .Context): kotlin.Int declared in ' - CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '$context_receiver_0: .Context declared in .testInline' type=.Context origin=null - FUN name:testInlineWithArg visibility:public modality:FINAL <> ($context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] - contextReceiverParametersCount: 1 - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context - VALUE_PARAMETER name:i index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR 'i: kotlin.Int declared in .testInlineWithArg' type=kotlin.Int origin=null - other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithArg' type=.Context origin=null - FUN name:testInlineWithExtensionAndArg visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context - VALUE_PARAMETER name:i index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndArg' type=kotlin.Int origin=null - other: GET_VAR 'i: kotlin.Int declared in .testInlineWithExtensionAndArg' type=kotlin.Int origin=null - other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndArg' type=.Context origin=null - FUN name:testInlineWithExtensionAndMultipleArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context - VALUE_PARAMETER name:i1 index:1 type:kotlin.Int - VALUE_PARAMETER name:i2 index:2 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleArgs ($context_receiver_0: .Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null - other: GET_VAR 'i1: kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null - other: GET_VAR 'i2: kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null - other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleArgs' type=.Context origin=null CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (a:kotlin.Any?) returnType:.A [primary] - VALUE_PARAMETER name:a index:0 type:kotlin.Any? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Any? visibility:private [final] EXPRESSION_BODY @@ -87,6 +12,11 @@ FILE fqName: fileName:/contextualInlineCall.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Any? visibility:private [final]' type=kotlin.Any? origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (a:kotlin.Any?) returnType:.A [primary] + VALUE_PARAMETER name:a index:0 type:kotlin.Any? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -100,38 +30,30 @@ FILE fqName: fileName:/contextualInlineCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testInlineWithExtensionAndMultipleContextsAndArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, $context_receiver_1:.A, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] - contextReceiverParametersCount: 2 - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context - VALUE_PARAMETER name:$context_receiver_1 index:1 type:.A - VALUE_PARAMETER name:i1 index:2 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - VALUE_PARAMETER name:i2 index:3 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleContextsAndArgs ($context_receiver_0: .Context, $context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null - other: GET_VAR 'i1: kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null - other: GET_VAR 'i2: kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null - other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.Context origin=null - other: WHEN type=kotlin.Int origin=IF - 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: CALL 'public final fun (): kotlin.Any? declared in .A' type=kotlin.Any? origin=GET_PROPERTY - $this: GET_VAR '$context_receiver_1: .A declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.A origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Int type=kotlin.Int value=1 + CLASS CLASS name:Context modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Context + CONSTRUCTOR visibility:public <> () returnType:.Context [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Context modality:FINAL visibility:public 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 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:c visibility:public modality:FINAL <> ($this:.Context) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.Context + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun c (): kotlin.Int declared in .Context' + CONST Int type=kotlin.Int value=1 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 ' @@ -206,3 +128,81 @@ FILE fqName: fileName:/contextualInlineCall.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="fail" + FUN name:testInline visibility:public modality:FINAL <> ($context_receiver_0:.Context) returnType:kotlin.Int [inline] + contextReceiverParametersCount: 1 + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInline ($context_receiver_0: .Context): kotlin.Int declared in ' + CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInline' type=.Context origin=null + FUN name:testInlineWithArg visibility:public modality:FINAL <> ($context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] + contextReceiverParametersCount: 1 + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:i index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInlineWithArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: GET_VAR 'i: kotlin.Int declared in .testInlineWithArg' type=kotlin.Int origin=null + other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithArg' type=.Context origin=null + FUN name:testInlineWithExtensionAndArg visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:i index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndArg' type=kotlin.Int origin=null + other: GET_VAR 'i: kotlin.Int declared in .testInlineWithExtensionAndArg' type=kotlin.Int origin=null + other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndArg' type=.Context origin=null + FUN name:testInlineWithExtensionAndMultipleArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:i1 index:1 type:kotlin.Int + VALUE_PARAMETER name:i2 index:2 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleArgs ($context_receiver_0: .Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null + other: GET_VAR 'i1: kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null + other: GET_VAR 'i2: kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null + other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleArgs' type=.Context origin=null + FUN name:testInlineWithExtensionAndMultipleContextsAndArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, $context_receiver_1:.A, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] + contextReceiverParametersCount: 2 + $receiver: VALUE_PARAMETER name: type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_1 index:1 type:.A + VALUE_PARAMETER name:i1 index:2 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + VALUE_PARAMETER name:i2 index:3 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleContextsAndArgs ($context_receiver_0: .Context, $context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null + other: GET_VAR 'i1: kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null + other: GET_VAR 'i2: kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null + other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.Context origin=null + other: WHEN type=kotlin.Int origin=IF + 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: CALL 'public final fun (): kotlin.Any? declared in .A' type=kotlin.Any? origin=GET_PROPERTY + $this: GET_VAR '$context_receiver_1: .A declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.A origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt.txt index db442f9c163..a06137781af 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt.txt @@ -1,3 +1,16 @@ +class A { + val a: Any? + field = a + get + + constructor(a: Any?) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + class Context { constructor() /* primary */ { super/*Any*/() @@ -11,42 +24,6 @@ class Context { } -inline fun testInline($context_receiver_0: Context): Int { - return $context_receiver_0.c() -} - -inline fun testInlineWithArg($context_receiver_0: Context, i: Int): Int { - return i.plus(other = $context_receiver_0.c()) -} - -inline fun Int.testInlineWithExtensionAndArg($context_receiver_0: Context, i: Int): Int { - return .plus(other = i).plus(other = $context_receiver_0.c()) -} - -inline fun Int.testInlineWithExtensionAndMultipleArgs($context_receiver_0: Context, i1: Int, i2: Int): Int { - return .plus(other = i1).plus(other = i2).plus(other = $context_receiver_0.c()) -} - -class A { - constructor(a: Any?) /* primary */ { - super/*Any*/() - /* () */ - - } - - val a: Any? - field = a - get - -} - -inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs($context_receiver_0: Context, $context_receiver_1: A, i1: Int = 1, i2: Int = 2): Int { - return .plus(other = i1).plus(other = i2).plus(other = $context_receiver_0.c()).plus(other = when { - EQEQ(arg0 = $context_receiver_1.(), arg1 = null) -> 0 - else -> 1 - }) -} - fun box(): String { return with(receiver = Context(), block = local fun Context.(): Nothing { var result: Int = 0 @@ -66,3 +43,27 @@ fun box(): String { } ) } + +inline fun testInline($context_receiver_0: Context): Int { + return $context_receiver_0.c() +} + +inline fun testInlineWithArg($context_receiver_0: Context, i: Int): Int { + return i.plus(other = $context_receiver_0.c()) +} + +inline fun Int.testInlineWithExtensionAndArg($context_receiver_0: Context, i: Int): Int { + return .plus(other = i).plus(other = $context_receiver_0.c()) +} + +inline fun Int.testInlineWithExtensionAndMultipleArgs($context_receiver_0: Context, i1: Int, i2: Int): Int { + return .plus(other = i1).plus(other = i2).plus(other = $context_receiver_0.c()) +} + +inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs($context_receiver_0: Context, $context_receiver_1: A, i1: Int = 1, i2: Int = 2): Int { + return .plus(other = i1).plus(other = i2).plus(other = $context_receiver_0.c()).plus(other = when { + EQEQ(arg0 = $context_receiver_1.(), arg1 = null) -> 0 + else -> 1 + }) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.ir.txt index c6f3d2d2d36..a763e0b541d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/contextualPrimaryConstructorWithParams.kt CLASS CLASS name:O modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.O - CONSTRUCTOR visibility:public <> (o:kotlin.String) returnType:.O [primary] - VALUE_PARAMETER name:o index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:o visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/contextualPrimaryConstructorWithParams.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .O' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .O declared in .O.' type=.O origin=null + CONSTRUCTOR visibility:public <> (o:kotlin.String) returnType:.O [primary] + VALUE_PARAMETER name:o index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:O modality:FINAL visibility:public 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 declared in kotlin.Any @@ -33,15 +33,6 @@ FILE fqName: fileName:/contextualPrimaryConstructorWithParams.kt CLASS CLASS name:OK modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OK FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.O visibility:private [final] - CONSTRUCTOR visibility:public <> ($context_receiver_0:.O, k:kotlin.String) returnType:.OK [primary] - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.O - VALUE_PARAMETER name:k index:1 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.O visibility:private [final]' type=kotlin.Unit origin=null - receiver: GET_VAR ': .OK declared in .OK' type=.OK origin=null - value: GET_VAR '$context_receiver_0: .O declared in .OK.' type=.O origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OK modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:k visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -69,6 +60,15 @@ FILE fqName: fileName:/contextualPrimaryConstructorWithParams.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .OK' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .OK declared in .OK.' type=.OK origin=null + CONSTRUCTOR visibility:public <> ($context_receiver_0:.O, k:kotlin.String) returnType:.OK [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.O + VALUE_PARAMETER name:k index:1 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.O visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .OK declared in .OK' type=.OK origin=null + value: GET_VAR '$context_receiver_0: .O declared in .OK.' type=.O origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OK modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt.txt index cb031fef033..ff4b0ed3054 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt.txt @@ -1,25 +1,18 @@ class O { + val o: String + field = o + get + constructor(o: String) /* primary */ { super/*Any*/() /* () */ } - val o: String - field = o - get - } class OK { private /* final field */ val contextReceiverField0: O - constructor($context_receiver_0: O, k: String) /* primary */ { - super/*Any*/() - .#contextReceiverField0 = $context_receiver_0 - /* () */ - - } - val k: String field = k get @@ -28,6 +21,13 @@ class OK { field = .#contextReceiverField0.().plus(other = .()) get + constructor($context_receiver_0: O, k: String) /* primary */ { + super/*Any*/() + .#contextReceiverField0 = $context_receiver_0 + /* () */ + + } + } fun box(): String { @@ -37,3 +37,4 @@ fun box(): String { } ) } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt index 0a2df27bb8f..d8d08e47033 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt @@ -16,10 +16,6 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - CONSTRUCTOR visibility:public <> () returnType:.Delegate [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:delegateValue visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:delegateValue type:kotlin.String visibility:private EXPRESSION_BODY @@ -39,6 +35,23 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegateValue type:kotlin.String visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null value: GET_VAR ': kotlin.String declared in .Delegate.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> () returnType:.Delegate [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public 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 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:getValue visibility:public modality:FINAL <> ($this:.Delegate, $context_receiver_0:kotlin.Int, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.Delegate contextReceiverParametersCount: 1 @@ -68,30 +81,9 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=EQ $this: GET_VAR ': .Delegate declared in .Delegate.setValue' type=.Delegate origin=null : GET_VAR 'value: kotlin.String declared in .Delegate.setValue' type=kotlin.String 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: 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 CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Result FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final] - CONSTRUCTOR visibility:public <> ($context_receiver_0:kotlin.Int) returnType:.Result [primary] - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Result declared in .Result' type=.Result origin=null - value: GET_VAR '$context_receiver_0: kotlin.Int declared in .Result.' type=kotlin.Int origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:s$delegate type:.Delegate visibility:private [final] EXPRESSION_BODY @@ -122,6 +114,14 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt thisRef: GET_VAR ': .Result declared in .Result.' type=.Result origin=null property: PROPERTY_REFERENCE 'public final s: kotlin.String' field=null getter='public final fun (): kotlin.String declared in .Result' setter='public final fun (: kotlin.String): kotlin.Unit declared in .Result' type=kotlin.reflect.KMutableProperty1<.Result, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.String declared in .Result.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> ($context_receiver_0:kotlin.Int) returnType:.Result [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Result declared in .Result' type=.Result origin=null + value: GET_VAR '$context_receiver_0: kotlin.Int declared in .Result.' type=kotlin.Int origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.kt.txt index 0d6a1df16bf..f5deddd6e99 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.kt.txt @@ -4,17 +4,17 @@ var operationScore: Int set class Delegate { + var delegateValue: String + field = "fail" + get + set + constructor() /* primary */ { super/*Any*/() /* () */ } - var delegateValue: String - field = "fail" - get - set - operator fun getValue($context_receiver_0: Int, thisRef: Any?, property: KProperty<*>): String { ( = ().plus(other = $context_receiver_0)) return .() @@ -29,13 +29,6 @@ class Delegate { class Result { private /* final field */ val contextReceiverField0: Int - constructor($context_receiver_0: Int) /* primary */ { - super/*Any*/() - .#contextReceiverField0 = $context_receiver_0 - /* () */ - - } - var s: String /* by */ field = Delegate() get(): String { @@ -45,6 +38,13 @@ class Result { return .#s$delegate.setValue($context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s, value = ) } + constructor($context_receiver_0: Int) /* primary */ { + super/*Any*/() + .#contextReceiverField0 = $context_receiver_0 + /* () */ + + } + } fun box(): String { @@ -59,3 +59,4 @@ fun box(): String { else -> "fail" } } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.ir.txt index eb69f8f5736..8e09f5cb198 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.ir.txt @@ -16,10 +16,6 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - CONSTRUCTOR visibility:public <> () returnType:.Delegate [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:delegateValue visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:delegateValue type:kotlin.String visibility:private EXPRESSION_BODY @@ -39,6 +35,23 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegateValue type:kotlin.String visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null value: GET_VAR ': kotlin.String declared in .Delegate.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> () returnType:.Delegate [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public 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 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:getValue visibility:public modality:FINAL <> ($this:.Delegate, $context_receiver_0:kotlin.Int, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.Delegate contextReceiverParametersCount: 1 @@ -70,30 +83,9 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=EQ $this: GET_VAR ': .Delegate declared in .Delegate.setValue' type=.Delegate origin=null : GET_VAR 'value: kotlin.String declared in .Delegate.setValue' type=kotlin.String 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: 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 CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Result FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final] - CONSTRUCTOR visibility:public <> ($context_receiver_0:kotlin.Int) returnType:.Result [primary] - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Result declared in .Result' type=.Result origin=null - value: GET_VAR '$context_receiver_0: kotlin.Int declared in .Result.' type=kotlin.Int origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:s$delegate type:.Delegate visibility:private [final] EXPRESSION_BODY @@ -124,6 +116,14 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt thisRef: GET_VAR ': .Result declared in .Result.' type=.Result origin=null property: PROPERTY_REFERENCE 'public final s: kotlin.String' field=null getter='public final fun (): kotlin.String declared in .Result' setter='public final fun (: kotlin.String): kotlin.Unit declared in .Result' type=kotlin.reflect.KMutableProperty1<.Result, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.String declared in .Result.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> ($context_receiver_0:kotlin.Int) returnType:.Result [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Result declared in .Result' type=.Result origin=null + value: GET_VAR '$context_receiver_0: kotlin.Int declared in .Result.' type=kotlin.Int origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt.txt index f1df42f2044..e36fac9b9e1 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt.txt @@ -4,17 +4,17 @@ var operationScore: Int set class Delegate { + var delegateValue: String + field = "fail" + get + set + constructor() /* primary */ { super/*Any*/() /* () */ } - var delegateValue: String - field = "fail" - get - set - operator fun getValue($context_receiver_0: Int, thisRef: Any?, property: KProperty<*>): String { { // BLOCK ( = ().plus(other = $context_receiver_0)) @@ -33,13 +33,6 @@ class Delegate { class Result { private /* final field */ val contextReceiverField0: Int - constructor($context_receiver_0: Int) /* primary */ { - super/*Any*/() - .#contextReceiverField0 = $context_receiver_0 - /* () */ - - } - var s: String /* by */ field = Delegate() get(): String { @@ -49,6 +42,13 @@ class Result { return .#s$delegate.setValue($context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s, value = ) } + constructor($context_receiver_0: Int) /* primary */ { + super/*Any*/() + .#contextReceiverField0 = $context_receiver_0 + /* () */ + + } + } fun box(): String { @@ -63,3 +63,4 @@ fun box(): String { else -> "fail" } } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.ir.txt index 6c3a66d2182..35cf9cd5961 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.ir.txt @@ -1,60 +1,10 @@ FILE fqName: fileName:/canvas.kt - CLASS INTERFACE name:Canvas modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Canvas - PROPERTY name:suffix visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Canvas) returnType:kotlin.String - correspondingProperty: PROPERTY name:suffix visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Canvas - 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: 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 - CLASS INTERFACE name:Shape modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Shape - FUN name:draw visibility:public modality:ABSTRACT <> ($this:.Shape, $context_receiver_0:.Canvas) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Shape - contextReceiverParametersCount: 1 - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Canvas - 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: 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 CLASS CLASS name:Circle modality:FINAL visibility:public superTypes:[.Shape] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Circle CONSTRUCTOR visibility:public <> () returnType:.Circle [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Circle modality:FINAL visibility:public superTypes:[.Shape]' - FUN name:draw visibility:public modality:OPEN <> ($this:.Circle, $context_receiver_0:.Canvas) returnType:kotlin.String - overridden: - public abstract fun draw ($context_receiver_0: .Canvas): kotlin.String declared in .Shape - $this: VALUE_PARAMETER name: type:.Circle - contextReceiverParametersCount: 1 - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Canvas - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun draw ($context_receiver_0: .Canvas): kotlin.String declared in .Circle' - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS - $this: CONST String type=kotlin.String value="OK" - other: CALL 'public abstract fun (): kotlin.String declared in .Canvas' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR '$context_receiver_0: .Canvas declared in .Circle.draw' type=.Canvas 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 .Shape @@ -68,12 +18,58 @@ FILE fqName: fileName:/canvas.kt overridden: public open fun toString (): kotlin.String declared in .Shape $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:draw visibility:public modality:OPEN <> ($this:.Circle, $context_receiver_0:.Canvas) returnType:kotlin.String + overridden: + public abstract fun draw ($context_receiver_0: .Canvas): kotlin.String declared in .Shape + $this: VALUE_PARAMETER name: type:.Circle + contextReceiverParametersCount: 1 + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Canvas + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun draw ($context_receiver_0: .Canvas): kotlin.String declared in .Circle' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS + $this: CONST String type=kotlin.String value="OK" + other: CALL 'public abstract fun (): kotlin.String declared in .Canvas' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR '$context_receiver_0: .Canvas declared in .Circle.draw' type=.Canvas origin=null + CLASS INTERFACE name:Canvas modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Canvas + 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: 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 + PROPERTY name:suffix visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Canvas) returnType:kotlin.String + correspondingProperty: PROPERTY name:suffix visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.Canvas + CLASS INTERFACE name:Shape modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Shape + 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: 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:draw visibility:public modality:ABSTRACT <> ($this:.Shape, $context_receiver_0:.Canvas) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Shape + contextReceiverParametersCount: 1 + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Canvas CLASS OBJECT name:MyCanvas modality:FINAL visibility:public superTypes:[.Canvas] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCanvas - CONSTRUCTOR visibility:private <> () returnType:.MyCanvas [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:MyCanvas modality:FINAL visibility:public superTypes:[.Canvas]' PROPERTY name:suffix visibility:public modality:OPEN [val] overridden: public abstract suffix: kotlin.String @@ -89,6 +85,10 @@ FILE fqName: fileName:/canvas.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MyCanvas' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:suffix type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .MyCanvas declared in .MyCanvas.' type=.MyCanvas origin=null + CONSTRUCTOR visibility:private <> () returnType:.MyCanvas [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:MyCanvas modality:FINAL visibility:public superTypes:[.Canvas]' 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 .Canvas diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt.txt index 11800ad493c..1bed2a34310 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt.txt @@ -1,14 +1,3 @@ -interface Canvas { - abstract val suffix: String - abstract get - -} - -interface Shape { - abstract fun draw($context_receiver_0: Canvas): String - -} - class Circle : Shape { constructor() /* primary */ { super/*Any*/() @@ -22,17 +11,28 @@ class Circle : Shape { } +interface Canvas { + abstract val suffix: String + abstract get + +} + +interface Shape { + abstract fun draw($context_receiver_0: Canvas): String + +} + object MyCanvas : Canvas { + override val suffix: String + field = "" + override get + private constructor() /* primary */ { super/*Any*/() /* () */ } - override val suffix: String - field = "" - override get - } fun box(): String { @@ -41,3 +41,4 @@ fun box(): String { } ) } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt index b1728cf9e9f..06a63243d90 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt @@ -3,12 +3,6 @@ FILE fqName: fileName:/compareTo.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Pair.Pair, B of .Pair> TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (first:A of .Pair, second:B of .Pair) returnType:.Pair.Pair, B of .Pair> [primary] - VALUE_PARAMETER name:first index:0 type:A of .Pair - VALUE_PARAMETER name:second index:1 type:B of .Pair - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Pair modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:first visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final] EXPRESSION_BODY @@ -31,6 +25,12 @@ FILE fqName: fileName:/compareTo.kt RETURN type=kotlin.Nothing from='public final fun (): B of .Pair declared in .Pair' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.' type=.Pair.Pair, B of .Pair> origin=null + CONSTRUCTOR visibility:public <> (first:A of .Pair, second:B of .Pair) returnType:.Pair.Pair, B of .Pair> [primary] + VALUE_PARAMETER name:first index:0 type:A of .Pair + VALUE_PARAMETER name:second index:1 type:B of .Pair + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Pair modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Pair.Pair, B of .Pair>) returnType:A of .Pair [operator] $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> BLOCK_BODY @@ -60,59 +60,6 @@ FILE fqName: fileName:/compareTo.kt : B of .Pair first: GET_VAR 'first: A of .Pair declared in .Pair.copy' type=A of .Pair origin=null second: GET_VAR 'second: B of .Pair declared in .Pair.copy' type=B of .Pair origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Pair' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Pair(" - CONST String type=kotlin.String value="first=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null - receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.toString' type=.Pair.Pair, B of .Pair> origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="second=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null - receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.toString' type=.Pair.Pair, B of .Pair> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null - receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null - receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null - SET_VAR 'var result: kotlin.Int declared in .Pair.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Pair.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null - receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null - receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Pair' - GET_VAR 'var result: kotlin.Int declared in .Pair.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -157,44 +104,59 @@ FILE fqName: fileName:/compareTo.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Pair' CONST Boolean type=kotlin.Boolean value=true - FUN name:compareTo visibility:public modality:FINAL ($receiver:T of .compareTo, $context_receiver_0:java.util.Comparator.compareTo>, other:T of .compareTo) returnType:kotlin.Int [operator,infix] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:T of .compareTo - VALUE_PARAMETER name:$context_receiver_0 index:0 type:java.util.Comparator.compareTo> - VALUE_PARAMETER name:other index:1 type:T of .compareTo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun compareTo ($context_receiver_0: java.util.Comparator.compareTo>, other: T of .compareTo): kotlin.Int declared in ' - CALL 'public abstract fun compare (p0: @[FlexibleNullability] T of java.util.Comparator?, p1: @[FlexibleNullability] T of java.util.Comparator?): kotlin.Int declared in java.util.Comparator' type=kotlin.Int origin=null - $this: GET_VAR '$context_receiver_0: java.util.Comparator.compareTo> declared in .compareTo' type=java.util.Comparator.compareTo> origin=null - p0: GET_VAR ': T of .compareTo declared in .compareTo' type=T of .compareTo origin=null - p1: GET_VAR 'other: T of .compareTo declared in .compareTo' type=T of .compareTo origin=null - PROPERTY name:min visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($receiver:.Pair., T of .>, $context_receiver_0:java.util.Comparator.>) returnType:T of . - correspondingProperty: PROPERTY name:min visibility:public modality:FINAL [val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Pair., T of .> - VALUE_PARAMETER name:$context_receiver_0 index:0 type:java.util.Comparator.> + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun ($context_receiver_0: java.util.Comparator.>): T of . declared in ' - WHEN type=T of . origin=IF + VAR name:result type:kotlin.Int [var] + WHEN type=kotlin.Int origin=null BRANCH - if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: CALL 'public final fun compareTo ($context_receiver_0: java.util.Comparator.compareTo>, other: T of .compareTo): kotlin.Int declared in ' type=kotlin.Int origin=null - : T of . - $receiver: CALL 'public final fun (): A of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY - $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null - $context_receiver_0: GET_VAR '$context_receiver_0: java.util.Comparator.> declared in .' type=java.util.Comparator.> origin=null - other: CALL 'public final fun (): B of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY - $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null - arg1: CONST Int type=kotlin.Int value=0 - then: CALL 'public final fun (): A of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY - $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null + 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null + receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun (): B of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY - $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null + receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null + SET_VAR 'var result: kotlin.Int declared in .Pair.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Pair.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null + receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null + receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Pair' + GET_VAR 'var result: kotlin.Int declared in .Pair.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Pair' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Pair(" + CONST String type=kotlin.String value="first=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null + receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.toString' type=.Pair.Pair, B of .Pair> origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="second=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null + receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.toString' type=.Pair.Pair, B of .Pair> origin=null + CONST String type=kotlin.String value=")" FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:comparator type:java.util.Comparator [val] @@ -244,3 +206,41 @@ FILE fqName: fileName:/compareTo.kt first: CONST String type=kotlin.String value="OK" second: CONST String type=kotlin.String value="fail" $context_receiver_0: GET_VAR '$this$with: java.util.Comparator declared in .box.' type=java.util.Comparator origin=null + FUN name:compareTo visibility:public modality:FINAL ($receiver:T of .compareTo, $context_receiver_0:java.util.Comparator.compareTo>, other:T of .compareTo) returnType:kotlin.Int [operator,infix] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:T of .compareTo + VALUE_PARAMETER name:$context_receiver_0 index:0 type:java.util.Comparator.compareTo> + VALUE_PARAMETER name:other index:1 type:T of .compareTo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun compareTo ($context_receiver_0: java.util.Comparator.compareTo>, other: T of .compareTo): kotlin.Int declared in ' + CALL 'public abstract fun compare (p0: @[FlexibleNullability] T of java.util.Comparator?, p1: @[FlexibleNullability] T of java.util.Comparator?): kotlin.Int declared in java.util.Comparator' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: java.util.Comparator.compareTo> declared in .compareTo' type=java.util.Comparator.compareTo> origin=null + p0: GET_VAR ': T of .compareTo declared in .compareTo' type=T of .compareTo origin=null + p1: GET_VAR 'other: T of .compareTo declared in .compareTo' type=T of .compareTo origin=null + PROPERTY name:min visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL ($receiver:.Pair., T of .>, $context_receiver_0:java.util.Comparator.>) returnType:T of . + correspondingProperty: PROPERTY name:min visibility:public modality:FINAL [val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Pair., T of .> + VALUE_PARAMETER name:$context_receiver_0 index:0 type:java.util.Comparator.> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ($context_receiver_0: java.util.Comparator.>): T of . declared in ' + WHEN type=T of . origin=IF + BRANCH + if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: CALL 'public final fun compareTo ($context_receiver_0: java.util.Comparator.compareTo>, other: T of .compareTo): kotlin.Int declared in ' type=kotlin.Int origin=null + : T of . + $receiver: CALL 'public final fun (): A of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY + $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null + $context_receiver_0: GET_VAR '$context_receiver_0: java.util.Comparator.> declared in .' type=java.util.Comparator.> origin=null + other: CALL 'public final fun (): B of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY + $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: CALL 'public final fun (): A of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY + $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun (): B of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY + $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt index 08f1aa3e2d3..8a0907a695d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt @@ -1,10 +1,4 @@ data class Pair { - constructor(first: A, second: B) /* primary */ { - super/*Any*/() - /* () */ - - } - val first: A field = first get @@ -13,6 +7,12 @@ data class Pair { field = second get + constructor(first: A, second: B) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): A { return .#first } @@ -25,22 +25,6 @@ data class Pair { return Pair(first = first, second = second) } - override fun toString(): String { - return "Pair(" + "first=" + .#first + ", " + "second=" + .#second + ")" - } - - override fun hashCode(): Int { - var result: Int = when { - EQEQ(arg0 = .#first, arg1 = null) -> 0 - else -> .#first.hashCode() - } - result = result.times(other = 31).plus(other = when { - EQEQ(arg0 = .#second, arg1 = null) -> 0 - else -> .#second.hashCode() - }) - return result - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -58,20 +42,24 @@ data class Pair { return true } -} - -infix operator fun T.compareTo($context_receiver_0: Comparator, other: T): Int { - return $context_receiver_0.compare(p0 = , p1 = other) -} - -val Pair.min: T - get($context_receiver_0: Comparator): T { - return when { - less(arg0 = .().compareTo($context_receiver_0 = $context_receiver_0, other = .()), arg1 = 0) -> .() - else -> .() + override fun hashCode(): Int { + var result: Int = when { + EQEQ(arg0 = .#first, arg1 = null) -> 0 + else -> .#first.hashCode() } + result = result.times(other = 31).plus(other = when { + EQEQ(arg0 = .#second, arg1 = null) -> 0 + else -> .#second.hashCode() + }) + return result } + override fun toString(): String { + return "Pair(" + "first=" + .#first + ", " + "second=" + .#second + ")" + } + +} + fun box(): String { val comparator: Comparator = local fun (a: @FlexibleNullability String?, b: @FlexibleNullability String?): Int { return when { @@ -89,3 +77,15 @@ fun box(): String { ) } +infix operator fun T.compareTo($context_receiver_0: Comparator, other: T): Int { + return $context_receiver_0.compare(p0 = , p1 = other) +} + +val Pair.min: T + get($context_receiver_0: Comparator): T { + return when { + less(arg0 = .().compareTo($context_receiver_0 = $context_receiver_0, other = .()), arg1 = 0) -> .() + else -> .() + } + } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.ir.txt index 02220ec3e51..936a866d230 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.ir.txt @@ -3,12 +3,6 @@ FILE fqName: fileName:/compareTo.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Pair.Pair, B of .Pair> TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (first:A of .Pair, second:B of .Pair) returnType:.Pair.Pair, B of .Pair> [primary] - VALUE_PARAMETER name:first index:0 type:A of .Pair - VALUE_PARAMETER name:second index:1 type:B of .Pair - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Pair modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:first visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final] EXPRESSION_BODY @@ -31,6 +25,12 @@ FILE fqName: fileName:/compareTo.kt RETURN type=kotlin.Nothing from='public final fun (): B of .Pair declared in .Pair' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.' type=.Pair.Pair, B of .Pair> origin=null + CONSTRUCTOR visibility:public <> (first:A of .Pair, second:B of .Pair) returnType:.Pair.Pair, B of .Pair> [primary] + VALUE_PARAMETER name:first index:0 type:A of .Pair + VALUE_PARAMETER name:second index:1 type:B of .Pair + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Pair modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Pair.Pair, B of .Pair>) returnType:A of .Pair [operator] $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> BLOCK_BODY @@ -60,59 +60,6 @@ FILE fqName: fileName:/compareTo.kt : B of .Pair first: GET_VAR 'first: A of .Pair declared in .Pair.copy' type=A of .Pair origin=null second: GET_VAR 'second: B of .Pair declared in .Pair.copy' type=B of .Pair origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Pair' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Pair(" - CONST String type=kotlin.String value="first=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null - receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.toString' type=.Pair.Pair, B of .Pair> origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="second=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null - receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.toString' type=.Pair.Pair, B of .Pair> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null - receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null - receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null - SET_VAR 'var result: kotlin.Int declared in .Pair.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Pair.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null - receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null - receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Pair' - GET_VAR 'var result: kotlin.Int declared in .Pair.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -157,44 +104,59 @@ FILE fqName: fileName:/compareTo.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Pair' CONST Boolean type=kotlin.Boolean value=true - FUN name:compareTo visibility:public modality:FINAL ($receiver:T of .compareTo, $context_receiver_0:java.util.Comparator.compareTo>, other:T of .compareTo) returnType:kotlin.Int [operator,infix] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:T of .compareTo - VALUE_PARAMETER name:$context_receiver_0 index:0 type:java.util.Comparator.compareTo> - VALUE_PARAMETER name:other index:1 type:T of .compareTo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun compareTo ($context_receiver_0: java.util.Comparator.compareTo>, other: T of .compareTo): kotlin.Int declared in ' - CALL 'public abstract fun compare (p0: @[FlexibleNullability] T of java.util.Comparator?, p1: @[FlexibleNullability] T of java.util.Comparator?): kotlin.Int declared in java.util.Comparator' type=kotlin.Int origin=null - $this: GET_VAR '$context_receiver_0: java.util.Comparator.compareTo> declared in .compareTo' type=java.util.Comparator.compareTo> origin=null - p0: GET_VAR ': T of .compareTo declared in .compareTo' type=T of .compareTo origin=null - p1: GET_VAR 'other: T of .compareTo declared in .compareTo' type=T of .compareTo origin=null - PROPERTY name:min visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($receiver:.Pair., T of .>, $context_receiver_0:java.util.Comparator.>) returnType:T of . - correspondingProperty: PROPERTY name:min visibility:public modality:FINAL [val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Pair., T of .> - VALUE_PARAMETER name:$context_receiver_0 index:0 type:java.util.Comparator.> + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun ($context_receiver_0: java.util.Comparator.>): T of . declared in ' - WHEN type=T of . origin=IF + VAR name:result type:kotlin.Int [var] + WHEN type=kotlin.Int origin=null BRANCH - if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: CALL 'public final fun compareTo ($context_receiver_0: java.util.Comparator.compareTo>, other: T of .compareTo): kotlin.Int declared in ' type=kotlin.Int origin=LT - : T of . - $receiver: CALL 'public final fun (): A of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY - $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null - $context_receiver_0: GET_VAR '$context_receiver_0: java.util.Comparator.> declared in .' type=java.util.Comparator.> origin=null - other: CALL 'public final fun (): B of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY - $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null - arg1: CONST Int type=kotlin.Int value=0 - then: CALL 'public final fun (): A of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY - $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null + 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null + receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun (): B of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY - $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null + receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null + SET_VAR 'var result: kotlin.Int declared in .Pair.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Pair.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null + receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null + receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.hashCode' type=.Pair.Pair, B of .Pair> origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Pair' + GET_VAR 'var result: kotlin.Int declared in .Pair.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Pair' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Pair(" + CONST String type=kotlin.String value="first=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null + receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.toString' type=.Pair.Pair, B of .Pair> origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="second=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null + receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.toString' type=.Pair.Pair, B of .Pair> origin=null + CONST String type=kotlin.String value=")" FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:comparator type:java.util.Comparator [val] @@ -246,3 +208,41 @@ FILE fqName: fileName:/compareTo.kt first: CONST String type=kotlin.String value="OK" second: CONST String type=kotlin.String value="fail" $context_receiver_0: GET_VAR '$this$with: java.util.Comparator declared in .box.' type=java.util.Comparator origin=null + FUN name:compareTo visibility:public modality:FINAL ($receiver:T of .compareTo, $context_receiver_0:java.util.Comparator.compareTo>, other:T of .compareTo) returnType:kotlin.Int [operator,infix] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:T of .compareTo + VALUE_PARAMETER name:$context_receiver_0 index:0 type:java.util.Comparator.compareTo> + VALUE_PARAMETER name:other index:1 type:T of .compareTo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun compareTo ($context_receiver_0: java.util.Comparator.compareTo>, other: T of .compareTo): kotlin.Int declared in ' + CALL 'public abstract fun compare (p0: @[FlexibleNullability] T of java.util.Comparator?, p1: @[FlexibleNullability] T of java.util.Comparator?): kotlin.Int declared in java.util.Comparator' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: java.util.Comparator.compareTo> declared in .compareTo' type=java.util.Comparator.compareTo> origin=null + p0: GET_VAR ': T of .compareTo declared in .compareTo' type=T of .compareTo origin=null + p1: GET_VAR 'other: T of .compareTo declared in .compareTo' type=T of .compareTo origin=null + PROPERTY name:min visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL ($receiver:.Pair., T of .>, $context_receiver_0:java.util.Comparator.>) returnType:T of . + correspondingProperty: PROPERTY name:min visibility:public modality:FINAL [val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Pair., T of .> + VALUE_PARAMETER name:$context_receiver_0 index:0 type:java.util.Comparator.> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ($context_receiver_0: java.util.Comparator.>): T of . declared in ' + WHEN type=T of . origin=IF + BRANCH + if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: CALL 'public final fun compareTo ($context_receiver_0: java.util.Comparator.compareTo>, other: T of .compareTo): kotlin.Int declared in ' type=kotlin.Int origin=LT + : T of . + $receiver: CALL 'public final fun (): A of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY + $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null + $context_receiver_0: GET_VAR '$context_receiver_0: java.util.Comparator.> declared in .' type=java.util.Comparator.> origin=null + other: CALL 'public final fun (): B of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY + $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: CALL 'public final fun (): A of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY + $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun (): B of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY + $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt.txt index 7a19c3a22a4..65f9dbbf0c7 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt.txt @@ -1,10 +1,4 @@ data class Pair { - constructor(first: A, second: B) /* primary */ { - super/*Any*/() - /* () */ - - } - val first: A field = first get @@ -13,6 +7,12 @@ data class Pair { field = second get + constructor(first: A, second: B) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): A { return .#first } @@ -25,22 +25,6 @@ data class Pair { return Pair(first = first, second = second) } - override fun toString(): String { - return "Pair(" + "first=" + .#first + ", " + "second=" + .#second + ")" - } - - override fun hashCode(): Int { - var result: Int = when { - EQEQ(arg0 = .#first, arg1 = null) -> 0 - else -> .#first.hashCode() - } - result = result.times(other = 31).plus(other = when { - EQEQ(arg0 = .#second, arg1 = null) -> 0 - else -> .#second.hashCode() - }) - return result - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -58,20 +42,24 @@ data class Pair { return true } -} - -infix operator fun T.compareTo($context_receiver_0: Comparator, other: T): Int { - return $context_receiver_0.compare(p0 = , p1 = other) -} - -val Pair.min: T - get($context_receiver_0: Comparator): T { - return when { - less(arg0 = .().compareTo($context_receiver_0 = $context_receiver_0, other = .()), arg1 = 0) -> .() - else -> .() + override fun hashCode(): Int { + var result: Int = when { + EQEQ(arg0 = .#first, arg1 = null) -> 0 + else -> .#first.hashCode() } + result = result.times(other = 31).plus(other = when { + EQEQ(arg0 = .#second, arg1 = null) -> 0 + else -> .#second.hashCode() + }) + return result } + override fun toString(): String { + return "Pair(" + "first=" + .#first + ", " + "second=" + .#second + ")" + } + +} + fun box(): String { val comparator: Comparator = local fun (a: @FlexibleNullability String?, b: @FlexibleNullability String?): Int { return when { @@ -88,3 +76,16 @@ fun box(): String { } ) } + +infix operator fun T.compareTo($context_receiver_0: Comparator, other: T): Int { + return $context_receiver_0.compare(p0 = , p1 = other) +} + +val Pair.min: T + get($context_receiver_0: Comparator): T { + return when { + less(arg0 = .().compareTo($context_receiver_0 = $context_receiver_0, other = .()), arg1 = 0) -> .() + else -> .() + } + } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.ir.txt index 9cc49f5812c..1fd71b954e2 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/dp.kt CLASS CLASS name:View modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.View - CONSTRUCTOR visibility:public <> () returnType:.View [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:View modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:coefficient visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:coefficient type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -16,6 +12,10 @@ FILE fqName: fileName:/dp.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .View' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:coefficient type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .View declared in .View.' type=.View origin=null + CONSTRUCTOR visibility:public <> () returnType:.View [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:View modality:FINAL visibility:public 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 declared in kotlin.Any @@ -29,18 +29,6 @@ FILE fqName: fileName:/dp.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:dp visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.View) returnType:kotlin.Int - correspondingProperty: PROPERTY name:dp visibility:public modality:FINAL [val] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.View - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun ($context_receiver_0: .View): kotlin.Int declared in ' - CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MUL - $this: CALL 'public final fun (): kotlin.Int declared in .View' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '$context_receiver_0: .View declared in .' type=.View origin=null - other: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.Nothing origin=null @@ -82,3 +70,15 @@ FILE fqName: fileName:/dp.kt CONST String type=kotlin.String value="OK" RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CONST String type=kotlin.String value="fail" + PROPERTY name:dp visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.View) returnType:kotlin.Int + correspondingProperty: PROPERTY name:dp visibility:public modality:FINAL [val] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.View + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ($context_receiver_0: .View): kotlin.Int declared in ' + CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MUL + $this: CALL 'public final fun (): kotlin.Int declared in .View' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR '$context_receiver_0: .View declared in .' type=.View origin=null + other: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt.txt index 75a72bdbc6b..2035c2dbead 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt.txt @@ -1,21 +1,16 @@ class View { + val coefficient: Int + field = 42 + get + constructor() /* primary */ { super/*Any*/() /* () */ } - val coefficient: Int - field = 42 - get - } -val Int.dp: Int - get($context_receiver_0: View): Int { - return $context_receiver_0.().times(other = ) - } - fun box(): String { with(receiver = View(), block = local fun View.(): Nothing { when { @@ -30,3 +25,9 @@ fun box(): String { } ) } + +val Int.dp: Int + get($context_receiver_0: View): Int { + return $context_receiver_0.().times(other = ) + } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.ir.txt index a78a20c4d49..8b87049b3d8 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.ir.txt @@ -1,4 +1,64 @@ FILE fqName: fileName:/functionalType.kt + CLASS CLASS name:K modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K + PROPERTY name:k visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="K" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.K) returnType:kotlin.String + correspondingProperty: PROPERTY name:k visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.K + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .K' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .K declared in .K.' type=.K origin=null + CONSTRUCTOR visibility:public <> () returnType:.K [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K modality:FINAL visibility:public 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 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 + CLASS CLASS name:O modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.O + PROPERTY name:o visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="O" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.O) returnType:kotlin.String + correspondingProperty: PROPERTY name:o visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.O + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .O' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .O declared in .O.' type=.O origin=null + CONSTRUCTOR visibility:public <> () returnType:.O [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:O modality:FINAL visibility:public 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 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 CLASS CLASS name:Param modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Param CONSTRUCTOR visibility:public <> () returnType:.Param [primary] @@ -18,79 +78,6 @@ FILE fqName: fileName:/functionalType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:O modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.O - CONSTRUCTOR visibility:public <> () returnType:.O [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:o visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final] - EXPRESSION_BODY - CONST String type=kotlin.String value="O" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.O) returnType:kotlin.String - correspondingProperty: PROPERTY name:o visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.O - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .O' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .O declared in .O.' type=.O 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: 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 - CLASS CLASS name:K modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K - CONSTRUCTOR visibility:public <> () returnType:.K [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:k visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final] - EXPRESSION_BODY - CONST String type=kotlin.String value="K" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.K) returnType:kotlin.String - correspondingProperty: PROPERTY name:k visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.K - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .K' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .K declared in .K.' type=.K 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: 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:f visibility:public modality:FINAL ($receiver:.K, $context_receiver_0:.O, g:@[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f>) returnType:T of .f - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.K - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.O - VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f ($context_receiver_0: .O, g: @[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f>): T of .f declared in ' - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function3, p2: P2 of kotlin.Function3, p3: P3 of kotlin.Function3): R of kotlin.Function3 declared in kotlin.Function3' type=T of .f origin=INVOKE - $this: GET_VAR 'g: @[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f> declared in .f' type=@[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '$context_receiver_0: .O declared in .f' type=.O origin=null - p2: GET_VAR ': .K declared in .f' type=.K origin=null - p3: CONSTRUCTOR_CALL 'public constructor () declared in .Param' type=.Param 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 ' @@ -120,3 +107,16 @@ FILE fqName: fileName:/functionalType.kt $this: GET_VAR '$this$with: .O declared in .box.' type=.O origin=null other: CALL 'public final fun (): kotlin.String declared in .K' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR '$this$f: .K declared in .box..' type=.K origin=null + FUN name:f visibility:public modality:FINAL ($receiver:.K, $context_receiver_0:.O, g:@[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f>) returnType:T of .f + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.K + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.O + VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f ($context_receiver_0: .O, g: @[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f>): T of .f declared in ' + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function3, p2: P2 of kotlin.Function3, p3: P3 of kotlin.Function3): R of kotlin.Function3 declared in kotlin.Function3' type=T of .f origin=INVOKE + $this: GET_VAR 'g: @[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f> declared in .f' type=@[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f> origin=VARIABLE_AS_FUNCTION + p1: GET_VAR '$context_receiver_0: .O declared in .f' type=.O origin=null + p2: GET_VAR ': .K declared in .f' type=.K origin=null + p3: CONSTRUCTOR_CALL 'public constructor () declared in .Param' type=.Param origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.kt.txt index 01424488a25..56d6007c960 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.kt.txt @@ -1,4 +1,8 @@ -class Param { +class K { + val k: String + field = "K" + get + constructor() /* primary */ { super/*Any*/() /* () */ @@ -8,33 +12,25 @@ class Param { } class O { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val o: String field = "O" get -} - -class K { constructor() /* primary */ { super/*Any*/() /* () */ } - val k: String - field = "K" - get - } -fun K.f($context_receiver_0: O, g: @ExtensionFunctionType Function3): T { - return g.invoke(p1 = $context_receiver_0, p2 = , p3 = Param()) +class Param { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } fun box(): String { @@ -46,3 +42,8 @@ fun box(): String { } ) } + +fun K.f($context_receiver_0: O, g: @ExtensionFunctionType Function3): T { + return g.invoke(p1 = $context_receiver_0, p2 = , p3 = Param()) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.ir.txt index b0515a16c2a..650354707e3 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.ir.txt @@ -1,4 +1,64 @@ FILE fqName: fileName:/functionalType.kt + CLASS CLASS name:K modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K + PROPERTY name:k visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="K" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.K) returnType:kotlin.String + correspondingProperty: PROPERTY name:k visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.K + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .K' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .K declared in .K.' type=.K origin=null + CONSTRUCTOR visibility:public <> () returnType:.K [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K modality:FINAL visibility:public 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 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 + CLASS CLASS name:O modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.O + PROPERTY name:o visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="O" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.O) returnType:kotlin.String + correspondingProperty: PROPERTY name:o visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.O + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .O' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .O declared in .O.' type=.O origin=null + CONSTRUCTOR visibility:public <> () returnType:.O [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:O modality:FINAL visibility:public 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 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 CLASS CLASS name:Param modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Param CONSTRUCTOR visibility:public <> () returnType:.Param [primary] @@ -18,79 +78,6 @@ FILE fqName: fileName:/functionalType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:O modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.O - CONSTRUCTOR visibility:public <> () returnType:.O [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:o visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final] - EXPRESSION_BODY - CONST String type=kotlin.String value="O" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.O) returnType:kotlin.String - correspondingProperty: PROPERTY name:o visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.O - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .O' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .O declared in .O.' type=.O 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: 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 - CLASS CLASS name:K modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K - CONSTRUCTOR visibility:public <> () returnType:.K [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:k visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final] - EXPRESSION_BODY - CONST String type=kotlin.String value="K" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.K) returnType:kotlin.String - correspondingProperty: PROPERTY name:k visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.K - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .K' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .K declared in .K.' type=.K 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: 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:f visibility:public modality:FINAL ($receiver:.K, $context_receiver_0:.O, g:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = 1)] kotlin.Function3<.O, .K, .Param, T of .f>) returnType:T of .f - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.K - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.O - VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = 1)] kotlin.Function3<.O, .K, .Param, T of .f> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f ($context_receiver_0: .O, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = 1)] kotlin.Function3<.O, .K, .Param, T of .f>): T of .f declared in ' - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function3, p2: P2 of kotlin.Function3, p3: P3 of kotlin.Function3): R of kotlin.Function3 declared in kotlin.Function3' type=T of .f origin=INVOKE - $this: GET_VAR 'g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = 1)] kotlin.Function3<.O, .K, .Param, T of .f> declared in .f' type=@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = 1)] kotlin.Function3<.O, .K, .Param, T of .f> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '$context_receiver_0: .O declared in .f' type=.O origin=null - p2: GET_VAR ': .K declared in .f' type=.K origin=null - p3: CONSTRUCTOR_CALL 'public constructor () declared in .Param' type=.Param 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 ' @@ -120,3 +107,16 @@ FILE fqName: fileName:/functionalType.kt $this: GET_VAR '$this$with: .O declared in .box.' type=.O origin=null other: CALL 'public final fun (): kotlin.String declared in .K' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR '$this$f: .K declared in .box..' type=.K origin=null + FUN name:f visibility:public modality:FINAL ($receiver:.K, $context_receiver_0:.O, g:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = 1)] kotlin.Function3<.O, .K, .Param, T of .f>) returnType:T of .f + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.K + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.O + VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = 1)] kotlin.Function3<.O, .K, .Param, T of .f> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f ($context_receiver_0: .O, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = 1)] kotlin.Function3<.O, .K, .Param, T of .f>): T of .f declared in ' + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function3, p2: P2 of kotlin.Function3, p3: P3 of kotlin.Function3): R of kotlin.Function3 declared in kotlin.Function3' type=T of .f origin=INVOKE + $this: GET_VAR 'g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = 1)] kotlin.Function3<.O, .K, .Param, T of .f> declared in .f' type=@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = 1)] kotlin.Function3<.O, .K, .Param, T of .f> origin=VARIABLE_AS_FUNCTION + p1: GET_VAR '$context_receiver_0: .O declared in .f' type=.O origin=null + p2: GET_VAR ': .K declared in .f' type=.K origin=null + p3: CONSTRUCTOR_CALL 'public constructor () declared in .Param' type=.Param origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt.txt index c79a9260272..fab9b27c695 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt.txt @@ -1,4 +1,8 @@ -class Param { +class K { + val k: String + field = "K" + get + constructor() /* primary */ { super/*Any*/() /* () */ @@ -8,33 +12,25 @@ class Param { } class O { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val o: String field = "O" get -} - -class K { constructor() /* primary */ { super/*Any*/() /* () */ } - val k: String - field = "K" - get - } -fun K.f($context_receiver_0: O, g: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function3): T { - return g.invoke(p1 = $context_receiver_0, p2 = , p3 = Param()) +class Param { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } fun box(): String { @@ -46,3 +42,8 @@ fun box(): String { } ) } + +fun K.f($context_receiver_0: O, g: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function3): T { + return g.invoke(p1 = $context_receiver_0, p2 = , p3 = Param()) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.ir.txt index ee83cc9bf29..6d0a53757c1 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.ir.txt @@ -1,31 +1,7 @@ FILE fqName: fileName:/monoidSum.kt - CLASS INTERFACE name:Semigroup modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Semigroup.Semigroup> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:combine visibility:public modality:ABSTRACT <> ($this:.Semigroup.Semigroup>, $receiver:T of .Semigroup, other:T of .Semigroup) returnType:T of .Semigroup [infix] - $this: VALUE_PARAMETER name: type:.Semigroup.Semigroup> - $receiver: VALUE_PARAMETER name: type:T of .Semigroup - VALUE_PARAMETER name:other index:0 type:T of .Semigroup - 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: 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 CLASS INTERFACE name:Monoid modality:ABSTRACT visibility:public superTypes:[.Semigroup.Monoid>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Monoid.Monoid> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - PROPERTY name:unit visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Monoid.Monoid>) returnType:T of .Monoid - correspondingProperty: PROPERTY name:unit visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Monoid.Monoid> FUN FAKE_OVERRIDE name:combine visibility:public modality:ABSTRACT <> ($this:.Semigroup.Monoid>, $receiver:T of .Monoid, other:T of .Monoid) returnType:T of .Monoid [fake_override,infix] overridden: public abstract fun combine (other: T of .Semigroup): T of .Semigroup declared in .Semigroup @@ -45,23 +21,32 @@ FILE fqName: fileName:/monoidSum.kt overridden: public open fun toString (): kotlin.String declared in .Semigroup $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:unit visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Monoid.Monoid>) returnType:T of .Monoid + correspondingProperty: PROPERTY name:unit visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.Monoid.Monoid> + CLASS INTERFACE name:Semigroup modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Semigroup.Semigroup> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:combine visibility:public modality:ABSTRACT <> ($this:.Semigroup.Semigroup>, $receiver:T of .Semigroup, other:T of .Semigroup) returnType:T of .Semigroup [infix] + $this: VALUE_PARAMETER name: type:.Semigroup.Semigroup> + $receiver: VALUE_PARAMETER name: type:T of .Semigroup + VALUE_PARAMETER name:other index:0 type:T of .Semigroup CLASS OBJECT name:IntMonoid modality:FINAL visibility:public superTypes:[.Monoid] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IntMonoid - CONSTRUCTOR visibility:private <> () returnType:.IntMonoid [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:IntMonoid modality:FINAL visibility:public superTypes:[.Monoid]' - FUN name:combine visibility:public modality:OPEN <> ($this:.IntMonoid, $receiver:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix] - overridden: - public abstract fun combine (other: T of .Monoid): T of .Monoid declared in .Monoid - $this: VALUE_PARAMETER name: type:.IntMonoid - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:other index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun combine (other: kotlin.Int): kotlin.Int declared in .IntMonoid' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR ': kotlin.Int declared in .IntMonoid.combine' type=kotlin.Int origin=null - other: GET_VAR 'other: kotlin.Int declared in .IntMonoid.combine' type=kotlin.Int origin=null PROPERTY name:unit visibility:public modality:OPEN [val] overridden: public abstract unit: T of .Monoid @@ -77,6 +62,10 @@ FILE fqName: fileName:/monoidSum.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .IntMonoid' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:unit type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .IntMonoid declared in .IntMonoid.' type=.IntMonoid origin=null + CONSTRUCTOR visibility:private <> () returnType:.IntMonoid [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:IntMonoid modality:FINAL visibility:public superTypes:[.Monoid]' 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 .Monoid @@ -90,23 +79,19 @@ FILE fqName: fileName:/monoidSum.kt overridden: public open fun toString (): kotlin.String declared in .Monoid $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[.Monoid] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.StringMonoid - CONSTRUCTOR visibility:private <> () returnType:.StringMonoid [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[.Monoid]' - FUN name:combine visibility:public modality:OPEN <> ($this:.StringMonoid, $receiver:kotlin.String, other:kotlin.String) returnType:kotlin.String [infix] + FUN name:combine visibility:public modality:OPEN <> ($this:.IntMonoid, $receiver:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix] overridden: public abstract fun combine (other: T of .Monoid): T of .Monoid declared in .Monoid - $this: VALUE_PARAMETER name: type:.StringMonoid - $receiver: VALUE_PARAMETER name: type:kotlin.String - VALUE_PARAMETER name:other index:0 type:kotlin.String + $this: VALUE_PARAMETER name: type:.IntMonoid + $receiver: VALUE_PARAMETER name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun combine (other: kotlin.String): kotlin.String declared in .StringMonoid' - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS - $this: GET_VAR ': kotlin.String declared in .StringMonoid.combine' type=kotlin.String origin=null - other: GET_VAR 'other: kotlin.String declared in .StringMonoid.combine' type=kotlin.String origin=null + RETURN type=kotlin.Nothing from='public open fun combine (other: kotlin.Int): kotlin.Int declared in .IntMonoid' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: GET_VAR ': kotlin.Int declared in .IntMonoid.combine' type=kotlin.Int origin=null + other: GET_VAR 'other: kotlin.Int declared in .IntMonoid.combine' type=kotlin.Int origin=null + CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[.Monoid] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.StringMonoid PROPERTY name:unit visibility:public modality:OPEN [val] overridden: public abstract unit: T of .Monoid @@ -122,6 +107,10 @@ FILE fqName: fileName:/monoidSum.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .StringMonoid' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:unit type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .StringMonoid declared in .StringMonoid.' type=.StringMonoid origin=null + CONSTRUCTOR visibility:private <> () returnType:.StringMonoid [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[.Monoid]' 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 .Monoid @@ -135,29 +124,17 @@ FILE fqName: fileName:/monoidSum.kt overridden: public open fun toString (): kotlin.String declared in .Monoid $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:sum visibility:public modality:FINAL ($receiver:kotlin.collections.List.sum>, $context_receiver_0:.Monoid.sum>) returnType:T of .sum - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.sum> - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Monoid.sum> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun sum ($context_receiver_0: .Monoid.sum>): T of .sum declared in ' - CALL 'public final fun fold (initial: R of kotlin.collections.fold, operation: kotlin.Function2<@[ParameterName(name = "acc")] R of kotlin.collections.fold, T of kotlin.collections.fold, R of kotlin.collections.fold>): R of kotlin.collections.fold declared in kotlin.collections' type=T of .sum origin=null - : T of .sum - : T of .sum - $receiver: GET_VAR ': kotlin.collections.List.sum> declared in .sum' type=kotlin.collections.List.sum> origin=null - initial: CALL 'public abstract fun (): T of .Monoid declared in .Monoid' type=T of .sum origin=GET_PROPERTY - $this: GET_VAR '$context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null - operation: FUN_EXPR type=kotlin.Function2<@[ParameterName(name = "acc")] T of .sum, T of .sum, T of .sum> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (acc:@[ParameterName(name = "acc")] T of .sum, e:T of .sum) returnType:T of .sum - VALUE_PARAMETER name:acc index:0 type:@[ParameterName(name = "acc")] T of .sum - VALUE_PARAMETER name:e index:1 type:T of .sum - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (acc: @[ParameterName(name = "acc")] T of .sum, e: T of .sum): T of .sum declared in .sum' - CALL 'public abstract fun combine (other: T of .Monoid): T of .Monoid declared in .Monoid' type=T of .sum origin=null - $this: GET_VAR '$context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null - $receiver: GET_VAR 'acc: @[ParameterName(name = "acc")] T of .sum declared in .sum.' type=@[ParameterName(name = "acc")] T of .sum origin=null - other: GET_VAR 'e: T of .sum declared in .sum.' type=T of .sum origin=null + FUN name:combine visibility:public modality:OPEN <> ($this:.StringMonoid, $receiver:kotlin.String, other:kotlin.String) returnType:kotlin.String [infix] + overridden: + public abstract fun combine (other: T of .Monoid): T of .Monoid declared in .Monoid + $this: VALUE_PARAMETER name: type:.StringMonoid + $receiver: VALUE_PARAMETER name: type:kotlin.String + VALUE_PARAMETER name:other index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun combine (other: kotlin.String): kotlin.String declared in .StringMonoid' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS + $this: GET_VAR ': kotlin.String declared in .StringMonoid.combine' type=kotlin.String origin=null + other: GET_VAR 'other: kotlin.String declared in .StringMonoid.combine' type=kotlin.String origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -197,3 +174,26 @@ FILE fqName: fileName:/monoidSum.kt CONST String type=kotlin.String value="O" CONST String type=kotlin.String value="K" $context_receiver_0: GET_VAR '$this$with: .StringMonoid declared in .box.' type=.StringMonoid origin=null + FUN name:sum visibility:public modality:FINAL ($receiver:kotlin.collections.List.sum>, $context_receiver_0:.Monoid.sum>) returnType:T of .sum + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.sum> + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Monoid.sum> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun sum ($context_receiver_0: .Monoid.sum>): T of .sum declared in ' + CALL 'public final fun fold (initial: R of kotlin.collections.fold, operation: kotlin.Function2<@[ParameterName(name = "acc")] R of kotlin.collections.fold, T of kotlin.collections.fold, R of kotlin.collections.fold>): R of kotlin.collections.fold declared in kotlin.collections' type=T of .sum origin=null + : T of .sum + : T of .sum + $receiver: GET_VAR ': kotlin.collections.List.sum> declared in .sum' type=kotlin.collections.List.sum> origin=null + initial: CALL 'public abstract fun (): T of .Monoid declared in .Monoid' type=T of .sum origin=GET_PROPERTY + $this: GET_VAR '$context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null + operation: FUN_EXPR type=kotlin.Function2<@[ParameterName(name = "acc")] T of .sum, T of .sum, T of .sum> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (acc:@[ParameterName(name = "acc")] T of .sum, e:T of .sum) returnType:T of .sum + VALUE_PARAMETER name:acc index:0 type:@[ParameterName(name = "acc")] T of .sum + VALUE_PARAMETER name:e index:1 type:T of .sum + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (acc: @[ParameterName(name = "acc")] T of .sum, e: T of .sum): T of .sum declared in .sum' + CALL 'public abstract fun combine (other: T of .Monoid): T of .Monoid declared in .Monoid' type=T of .sum origin=null + $this: GET_VAR '$context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null + $receiver: GET_VAR 'acc: @[ParameterName(name = "acc")] T of .sum declared in .sum.' type=@[ParameterName(name = "acc")] T of .sum origin=null + other: GET_VAR 'e: T of .sum declared in .sum.' type=T of .sum origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.kt.txt index aef0a308b2e..2a1abda9995 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.kt.txt @@ -1,15 +1,19 @@ -interface Semigroup { - abstract infix fun T.combine(other: T): T - -} - interface Monoid : Semigroup { abstract val unit: T abstract get } +interface Semigroup { + abstract infix fun T.combine(other: T): T + +} + object IntMonoid : Monoid { + override val unit: Int + field = 0 + override get + private constructor() /* primary */ { super/*Any*/() /* () */ @@ -20,13 +24,13 @@ object IntMonoid : Monoid { return .plus(other = other) } - override val unit: Int - field = 0 - override get - } object StringMonoid : Monoid { + override val unit: String + field = "" + override get + private constructor() /* primary */ { super/*Any*/() /* () */ @@ -37,17 +41,6 @@ object StringMonoid : Monoid { return .plus(other = other) } - override val unit: String - field = "" - override get - -} - -fun List.sum($context_receiver_0: Monoid): T { - return .fold(initial = $context_receiver_0.(), operation = local fun (acc: @ParameterName(name = "acc") T, e: T): T { - return ($context_receiver_0, acc).combine(other = e) - } -) } fun box(): String { @@ -60,3 +53,11 @@ fun box(): String { } ) } + +fun List.sum($context_receiver_0: Monoid): T { + return .fold(initial = $context_receiver_0.(), operation = local fun (acc: @ParameterName(name = "acc") T, e: T): T { + return ($context_receiver_0, acc).combine(other = e) + } +) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.ir.txt index 7be99e70ad9..549364c7c2d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.ir.txt @@ -1,31 +1,7 @@ FILE fqName: fileName:/monoidSum.kt - CLASS INTERFACE name:Semigroup modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Semigroup.Semigroup> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:combine visibility:public modality:ABSTRACT <> ($this:.Semigroup.Semigroup>, $receiver:T of .Semigroup, other:T of .Semigroup) returnType:T of .Semigroup [infix] - $this: VALUE_PARAMETER name: type:.Semigroup.Semigroup> - $receiver: VALUE_PARAMETER name: type:T of .Semigroup - VALUE_PARAMETER name:other index:0 type:T of .Semigroup - 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: 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 CLASS INTERFACE name:Monoid modality:ABSTRACT visibility:public superTypes:[.Semigroup.Monoid>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Monoid.Monoid> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - PROPERTY name:unit visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Monoid.Monoid>) returnType:T of .Monoid - correspondingProperty: PROPERTY name:unit visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Monoid.Monoid> FUN FAKE_OVERRIDE name:combine visibility:public modality:ABSTRACT <> ($this:.Semigroup.Monoid>, $receiver:T of .Monoid, other:T of .Monoid) returnType:T of .Monoid [fake_override,infix] overridden: public abstract fun combine (other: T of .Semigroup): T of .Semigroup declared in .Semigroup @@ -45,23 +21,32 @@ FILE fqName: fileName:/monoidSum.kt overridden: public open fun toString (): kotlin.String declared in .Semigroup $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:unit visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Monoid.Monoid>) returnType:T of .Monoid + correspondingProperty: PROPERTY name:unit visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.Monoid.Monoid> + CLASS INTERFACE name:Semigroup modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Semigroup.Semigroup> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:combine visibility:public modality:ABSTRACT <> ($this:.Semigroup.Semigroup>, $receiver:T of .Semigroup, other:T of .Semigroup) returnType:T of .Semigroup [infix] + $this: VALUE_PARAMETER name: type:.Semigroup.Semigroup> + $receiver: VALUE_PARAMETER name: type:T of .Semigroup + VALUE_PARAMETER name:other index:0 type:T of .Semigroup CLASS OBJECT name:IntMonoid modality:FINAL visibility:public superTypes:[.Monoid] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IntMonoid - CONSTRUCTOR visibility:private <> () returnType:.IntMonoid [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:IntMonoid modality:FINAL visibility:public superTypes:[.Monoid]' - FUN name:combine visibility:public modality:OPEN <> ($this:.IntMonoid, $receiver:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix] - overridden: - public abstract fun combine (other: T of .Monoid): T of .Monoid declared in .Monoid - $this: VALUE_PARAMETER name: type:.IntMonoid - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:other index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun combine (other: kotlin.Int): kotlin.Int declared in .IntMonoid' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR ': kotlin.Int declared in .IntMonoid.combine' type=kotlin.Int origin=null - other: GET_VAR 'other: kotlin.Int declared in .IntMonoid.combine' type=kotlin.Int origin=null PROPERTY name:unit visibility:public modality:OPEN [val] overridden: public abstract unit: T of .Monoid @@ -77,6 +62,10 @@ FILE fqName: fileName:/monoidSum.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .IntMonoid' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:unit type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .IntMonoid declared in .IntMonoid.' type=.IntMonoid origin=null + CONSTRUCTOR visibility:private <> () returnType:.IntMonoid [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:IntMonoid modality:FINAL visibility:public superTypes:[.Monoid]' 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 .Monoid @@ -90,23 +79,19 @@ FILE fqName: fileName:/monoidSum.kt overridden: public open fun toString (): kotlin.String declared in .Monoid $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[.Monoid] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.StringMonoid - CONSTRUCTOR visibility:private <> () returnType:.StringMonoid [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[.Monoid]' - FUN name:combine visibility:public modality:OPEN <> ($this:.StringMonoid, $receiver:kotlin.String, other:kotlin.String) returnType:kotlin.String [infix] + FUN name:combine visibility:public modality:OPEN <> ($this:.IntMonoid, $receiver:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix] overridden: public abstract fun combine (other: T of .Monoid): T of .Monoid declared in .Monoid - $this: VALUE_PARAMETER name: type:.StringMonoid - $receiver: VALUE_PARAMETER name: type:kotlin.String - VALUE_PARAMETER name:other index:0 type:kotlin.String + $this: VALUE_PARAMETER name: type:.IntMonoid + $receiver: VALUE_PARAMETER name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun combine (other: kotlin.String): kotlin.String declared in .StringMonoid' - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS - $this: GET_VAR ': kotlin.String declared in .StringMonoid.combine' type=kotlin.String origin=null - other: GET_VAR 'other: kotlin.String declared in .StringMonoid.combine' type=kotlin.String origin=null + RETURN type=kotlin.Nothing from='public open fun combine (other: kotlin.Int): kotlin.Int declared in .IntMonoid' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: GET_VAR ': kotlin.Int declared in .IntMonoid.combine' type=kotlin.Int origin=null + other: GET_VAR 'other: kotlin.Int declared in .IntMonoid.combine' type=kotlin.Int origin=null + CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[.Monoid] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.StringMonoid PROPERTY name:unit visibility:public modality:OPEN [val] overridden: public abstract unit: T of .Monoid @@ -122,6 +107,10 @@ FILE fqName: fileName:/monoidSum.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .StringMonoid' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:unit type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .StringMonoid declared in .StringMonoid.' type=.StringMonoid origin=null + CONSTRUCTOR visibility:private <> () returnType:.StringMonoid [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[.Monoid]' 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 .Monoid @@ -135,29 +124,17 @@ FILE fqName: fileName:/monoidSum.kt overridden: public open fun toString (): kotlin.String declared in .Monoid $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:sum visibility:public modality:FINAL ($receiver:kotlin.collections.List.sum>, $context_receiver_0:.Monoid.sum>) returnType:T of .sum - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.sum> - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Monoid.sum> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun sum ($context_receiver_0: .Monoid.sum>): T of .sum declared in ' - CALL 'public final fun fold (initial: R of kotlin.collections.fold, operation: kotlin.Function2<@[ParameterName(name = "acc")] R of kotlin.collections.fold, T of kotlin.collections.fold, R of kotlin.collections.fold>): R of kotlin.collections.fold declared in kotlin.collections' type=T of .sum origin=null - : T of .sum - : T of .sum - $receiver: GET_VAR ': kotlin.collections.List.sum> declared in .sum' type=kotlin.collections.List.sum> origin=null - initial: CALL 'public abstract fun (): T of .Monoid declared in .Monoid' type=T of .sum origin=GET_PROPERTY - $this: GET_VAR '$context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null - operation: FUN_EXPR type=kotlin.Function2<@[ParameterName(name = "acc")] T of .sum, T of .sum, T of .sum> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (acc:T of .sum, e:T of .sum) returnType:T of .sum - VALUE_PARAMETER name:acc index:0 type:T of .sum - VALUE_PARAMETER name:e index:1 type:T of .sum - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (acc: T of .sum, e: T of .sum): T of .sum declared in .sum' - CALL 'public abstract fun combine (other: T of .Monoid): T of .Monoid declared in .Monoid' type=T of .sum origin=null - $this: GET_VAR '$context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null - $receiver: GET_VAR 'acc: T of .sum declared in .sum.' type=T of .sum origin=null - other: GET_VAR 'e: T of .sum declared in .sum.' type=T of .sum origin=null + FUN name:combine visibility:public modality:OPEN <> ($this:.StringMonoid, $receiver:kotlin.String, other:kotlin.String) returnType:kotlin.String [infix] + overridden: + public abstract fun combine (other: T of .Monoid): T of .Monoid declared in .Monoid + $this: VALUE_PARAMETER name: type:.StringMonoid + $receiver: VALUE_PARAMETER name: type:kotlin.String + VALUE_PARAMETER name:other index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun combine (other: kotlin.String): kotlin.String declared in .StringMonoid' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS + $this: GET_VAR ': kotlin.String declared in .StringMonoid.combine' type=kotlin.String origin=null + other: GET_VAR 'other: kotlin.String declared in .StringMonoid.combine' type=kotlin.String origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -197,3 +174,26 @@ FILE fqName: fileName:/monoidSum.kt CONST String type=kotlin.String value="O" CONST String type=kotlin.String value="K" $context_receiver_0: GET_VAR '$this$with: .StringMonoid declared in .box.' type=.StringMonoid origin=null + FUN name:sum visibility:public modality:FINAL ($receiver:kotlin.collections.List.sum>, $context_receiver_0:.Monoid.sum>) returnType:T of .sum + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.sum> + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Monoid.sum> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun sum ($context_receiver_0: .Monoid.sum>): T of .sum declared in ' + CALL 'public final fun fold (initial: R of kotlin.collections.fold, operation: kotlin.Function2<@[ParameterName(name = "acc")] R of kotlin.collections.fold, T of kotlin.collections.fold, R of kotlin.collections.fold>): R of kotlin.collections.fold declared in kotlin.collections' type=T of .sum origin=null + : T of .sum + : T of .sum + $receiver: GET_VAR ': kotlin.collections.List.sum> declared in .sum' type=kotlin.collections.List.sum> origin=null + initial: CALL 'public abstract fun (): T of .Monoid declared in .Monoid' type=T of .sum origin=GET_PROPERTY + $this: GET_VAR '$context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null + operation: FUN_EXPR type=kotlin.Function2<@[ParameterName(name = "acc")] T of .sum, T of .sum, T of .sum> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (acc:T of .sum, e:T of .sum) returnType:T of .sum + VALUE_PARAMETER name:acc index:0 type:T of .sum + VALUE_PARAMETER name:e index:1 type:T of .sum + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (acc: T of .sum, e: T of .sum): T of .sum declared in .sum' + CALL 'public abstract fun combine (other: T of .Monoid): T of .Monoid declared in .Monoid' type=T of .sum origin=null + $this: GET_VAR '$context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null + $receiver: GET_VAR 'acc: T of .sum declared in .sum.' type=T of .sum origin=null + other: GET_VAR 'e: T of .sum declared in .sum.' type=T of .sum origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt.txt index 57680375178..d916c4550e2 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt.txt @@ -1,15 +1,19 @@ -interface Semigroup { - abstract infix fun T.combine(other: T): T - -} - interface Monoid : Semigroup { abstract val unit: T abstract get } +interface Semigroup { + abstract infix fun T.combine(other: T): T + +} + object IntMonoid : Monoid { + override val unit: Int + field = 0 + override get + private constructor() /* primary */ { super/*Any*/() /* () */ @@ -20,13 +24,13 @@ object IntMonoid : Monoid { return .plus(other = other) } - override val unit: Int - field = 0 - override get - } object StringMonoid : Monoid { + override val unit: String + field = "" + override get + private constructor() /* primary */ { super/*Any*/() /* () */ @@ -37,17 +41,6 @@ object StringMonoid : Monoid { return .plus(other = other) } - override val unit: String - field = "" - override get - -} - -fun List.sum($context_receiver_0: Monoid): T { - return .fold(initial = $context_receiver_0.(), operation = local fun (acc: T, e: T): T { - return ($context_receiver_0, acc).combine(other = e) - } -) } fun box(): String { @@ -60,3 +53,11 @@ fun box(): String { } ) } + +fun List.sum($context_receiver_0: Monoid): T { + return .fold(initial = $context_receiver_0.(), operation = local fun (acc: T, e: T): T { + return ($context_receiver_0, acc).combine(other = e) + } +) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/function.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/function.ir.txt index e9bd075837f..c47fb824a76 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/function.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/function.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/function.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:c visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -16,6 +12,10 @@ FILE fqName: fileName:/function.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -29,13 +29,6 @@ FILE fqName: fileName:/function.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:foo visibility:public modality:FINAL <> ($context_receiver_0:.C) returnType:kotlin.Unit - contextReceiverParametersCount: 1 - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '$context_receiver_0: .C declared in .foo' type=.C origin=null FUN name:bar visibility:public modality:FINAL <> (c:.C) returnType:kotlin.Unit VALUE_PARAMETER name:c index:0 type:.C BLOCK_BODY @@ -49,3 +42,10 @@ FILE fqName: fileName:/function.kt BLOCK_BODY CALL 'public final fun foo ($context_receiver_0: .C): kotlin.Unit declared in ' type=kotlin.Unit origin=null $context_receiver_0: GET_VAR '$this$with: .C declared in .bar.' type=.C origin=null + FUN name:foo visibility:public modality:FINAL <> ($context_receiver_0:.C) returnType:kotlin.Unit + contextReceiverParametersCount: 1 + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR '$context_receiver_0: .C declared in .foo' type=.C origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/function.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/function.kt.txt index 66c81a67956..f349721a12f 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/function.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/function.kt.txt @@ -1,18 +1,14 @@ class C { + val c: Int + field = 42 + get + constructor() /* primary */ { super/*Any*/() /* () */ } - val c: Int - field = 42 - get - -} - -fun foo($context_receiver_0: C) { - $context_receiver_0.() /*~> Unit */ } fun bar(c: C) { @@ -21,3 +17,8 @@ fun bar(c: C) { } ) } + +fun foo($context_receiver_0: C) { + $context_receiver_0.() /*~> Unit */ +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.ir.txt index dfa456dddf8..98d89d0c762 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.ir.txt @@ -1,4 +1,34 @@ FILE fqName: fileName:/functionalType.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + PROPERTY name:c visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 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 CLASS CLASS name:Param modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Param CONSTRUCTOR visibility:public <> () returnType:.Param [primary] @@ -18,42 +48,8 @@ FILE fqName: fileName:/functionalType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:c visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=42 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.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 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 CLASS CLASS name:R modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.R - CONSTRUCTOR visibility:public <> () returnType:.R [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:R modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:r visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:r type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -65,6 +61,10 @@ FILE fqName: fileName:/functionalType.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .R' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:r type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .R declared in .R.' type=.R origin=null + CONSTRUCTOR visibility:public <> () returnType:.R [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:R modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.kt.txt index c53c37b1ff5..a832ae1e0d1 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.kt.txt @@ -1,3 +1,16 @@ +class C { + val c: Int + field = 42 + get + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + class Param { constructor() /* primary */ { super/*Any*/() @@ -7,30 +20,17 @@ class Param { } -class C { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - val c: Int - field = 42 - get - -} - class R { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val r: Int field = 42 get + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } fun R.f1($context_receiver_0: C, g: @ExtensionFunctionType Function3) { @@ -97,3 +97,4 @@ fun test() { } ) } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.ir.txt index 23e49e20ba0..cc3308d202b 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.ir.txt @@ -1,4 +1,34 @@ FILE fqName: fileName:/functionalType.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + PROPERTY name:c visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 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 CLASS CLASS name:Param modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Param CONSTRUCTOR visibility:public <> () returnType:.Param [primary] @@ -18,42 +48,8 @@ FILE fqName: fileName:/functionalType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:c visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=42 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.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 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 CLASS CLASS name:R modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.R - CONSTRUCTOR visibility:public <> () returnType:.R [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:R modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:r visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:r type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -65,6 +61,10 @@ FILE fqName: fileName:/functionalType.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .R' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:r type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .R declared in .R.' type=.R origin=null + CONSTRUCTOR visibility:public <> () returnType:.R [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:R modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt.txt index 5aaa71b2b47..9af6ed5e1ad 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt.txt @@ -1,3 +1,16 @@ +class C { + val c: Int + field = 42 + get + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + class Param { constructor() /* primary */ { super/*Any*/() @@ -7,30 +20,17 @@ class Param { } -class C { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - val c: Int - field = 42 - get - -} - class R { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val r: Int field = 42 get + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } fun R.f1($context_receiver_0: C, g: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function3) { @@ -97,3 +97,4 @@ fun test() { } ) } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.ir.txt index c24276f2761..8c1f447d692 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.ir.txt @@ -49,13 +49,6 @@ FILE fqName: fileName:/genericOuterClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:foo visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: T of .A) declared in .A' type=.A origin=null - : kotlin.Int - $context_receiver_0: GET_VAR ': kotlin.Int declared in .foo' type=kotlin.Int origin=null FUN name:bar visibility:public modality:FINAL <> ($receiver:kotlin.collections.Collection) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:kotlin.collections.Collection BLOCK_BODY @@ -63,3 +56,10 @@ FILE fqName: fileName:/genericOuterClass.kt CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: kotlin.collections.Collection

.B>) declared in .B' type=.B origin=null : kotlin.Int $context_receiver_0: GET_VAR ': kotlin.collections.Collection declared in .bar' type=kotlin.collections.Collection origin=null + FUN name:foo visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:kotlin.Int + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: T of .A) declared in .A' type=.A origin=null + : kotlin.Int + $context_receiver_0: GET_VAR ': kotlin.Int declared in .foo' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt.txt index a4f98c15880..63a30b65f34 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt.txt @@ -20,10 +20,11 @@ class B

{ } +fun Collection.bar() { + B($context_receiver_0 = ) /*~> Unit */ +} + fun Int.foo() { A($context_receiver_0 = ) /*~> Unit */ } -fun Collection.bar() { - B($context_receiver_0 = ) /*~> Unit */ -} diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt index b3861dfa5ac..dd1770b16db 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt @@ -1,13 +1,6 @@ FILE fqName: fileName:/iteratorOperator.kt CLASS CLASS name:Counter modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Counter - CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.Counter [primary] - VALUE_PARAMETER name:i index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Counter modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:i visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private EXPRESSION_BODY @@ -27,6 +20,13 @@ FILE fqName: fileName:/iteratorOperator.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Counter declared in .Counter.' type=.Counter origin=null value: GET_VAR ': kotlin.Int declared in .Counter.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.Counter [primary] + VALUE_PARAMETER name:i index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Counter modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Counter) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.Counter BLOCK_BODY @@ -43,27 +43,6 @@ FILE fqName: fileName:/iteratorOperator.kt RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): .Counter declared in .Counter' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Counter' type=.Counter origin=null i: GET_VAR 'i: kotlin.Int declared in .Counter.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Counter) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Counter - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Counter' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Counter(" - CONST String type=kotlin.String value="i=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .Counter declared in .Counter.toString' type=.Counter origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Counter) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Counter - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Counter' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .Counter declared in .Counter.hashCode' type=.Counter origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Counter, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -98,15 +77,29 @@ FILE fqName: fileName:/iteratorOperator.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Counter' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Counter) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Counter + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Counter' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .Counter declared in .Counter.hashCode' type=.Counter origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Counter) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Counter + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Counter' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Counter(" + CONST String type=kotlin.String value="i=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .Counter declared in .Counter.toString' type=.Counter origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:CounterConfig modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CounterConfig - CONSTRUCTOR visibility:public <> (max:kotlin.Int) returnType:.CounterConfig [primary] - VALUE_PARAMETER name:max index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=10 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterConfig modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:max visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -118,6 +111,13 @@ FILE fqName: fileName:/iteratorOperator.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .CounterConfig' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .CounterConfig declared in .CounterConfig.' type=.CounterConfig origin=null + CONSTRUCTOR visibility:public <> (max:kotlin.Int) returnType:.CounterConfig [primary] + VALUE_PARAMETER name:max index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=10 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterConfig modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.CounterConfig) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.CounterConfig BLOCK_BODY @@ -134,27 +134,6 @@ FILE fqName: fileName:/iteratorOperator.kt RETURN type=kotlin.Nothing from='public final fun copy (max: kotlin.Int): .CounterConfig declared in .CounterConfig' CONSTRUCTOR_CALL 'public constructor (max: kotlin.Int) declared in .CounterConfig' type=.CounterConfig origin=null max: GET_VAR 'max: kotlin.Int declared in .CounterConfig.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.CounterConfig) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.CounterConfig - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .CounterConfig' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="CounterConfig(" - CONST String type=kotlin.String value="max=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .CounterConfig declared in .CounterConfig.toString' type=.CounterConfig origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.CounterConfig) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.CounterConfig - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .CounterConfig' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .CounterConfig declared in .CounterConfig.hashCode' type=.CounterConfig origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.CounterConfig, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -189,18 +168,30 @@ FILE fqName: fileName:/iteratorOperator.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .CounterConfig' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.CounterConfig) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.CounterConfig + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .CounterConfig' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .CounterConfig declared in .CounterConfig.hashCode' type=.CounterConfig origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.CounterConfig) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.CounterConfig + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .CounterConfig' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="CounterConfig(" + CONST String type=kotlin.String value="max=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .CounterConfig declared in .CounterConfig.toString' type=.CounterConfig origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CounterIterator FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.CounterConfig visibility:private [final] - CONSTRUCTOR visibility:public <> ($context_receiver_0:.CounterConfig, counter:.Counter) returnType:.CounterIterator [primary] - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.CounterConfig - VALUE_PARAMETER name:counter index:1 type:.Counter - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.CounterConfig visibility:private [final]' type=kotlin.Unit origin=null - receiver: GET_VAR ': .CounterIterator declared in .CounterIterator' type=.CounterIterator origin=null - value: GET_VAR '$context_receiver_0: .CounterConfig declared in .CounterIterator.' type=.CounterConfig origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator]' PROPERTY name:counter visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:counter type:.Counter visibility:private [final] EXPRESSION_BODY @@ -212,6 +203,28 @@ FILE fqName: fileName:/iteratorOperator.kt RETURN type=kotlin.Nothing from='private final fun (): .Counter declared in .CounterIterator' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:.Counter visibility:private [final]' type=.Counter origin=null receiver: GET_VAR ': .CounterIterator declared in .CounterIterator.' type=.CounterIterator origin=null + CONSTRUCTOR visibility:public <> ($context_receiver_0:.CounterConfig, counter:.Counter) returnType:.CounterIterator [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.CounterConfig + VALUE_PARAMETER name:counter index:1 type:.Counter + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.CounterConfig visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .CounterIterator declared in .CounterIterator' type=.CounterIterator origin=null + value: GET_VAR '$context_receiver_0: .CounterConfig declared in .CounterIterator.' type=.CounterConfig origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator]' + 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.collections.Iterator + $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.collections.Iterator + $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.collections.Iterator + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:hasNext visibility:public modality:OPEN <> ($this:.CounterIterator) returnType:kotlin.Boolean [operator] overridden: public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator @@ -243,37 +256,6 @@ FILE fqName: fileName:/iteratorOperator.kt : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR $this: GET_VAR 'val tmp_3: kotlin.Int declared in .CounterIterator.next' type=kotlin.Int origin=null GET_VAR 'val tmp_3: kotlin.Int declared in .CounterIterator.next' type=kotlin.Int 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.collections.Iterator - $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.collections.Iterator - $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.collections.Iterator - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:iterator visibility:public modality:FINAL <> ($receiver:.Counter, $context_receiver_0:.CounterConfig) returnType:.CounterIterator [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Counter - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.CounterConfig - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun iterator ($context_receiver_0: .CounterConfig): .CounterIterator declared in ' - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=.CounterIterator origin=null - : .CounterConfig - : .CounterIterator - receiver: GET_VAR '$context_receiver_0: .CounterConfig declared in .iterator' type=.CounterConfig origin=null - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<.CounterConfig, .CounterIterator> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.CounterConfig) returnType:.CounterIterator - $receiver: VALUE_PARAMETER name:$this$with type:.CounterConfig - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): .CounterIterator declared in .iterator' - CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: .CounterConfig, counter: .Counter) declared in .CounterIterator' type=.CounterIterator origin=null - $context_receiver_0: GET_VAR '$this$with: .CounterConfig declared in .iterator.' type=.CounterConfig origin=null - counter: GET_VAR ': .Counter declared in .iterator' type=.Counter origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:result type:kotlin.Int [var] @@ -313,3 +295,21 @@ FILE fqName: fileName:/iteratorOperator.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="fail" + FUN name:iterator visibility:public modality:FINAL <> ($receiver:.Counter, $context_receiver_0:.CounterConfig) returnType:.CounterIterator [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Counter + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.CounterConfig + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun iterator ($context_receiver_0: .CounterConfig): .CounterIterator declared in ' + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=.CounterIterator origin=null + : .CounterConfig + : .CounterIterator + receiver: GET_VAR '$context_receiver_0: .CounterConfig declared in .iterator' type=.CounterConfig origin=null + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<.CounterConfig, .CounterIterator> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.CounterConfig) returnType:.CounterIterator + $receiver: VALUE_PARAMETER name:$this$with type:.CounterConfig + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): .CounterIterator declared in .iterator' + CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: .CounterConfig, counter: .Counter) declared in .CounterIterator' type=.CounterIterator origin=null + $context_receiver_0: GET_VAR '$this$with: .CounterConfig declared in .iterator.' type=.CounterConfig origin=null + counter: GET_VAR ': .Counter declared in .iterator' type=.Counter origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt index 0737f936ef3..80b244e6edf 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt @@ -1,15 +1,15 @@ data class Counter { + var i: Int + field = i + get + set + constructor(i: Int = 0) /* primary */ { super/*Any*/() /* () */ } - var i: Int - field = i - get - set - operator fun component1(): Int { return .#i } @@ -18,14 +18,6 @@ data class Counter { return Counter(i = i) } - override fun toString(): String { - return "Counter(" + "i=" + .#i + ")" - } - - override fun hashCode(): Int { - return .#i.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -40,19 +32,27 @@ data class Counter { return true } + override fun hashCode(): Int { + return .#i.hashCode() + } + + override fun toString(): String { + return "Counter(" + "i=" + .#i + ")" + } + } data class CounterConfig { + val max: Int + field = max + get + constructor(max: Int = 10) /* primary */ { super/*Any*/() /* () */ } - val max: Int - field = max - get - operator fun component1(): Int { return .#max } @@ -61,14 +61,6 @@ data class CounterConfig { return CounterConfig(max = max) } - override fun toString(): String { - return "CounterConfig(" + "max=" + .#max + ")" - } - - override fun hashCode(): Int { - return .#max.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -83,10 +75,22 @@ data class CounterConfig { return true } + override fun hashCode(): Int { + return .#max.hashCode() + } + + override fun toString(): String { + return "CounterConfig(" + "max=" + .#max + ")" + } + } class CounterIterator : Iterator { private /* final field */ val contextReceiverField0: CounterConfig + private val counter: Counter + field = counter + private get + constructor($context_receiver_0: CounterConfig, counter: Counter) /* primary */ { super/*Any*/() .#contextReceiverField0 = $context_receiver_0 @@ -94,10 +98,6 @@ class CounterIterator : Iterator { } - private val counter: Counter - field = counter - private get - override operator fun hasNext(): Boolean { return less(arg0 = .().(), arg1 = .#contextReceiverField0.()) } @@ -113,13 +113,6 @@ class CounterIterator : Iterator { } -operator fun Counter.iterator($context_receiver_0: CounterConfig): CounterIterator { - return with(receiver = $context_receiver_0, block = local fun CounterConfig.(): CounterIterator { - return CounterIterator($context_receiver_0 = $this$with, counter = ) - } -) -} - fun box(): String { var result: Int = 0 with(receiver = CounterConfig(), block = local fun CounterConfig.() { @@ -140,3 +133,10 @@ fun box(): String { } } +operator fun Counter.iterator($context_receiver_0: CounterConfig): CounterIterator { + return with(receiver = $context_receiver_0, block = local fun CounterConfig.(): CounterIterator { + return CounterIterator($context_receiver_0 = $this$with, counter = ) + } +) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.ir.txt index 8c50d52c391..971d38900ec 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.ir.txt @@ -1,13 +1,6 @@ FILE fqName: fileName:/iteratorOperator.kt CLASS CLASS name:Counter modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Counter - CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.Counter [primary] - VALUE_PARAMETER name:i index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Counter modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:i visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private EXPRESSION_BODY @@ -27,6 +20,13 @@ FILE fqName: fileName:/iteratorOperator.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Counter declared in .Counter.' type=.Counter origin=null value: GET_VAR ': kotlin.Int declared in .Counter.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.Counter [primary] + VALUE_PARAMETER name:i index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Counter modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Counter) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.Counter BLOCK_BODY @@ -43,27 +43,6 @@ FILE fqName: fileName:/iteratorOperator.kt RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): .Counter declared in .Counter' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Counter' type=.Counter origin=null i: GET_VAR 'i: kotlin.Int declared in .Counter.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Counter) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Counter - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Counter' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Counter(" - CONST String type=kotlin.String value="i=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .Counter declared in .Counter.toString' type=.Counter origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Counter) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Counter - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Counter' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .Counter declared in .Counter.hashCode' type=.Counter origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Counter, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -98,15 +77,29 @@ FILE fqName: fileName:/iteratorOperator.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Counter' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Counter) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Counter + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Counter' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .Counter declared in .Counter.hashCode' type=.Counter origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Counter) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Counter + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Counter' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Counter(" + CONST String type=kotlin.String value="i=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .Counter declared in .Counter.toString' type=.Counter origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:CounterConfig modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CounterConfig - CONSTRUCTOR visibility:public <> (max:kotlin.Int) returnType:.CounterConfig [primary] - VALUE_PARAMETER name:max index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=10 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterConfig modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:max visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -118,6 +111,13 @@ FILE fqName: fileName:/iteratorOperator.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .CounterConfig' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .CounterConfig declared in .CounterConfig.' type=.CounterConfig origin=null + CONSTRUCTOR visibility:public <> (max:kotlin.Int) returnType:.CounterConfig [primary] + VALUE_PARAMETER name:max index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=10 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterConfig modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.CounterConfig) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.CounterConfig BLOCK_BODY @@ -134,27 +134,6 @@ FILE fqName: fileName:/iteratorOperator.kt RETURN type=kotlin.Nothing from='public final fun copy (max: kotlin.Int): .CounterConfig declared in .CounterConfig' CONSTRUCTOR_CALL 'public constructor (max: kotlin.Int) declared in .CounterConfig' type=.CounterConfig origin=null max: GET_VAR 'max: kotlin.Int declared in .CounterConfig.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.CounterConfig) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.CounterConfig - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .CounterConfig' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="CounterConfig(" - CONST String type=kotlin.String value="max=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .CounterConfig declared in .CounterConfig.toString' type=.CounterConfig origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.CounterConfig) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.CounterConfig - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .CounterConfig' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .CounterConfig declared in .CounterConfig.hashCode' type=.CounterConfig origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.CounterConfig, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -189,18 +168,30 @@ FILE fqName: fileName:/iteratorOperator.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .CounterConfig' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.CounterConfig) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.CounterConfig + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .CounterConfig' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .CounterConfig declared in .CounterConfig.hashCode' type=.CounterConfig origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.CounterConfig) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.CounterConfig + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .CounterConfig' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="CounterConfig(" + CONST String type=kotlin.String value="max=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .CounterConfig declared in .CounterConfig.toString' type=.CounterConfig origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CounterIterator FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.CounterConfig visibility:private [final] - CONSTRUCTOR visibility:public <> ($context_receiver_0:.CounterConfig, counter:.Counter) returnType:.CounterIterator [primary] - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.CounterConfig - VALUE_PARAMETER name:counter index:1 type:.Counter - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.CounterConfig visibility:private [final]' type=kotlin.Unit origin=null - receiver: GET_VAR ': .CounterIterator declared in .CounterIterator' type=.CounterIterator origin=null - value: GET_VAR '$context_receiver_0: .CounterConfig declared in .CounterIterator.' type=.CounterConfig origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator]' PROPERTY name:counter visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:counter type:.Counter visibility:private [final] EXPRESSION_BODY @@ -212,6 +203,28 @@ FILE fqName: fileName:/iteratorOperator.kt RETURN type=kotlin.Nothing from='private final fun (): .Counter declared in .CounterIterator' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:.Counter visibility:private [final]' type=.Counter origin=null receiver: GET_VAR ': .CounterIterator declared in .CounterIterator.' type=.CounterIterator origin=null + CONSTRUCTOR visibility:public <> ($context_receiver_0:.CounterConfig, counter:.Counter) returnType:.CounterIterator [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.CounterConfig + VALUE_PARAMETER name:counter index:1 type:.Counter + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.CounterConfig visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .CounterIterator declared in .CounterIterator' type=.CounterIterator origin=null + value: GET_VAR '$context_receiver_0: .CounterConfig declared in .CounterIterator.' type=.CounterConfig origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator]' + 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.collections.Iterator + $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.collections.Iterator + $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.collections.Iterator + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:hasNext visibility:public modality:OPEN <> ($this:.CounterIterator) returnType:kotlin.Boolean [operator] overridden: public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator @@ -244,37 +257,6 @@ FILE fqName: fileName:/iteratorOperator.kt : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR $this: GET_VAR 'val tmp_3: kotlin.Int declared in .CounterIterator.next' type=kotlin.Int origin=null GET_VAR 'val tmp_3: kotlin.Int declared in .CounterIterator.next' type=kotlin.Int 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.collections.Iterator - $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.collections.Iterator - $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.collections.Iterator - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:iterator visibility:public modality:FINAL <> ($receiver:.Counter, $context_receiver_0:.CounterConfig) returnType:.CounterIterator [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Counter - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.CounterConfig - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun iterator ($context_receiver_0: .CounterConfig): .CounterIterator declared in ' - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=.CounterIterator origin=null - : .CounterConfig - : .CounterIterator - receiver: GET_VAR '$context_receiver_0: .CounterConfig declared in .iterator' type=.CounterConfig origin=null - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<.CounterConfig, .CounterIterator> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.CounterConfig) returnType:.CounterIterator - $receiver: VALUE_PARAMETER name:$this$with type:.CounterConfig - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): .CounterIterator declared in .iterator' - CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: .CounterConfig, counter: .Counter) declared in .CounterIterator' type=.CounterIterator origin=null - $context_receiver_0: GET_VAR '$this$with: .CounterConfig declared in .iterator.' type=.CounterConfig origin=null - counter: GET_VAR ': .Counter declared in .iterator' type=.Counter origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:result type:kotlin.Int [var] @@ -314,3 +296,21 @@ FILE fqName: fileName:/iteratorOperator.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="fail" + FUN name:iterator visibility:public modality:FINAL <> ($receiver:.Counter, $context_receiver_0:.CounterConfig) returnType:.CounterIterator [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Counter + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.CounterConfig + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun iterator ($context_receiver_0: .CounterConfig): .CounterIterator declared in ' + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=.CounterIterator origin=null + : .CounterConfig + : .CounterIterator + receiver: GET_VAR '$context_receiver_0: .CounterConfig declared in .iterator' type=.CounterConfig origin=null + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<.CounterConfig, .CounterIterator> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.CounterConfig) returnType:.CounterIterator + $receiver: VALUE_PARAMETER name:$this$with type:.CounterConfig + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): .CounterIterator declared in .iterator' + CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: .CounterConfig, counter: .Counter) declared in .CounterIterator' type=.CounterIterator origin=null + $context_receiver_0: GET_VAR '$this$with: .CounterConfig declared in .iterator.' type=.CounterConfig origin=null + counter: GET_VAR ': .Counter declared in .iterator' type=.Counter origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt.txt index a9551f60e52..58df8f53f9e 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt.txt @@ -1,15 +1,15 @@ data class Counter { + var i: Int + field = i + get + set + constructor(i: Int = 0) /* primary */ { super/*Any*/() /* () */ } - var i: Int - field = i - get - set - operator fun component1(): Int { return .#i } @@ -18,14 +18,6 @@ data class Counter { return Counter(i = i) } - override fun toString(): String { - return "Counter(" + "i=" + .#i + ")" - } - - override fun hashCode(): Int { - return .#i.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -40,19 +32,27 @@ data class Counter { return true } + override fun hashCode(): Int { + return .#i.hashCode() + } + + override fun toString(): String { + return "Counter(" + "i=" + .#i + ")" + } + } data class CounterConfig { + val max: Int + field = max + get + constructor(max: Int = 10) /* primary */ { super/*Any*/() /* () */ } - val max: Int - field = max - get - operator fun component1(): Int { return .#max } @@ -61,14 +61,6 @@ data class CounterConfig { return CounterConfig(max = max) } - override fun toString(): String { - return "CounterConfig(" + "max=" + .#max + ")" - } - - override fun hashCode(): Int { - return .#max.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -83,10 +75,22 @@ data class CounterConfig { return true } + override fun hashCode(): Int { + return .#max.hashCode() + } + + override fun toString(): String { + return "CounterConfig(" + "max=" + .#max + ")" + } + } class CounterIterator : Iterator { private /* final field */ val contextReceiverField0: CounterConfig + private val counter: Counter + field = counter + private get + constructor($context_receiver_0: CounterConfig, counter: Counter) /* primary */ { super/*Any*/() .#contextReceiverField0 = $context_receiver_0 @@ -94,10 +98,6 @@ class CounterIterator : Iterator { } - private val counter: Counter - field = counter - private get - override operator fun hasNext(): Boolean { return less(arg0 = .().(), arg1 = .#contextReceiverField0.()) } @@ -115,13 +115,6 @@ class CounterIterator : Iterator { } -operator fun Counter.iterator($context_receiver_0: CounterConfig): CounterIterator { - return with(receiver = $context_receiver_0, block = local fun CounterConfig.(): CounterIterator { - return CounterIterator($context_receiver_0 = $this$with, counter = ) - } -) -} - fun box(): String { var result: Int = 0 with(receiver = CounterConfig(), block = local fun CounterConfig.() { @@ -141,3 +134,11 @@ fun box(): String { else -> "fail" } } + +operator fun Counter.iterator($context_receiver_0: CounterConfig): CounterIterator { + return with(receiver = $context_receiver_0, block = local fun CounterConfig.(): CounterIterator { + return CounterIterator($context_receiver_0 = $this$with, counter = ) + } +) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.ir.txt index ec81619d320..31ae15fb3d9 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.ir.txt @@ -15,23 +15,6 @@ FILE fqName: fileName:/lazy.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test1 visibility:public modality:FINAL <> ($context_receiver_0:.Lazy, $context_receiver_1:.Lazy) returnType:kotlin.Unit - contextReceiverParametersCount: 2 - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Lazy - VALUE_PARAMETER name:$context_receiver_1 index:1 type:.Lazy - BLOCK_BODY - FUN name:test2 visibility:public modality:FINAL ($receiver:.Lazy, $context_receiver_0:.Lazy.test2>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Lazy - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Lazy.test2> - BLOCK_BODY - FUN name:test3 visibility:public modality:FINAL ($receiver:.Lazy, $context_receiver_0:.Lazy<.Lazy.test3>>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Lazy - VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Lazy<.Lazy.test3>> - BLOCK_BODY FUN name:f visibility:public modality:FINAL (lazy1:.Lazy, lazy2:.Lazy, lazyT:.Lazy.f>, lazyLazyT:.Lazy<.Lazy.f>>) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:lazy1 index:0 type:.Lazy @@ -153,3 +136,20 @@ FILE fqName: fileName:/lazy.kt : T of .f $receiver: GET_VAR '$this$with: .Lazy declared in .f.' type=.Lazy origin=null $context_receiver_0: GET_VAR '$this$with: .Lazy<.Lazy.f>> declared in .f..' type=.Lazy<.Lazy.f>> origin=null + FUN name:test1 visibility:public modality:FINAL <> ($context_receiver_0:.Lazy, $context_receiver_1:.Lazy) returnType:kotlin.Unit + contextReceiverParametersCount: 2 + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Lazy + VALUE_PARAMETER name:$context_receiver_1 index:1 type:.Lazy + BLOCK_BODY + FUN name:test2 visibility:public modality:FINAL ($receiver:.Lazy, $context_receiver_0:.Lazy.test2>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Lazy + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Lazy.test2> + BLOCK_BODY + FUN name:test3 visibility:public modality:FINAL ($receiver:.Lazy, $context_receiver_0:.Lazy<.Lazy.test3>>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Lazy + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Lazy<.Lazy.test3>> + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt.txt index ec4ecfed2cb..cbf2645268b 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt.txt @@ -1,15 +1,6 @@ interface Lazy { } -fun test1($context_receiver_0: Lazy, $context_receiver_1: Lazy) { -} - -fun Lazy.test2($context_receiver_0: Lazy) { -} - -fun Lazy.test3($context_receiver_0: Lazy>) { -} - fun f(lazy1: Lazy, lazy2: Lazy, lazyT: Lazy, lazyLazyT: Lazy>) { with, Unit>(receiver = lazy1, block = local fun Lazy.() { with, Unit>(receiver = lazy2, block = local fun Lazy.() { @@ -51,3 +42,13 @@ fun f(lazy1: Lazy, lazy2: Lazy, lazyT: Lazy, la } ) } + +fun test1($context_receiver_0: Lazy, $context_receiver_1: Lazy) { +} + +fun Lazy.test2($context_receiver_0: Lazy) { +} + +fun Lazy.test3($context_receiver_0: Lazy>) { +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.ir.txt index c7828878889..1656d823f00 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.ir.txt @@ -1,4 +1,12 @@ FILE fqName: fileName:/overloading.kt + FUN name:foo visibility:public modality:FINAL <> ($context_receiver_0:kotlin.Int) returnType:kotlin.Int + contextReceiverParametersCount: 1 + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo ($context_receiver_0: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: GET_VAR '$context_receiver_0: kotlin.Int declared in .foo' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=42 FUN name:foo visibility:public modality:FINAL <> ($context_receiver_0:kotlin.Int, $context_receiver_1:kotlin.String) returnType:kotlin.Int contextReceiverParametersCount: 2 VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int @@ -8,14 +16,6 @@ FILE fqName: fileName:/overloading.kt CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS $this: GET_VAR '$context_receiver_0: kotlin.Int declared in .foo' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=42 - FUN name:foo visibility:public modality:FINAL <> ($context_receiver_0:kotlin.Int) returnType:kotlin.Int - contextReceiverParametersCount: 1 - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo ($context_receiver_0: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR '$context_receiver_0: kotlin.Int declared in .foo' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=42 FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt.txt index d3eac2fd004..651a88bfaf8 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt.txt @@ -1,8 +1,8 @@ -fun foo($context_receiver_0: Int, $context_receiver_1: String): Int { +fun foo($context_receiver_0: Int): Int { return $context_receiver_0.plus(other = 42) } -fun foo($context_receiver_0: Int): Int { +fun foo($context_receiver_0: Int, $context_receiver_1: String): Int { return $context_receiver_0.plus(other = 42) } @@ -12,3 +12,4 @@ fun test() { } ) /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.ir.txt index 97ee739e889..a7b957dc0b2 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/passingLambdaToContextualParam.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:result visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -16,6 +12,10 @@ FILE fqName: fileName:/passingLambdaToContextualParam.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -29,13 +29,6 @@ FILE fqName: fileName:/passingLambdaToContextualParam.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:contextual visibility:public modality:FINAL <> (f:kotlin.Function1<.C, kotlin.String>) returnType:kotlin.String - VALUE_PARAMETER name:f index:0 type:kotlin.Function1<.C, kotlin.String> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun contextual (f: kotlin.Function1<.C, kotlin.String>): kotlin.String declared in ' - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE - $this: GET_VAR 'f: kotlin.Function1<.C, kotlin.String> declared in .contextual' type=kotlin.Function1<.C, kotlin.String> origin=VARIABLE_AS_FUNCTION - p1: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C 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 ' @@ -48,3 +41,10 @@ FILE fqName: fileName:/passingLambdaToContextualParam.kt RETURN type=kotlin.Nothing from='local final fun ($context_receiver_0: .C): kotlin.String declared in .box' CALL 'public final fun (): kotlin.String declared in .C' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR '$context_receiver_0: .C declared in .box.' type=.C origin=null + FUN name:contextual visibility:public modality:FINAL <> (f:kotlin.Function1<.C, kotlin.String>) returnType:kotlin.String + VALUE_PARAMETER name:f index:0 type:kotlin.Function1<.C, kotlin.String> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun contextual (f: kotlin.Function1<.C, kotlin.String>): kotlin.String declared in ' + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE + $this: GET_VAR 'f: kotlin.Function1<.C, kotlin.String> declared in .contextual' type=kotlin.Function1<.C, kotlin.String> origin=VARIABLE_AS_FUNCTION + p1: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.kt.txt index 45157a445da..1d562d3f38c 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.kt.txt @@ -1,18 +1,14 @@ class C { + val result: String + field = "OK" + get + constructor() /* primary */ { super/*Any*/() /* () */ } - val result: String - field = "OK" - get - -} - -fun contextual(f: Function1): String { - return f.invoke(p1 = C()) } fun box(): String { @@ -21,3 +17,8 @@ fun box(): String { } ) } + +fun contextual(f: Function1): String { + return f.invoke(p1 = C()) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.ir.txt index 27f6f316010..d3a60394565 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/passingLambdaToContextualParam.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:result visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -16,6 +12,10 @@ FILE fqName: fileName:/passingLambdaToContextualParam.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -29,13 +29,6 @@ FILE fqName: fileName:/passingLambdaToContextualParam.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:contextual visibility:public modality:FINAL <> (f:@[ContextFunctionTypeParams(count = 1)] kotlin.Function1<.C, kotlin.String>) returnType:kotlin.String - VALUE_PARAMETER name:f index:0 type:@[ContextFunctionTypeParams(count = 1)] kotlin.Function1<.C, kotlin.String> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun contextual (f: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1<.C, kotlin.String>): kotlin.String declared in ' - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE - $this: GET_VAR 'f: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1<.C, kotlin.String> declared in .contextual' type=@[ContextFunctionTypeParams(count = 1)] kotlin.Function1<.C, kotlin.String> origin=VARIABLE_AS_FUNCTION - p1: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C 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 ' @@ -48,3 +41,10 @@ FILE fqName: fileName:/passingLambdaToContextualParam.kt RETURN type=kotlin.Nothing from='local final fun ($context_receiver_0: .C): kotlin.String declared in .box' CALL 'public final fun (): kotlin.String declared in .C' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR '$context_receiver_0: .C declared in .box.' type=.C origin=null + FUN name:contextual visibility:public modality:FINAL <> (f:@[ContextFunctionTypeParams(count = 1)] kotlin.Function1<.C, kotlin.String>) returnType:kotlin.String + VALUE_PARAMETER name:f index:0 type:@[ContextFunctionTypeParams(count = 1)] kotlin.Function1<.C, kotlin.String> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun contextual (f: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1<.C, kotlin.String>): kotlin.String declared in ' + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE + $this: GET_VAR 'f: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1<.C, kotlin.String> declared in .contextual' type=@[ContextFunctionTypeParams(count = 1)] kotlin.Function1<.C, kotlin.String> origin=VARIABLE_AS_FUNCTION + p1: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.kt.txt index 65f526c6d30..644cfa37088 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.kt.txt @@ -1,18 +1,14 @@ class C { + val result: String + field = "OK" + get + constructor() /* primary */ { super/*Any*/() /* () */ } - val result: String - field = "OK" - get - -} - -fun contextual(f: @ContextFunctionTypeParams(count = 1) Function1): String { - return f.invoke(p1 = C()) } fun box(): String { @@ -21,3 +17,8 @@ fun box(): String { } ) } + +fun contextual(f: @ContextFunctionTypeParams(count = 1) Function1): String { + return f.invoke(p1 = C()) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.ir.txt index 78b2f265ccd..7dabf1b355b 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.ir.txt @@ -1,23 +1,4 @@ FILE fqName: fileName:/plusMatrix.kt - CLASS INTERFACE name:NumberOperations modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.NumberOperations - FUN name:plus visibility:public modality:ABSTRACT <> ($this:.NumberOperations, $receiver:kotlin.Number, other:kotlin.Number) returnType:kotlin.Number - $this: VALUE_PARAMETER name: type:.NumberOperations - $receiver: VALUE_PARAMETER name: type:kotlin.Number - VALUE_PARAMETER name:other index:0 type:kotlin.Number - 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: 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 CLASS CLASS name:Matrix modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Matrix CONSTRUCTOR visibility:public <> () returnType:.Matrix [primary] @@ -37,6 +18,25 @@ FILE fqName: fileName:/plusMatrix.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:NumberOperations modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.NumberOperations + 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: 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:plus visibility:public modality:ABSTRACT <> ($this:.NumberOperations, $receiver:kotlin.Number, other:kotlin.Number) returnType:kotlin.Number + $this: VALUE_PARAMETER name: type:.NumberOperations + $receiver: VALUE_PARAMETER name: type:kotlin.Number + VALUE_PARAMETER name:other index:0 type:kotlin.Number FUN name:plus visibility:public modality:FINAL <> ($receiver:.Matrix, $context_receiver_0:.NumberOperations, other:.Matrix) returnType:.Matrix contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Matrix diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt.txt index a38da23c182..65b23f79ac7 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt.txt @@ -1,8 +1,3 @@ -interface NumberOperations { - abstract fun Number.plus(other: Number): Number - -} - class Matrix { constructor() /* primary */ { super/*Any*/() @@ -12,6 +7,11 @@ class Matrix { } +interface NumberOperations { + abstract fun Number.plus(other: Number): Number + +} + fun Matrix.plus($context_receiver_0: NumberOperations, other: Matrix): Matrix { return TODO() } @@ -20,3 +20,4 @@ fun NumberOperations.plusMatrix(m1: Matrix, m2: Matrix) { m1.plus($context_receiver_0 = , other = m2) /*~> Unit */ m2.plus($context_receiver_0 = , other = m1) /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/property.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/property.ir.txt index 929c0fa7c94..d2e4b9028b9 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/property.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/property.ir.txt @@ -1,25 +1,23 @@ FILE fqName: fileName:/property.kt CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + 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: 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:a visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Int $this: VALUE_PARAMETER name: type:.A - 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: 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 CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - FUN name:b visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.B 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 @@ -33,6 +31,8 @@ FILE fqName: fileName:/property.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:b visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.B PROPERTY name:c visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL <> ($context_receiver_0:.A, $context_receiver_1:.B) returnType:kotlin.Int correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val] diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.ir.txt index 2137243ebf7..0f11c947926 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/thisWithCustomLabel.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (a:T of .A) returnType:.A.A> [primary] - VALUE_PARAMETER name:a index:0 type:T of .A - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:T of .A visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,11 @@ FILE fqName: fileName:/thisWithCustomLabel.kt RETURN type=kotlin.Nothing from='public final fun (): T of .A declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:T of .A visibility:private [final]' type=T of .A origin=null receiver: GET_VAR ': .A.A> declared in .A.' type=.A.A> origin=null + CONSTRUCTOR visibility:public <> (a:T of .A) returnType:.A.A> [primary] + VALUE_PARAMETER name:a index:0 type:T of .A + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -33,11 +33,6 @@ FILE fqName: fileName:/thisWithCustomLabel.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - CONSTRUCTOR visibility:public <> (b:kotlin.Any) returnType:.B [primary] - VALUE_PARAMETER name:b index:0 type:kotlin.Any - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:b visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.Any visibility:private [final] EXPRESSION_BODY @@ -49,6 +44,11 @@ FILE fqName: fileName:/thisWithCustomLabel.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .B' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR ': .B declared in .B.' type=.B origin=null + CONSTRUCTOR visibility:public <> (b:kotlin.Any) returnType:.B [primary] + VALUE_PARAMETER name:b index:0 type:kotlin.Any + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public 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 declared in kotlin.Any @@ -64,11 +64,6 @@ FILE fqName: fileName:/thisWithCustomLabel.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (c:kotlin.Any) returnType:.C [primary] - VALUE_PARAMETER name:c index:0 type:kotlin.Any - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:c visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Any visibility:private [final] EXPRESSION_BODY @@ -80,6 +75,11 @@ FILE fqName: fileName:/thisWithCustomLabel.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> (c:kotlin.Any) returnType:.C [primary] + VALUE_PARAMETER name:c index:0 type:kotlin.Any + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt.txt index 6986bcb1ed4..e5da946a9b1 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt.txt @@ -1,40 +1,40 @@ class A { + val a: T + field = a + get + constructor(a: T) /* primary */ { super/*Any*/() /* () */ } - val a: T - field = a - get - } class B { + val b: Any + field = b + get + constructor(b: Any) /* primary */ { super/*Any*/() /* () */ } - val b: Any - field = b - get - } class C { + val c: Any + field = c + get + constructor(c: Any) /* primary */ { super/*Any*/() /* () */ } - val c: Any - field = c - get - } fun f($context_receiver_0: A, $context_receiver_1: A, $context_receiver_2: B) { @@ -53,3 +53,4 @@ val C.p: Int .() /*~> Unit */ return 1 } + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.ir.txt index 2ad1c7fad2e..55122ea7193 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.ir.txt @@ -1,10 +1,4 @@ FILE fqName: fileName:/typeParameterAsContextReceiver.kt - FUN name:useContext visibility:public modality:FINAL ($context_receiver_0:T of .useContext, block:kotlin.Function1.useContext, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - contextReceiverParametersCount: 1 - VALUE_PARAMETER name:$context_receiver_0 index:0 type:T of .useContext - VALUE_PARAMETER name:block index:1 type:kotlin.Function1.useContext, kotlin.Unit> - BLOCK_BODY FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.Unit origin=null @@ -25,3 +19,9 @@ FILE fqName: fileName:/typeParameterAsContextReceiver.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Int' type=kotlin.Double origin=null $this: GET_VAR 'i: kotlin.Int declared in .test..' type=kotlin.Int origin=null + FUN name:useContext visibility:public modality:FINAL ($context_receiver_0:T of .useContext, block:kotlin.Function1.useContext, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + contextReceiverParametersCount: 1 + VALUE_PARAMETER name:$context_receiver_0 index:0 type:T of .useContext + VALUE_PARAMETER name:block index:1 type:kotlin.Function1.useContext, kotlin.Unit> + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt.txt index 724f9f1edee..345ad7d415a 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt.txt @@ -1,6 +1,3 @@ -fun useContext($context_receiver_0: T, block: Function1) { -} - fun test() { with(receiver = 42, block = local fun Int.() { useContext($context_receiver_0 = $this$with, block = local fun (i: Int) { @@ -10,3 +7,7 @@ fun test() { } ) } + +fun useContext($context_receiver_0: T, block: Function1) { +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt index fe6423c59a3..b72d79dea87 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt @@ -1,11 +1,21 @@ FILE fqName: fileName:/unaryOperators.kt + PROPERTY name:operationScore visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Result - CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.Result [primary] - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:i visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -17,6 +27,11 @@ FILE fqName: fileName:/unaryOperators.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Result' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null + CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.Result [primary] + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Result) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY @@ -33,27 +48,6 @@ FILE fqName: fileName:/unaryOperators.kt RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): .Result declared in .Result' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null i: GET_VAR 'i: kotlin.Int declared in .Result.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Result - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Result' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Result(" - CONST String type=kotlin.String value="i=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Result declared in .Result.toString' type=.Result origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Result - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Result' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Result declared in .Result.hashCode' type=.Result origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Result, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -88,89 +82,27 @@ FILE fqName: fileName:/unaryOperators.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Result' CONST Boolean type=kotlin.Boolean value=true - PROPERTY name:operationScore visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Int + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Result' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Result declared in .Result.hashCode' type=.Result origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - FUN name:unaryMinus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .unaryMinus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun unaryMinus ($context_receiver_0: kotlin.Int): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .unaryMinus' type=.Result origin=null - FUN name:unaryPlus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .unaryPlus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun unaryPlus ($context_receiver_0: kotlin.Int): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: WHEN type=kotlin.Int origin=IF - BRANCH - if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null - arg1: CONST Int type=kotlin.Int value=0 - then: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null - FUN name:inc visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun inc ($context_receiver_0: kotlin.Int): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .inc' type=.Result origin=null - other: CONST Int type=kotlin.Int value=1 - FUN name:dec visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .dec' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun dec ($context_receiver_0: kotlin.Int): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUS - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .dec' type=.Result origin=null - other: CONST Int type=kotlin.Int value=1 + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Result' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Result(" + CONST String type=kotlin.String value="i=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Result declared in .Result.toString' type=.Result origin=null + CONST String type=kotlin.String value=")" FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:result type:.Result [var] @@ -239,3 +171,71 @@ FILE fqName: fileName:/unaryOperators.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="fail" + FUN name:dec visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .dec' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun dec ($context_receiver_0: kotlin.Int): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUS + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .dec' type=.Result origin=null + other: CONST Int type=kotlin.Int value=1 + FUN name:inc visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun inc ($context_receiver_0: kotlin.Int): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .inc' type=.Result origin=null + other: CONST Int type=kotlin.Int value=1 + FUN name:unaryMinus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .unaryMinus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun unaryMinus ($context_receiver_0: kotlin.Int): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .unaryMinus' type=.Result origin=null + FUN name:unaryPlus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .unaryPlus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun unaryPlus ($context_receiver_0: kotlin.Int): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: WHEN type=kotlin.Int origin=IF + BRANCH + if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt index f2692a22839..a1d775ab32f 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt @@ -1,14 +1,19 @@ +var operationScore: Int + field = 0 + get + set + data class Result { + val i: Int + field = i + get + constructor(i: Int) /* primary */ { super/*Any*/() /* () */ } - val i: Int - field = i - get - operator fun component1(): Int { return .#i } @@ -17,14 +22,6 @@ data class Result { return Result(i = i) } - override fun toString(): String { - return "Result(" + "i=" + .#i + ")" - } - - override fun hashCode(): Int { - return .#i.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -39,34 +36,14 @@ data class Result { return true } -} + override fun hashCode(): Int { + return .#i.hashCode() + } -var operationScore: Int - field = 0 - get - set + override fun toString(): String { + return "Result(" + "i=" + .#i + ")" + } -operator fun Result.unaryMinus($context_receiver_0: Int): Result { - ( = ().plus(other = $context_receiver_0)) - return Result(i = .().unaryMinus()) -} - -operator fun Result.unaryPlus($context_receiver_0: Int): Result { - ( = ().plus(other = $context_receiver_0)) - return Result(i = when { - less(arg0 = .(), arg1 = 0) -> .().unaryMinus() - else -> .() - }) -} - -operator fun Result.inc($context_receiver_0: Int): Result { - ( = ().plus(other = $context_receiver_0)) - return Result(i = .().plus(other = 1)) -} - -operator fun Result.dec($context_receiver_0: Int): Result { - ( = ().plus(other = $context_receiver_0)) - return Result(i = .().minus(other = 1)) } fun box(): String { @@ -100,3 +77,26 @@ fun box(): String { } } +operator fun Result.dec($context_receiver_0: Int): Result { + ( = ().plus(other = $context_receiver_0)) + return Result(i = .().minus(other = 1)) +} + +operator fun Result.inc($context_receiver_0: Int): Result { + ( = ().plus(other = $context_receiver_0)) + return Result(i = .().plus(other = 1)) +} + +operator fun Result.unaryMinus($context_receiver_0: Int): Result { + ( = ().plus(other = $context_receiver_0)) + return Result(i = .().unaryMinus()) +} + +operator fun Result.unaryPlus($context_receiver_0: Int): Result { + ( = ().plus(other = $context_receiver_0)) + return Result(i = when { + less(arg0 = .(), arg1 = 0) -> .().unaryMinus() + else -> .() + }) +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.ir.txt index fdbd6635e42..35a14f42050 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.ir.txt @@ -1,11 +1,21 @@ FILE fqName: fileName:/unaryOperators.kt + PROPERTY name:operationScore visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Result - CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.Result [primary] - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:i visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -17,6 +27,11 @@ FILE fqName: fileName:/unaryOperators.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Result' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null + CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.Result [primary] + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Result) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY @@ -33,27 +48,6 @@ FILE fqName: fileName:/unaryOperators.kt RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): .Result declared in .Result' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null i: GET_VAR 'i: kotlin.Int declared in .Result.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Result - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Result' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Result(" - CONST String type=kotlin.String value="i=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Result declared in .Result.toString' type=.Result origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Result - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Result' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Result declared in .Result.hashCode' type=.Result origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Result, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -88,93 +82,27 @@ FILE fqName: fileName:/unaryOperators.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Result' CONST Boolean type=kotlin.Boolean value=true - PROPERTY name:operationScore visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Int + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Result' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Result declared in .Result.hashCode' type=.Result origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - FUN name:unaryMinus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .unaryMinus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun unaryMinus ($context_receiver_0: kotlin.Int): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=UMINUS - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .unaryMinus' type=.Result origin=null - FUN name:unaryPlus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .unaryPlus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun unaryPlus ($context_receiver_0: kotlin.Int): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: WHEN type=kotlin.Int origin=IF - BRANCH - if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null - arg1: CONST Int type=kotlin.Int value=0 - then: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=UMINUS - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null - FUN name:inc visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun inc ($context_receiver_0: kotlin.Int): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .inc' type=.Result origin=null - other: CONST Int type=kotlin.Int value=1 - FUN name:dec visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] - contextReceiverParametersCount: 1 - $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '$context_receiver_0: kotlin.Int declared in .dec' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun dec ($context_receiver_0: kotlin.Int): .Result declared in ' - CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null - i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUS - $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Result declared in .dec' type=.Result origin=null - other: CONST Int type=kotlin.Int value=1 + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Result' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Result(" + CONST String type=kotlin.String value="i=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Result declared in .Result.toString' type=.Result origin=null + CONST String type=kotlin.String value=")" FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:result type:.Result [var] @@ -243,3 +171,75 @@ FILE fqName: fileName:/unaryOperators.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="fail" + FUN name:dec visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .dec' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun dec ($context_receiver_0: kotlin.Int): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUS + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .dec' type=.Result origin=null + other: CONST Int type=kotlin.Int value=1 + FUN name:inc visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun inc ($context_receiver_0: kotlin.Int): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .inc' type=.Result origin=null + other: CONST Int type=kotlin.Int value=1 + FUN name:unaryMinus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .unaryMinus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun unaryMinus ($context_receiver_0: kotlin.Int): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=UMINUS + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .unaryMinus' type=.Result origin=null + FUN name:unaryPlus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] + contextReceiverParametersCount: 1 + $receiver: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .unaryPlus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun unaryPlus ($context_receiver_0: kotlin.Int): .Result declared in ' + CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) declared in .Result' type=.Result origin=null + i: WHEN type=kotlin.Int origin=IF + BRANCH + if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=UMINUS + $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt.txt index 5c94d338289..670481df78c 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt.txt @@ -1,14 +1,19 @@ +var operationScore: Int + field = 0 + get + set + data class Result { + val i: Int + field = i + get + constructor(i: Int) /* primary */ { super/*Any*/() /* () */ } - val i: Int - field = i - get - operator fun component1(): Int { return .#i } @@ -17,14 +22,6 @@ data class Result { return Result(i = i) } - override fun toString(): String { - return "Result(" + "i=" + .#i + ")" - } - - override fun hashCode(): Int { - return .#i.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -39,42 +36,14 @@ data class Result { return true } -} - -var operationScore: Int - field = 0 - get - set - -operator fun Result.unaryMinus($context_receiver_0: Int): Result { - { // BLOCK - ( = ().plus(other = $context_receiver_0)) + override fun hashCode(): Int { + return .#i.hashCode() } - return Result(i = .().unaryMinus()) -} -operator fun Result.unaryPlus($context_receiver_0: Int): Result { - { // BLOCK - ( = ().plus(other = $context_receiver_0)) + override fun toString(): String { + return "Result(" + "i=" + .#i + ")" } - return Result(i = when { - less(arg0 = .(), arg1 = 0) -> .().unaryMinus() - else -> .() - }) -} -operator fun Result.inc($context_receiver_0: Int): Result { - { // BLOCK - ( = ().plus(other = $context_receiver_0)) - } - return Result(i = .().plus(other = 1)) -} - -operator fun Result.dec($context_receiver_0: Int): Result { - { // BLOCK - ( = ().plus(other = $context_receiver_0)) - } - return Result(i = .().minus(other = 1)) } fun box(): String { @@ -107,3 +76,35 @@ fun box(): String { else -> "fail" } } + +operator fun Result.dec($context_receiver_0: Int): Result { + { // BLOCK + ( = ().plus(other = $context_receiver_0)) + } + return Result(i = .().minus(other = 1)) +} + +operator fun Result.inc($context_receiver_0: Int): Result { + { // BLOCK + ( = ().plus(other = $context_receiver_0)) + } + return Result(i = .().plus(other = 1)) +} + +operator fun Result.unaryMinus($context_receiver_0: Int): Result { + { // BLOCK + ( = ().plus(other = $context_receiver_0)) + } + return Result(i = .().unaryMinus()) +} + +operator fun Result.unaryPlus($context_receiver_0: Int): Result { + { // BLOCK + ( = ().plus(other = $context_receiver_0)) + } + return Result(i = when { + less(arg0 = .(), arg1 = 0) -> .().unaryMinus() + else -> .() + }) +} + diff --git a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.ir.txt b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.ir.txt index 60f0e967be4..17546733cdf 100644 --- a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.ir.txt @@ -1,66 +1,4 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base - FUN name:foo visibility:public modality:ABSTRACT <> ($this:foo.Base, x:kotlin.String) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:foo.Base - VALUE_PARAMETER name:x index:0 type:kotlin.String - 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: 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 - CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.BaseImpl - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.BaseImpl [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base]' - PROPERTY name:s visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 's: kotlin.String declared in foo.BaseImpl.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:foo.BaseImpl) returnType:kotlin.String - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:foo.BaseImpl - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.BaseImpl' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.' type=foo.BaseImpl origin=null - FUN name:foo visibility:public modality:OPEN <> ($this:foo.BaseImpl, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base - $this: VALUE_PARAMETER name: type:foo.BaseImpl - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.BaseImpl' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Base: " - CALL 'public final fun (): kotlin.String declared in foo.BaseImpl' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.foo' type=foo.BaseImpl origin=null - CONST String type=kotlin.String value=":" - GET_VAR 'x: kotlin.String declared in foo.BaseImpl.foo' type=kotlin.String 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 foo.Base - $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 foo.Base - $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 foo.Base - $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:global visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:global type:kotlin.String visibility:private [static] EXPRESSION_BODY @@ -76,49 +14,65 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:global type:kotlin.String visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.String declared in foo.' type=kotlin.String origin=null - CLASS CLASS name:DerivedBase modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.DerivedBase - CONSTRUCTOR visibility:public <> () returnType:foo.DerivedBase [primary] + CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.BaseImpl + PROPERTY name:s visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 's: kotlin.String declared in foo.BaseImpl.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:foo.BaseImpl) returnType:kotlin.String + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:foo.BaseImpl + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.BaseImpl' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.' type=foo.BaseImpl origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.BaseImpl [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedBase modality:OPEN visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base]' + 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 foo.Base + $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 foo.Base + $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 foo.Base + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:foo.BaseImpl, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base + $this: VALUE_PARAMETER name: type:foo.BaseImpl + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.BaseImpl' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Base: " + CALL 'public final fun (): kotlin.String declared in foo.BaseImpl' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.foo' type=foo.BaseImpl origin=null + CONST String type=kotlin.String value=":" + GET_VAR 'x: kotlin.String declared in foo.BaseImpl.foo' type=kotlin.String origin=null + CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY - other: CONST String type=kotlin.String value=":DerivedBase" - 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: 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:newBase visibility:public modality:FINAL <> () returnType:foo.Base - BLOCK_BODY - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY - other: CONST String type=kotlin.String value=":newBase" - RETURN type=kotlin.Nothing from='public final fun newBase (): foo.Base declared in foo' - CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.BaseImpl' type=foo.BaseImpl origin=null - s: CONST String type=kotlin.String value="test" - CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived + other: CONST String type=kotlin.String value=":Derived" CONSTRUCTOR visibility:public <> () returnType:foo.Derived [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base]' - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base @@ -130,12 +84,6 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null receiver: GET_VAR ': foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived.foo' type=kotlin.String origin=null - ANONYMOUS_INITIALIZER isStatic=false - BLOCK_BODY - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY - other: CONST String type=kotlin.String value=":Derived" 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 foo.DerivedBase @@ -154,13 +102,19 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[foo.Base; foo.DerivedBase] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived1 + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY + other: CONST String type=kotlin.String value=":Derived" CONSTRUCTOR visibility:public <> () returnType:foo.Derived1 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[foo.Base; foo.DerivedBase]' - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived1, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base @@ -172,12 +126,6 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null receiver: GET_VAR ': foo.Derived1 declared in foo.Derived1.foo' type=foo.Derived1 origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived1.foo' type=kotlin.String origin=null - ANONYMOUS_INITIALIZER isStatic=false - BLOCK_BODY - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY - other: CONST String type=kotlin.String value=":Derived" 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 foo.Base @@ -194,6 +142,49 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt public open fun toString (): kotlin.String declared in foo.Base public open fun toString (): kotlin.String declared in foo.DerivedBase $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:DerivedBase modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.DerivedBase + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY + other: CONST String type=kotlin.String value=":DerivedBase" + CONSTRUCTOR visibility:public <> () returnType:foo.DerivedBase [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedBase modality:OPEN visibility:public 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 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 + CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:foo.Base, x:kotlin.String) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:foo.Base + VALUE_PARAMETER name:x index:0 type:kotlin.String FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:d type:foo.Derived [var] @@ -202,3 +193,12 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt CONSTRUCTOR_CALL 'public constructor () declared in foo.Derived1' type=foo.Derived1 origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in foo' CONST String type=kotlin.String value="OK" + FUN name:newBase visibility:public modality:FINAL <> () returnType:foo.Base + BLOCK_BODY + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY + other: CONST String type=kotlin.String value=":newBase" + RETURN type=kotlin.Nothing from='public final fun newBase (): foo.Base declared in foo' + CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.BaseImpl' type=foo.BaseImpl origin=null + s: CONST String type=kotlin.String value="test" diff --git a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.kt.txt b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.kt.txt index e897435f63b..e5cbd605576 100644 --- a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.kt.txt @@ -1,83 +1,78 @@ package foo -interface Base { - abstract fun foo(x: String): String - -} +var global: String + field = "" + get + set class BaseImpl : Base { + val s: String + field = s + get + constructor(s: String) /* primary */ { super/*Any*/() /* () */ } - val s: String - field = s - get - override fun foo(x: String): String { return "Base: " + .() + ":" + x } } -var global: String - field = "" - get - set +class Derived : DerivedBase, Base { + private /* final field */ val $$delegate_0: Base = newBase() + init { + ( = ().plus(other = ":Derived")) + } + + constructor() /* primary */ { + super/*DerivedBase*/() + /* () */ + + } + + override fun foo(x: String): String { + return .#$$delegate_0.foo(x = x) + } + +} + +class Derived1 : DerivedBase, Base { + private /* final field */ val $$delegate_0: Base = newBase() + init { + ( = ().plus(other = ":Derived")) + } + + constructor() /* primary */ { + super/*DerivedBase*/() + /* () */ + + } + + override fun foo(x: String): String { + return .#$$delegate_0.foo(x = x) + } + +} open class DerivedBase { + init { + ( = ().plus(other = ":DerivedBase")) + } + constructor() /* primary */ { super/*Any*/() /* () */ } - init { - ( = ().plus(other = ":DerivedBase")) - } - } -fun newBase(): Base { - ( = ().plus(other = ":newBase")) - return BaseImpl(s = "test") -} - -class Derived : DerivedBase, Base { - constructor() /* primary */ { - super/*DerivedBase*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Base = newBase() - override fun foo(x: String): String { - return .#$$delegate_0.foo(x = x) - } - - init { - ( = ().plus(other = ":Derived")) - } - -} - -class Derived1 : Base, DerivedBase { - constructor() /* primary */ { - super/*DerivedBase*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Base = newBase() - override fun foo(x: String): String { - return .#$$delegate_0.foo(x = x) - } - - init { - ( = ().plus(other = ":Derived")) - } +interface Base { + abstract fun foo(x: String): String } @@ -87,3 +82,8 @@ fun box(): String { return "OK" } +fun newBase(): Base { + ( = ().plus(other = ":newBase")) + return BaseImpl(s = "test") +} + diff --git a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.ir.txt b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.ir.txt index f2a3e762d55..dd5ca685925 100644 --- a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.ir.txt +++ b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.ir.txt @@ -1,66 +1,4 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base - FUN name:foo visibility:public modality:ABSTRACT <> ($this:foo.Base, x:kotlin.String) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:foo.Base - VALUE_PARAMETER name:x index:0 type:kotlin.String - 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: 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 - CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.BaseImpl - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.BaseImpl [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base]' - PROPERTY name:s visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 's: kotlin.String declared in foo.BaseImpl.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:foo.BaseImpl) returnType:kotlin.String - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:foo.BaseImpl - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.BaseImpl' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.' type=foo.BaseImpl origin=null - FUN name:foo visibility:public modality:OPEN <> ($this:foo.BaseImpl, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base - $this: VALUE_PARAMETER name: type:foo.BaseImpl - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.BaseImpl' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Base: " - CALL 'public final fun (): kotlin.String declared in foo.BaseImpl' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.foo' type=foo.BaseImpl origin=null - CONST String type=kotlin.String value=":" - GET_VAR 'x: kotlin.String declared in foo.BaseImpl.foo' type=kotlin.String 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 foo.Base - $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 foo.Base - $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 foo.Base - $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:global visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:global type:kotlin.String visibility:private [static] EXPRESSION_BODY @@ -76,51 +14,66 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:global type:kotlin.String visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.String declared in foo.' type=kotlin.String origin=null - CLASS CLASS name:DerivedBase modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.DerivedBase - CONSTRUCTOR visibility:public <> () returnType:foo.DerivedBase [primary] + CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.BaseImpl + PROPERTY name:s visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 's: kotlin.String declared in foo.BaseImpl.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:foo.BaseImpl) returnType:kotlin.String + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:foo.BaseImpl + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.BaseImpl' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.' type=foo.BaseImpl origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.BaseImpl [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedBase modality:OPEN visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base]' + 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 foo.Base + $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 foo.Base + $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 foo.Base + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:foo.BaseImpl, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base + $this: VALUE_PARAMETER name: type:foo.BaseImpl + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.BaseImpl' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Base: " + CALL 'public final fun (): kotlin.String declared in foo.BaseImpl' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.foo' type=foo.BaseImpl origin=null + CONST String type=kotlin.String value=":" + GET_VAR 'x: kotlin.String declared in foo.BaseImpl.foo' type=kotlin.String origin=null + CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ - other: CONST String type=kotlin.String value=":DerivedBase" - 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: 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:newBase visibility:public modality:FINAL <> () returnType:foo.Base - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ - other: CONST String type=kotlin.String value=":newBase" - RETURN type=kotlin.Nothing from='public final fun newBase (): foo.Base declared in foo' - CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.BaseImpl' type=foo.BaseImpl origin=null - s: CONST String type=kotlin.String value="test" - CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived + other: CONST String type=kotlin.String value=":Derived" CONSTRUCTOR visibility:public <> () returnType:foo.Derived [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base]' - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base @@ -132,13 +85,6 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null receiver: GET_VAR ': foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived.foo' type=kotlin.String origin=null - ANONYMOUS_INITIALIZER isStatic=false - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ - other: CONST String type=kotlin.String value=":Derived" 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 foo.DerivedBase @@ -157,13 +103,20 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[foo.Base; foo.DerivedBase] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived1 + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ + other: CONST String type=kotlin.String value=":Derived" CONSTRUCTOR visibility:public <> () returnType:foo.Derived1 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[foo.Base; foo.DerivedBase]' - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived1, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base @@ -175,13 +128,6 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null receiver: GET_VAR ': foo.Derived1 declared in foo.Derived1.foo' type=foo.Derived1 origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived1.foo' type=kotlin.String origin=null - ANONYMOUS_INITIALIZER isStatic=false - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ - other: CONST String type=kotlin.String value=":Derived" 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 foo.Base @@ -198,6 +144,50 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt public open fun toString (): kotlin.String declared in foo.Base public open fun toString (): kotlin.String declared in foo.DerivedBase $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:DerivedBase modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.DerivedBase + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ + other: CONST String type=kotlin.String value=":DerivedBase" + CONSTRUCTOR visibility:public <> () returnType:foo.DerivedBase [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedBase modality:OPEN visibility:public 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 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 + CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:foo.Base, x:kotlin.String) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:foo.Base + VALUE_PARAMETER name:x index:0 type:kotlin.String FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:d type:foo.Derived [var] @@ -206,3 +196,13 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt CONSTRUCTOR_CALL 'public constructor () declared in foo.Derived1' type=foo.Derived1 origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in foo' CONST String type=kotlin.String value="OK" + FUN name:newBase visibility:public modality:FINAL <> () returnType:foo.Base + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ + other: CONST String type=kotlin.String value=":newBase" + RETURN type=kotlin.Nothing from='public final fun newBase (): foo.Base declared in foo' + CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.BaseImpl' type=foo.BaseImpl origin=null + s: CONST String type=kotlin.String value="test" diff --git a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.kt.txt b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.kt.txt index 44d0e127d72..efce2934b0a 100644 --- a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.kt.txt +++ b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.kt.txt @@ -1,45 +1,91 @@ package foo -interface Base { - abstract fun foo(x: String): String - -} +var global: String + field = "" + get + set class BaseImpl : Base { + val s: String + field = s + get + constructor(s: String) /* primary */ { super/*Any*/() /* () */ } - val s: String - field = s - get - override fun foo(x: String): String { return "Base: " + .() + ":" + x } } -var global: String - field = "" - get - set +class Derived : DerivedBase, Base { + private /* final field */ val $$delegate_0: Base = newBase() + init { + { // BLOCK + ( = ().plus(other = ":Derived")) + } + } -open class DerivedBase { constructor() /* primary */ { - super/*Any*/() + super/*DerivedBase*/() /* () */ } + override fun foo(x: String): String { + return .#$$delegate_0.foo(x = x) + } + +} + +class Derived1 : DerivedBase, Base { + private /* final field */ val $$delegate_0: Base = newBase() + init { + { // BLOCK + ( = ().plus(other = ":Derived")) + } + } + + constructor() /* primary */ { + super/*DerivedBase*/() + /* () */ + + } + + override fun foo(x: String): String { + return .#$$delegate_0.foo(x = x) + } + +} + +open class DerivedBase { init { { // BLOCK ( = ().plus(other = ":DerivedBase")) } } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface Base { + abstract fun foo(x: String): String + +} + +fun box(): String { + var d: Derived = Derived() + var d1: Derived1 = Derived1() + return "OK" } fun newBase(): Base { @@ -49,48 +95,3 @@ fun newBase(): Base { return BaseImpl(s = "test") } -class Derived : DerivedBase, Base { - constructor() /* primary */ { - super/*DerivedBase*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Base = newBase() - override fun foo(x: String): String { - return .#$$delegate_0.foo(x = x) - } - - init { - { // BLOCK - ( = ().plus(other = ":Derived")) - } - } - -} - -class Derived1 : Base, DerivedBase { - constructor() /* primary */ { - super/*DerivedBase*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Base = newBase() - override fun foo(x: String): String { - return .#$$delegate_0.foo(x = x) - } - - init { - { // BLOCK - ( = ().plus(other = ":Derived")) - } - } - -} - -fun box(): String { - var d: Derived = Derived() - var d1: Derived1 = Derived1() - return "OK" -} diff --git a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.ir.txt b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.ir.txt index 19c9409f4b7..9fd7b745ebd 100644 --- a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.ir.txt @@ -1,128 +1,4 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base - FUN name:foo visibility:public modality:ABSTRACT <> ($this:foo.Base, x:kotlin.String) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:foo.Base - VALUE_PARAMETER name:x index:0 type:kotlin.String - 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: 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 - CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.BaseImpl - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.BaseImpl [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base]' - PROPERTY name:s visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 's: kotlin.String declared in foo.BaseImpl.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:foo.BaseImpl) returnType:kotlin.String - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:foo.BaseImpl - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.BaseImpl' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.' type=foo.BaseImpl origin=null - FUN name:foo visibility:public modality:OPEN <> ($this:foo.BaseImpl, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base - $this: VALUE_PARAMETER name: type:foo.BaseImpl - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.BaseImpl' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Base: " - CALL 'public final fun (): kotlin.String declared in foo.BaseImpl' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.foo' type=foo.BaseImpl origin=null - CONST String type=kotlin.String value=":" - GET_VAR 'x: kotlin.String declared in foo.BaseImpl.foo' type=kotlin.String 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 foo.Base - $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 foo.Base - $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 foo.Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Base2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base2 - FUN name:bar visibility:public modality:ABSTRACT <> ($this:foo.Base2, x:kotlin.String) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:foo.Base2 - VALUE_PARAMETER name:x index:0 type:kotlin.String - 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: 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 - CLASS CLASS name:Base2Impl modality:FINAL visibility:public superTypes:[foo.Base2] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base2Impl - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.Base2Impl [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base2Impl modality:FINAL visibility:public superTypes:[foo.Base2]' - PROPERTY name:s visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 's: kotlin.String declared in foo.Base2Impl.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:foo.Base2Impl) returnType:kotlin.String - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:foo.Base2Impl - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.Base2Impl' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': foo.Base2Impl declared in foo.Base2Impl.' type=foo.Base2Impl origin=null - FUN name:bar visibility:public modality:OPEN <> ($this:foo.Base2Impl, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 - $this: VALUE_PARAMETER name: type:foo.Base2Impl - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun bar (x: kotlin.String): kotlin.String declared in foo.Base2Impl' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Base2: " - CALL 'public final fun (): kotlin.String declared in foo.Base2Impl' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': foo.Base2Impl declared in foo.Base2Impl.bar' type=foo.Base2Impl origin=null - CONST String type=kotlin.String value=":" - GET_VAR 'x: kotlin.String declared in foo.Base2Impl.bar' type=kotlin.String 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 foo.Base2 - $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 foo.Base2 - $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 foo.Base2 - $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:global visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:global type:kotlin.String visibility:private [static] EXPRESSION_BODY @@ -138,72 +14,112 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:global type:kotlin.String visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.String declared in foo.' type=kotlin.String origin=null - CLASS CLASS name:DerivedBase modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.DerivedBase - CONSTRUCTOR visibility:public <> () returnType:foo.DerivedBase [primary] + CLASS CLASS name:Base2Impl modality:FINAL visibility:public superTypes:[foo.Base2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base2Impl + PROPERTY name:s visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 's: kotlin.String declared in foo.Base2Impl.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:foo.Base2Impl) returnType:kotlin.String + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:foo.Base2Impl + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.Base2Impl' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': foo.Base2Impl declared in foo.Base2Impl.' type=foo.Base2Impl origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.Base2Impl [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedBase modality:OPEN visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base2Impl modality:FINAL visibility:public superTypes:[foo.Base2]' + 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 foo.Base2 + $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 foo.Base2 + $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 foo.Base2 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:OPEN <> ($this:foo.Base2Impl, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 + $this: VALUE_PARAMETER name: type:foo.Base2Impl + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun bar (x: kotlin.String): kotlin.String declared in foo.Base2Impl' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Base2: " + CALL 'public final fun (): kotlin.String declared in foo.Base2Impl' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': foo.Base2Impl declared in foo.Base2Impl.bar' type=foo.Base2Impl origin=null + CONST String type=kotlin.String value=":" + GET_VAR 'x: kotlin.String declared in foo.Base2Impl.bar' type=kotlin.String origin=null + CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.BaseImpl + PROPERTY name:s visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 's: kotlin.String declared in foo.BaseImpl.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:foo.BaseImpl) returnType:kotlin.String + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:foo.BaseImpl + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.BaseImpl' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.' type=foo.BaseImpl origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.BaseImpl [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base]' + 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 foo.Base + $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 foo.Base + $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 foo.Base + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:foo.BaseImpl, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base + $this: VALUE_PARAMETER name: type:foo.BaseImpl + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.BaseImpl' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Base: " + CALL 'public final fun (): kotlin.String declared in foo.BaseImpl' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.foo' type=foo.BaseImpl origin=null + CONST String type=kotlin.String value=":" + GET_VAR 'x: kotlin.String declared in foo.BaseImpl.foo' type=kotlin.String origin=null + CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base; foo.Base2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null + FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY - other: CONST String type=kotlin.String value=":DerivedBase" - 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: 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:newBase visibility:public modality:FINAL <> () returnType:foo.Base - BLOCK_BODY - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY - other: CONST String type=kotlin.String value=":newBase" - RETURN type=kotlin.Nothing from='public final fun newBase (): foo.Base declared in foo' - CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.BaseImpl' type=foo.BaseImpl origin=null - s: CONST String type=kotlin.String value="test" - FUN name:newBase2 visibility:public modality:FINAL <> () returnType:foo.Base2 - BLOCK_BODY - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY - other: CONST String type=kotlin.String value=":newBase2" - RETURN type=kotlin.Nothing from='public final fun newBase2 (): foo.Base2 declared in foo' - CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.Base2Impl' type=foo.Base2Impl origin=null - s: CONST String type=kotlin.String value="test" - CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base; foo.Base2] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived + other: CONST String type=kotlin.String value=":Derived" CONSTRUCTOR visibility:public <> () returnType:foo.Derived [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base; foo.Base2]' - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base - $this: VALUE_PARAMETER name: type:foo.Derived - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.Derived' - CALL 'public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null - receiver: GET_VAR ': foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null - x: GET_VAR 'x: kotlin.String declared in foo.Derived.foo' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:foo.Derived, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 @@ -215,12 +131,17 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final]' type=foo.Base2 origin=null receiver: GET_VAR ': foo.Derived declared in foo.Derived.bar' type=foo.Derived origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived.bar' type=kotlin.String origin=null - ANONYMOUS_INITIALIZER isStatic=false + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base + $this: VALUE_PARAMETER name: type:foo.Derived + VALUE_PARAMETER name:x index:0 type:kotlin.String BLOCK_BODY - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY - other: CONST String type=kotlin.String value=":Derived" + RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.Derived' + CALL 'public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null + receiver: GET_VAR ': foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null + x: GET_VAR 'x: kotlin.String declared in foo.Derived.foo' type=kotlin.String 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 foo.DerivedBase @@ -242,27 +163,22 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[foo.Base; foo.DerivedBase; foo.Base2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived1 + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null + FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY + other: CONST String type=kotlin.String value=":Derived" CONSTRUCTOR visibility:public <> () returnType:foo.Derived1 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[foo.Base; foo.DerivedBase; foo.Base2]' - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived1, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base - $this: VALUE_PARAMETER name: type:foo.Derived1 - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.Derived1' - CALL 'public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null - receiver: GET_VAR ': foo.Derived1 declared in foo.Derived1.foo' type=foo.Derived1 origin=null - x: GET_VAR 'x: kotlin.String declared in foo.Derived1.foo' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:foo.Derived1, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 @@ -274,12 +190,17 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final]' type=foo.Base2 origin=null receiver: GET_VAR ': foo.Derived1 declared in foo.Derived1.bar' type=foo.Derived1 origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived1.bar' type=kotlin.String origin=null - ANONYMOUS_INITIALIZER isStatic=false + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived1, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base + $this: VALUE_PARAMETER name: type:foo.Derived1 + VALUE_PARAMETER name:x index:0 type:kotlin.String BLOCK_BODY - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY - other: CONST String type=kotlin.String value=":Derived" + RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.Derived1' + CALL 'public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null + receiver: GET_VAR ': foo.Derived1 declared in foo.Derived1.foo' type=foo.Derived1 origin=null + x: GET_VAR 'x: kotlin.String declared in foo.Derived1.foo' type=kotlin.String 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 foo.Base @@ -301,27 +222,22 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[foo.Base; foo.Base2; foo.DerivedBase] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived2 + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null + FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY + other: CONST String type=kotlin.String value=":Derived" CONSTRUCTOR visibility:public <> () returnType:foo.Derived2 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[foo.Base; foo.Base2; foo.DerivedBase]' - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived2, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base - $this: VALUE_PARAMETER name: type:foo.Derived2 - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.Derived2' - CALL 'public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null - receiver: GET_VAR ': foo.Derived2 declared in foo.Derived2.foo' type=foo.Derived2 origin=null - x: GET_VAR 'x: kotlin.String declared in foo.Derived2.foo' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:foo.Derived2, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 @@ -333,12 +249,17 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final]' type=foo.Base2 origin=null receiver: GET_VAR ': foo.Derived2 declared in foo.Derived2.bar' type=foo.Derived2 origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived2.bar' type=kotlin.String origin=null - ANONYMOUS_INITIALIZER isStatic=false + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived2, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base + $this: VALUE_PARAMETER name: type:foo.Derived2 + VALUE_PARAMETER name:x index:0 type:kotlin.String BLOCK_BODY - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY - other: CONST String type=kotlin.String value=":Derived" + RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.Derived2' + CALL 'public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null + receiver: GET_VAR ': foo.Derived2 declared in foo.Derived2.foo' type=foo.Derived2 origin=null + x: GET_VAR 'x: kotlin.String declared in foo.Derived2.foo' type=kotlin.String 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 foo.Base @@ -358,6 +279,67 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt public open fun toString (): kotlin.String declared in foo.Base2 public open fun toString (): kotlin.String declared in foo.DerivedBase $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:DerivedBase modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.DerivedBase + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY + other: CONST String type=kotlin.String value=":DerivedBase" + CONSTRUCTOR visibility:public <> () returnType:foo.DerivedBase [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedBase modality:OPEN visibility:public 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 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 + CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:foo.Base, x:kotlin.String) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:foo.Base + VALUE_PARAMETER name:x index:0 type:kotlin.String + CLASS INTERFACE name:Base2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base2 + 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: 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:bar visibility:public modality:ABSTRACT <> ($this:foo.Base2, x:kotlin.String) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:foo.Base2 + VALUE_PARAMETER name:x index:0 type:kotlin.String FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:d type:foo.Derived [var] @@ -368,3 +350,21 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt CONSTRUCTOR_CALL 'public constructor () declared in foo.Derived2' type=foo.Derived2 origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in foo' CONST String type=kotlin.String value="OK" + FUN name:newBase visibility:public modality:FINAL <> () returnType:foo.Base + BLOCK_BODY + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY + other: CONST String type=kotlin.String value=":newBase" + RETURN type=kotlin.Nothing from='public final fun newBase (): foo.Base declared in foo' + CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.BaseImpl' type=foo.BaseImpl origin=null + s: CONST String type=kotlin.String value="test" + FUN name:newBase2 visibility:public modality:FINAL <> () returnType:foo.Base2 + BLOCK_BODY + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=GET_PROPERTY + other: CONST String type=kotlin.String value=":newBase2" + RETURN type=kotlin.Nothing from='public final fun newBase2 (): foo.Base2 declared in foo' + CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.Base2Impl' type=foo.Base2Impl origin=null + s: CONST String type=kotlin.String value="test" diff --git a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.kt.txt b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.kt.txt index 5c892e4c18d..fbd46ebbfd9 100644 --- a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.kt.txt @@ -1,65 +1,141 @@ package foo -interface Base { - abstract fun foo(x: String): String +var global: String + field = "" + get + set -} +class Base2Impl : Base2 { + val s: String + field = s + get -class BaseImpl : Base { constructor(s: String) /* primary */ { super/*Any*/() /* () */ } + override fun bar(x: String): String { + return "Base2: " + .() + ":" + x + } + +} + +class BaseImpl : Base { val s: String field = s get + constructor(s: String) /* primary */ { + super/*Any*/() + /* () */ + + } + override fun foo(x: String): String { return "Base: " + .() + ":" + x } } +class Derived : DerivedBase, Base, Base2 { + private /* final field */ val $$delegate_0: Base = newBase() + private /* final field */ val $$delegate_1: Base2 = newBase2() + init { + ( = ().plus(other = ":Derived")) + } + + constructor() /* primary */ { + super/*DerivedBase*/() + /* () */ + + } + + override fun bar(x: String): String { + return .#$$delegate_1.bar(x = x) + } + + override fun foo(x: String): String { + return .#$$delegate_0.foo(x = x) + } + +} + +class Derived1 : DerivedBase, Base, Base2 { + private /* final field */ val $$delegate_0: Base = newBase() + private /* final field */ val $$delegate_1: Base2 = newBase2() + init { + ( = ().plus(other = ":Derived")) + } + + constructor() /* primary */ { + super/*DerivedBase*/() + /* () */ + + } + + override fun bar(x: String): String { + return .#$$delegate_1.bar(x = x) + } + + override fun foo(x: String): String { + return .#$$delegate_0.foo(x = x) + } + +} + +class Derived2 : DerivedBase, Base, Base2 { + private /* final field */ val $$delegate_0: Base = newBase() + private /* final field */ val $$delegate_1: Base2 = newBase2() + init { + ( = ().plus(other = ":Derived")) + } + + constructor() /* primary */ { + super/*DerivedBase*/() + /* () */ + + } + + override fun bar(x: String): String { + return .#$$delegate_1.bar(x = x) + } + + override fun foo(x: String): String { + return .#$$delegate_0.foo(x = x) + } + +} + +open class DerivedBase { + init { + ( = ().plus(other = ":DerivedBase")) + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface Base { + abstract fun foo(x: String): String + +} + interface Base2 { abstract fun bar(x: String): String } -class Base2Impl : Base2 { - constructor(s: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val s: String - field = s - get - - override fun bar(x: String): String { - return "Base2: " + .() + ":" + x - } - -} - -var global: String - field = "" - get - set - -open class DerivedBase { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - init { - ( = ().plus(other = ":DerivedBase")) - } - +fun box(): String { + var d: Derived = Derived() + var d1: Derived1 = Derived1() + var d2: Derived2 = Derived2() + return "OK" } fun newBase(): Base { @@ -72,79 +148,3 @@ fun newBase2(): Base2 { return Base2Impl(s = "test") } -class Derived : DerivedBase, Base, Base2 { - constructor() /* primary */ { - super/*DerivedBase*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Base = newBase() - override fun foo(x: String): String { - return .#$$delegate_0.foo(x = x) - } - - private /* final field */ val $$delegate_1: Base2 = newBase2() - override fun bar(x: String): String { - return .#$$delegate_1.bar(x = x) - } - - init { - ( = ().plus(other = ":Derived")) - } - -} - -class Derived1 : Base, DerivedBase, Base2 { - constructor() /* primary */ { - super/*DerivedBase*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Base = newBase() - override fun foo(x: String): String { - return .#$$delegate_0.foo(x = x) - } - - private /* final field */ val $$delegate_1: Base2 = newBase2() - override fun bar(x: String): String { - return .#$$delegate_1.bar(x = x) - } - - init { - ( = ().plus(other = ":Derived")) - } - -} - -class Derived2 : Base, Base2, DerivedBase { - constructor() /* primary */ { - super/*DerivedBase*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Base = newBase() - override fun foo(x: String): String { - return .#$$delegate_0.foo(x = x) - } - - private /* final field */ val $$delegate_1: Base2 = newBase2() - override fun bar(x: String): String { - return .#$$delegate_1.bar(x = x) - } - - init { - ( = ().plus(other = ":Derived")) - } - -} - -fun box(): String { - var d: Derived = Derived() - var d1: Derived1 = Derived1() - var d2: Derived2 = Derived2() - return "OK" -} - diff --git a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.ir.txt b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.ir.txt index afde5368773..44c3643f739 100644 --- a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.ir.txt +++ b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.ir.txt @@ -1,128 +1,4 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base - FUN name:foo visibility:public modality:ABSTRACT <> ($this:foo.Base, x:kotlin.String) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:foo.Base - VALUE_PARAMETER name:x index:0 type:kotlin.String - 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: 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 - CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.BaseImpl - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.BaseImpl [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base]' - PROPERTY name:s visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 's: kotlin.String declared in foo.BaseImpl.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:foo.BaseImpl) returnType:kotlin.String - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:foo.BaseImpl - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.BaseImpl' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.' type=foo.BaseImpl origin=null - FUN name:foo visibility:public modality:OPEN <> ($this:foo.BaseImpl, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base - $this: VALUE_PARAMETER name: type:foo.BaseImpl - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.BaseImpl' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Base: " - CALL 'public final fun (): kotlin.String declared in foo.BaseImpl' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.foo' type=foo.BaseImpl origin=null - CONST String type=kotlin.String value=":" - GET_VAR 'x: kotlin.String declared in foo.BaseImpl.foo' type=kotlin.String 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 foo.Base - $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 foo.Base - $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 foo.Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Base2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base2 - FUN name:bar visibility:public modality:ABSTRACT <> ($this:foo.Base2, x:kotlin.String) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:foo.Base2 - VALUE_PARAMETER name:x index:0 type:kotlin.String - 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: 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 - CLASS CLASS name:Base2Impl modality:FINAL visibility:public superTypes:[foo.Base2] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base2Impl - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.Base2Impl [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base2Impl modality:FINAL visibility:public superTypes:[foo.Base2]' - PROPERTY name:s visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 's: kotlin.String declared in foo.Base2Impl.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:foo.Base2Impl) returnType:kotlin.String - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:foo.Base2Impl - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.Base2Impl' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': foo.Base2Impl declared in foo.Base2Impl.' type=foo.Base2Impl origin=null - FUN name:bar visibility:public modality:OPEN <> ($this:foo.Base2Impl, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 - $this: VALUE_PARAMETER name: type:foo.Base2Impl - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun bar (x: kotlin.String): kotlin.String declared in foo.Base2Impl' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Base2: " - CALL 'public final fun (): kotlin.String declared in foo.Base2Impl' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': foo.Base2Impl declared in foo.Base2Impl.bar' type=foo.Base2Impl origin=null - CONST String type=kotlin.String value=":" - GET_VAR 'x: kotlin.String declared in foo.Base2Impl.bar' type=kotlin.String 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 foo.Base2 - $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 foo.Base2 - $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 foo.Base2 - $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:global visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:global type:kotlin.String visibility:private [static] EXPRESSION_BODY @@ -138,75 +14,113 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:global type:kotlin.String visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.String declared in foo.' type=kotlin.String origin=null - CLASS CLASS name:DerivedBase modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.DerivedBase - CONSTRUCTOR visibility:public <> () returnType:foo.DerivedBase [primary] + CLASS CLASS name:Base2Impl modality:FINAL visibility:public superTypes:[foo.Base2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base2Impl + PROPERTY name:s visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 's: kotlin.String declared in foo.Base2Impl.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:foo.Base2Impl) returnType:kotlin.String + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:foo.Base2Impl + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.Base2Impl' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': foo.Base2Impl declared in foo.Base2Impl.' type=foo.Base2Impl origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.Base2Impl [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedBase modality:OPEN visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base2Impl modality:FINAL visibility:public superTypes:[foo.Base2]' + 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 foo.Base2 + $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 foo.Base2 + $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 foo.Base2 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:OPEN <> ($this:foo.Base2Impl, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 + $this: VALUE_PARAMETER name: type:foo.Base2Impl + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun bar (x: kotlin.String): kotlin.String declared in foo.Base2Impl' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Base2: " + CALL 'public final fun (): kotlin.String declared in foo.Base2Impl' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': foo.Base2Impl declared in foo.Base2Impl.bar' type=foo.Base2Impl origin=null + CONST String type=kotlin.String value=":" + GET_VAR 'x: kotlin.String declared in foo.Base2Impl.bar' type=kotlin.String origin=null + CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.BaseImpl + PROPERTY name:s visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 's: kotlin.String declared in foo.BaseImpl.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:foo.BaseImpl) returnType:kotlin.String + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:foo.BaseImpl + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in foo.BaseImpl' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.' type=foo.BaseImpl origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:foo.BaseImpl [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseImpl modality:FINAL visibility:public superTypes:[foo.Base]' + 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 foo.Base + $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 foo.Base + $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 foo.Base + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:foo.BaseImpl, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base + $this: VALUE_PARAMETER name: type:foo.BaseImpl + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.BaseImpl' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Base: " + CALL 'public final fun (): kotlin.String declared in foo.BaseImpl' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': foo.BaseImpl declared in foo.BaseImpl.foo' type=foo.BaseImpl origin=null + CONST String type=kotlin.String value=":" + GET_VAR 'x: kotlin.String declared in foo.BaseImpl.foo' type=kotlin.String origin=null + CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base; foo.Base2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null + FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ - other: CONST String type=kotlin.String value=":DerivedBase" - 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: 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:newBase visibility:public modality:FINAL <> () returnType:foo.Base - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ - other: CONST String type=kotlin.String value=":newBase" - RETURN type=kotlin.Nothing from='public final fun newBase (): foo.Base declared in foo' - CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.BaseImpl' type=foo.BaseImpl origin=null - s: CONST String type=kotlin.String value="test" - FUN name:newBase2 visibility:public modality:FINAL <> () returnType:foo.Base2 - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ - other: CONST String type=kotlin.String value=":newBase2" - RETURN type=kotlin.Nothing from='public final fun newBase2 (): foo.Base2 declared in foo' - CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.Base2Impl' type=foo.Base2Impl origin=null - s: CONST String type=kotlin.String value="test" - CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base; foo.Base2] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived + other: CONST String type=kotlin.String value=":Derived" CONSTRUCTOR visibility:public <> () returnType:foo.Derived [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base; foo.Base2]' - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base - $this: VALUE_PARAMETER name: type:foo.Derived - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.Derived' - CALL 'public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null - receiver: GET_VAR ': foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null - x: GET_VAR 'x: kotlin.String declared in foo.Derived.foo' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:foo.Derived, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 @@ -218,13 +132,17 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final]' type=foo.Base2 origin=null receiver: GET_VAR ': foo.Derived declared in foo.Derived.bar' type=foo.Derived origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived.bar' type=kotlin.String origin=null - ANONYMOUS_INITIALIZER isStatic=false + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base + $this: VALUE_PARAMETER name: type:foo.Derived + VALUE_PARAMETER name:x index:0 type:kotlin.String BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ - other: CONST String type=kotlin.String value=":Derived" + RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.Derived' + CALL 'public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null + receiver: GET_VAR ': foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null + x: GET_VAR 'x: kotlin.String declared in foo.Derived.foo' type=kotlin.String 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 foo.DerivedBase @@ -246,27 +164,23 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[foo.Base; foo.DerivedBase; foo.Base2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived1 + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null + FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ + other: CONST String type=kotlin.String value=":Derived" CONSTRUCTOR visibility:public <> () returnType:foo.Derived1 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[foo.Base; foo.DerivedBase; foo.Base2]' - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived1, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base - $this: VALUE_PARAMETER name: type:foo.Derived1 - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.Derived1' - CALL 'public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null - receiver: GET_VAR ': foo.Derived1 declared in foo.Derived1.foo' type=foo.Derived1 origin=null - x: GET_VAR 'x: kotlin.String declared in foo.Derived1.foo' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:foo.Derived1, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 @@ -278,13 +192,17 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final]' type=foo.Base2 origin=null receiver: GET_VAR ': foo.Derived1 declared in foo.Derived1.bar' type=foo.Derived1 origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived1.bar' type=kotlin.String origin=null - ANONYMOUS_INITIALIZER isStatic=false + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived1, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base + $this: VALUE_PARAMETER name: type:foo.Derived1 + VALUE_PARAMETER name:x index:0 type:kotlin.String BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ - other: CONST String type=kotlin.String value=":Derived" + RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.Derived1' + CALL 'public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null + receiver: GET_VAR ': foo.Derived1 declared in foo.Derived1.foo' type=foo.Derived1 origin=null + x: GET_VAR 'x: kotlin.String declared in foo.Derived1.foo' type=kotlin.String 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 foo.Base @@ -306,27 +224,23 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[foo.Base; foo.Base2; foo.DerivedBase] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Derived2 + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null + FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ + other: CONST String type=kotlin.String value=":Derived" CONSTRUCTOR visibility:public <> () returnType:foo.Derived2 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[foo.Base; foo.Base2; foo.DerivedBase]' - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived2, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base - $this: VALUE_PARAMETER name: type:foo.Derived2 - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.Derived2' - CALL 'public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null - receiver: GET_VAR ': foo.Derived2 declared in foo.Derived2.foo' type=foo.Derived2 origin=null - x: GET_VAR 'x: kotlin.String declared in foo.Derived2.foo' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:foo.Derived2, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 @@ -338,13 +252,17 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final]' type=foo.Base2 origin=null receiver: GET_VAR ': foo.Derived2 declared in foo.Derived2.bar' type=foo.Derived2 origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived2.bar' type=kotlin.String origin=null - ANONYMOUS_INITIALIZER isStatic=false + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived2, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base + $this: VALUE_PARAMETER name: type:foo.Derived2 + VALUE_PARAMETER name:x index:0 type:kotlin.String BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ - other: CONST String type=kotlin.String value=":Derived" + RETURN type=kotlin.Nothing from='public open fun foo (x: kotlin.String): kotlin.String declared in foo.Derived2' + CALL 'public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null + receiver: GET_VAR ': foo.Derived2 declared in foo.Derived2.foo' type=foo.Derived2 origin=null + x: GET_VAR 'x: kotlin.String declared in foo.Derived2.foo' type=kotlin.String 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 foo.Base @@ -364,6 +282,68 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt public open fun toString (): kotlin.String declared in foo.Base2 public open fun toString (): kotlin.String declared in foo.DerivedBase $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:DerivedBase modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.DerivedBase + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ + other: CONST String type=kotlin.String value=":DerivedBase" + CONSTRUCTOR visibility:public <> () returnType:foo.DerivedBase [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedBase modality:OPEN visibility:public 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 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 + CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:foo.Base, x:kotlin.String) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:foo.Base + VALUE_PARAMETER name:x index:0 type:kotlin.String + CLASS INTERFACE name:Base2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.Base2 + 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: 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:bar visibility:public modality:ABSTRACT <> ($this:foo.Base2, x:kotlin.String) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:foo.Base2 + VALUE_PARAMETER name:x index:0 type:kotlin.String FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:d type:foo.Derived [var] @@ -374,3 +354,23 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt CONSTRUCTOR_CALL 'public constructor () declared in foo.Derived2' type=foo.Derived2 origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in foo' CONST String type=kotlin.String value="OK" + FUN name:newBase visibility:public modality:FINAL <> () returnType:foo.Base + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ + other: CONST String type=kotlin.String value=":newBase" + RETURN type=kotlin.Nothing from='public final fun newBase (): foo.Base declared in foo' + CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.BaseImpl' type=foo.BaseImpl origin=null + s: CONST String type=kotlin.String value="test" + FUN name:newBase2 visibility:public modality:FINAL <> () returnType:foo.Base2 + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=PLUSEQ + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.String declared in foo' type=kotlin.String origin=PLUSEQ + other: CONST String type=kotlin.String value=":newBase2" + RETURN type=kotlin.Nothing from='public final fun newBase2 (): foo.Base2 declared in foo' + CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in foo.Base2Impl' type=foo.Base2Impl origin=null + s: CONST String type=kotlin.String value="test" diff --git a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.kt.txt b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.kt.txt index ed79dc75b06..7839b5ef462 100644 --- a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.kt.txt +++ b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.kt.txt @@ -1,67 +1,149 @@ package foo -interface Base { - abstract fun foo(x: String): String +var global: String + field = "" + get + set -} +class Base2Impl : Base2 { + val s: String + field = s + get -class BaseImpl : Base { constructor(s: String) /* primary */ { super/*Any*/() /* () */ } + override fun bar(x: String): String { + return "Base2: " + .() + ":" + x + } + +} + +class BaseImpl : Base { val s: String field = s get + constructor(s: String) /* primary */ { + super/*Any*/() + /* () */ + + } + override fun foo(x: String): String { return "Base: " + .() + ":" + x } } +class Derived : DerivedBase, Base, Base2 { + private /* final field */ val $$delegate_0: Base = newBase() + private /* final field */ val $$delegate_1: Base2 = newBase2() + init { + { // BLOCK + ( = ().plus(other = ":Derived")) + } + } + + constructor() /* primary */ { + super/*DerivedBase*/() + /* () */ + + } + + override fun bar(x: String): String { + return .#$$delegate_1.bar(x = x) + } + + override fun foo(x: String): String { + return .#$$delegate_0.foo(x = x) + } + +} + +class Derived1 : DerivedBase, Base, Base2 { + private /* final field */ val $$delegate_0: Base = newBase() + private /* final field */ val $$delegate_1: Base2 = newBase2() + init { + { // BLOCK + ( = ().plus(other = ":Derived")) + } + } + + constructor() /* primary */ { + super/*DerivedBase*/() + /* () */ + + } + + override fun bar(x: String): String { + return .#$$delegate_1.bar(x = x) + } + + override fun foo(x: String): String { + return .#$$delegate_0.foo(x = x) + } + +} + +class Derived2 : DerivedBase, Base, Base2 { + private /* final field */ val $$delegate_0: Base = newBase() + private /* final field */ val $$delegate_1: Base2 = newBase2() + init { + { // BLOCK + ( = ().plus(other = ":Derived")) + } + } + + constructor() /* primary */ { + super/*DerivedBase*/() + /* () */ + + } + + override fun bar(x: String): String { + return .#$$delegate_1.bar(x = x) + } + + override fun foo(x: String): String { + return .#$$delegate_0.foo(x = x) + } + +} + +open class DerivedBase { + init { + { // BLOCK + ( = ().plus(other = ":DerivedBase")) + } + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface Base { + abstract fun foo(x: String): String + +} + interface Base2 { abstract fun bar(x: String): String } -class Base2Impl : Base2 { - constructor(s: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val s: String - field = s - get - - override fun bar(x: String): String { - return "Base2: " + .() + ":" + x - } - -} - -var global: String - field = "" - get - set - -open class DerivedBase { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - init { - { // BLOCK - ( = ().plus(other = ":DerivedBase")) - } - } - +fun box(): String { + var d: Derived = Derived() + var d1: Derived1 = Derived1() + var d2: Derived2 = Derived2() + return "OK" } fun newBase(): Base { @@ -78,84 +160,3 @@ fun newBase2(): Base2 { return Base2Impl(s = "test") } -class Derived : DerivedBase, Base, Base2 { - constructor() /* primary */ { - super/*DerivedBase*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Base = newBase() - override fun foo(x: String): String { - return .#$$delegate_0.foo(x = x) - } - - private /* final field */ val $$delegate_1: Base2 = newBase2() - override fun bar(x: String): String { - return .#$$delegate_1.bar(x = x) - } - - init { - { // BLOCK - ( = ().plus(other = ":Derived")) - } - } - -} - -class Derived1 : Base, DerivedBase, Base2 { - constructor() /* primary */ { - super/*DerivedBase*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Base = newBase() - override fun foo(x: String): String { - return .#$$delegate_0.foo(x = x) - } - - private /* final field */ val $$delegate_1: Base2 = newBase2() - override fun bar(x: String): String { - return .#$$delegate_1.bar(x = x) - } - - init { - { // BLOCK - ( = ().plus(other = ":Derived")) - } - } - -} - -class Derived2 : Base, Base2, DerivedBase { - constructor() /* primary */ { - super/*DerivedBase*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Base = newBase() - override fun foo(x: String): String { - return .#$$delegate_0.foo(x = x) - } - - private /* final field */ val $$delegate_1: Base2 = newBase2() - override fun bar(x: String): String { - return .#$$delegate_1.bar(x = x) - } - - init { - { // BLOCK - ( = ().plus(other = ":Derived")) - } - } - -} - -fun box(): String { - var d: Derived = Derived() - var d1: Derived1 = Derived1() - var d2: Derived2 = Derived2() - return "OK" -} diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.ir.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.ir.txt index 3736e521179..6dcabe9218d 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.ir.txt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.ir.txt @@ -18,13 +18,35 @@ FILE fqName: fileName:/delegatedProperties.kt $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' type=kotlin.Lazy origin=null thisRef: CONST Null type=kotlin.Nothing? value=null property: PROPERTY_REFERENCE 'public final test1: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] + FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun hashMapOf (): java.util.HashMap declared in kotlin.collections' type=java.util.HashMap origin=null + : kotlin.String + : kotlin.Any + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in ' + CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V1 of kotlin.collections.getValue declared in kotlin.collections' type=kotlin.Any origin=null + : kotlin.Any + : kotlin.Any + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null + thisRef: CONST Null type=kotlin.Nothing? value=null + property: PROPERTY_REFERENCE 'public final test4: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in ' setter='public final fun (: kotlin.Any): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] + VALUE_PARAMETER name: index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (: kotlin.Any): kotlin.Unit declared in ' + CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null + thisRef: CONST Null type=kotlin.Nothing? value=null + property: PROPERTY_REFERENCE 'public final test4: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in ' setter='public final fun (: kotlin.Any): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': kotlin.Any declared in .' type=kotlin.Any origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (map:kotlin.collections.MutableMap) returnType:.C [primary] - VALUE_PARAMETER name:map index:0 type:kotlin.collections.MutableMap - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:map visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.MutableMap visibility:private [final] EXPRESSION_BODY @@ -87,6 +109,11 @@ FILE fqName: fileName:/delegatedProperties.kt thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null property: PROPERTY_REFERENCE 'public final test3: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in .C' setter='public final fun (: kotlin.Any): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.Any declared in .C.' type=kotlin.Any origin=null + CONSTRUCTOR visibility:public <> (map:kotlin.collections.MutableMap) returnType:.C [primary] + VALUE_PARAMETER name:map index:0 type:kotlin.collections.MutableMap + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -100,30 +127,3 @@ FILE fqName: fileName:/delegatedProperties.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] - FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun hashMapOf (): java.util.HashMap declared in kotlin.collections' type=java.util.HashMap origin=null - : kotlin.String - : kotlin.Any - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in ' - CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V1 of kotlin.collections.getValue declared in kotlin.collections' type=kotlin.Any origin=null - : kotlin.Any - : kotlin.Any - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test4: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in ' setter='public final fun (: kotlin.Any): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] - VALUE_PARAMETER name: index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (: kotlin.Any): kotlin.Unit declared in ' - CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null - : kotlin.Any - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test4: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in ' setter='public final fun (: kotlin.Any): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Any declared in .' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.kt.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.kt.txt index 59dff52a6ac..026a20507ec 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.kt.txt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.kt.txt @@ -7,13 +7,16 @@ val test1: Int /* by */ return #test1$delegate.getValue(thisRef = null, property = ::test1) } -class C { - constructor(map: MutableMap) /* primary */ { - super/*Any*/() - /* () */ - +var test4: Any /* by */ + field = hashMapOf() + get(): Any { + return #test4$delegate.getValue(thisRef = null, property = ::test4) + } + set(: Any) { + return #test4$delegate.setValue(thisRef = null, property = ::test4, value = ) } +class C { val map: MutableMap field = map get @@ -36,13 +39,11 @@ class C { return .#test3$delegate.setValue(thisRef = , property = C::test3, value = ) } + constructor(map: MutableMap) /* primary */ { + super/*Any*/() + /* () */ + + } + } -var test4: Any /* by */ - field = hashMapOf() - get(): Any { - return #test4$delegate.getValue(thisRef = null, property = ::test4) - } - set(: Any) { - return #test4$delegate.setValue(thisRef = null, property = ::test4, value = ) - } diff --git a/compiler/testData/ir/irText/declarations/deprecatedProperty.ir.txt b/compiler/testData/ir/irText/declarations/deprecatedProperty.ir.txt index c0b695404df..e595e185065 100644 --- a/compiler/testData/ir/irText/declarations/deprecatedProperty.ir.txt +++ b/compiler/testData/ir/irText/declarations/deprecatedProperty.ir.txt @@ -38,14 +38,6 @@ FILE fqName: fileName:/deprecatedProperty.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testValWithExplicitDefaultGet type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null - PROPERTY name:testValWithExplicitGet visibility:public modality:FINAL [val] - annotations: - Deprecated(message = "", replaceWith = , level = ) - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:testValWithExplicitGet visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=1 PROPERTY name:testVarWithExplicitDefaultGet visibility:public modality:FINAL [var] annotations: Deprecated(message = "", replaceWith = , level = ) @@ -97,18 +89,6 @@ FILE fqName: fileName:/deprecatedProperty.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testVarWithExplicitDefaultGetSet type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - PROPERTY name:testVarWithExplicitGetSet visibility:public modality:FINAL [var] - annotations: - Deprecated(message = "", replaceWith = , level = ) - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:testVarWithExplicitGetSet visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=1 - FUN name: visibility:public modality:FINAL <> (v:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:testVarWithExplicitGetSet visibility:public modality:FINAL [var] - VALUE_PARAMETER name:v index:0 type:kotlin.Int - BLOCK_BODY PROPERTY name:testLateinitVar visibility:public modality:FINAL [lateinit,var] annotations: Deprecated(message = "", replaceWith = , level = ) @@ -133,6 +113,26 @@ FILE fqName: fileName:/deprecatedProperty.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' CONST Int type=kotlin.Int value=1 + PROPERTY name:testValWithExplicitGet visibility:public modality:FINAL [val] + annotations: + Deprecated(message = "", replaceWith = , level = ) + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:testValWithExplicitGet visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 + PROPERTY name:testVarWithExplicitGetSet visibility:public modality:FINAL [var] + annotations: + Deprecated(message = "", replaceWith = , level = ) + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:testVarWithExplicitGetSet visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 + FUN name: visibility:public modality:FINAL <> (v:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testVarWithExplicitGetSet visibility:public modality:FINAL [var] + VALUE_PARAMETER name:v index:0 type:kotlin.Int + BLOCK_BODY PROPERTY name:textExtVar visibility:public modality:FINAL [var] annotations: Deprecated(message = "", replaceWith = , level = ) diff --git a/compiler/testData/ir/irText/declarations/deprecatedProperty.kt.txt b/compiler/testData/ir/irText/declarations/deprecatedProperty.kt.txt index 114d54c0ceb..dc602815c99 100644 --- a/compiler/testData/ir/irText/declarations/deprecatedProperty.kt.txt +++ b/compiler/testData/ir/irText/declarations/deprecatedProperty.kt.txt @@ -14,12 +14,6 @@ val testValWithExplicitDefaultGet: Int field = 1 get -@Deprecated(message = "") -val testValWithExplicitGet: Int - get(): Int { - return 1 - } - @Deprecated(message = "") var testVarWithExplicitDefaultGet: Int field = 1 @@ -38,14 +32,6 @@ var testVarWithExplicitDefaultGetSet: Int get set -@Deprecated(message = "") -var testVarWithExplicitGetSet: Int - get(): Int { - return 1 - } - set(v: Int) { - } - @Deprecated(message = "") lateinit var testLateinitVar: Any get @@ -57,6 +43,20 @@ val Any.testExtVal: Int return 1 } +@Deprecated(message = "") +val testValWithExplicitGet: Int + get(): Int { + return 1 + } + +@Deprecated(message = "") +var testVarWithExplicitGetSet: Int + get(): Int { + return 1 + } + set(v: Int) { + } + @Deprecated(message = "") var Any.textExtVar: Int get(): Int { @@ -64,3 +64,4 @@ var Any.textExtVar: Int } set(v: Int) { } + diff --git a/compiler/testData/ir/irText/declarations/extensionProperties.ir.txt b/compiler/testData/ir/irText/declarations/extensionProperties.ir.txt index 821919da49b..e26678c2511 100644 --- a/compiler/testData/ir/irText/declarations/extensionProperties.ir.txt +++ b/compiler/testData/ir/irText/declarations/extensionProperties.ir.txt @@ -1,29 +1,23 @@ FILE fqName: fileName:/extensionProperties.kt - PROPERTY name:test1 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 - PROPERTY name:test2 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String, value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] - $receiver: VALUE_PARAMETER name: type:kotlin.String - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host CONSTRUCTOR visibility:public <> () returnType:.Host [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public 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 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 PROPERTY name:test3 visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL <> ($this:.Host, $receiver:kotlin.String) returnType:kotlin.Int correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] @@ -46,16 +40,22 @@ FILE fqName: fileName:/extensionProperties.kt $receiver: VALUE_PARAMETER name: type:kotlin.String VALUE_PARAMETER name:value index:0 type:kotlin.Int BLOCK_BODY - 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: 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 + PROPERTY name:test1 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Int + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + PROPERTY name:test2 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Int + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String, value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:kotlin.String + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/extensionProperties.kt.txt b/compiler/testData/ir/irText/declarations/extensionProperties.kt.txt index 77d8a28ff70..db5265c8ff8 100644 --- a/compiler/testData/ir/irText/declarations/extensionProperties.kt.txt +++ b/compiler/testData/ir/irText/declarations/extensionProperties.kt.txt @@ -1,15 +1,3 @@ -val String.test1: Int - get(): Int { - return 42 - } - -var String.test2: Int - get(): Int { - return 42 - } - set(value: Int) { - } - class Host { constructor() /* primary */ { super/*Any*/() @@ -30,3 +18,16 @@ class Host { } } + +val String.test1: Int + get(): Int { + return 42 + } + +var String.test2: Int + get(): Int { + return 42 + } + set(value: Int) { + } + diff --git a/compiler/testData/ir/irText/declarations/fakeOverrideModality.ir.txt b/compiler/testData/ir/irText/declarations/fakeOverrideModality.ir.txt index 98c733bd1a8..446a91f742a 100644 --- a/compiler/testData/ir/irText/declarations/fakeOverrideModality.ir.txt +++ b/compiler/testData/ir/irText/declarations/fakeOverrideModality.ir.txt @@ -1,4 +1,31 @@ FILE fqName: fileName:/fakeOverrideModality.kt + CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[.I; .J] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .J' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[.I; .J]' + 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 .I + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.J) returnType:.Child [fake_override] + overridden: + public abstract fun foo (): .Base declared in .I + public abstract fun foo (): .Child declared in .J + $this: VALUE_PARAMETER name: type:.J + 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 .I + public open fun hashCode (): kotlin.Int declared in .J + $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 .I + public open fun toString (): kotlin.String declared in .J + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base CONSTRUCTOR visibility:public <> () returnType:.Base [primary] @@ -37,31 +64,12 @@ FILE fqName: fileName:/fakeOverrideModality.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.I) returnType:.Base - $this: VALUE_PARAMETER name: type:.I - 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: 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 CLASS CLASS name:J modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.J CONSTRUCTOR visibility:public <> () returnType:.J [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:J modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.J) returnType:.Child - $this: VALUE_PARAMETER name: type:.J 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 @@ -75,30 +83,22 @@ FILE fqName: fileName:/fakeOverrideModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[.I; .J] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .J' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[.I; .J]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.J) returnType:.Child [fake_override] - overridden: - public abstract fun foo (): .Base declared in .I - public abstract fun foo (): .Child declared in .J + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.J) returnType:.Child $this: VALUE_PARAMETER name: type:.J + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I 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 .I - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .I - public open fun hashCode (): kotlin.Int declared in .J + 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 .I - public open fun toString (): kotlin.String declared in .J + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.I) returnType:.Base + $this: VALUE_PARAMETER name: type:.I diff --git a/compiler/testData/ir/irText/declarations/fakeOverrideModality.kt.txt b/compiler/testData/ir/irText/declarations/fakeOverrideModality.kt.txt index 8fc9d8b640a..e543036ab3f 100644 --- a/compiler/testData/ir/irText/declarations/fakeOverrideModality.kt.txt +++ b/compiler/testData/ir/irText/declarations/fakeOverrideModality.kt.txt @@ -1,3 +1,12 @@ +abstract class A : J, I { + constructor() /* primary */ { + super/*J*/() + /* () */ + + } + +} + open class Base { constructor() /* primary */ { super/*Any*/() @@ -16,11 +25,6 @@ class Child : Base { } -interface I { - abstract fun foo(): Base - -} - abstract class J { constructor() /* primary */ { super/*Any*/() @@ -32,11 +36,8 @@ abstract class J { } -abstract class A : I, J { - constructor() /* primary */ { - super/*J*/() - /* () */ - - } +interface I { + abstract fun foo(): Base } + diff --git a/compiler/testData/ir/irText/declarations/fakeOverrides.ir.txt b/compiler/testData/ir/irText/declarations/fakeOverrides.ir.txt index 8028988f24b..f2f6c76edc7 100644 --- a/compiler/testData/ir/irText/declarations/fakeOverrides.ir.txt +++ b/compiler/testData/ir/irText/declarations/fakeOverrides.ir.txt @@ -1,41 +1,4 @@ FILE fqName: fileName:/fakeOverrides.kt - CLASS INTERFACE name:IFooStr modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFooStr - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFooStr, x:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFooStr - VALUE_PARAMETER name:x index:0 type:kotlin.String - 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: 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 - CLASS INTERFACE name:IBar modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBar - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBar) returnType:kotlin.Int - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IBar - 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: 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 CLASS CLASS name:CFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CFoo.CFoo> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -43,10 +6,6 @@ FILE fqName: fileName:/fakeOverrides.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.CFoo.CFoo>, x:T of .CFoo) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.CFoo.CFoo> - VALUE_PARAMETER name:x index:0 type:T of .CFoo - BLOCK_BODY 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 @@ -60,13 +19,12 @@ FILE fqName: fileName:/fakeOverrides.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.CFoo.CFoo>, x:T of .CFoo) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.CFoo.CFoo> + VALUE_PARAMETER name:x index:0 type:T of .CFoo + BLOCK_BODY CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.CFoo; .IFooStr; .IBar] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 - CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .CFoo' - : kotlin.String - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.CFoo; .IFooStr; .IBar]' PROPERTY name:bar visibility:public modality:OPEN [val] overridden: public abstract bar: kotlin.Int @@ -82,12 +40,11 @@ FILE fqName: fileName:/fakeOverrides.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.CFoo, x:kotlin.String) returnType:kotlin.Unit [fake_override] - overridden: - public final fun foo (x: T of .CFoo): kotlin.Unit declared in .CFoo - public abstract fun foo (x: kotlin.String): kotlin.Unit declared in .IFooStr - $this: VALUE_PARAMETER name: type:.CFoo - VALUE_PARAMETER name:x index:0 type:kotlin.String + CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .CFoo' + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.CFoo; .IFooStr; .IBar]' 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 .CFoo @@ -95,6 +52,12 @@ FILE fqName: fileName:/fakeOverrides.kt public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IBar $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.CFoo, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: T of .CFoo): kotlin.Unit declared in .CFoo + public abstract fun foo (x: kotlin.String): kotlin.Unit declared in .IFooStr + $this: VALUE_PARAMETER name: type:.CFoo + VALUE_PARAMETER name:x index:0 type:kotlin.String 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 .CFoo @@ -107,3 +70,40 @@ FILE fqName: fileName:/fakeOverrides.kt public open fun toString (): kotlin.String declared in .IFooStr public open fun toString (): kotlin.String declared in .IBar $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IBar modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBar + 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: 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 + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBar) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.IBar + CLASS INTERFACE name:IFooStr modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFooStr + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.IFooStr, x:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFooStr + VALUE_PARAMETER name:x index:0 type:kotlin.String diff --git a/compiler/testData/ir/irText/declarations/fakeOverrides.kt.txt b/compiler/testData/ir/irText/declarations/fakeOverrides.kt.txt index 35a49aaa6e7..190b68247f1 100644 --- a/compiler/testData/ir/irText/declarations/fakeOverrides.kt.txt +++ b/compiler/testData/ir/irText/declarations/fakeOverrides.kt.txt @@ -1,14 +1,3 @@ -interface IFooStr { - abstract fun foo(x: String) - -} - -interface IBar { - abstract val bar: Int - abstract get - -} - abstract class CFoo { constructor() /* primary */ { super/*Any*/() @@ -21,15 +10,27 @@ abstract class CFoo { } -class Test1 : CFoo, IFooStr, IBar { +class Test1 : CFoo, IBar, IFooStr { + override val bar: Int + field = 42 + override get + constructor() /* primary */ { super/*CFoo*/() /* () */ } - override val bar: Int - field = 42 - override get +} + +interface IBar { + abstract val bar: Int + abstract get } + +interface IFooStr { + abstract fun foo(x: String) + +} + diff --git a/compiler/testData/ir/irText/declarations/fileWithAnnotations.ir.txt b/compiler/testData/ir/irText/declarations/fileWithAnnotations.ir.txt index 80febf66a35..54261124ea6 100644 --- a/compiler/testData/ir/irText/declarations/fileWithAnnotations.ir.txt +++ b/compiler/testData/ir/irText/declarations/fileWithAnnotations.ir.txt @@ -1,8 +1,6 @@ FILE fqName: fileName:/fileWithAnnotations.kt annotations: JvmName(name = "FileWithAnnotations") - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY PROPERTY name:bar visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final,static] EXPRESSION_BODY @@ -12,3 +10,5 @@ FILE fqName: fileName:/fileWithAnnotations.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/fileWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/fileWithAnnotations.kt.txt index 176873fa0da..4ed961757a5 100644 --- a/compiler/testData/ir/irText/declarations/fileWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/fileWithAnnotations.kt.txt @@ -1,8 +1,9 @@ @file:JvmName(name = "FileWithAnnotations") -fun foo() { -} - val bar: Int field = 42 get + +fun foo() { +} + diff --git a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.ir.txt b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.ir.txt index 6c6b5c8ea4d..459deac2fa7 100644 --- a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.ir.txt +++ b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.ir.txt @@ -1,56 +1,4 @@ FILE fqName: fileName:/genericDelegatedProperty.kt - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.C.C> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 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 - CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - CONSTRUCTOR visibility:private <> () returnType:.Delegate [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any?) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Delegate' - CONST Int type=kotlin.Int value=42 - FUN name:setValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any?, newValue:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? - VALUE_PARAMETER name:newValue index:2 type:kotlin.Int - BLOCK_BODY - 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: 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 PROPERTY name:genericDelegatedProperty visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:genericDelegatedProperty$delegate type:.Delegate visibility:private [final,static] EXPRESSION_BODY @@ -79,3 +27,55 @@ FILE fqName: fileName:/genericDelegatedProperty.kt kProp: PROPERTY_REFERENCE 'public final genericDelegatedProperty: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1<.C.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE <1>: T of . newValue: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.C.C> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 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 + CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate + CONSTRUCTOR visibility:private <> () returnType:.Delegate [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Delegate modality:FINAL visibility:public 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 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:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any?) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Delegate' + CONST Int type=kotlin.Int value=42 + FUN name:setValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any?, newValue:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? + VALUE_PARAMETER name:newValue index:2 type:kotlin.Int + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt.txt b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt.txt index 27b6bfe00a3..73eb65c1002 100644 --- a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt.txt +++ b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt.txt @@ -1,3 +1,12 @@ +var C.genericDelegatedProperty: Int /* by */ + field = Delegate + get(): Int { + return #genericDelegatedProperty$delegate.getValue(thisRef = , kProp = ::genericDelegatedProperty/*()*/) + } + set(: Int) { + return #genericDelegatedProperty$delegate.setValue(thisRef = , kProp = ::genericDelegatedProperty/*()*/, newValue = ) + } + class C { constructor() /* primary */ { super/*Any*/() @@ -23,11 +32,3 @@ object Delegate { } -var C.genericDelegatedProperty: Int /* by */ - field = Delegate - get(): Int { - return #genericDelegatedProperty$delegate.getValue(thisRef = , kProp = ::genericDelegatedProperty/*()*/) - } - set(: Int) { - return #genericDelegatedProperty$delegate.setValue(thisRef = , kProp = ::genericDelegatedProperty/*()*/, newValue = ) - } diff --git a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.ir.txt b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.ir.txt index e50b3453337..2326150e3ed 100644 --- a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.ir.txt +++ b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt CLASS CLASS name:IT modality:FINAL visibility:public [value] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IT - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.IT [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IT modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -17,27 +12,11 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .IT' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .IT declared in .IT.' type=.IT origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.IT) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.IT + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.IT [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .IT' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="IT(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .IT declared in .IT.toString' type=.IT origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.IT) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.IT - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .IT' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .IT declared in .IT.hashCode' type=.IT origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IT modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.IT, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -65,13 +44,29 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IT' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.IT) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.IT + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .IT' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .IT declared in .IT.hashCode' type=.IT origin=null + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.IT) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.IT + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .IT' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="IT(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .IT declared in .IT.toString' type=.IT origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [value] superTypes:[kotlin.collections.MutableSet<.IT>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.InlineMutableSet - CONSTRUCTOR visibility:public <> (ms:kotlin.collections.MutableSet<.IT>) returnType:.InlineMutableSet [primary] - VALUE_PARAMETER name:ms index:0 type:kotlin.collections.MutableSet<.IT> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [value] superTypes:[kotlin.collections.MutableSet<.IT>]' PROPERTY name:ms visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final] EXPRESSION_BODY @@ -83,19 +78,89 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.' type=.InlineMutableSet origin=null - PROPERTY name:size visibility:public modality:OPEN [val] + CONSTRUCTOR visibility:public <> (ms:kotlin.collections.MutableSet<.IT>) returnType:.InlineMutableSet [primary] + VALUE_PARAMETER name:ms index:0 type:kotlin.collections.MutableSet<.IT> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [value] superTypes:[kotlin.collections.MutableSet<.IT>]' + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.InlineMutableSet, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: - public abstract size: kotlin.Int - FUN name: visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.Int - correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .InlineMutableSet' - CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.MutableSet' type=kotlin.Int origin=GET_PROPERTY - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.' type=.InlineMutableSet origin=null + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.MutableSet + $this: VALUE_PARAMETER name: type:.InlineMutableSet + 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=.InlineMutableSet + GET_VAR 'other: kotlin.Any? declared in .InlineMutableSet.equals' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .InlineMutableSet' + CONST Boolean type=kotlin.Boolean value=false + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.InlineMutableSet [val] + TYPE_OP type=.InlineMutableSet origin=CAST typeOperand=.InlineMutableSet + GET_VAR 'other: kotlin.Any? declared in .InlineMutableSet.equals' type=kotlin.Any? origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean 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:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null + receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.equals' type=.InlineMutableSet origin=null + arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null + receiver: GET_VAR 'val tmp_1: .InlineMutableSet declared in .InlineMutableSet.equals' type=.InlineMutableSet origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .InlineMutableSet' + CONST Boolean type=kotlin.Boolean value=false + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .InlineMutableSet' + CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.collections.MutableSet + $this: VALUE_PARAMETER name: type:.InlineMutableSet + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .InlineMutableSet' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.collections.MutableSet' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null + receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.hashCode' type=.InlineMutableSet origin=null + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.collections.MutableSet + $this: VALUE_PARAMETER name: type:.InlineMutableSet + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .InlineMutableSet' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="InlineMutableSet(" + CONST String type=kotlin.String value="ms=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null + receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.toString' type=.InlineMutableSet origin=null + CONST String type=kotlin.String value=")" + FUN name:add visibility:public modality:OPEN <> ($this:.InlineMutableSet, element:.IT) returnType:kotlin.Boolean + overridden: + public abstract fun add (element: E of kotlin.collections.MutableSet): kotlin.Boolean declared in kotlin.collections.MutableSet + $this: VALUE_PARAMETER name: type:.InlineMutableSet + VALUE_PARAMETER name:element index:0 type:.IT + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun add (element: .IT): kotlin.Boolean declared in .InlineMutableSet' + CALL 'public abstract fun add (element: E of kotlin.collections.MutableSet): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null + $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY + $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.add' type=.InlineMutableSet origin=null + element: GET_VAR 'element: .IT declared in .InlineMutableSet.add' type=.IT origin=null + FUN name:addAll visibility:public modality:OPEN <> ($this:.InlineMutableSet, elements:kotlin.collections.Collection<.IT>) returnType:kotlin.Boolean + overridden: + public abstract fun addAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableSet + $this: VALUE_PARAMETER name: type:.InlineMutableSet + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.IT> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun addAll (elements: kotlin.collections.Collection<.IT>): kotlin.Boolean declared in .InlineMutableSet' + CALL 'public abstract fun addAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null + $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY + $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.addAll' type=.InlineMutableSet origin=null + elements: GET_VAR 'elements: kotlin.collections.Collection<.IT> declared in .InlineMutableSet.addAll' type=kotlin.collections.Collection<.IT> origin=null + FUN name:clear visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.Unit + overridden: + public abstract fun clear (): kotlin.Unit declared in kotlin.collections.MutableSet + $this: VALUE_PARAMETER name: type:.InlineMutableSet + BLOCK_BODY + CALL 'public abstract fun clear (): kotlin.Unit declared in kotlin.collections.MutableSet' type=kotlin.Unit origin=null + $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY + $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.clear' type=.InlineMutableSet origin=null FUN name:contains visibility:public modality:OPEN <> ($this:.InlineMutableSet, element:.IT) returnType:kotlin.Boolean [operator] overridden: public abstract fun contains (element: E of kotlin.collections.MutableSet): kotlin.Boolean declared in kotlin.collections.MutableSet @@ -127,36 +192,6 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt CALL 'public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.isEmpty' type=.InlineMutableSet origin=null - FUN name:add visibility:public modality:OPEN <> ($this:.InlineMutableSet, element:.IT) returnType:kotlin.Boolean - overridden: - public abstract fun add (element: E of kotlin.collections.MutableSet): kotlin.Boolean declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - VALUE_PARAMETER name:element index:0 type:.IT - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun add (element: .IT): kotlin.Boolean declared in .InlineMutableSet' - CALL 'public abstract fun add (element: E of kotlin.collections.MutableSet): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.add' type=.InlineMutableSet origin=null - element: GET_VAR 'element: .IT declared in .InlineMutableSet.add' type=.IT origin=null - FUN name:addAll visibility:public modality:OPEN <> ($this:.InlineMutableSet, elements:kotlin.collections.Collection<.IT>) returnType:kotlin.Boolean - overridden: - public abstract fun addAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.IT> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun addAll (elements: kotlin.collections.Collection<.IT>): kotlin.Boolean declared in .InlineMutableSet' - CALL 'public abstract fun addAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.addAll' type=.InlineMutableSet origin=null - elements: GET_VAR 'elements: kotlin.collections.Collection<.IT> declared in .InlineMutableSet.addAll' type=kotlin.collections.Collection<.IT> origin=null - FUN name:clear visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.Unit - overridden: - public abstract fun clear (): kotlin.Unit declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - BLOCK_BODY - CALL 'public abstract fun clear (): kotlin.Unit declared in kotlin.collections.MutableSet' type=kotlin.Unit origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.clear' type=.InlineMutableSet origin=null FUN name:iterator visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.collections.MutableIterator<.IT> [operator] overridden: public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableSet @@ -199,51 +234,16 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.retainAll' type=.InlineMutableSet origin=null elements: GET_VAR 'elements: kotlin.collections.Collection<.IT> declared in .InlineMutableSet.retainAll' type=kotlin.collections.Collection<.IT> origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.String + PROPERTY name:size visibility:public modality:OPEN [val] overridden: - public open fun toString (): kotlin.String declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .InlineMutableSet' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="InlineMutableSet(" - CONST String type=kotlin.String value="ms=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null - receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.toString' type=.InlineMutableSet origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .InlineMutableSet' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.collections.MutableSet' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null - receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.hashCode' type=.InlineMutableSet origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.InlineMutableSet, other:kotlin.Any?) returnType:kotlin.Boolean [operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - 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=.InlineMutableSet - GET_VAR 'other: kotlin.Any? declared in .InlineMutableSet.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .InlineMutableSet' - CONST Boolean type=kotlin.Boolean value=false - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.InlineMutableSet [val] - TYPE_OP type=.InlineMutableSet origin=CAST typeOperand=.InlineMutableSet - GET_VAR 'other: kotlin.Any? declared in .InlineMutableSet.equals' type=kotlin.Any? origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean 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:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null - receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.equals' type=.InlineMutableSet origin=null - arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null - receiver: GET_VAR 'val tmp_1: .InlineMutableSet declared in .InlineMutableSet.equals' type=.InlineMutableSet origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .InlineMutableSet' - CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .InlineMutableSet' - CONST Boolean type=kotlin.Boolean value=true + public abstract size: kotlin.Int + FUN name: visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.Int + correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in kotlin.collections.MutableSet + $this: VALUE_PARAMETER name: type:.InlineMutableSet + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .InlineMutableSet' + CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.MutableSet' type=kotlin.Int origin=GET_PROPERTY + $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY + $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.' type=.InlineMutableSet origin=null diff --git a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.kt.txt b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.kt.txt index 2d379c5a065..1fb4bae4b8b 100644 --- a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.kt.txt +++ b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.kt.txt @@ -1,20 +1,12 @@ value class IT { - constructor(x: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x get - override fun toString(): String { - return "IT(" + "x=" + .#x + ")" - } + constructor(x: Int) /* primary */ { + super/*Any*/() + /* () */ - override fun hashCode(): Int { - return .#x.hashCode() } override operator fun equals(other: Any?): Boolean { @@ -28,34 +20,44 @@ value class IT { return true } + override fun hashCode(): Int { + return .#x.hashCode() + } + + override fun toString(): String { + return "IT(" + "x=" + .#x + ")" + } + } value class InlineMutableSet : MutableSet { + private val ms: MutableSet + field = ms + private get + constructor(ms: MutableSet) /* primary */ { super/*Any*/() /* () */ } - private val ms: MutableSet - field = ms - private get - - override val size: Int - override get(): Int { - return .().() + override operator fun equals(other: Any?): Boolean { + when { + other !is InlineMutableSet -> return false } - - override operator fun contains(element: IT): Boolean { - return .().contains(element = element) + val tmp_1: InlineMutableSet = other as InlineMutableSet + when { + EQEQ(arg0 = .#ms, arg1 = tmp_1.#ms).not() -> return false + } + return true } - override fun containsAll(elements: Collection): Boolean { - return .().containsAll(elements = elements) + override fun hashCode(): Int { + return .#ms.hashCode() } - override fun isEmpty(): Boolean { - return .().isEmpty() + override fun toString(): String { + return "InlineMutableSet(" + "ms=" + .#ms + ")" } override fun add(element: IT): Boolean { @@ -70,6 +72,18 @@ value class InlineMutableSet : MutableSet { .().clear() } + override operator fun contains(element: IT): Boolean { + return .().contains(element = element) + } + + override fun containsAll(elements: Collection): Boolean { + return .().containsAll(elements = elements) + } + + override fun isEmpty(): Boolean { + return .().isEmpty() + } + override operator fun iterator(): MutableIterator { return .().iterator() } @@ -86,23 +100,10 @@ value class InlineMutableSet : MutableSet { return .().retainAll(elements = elements) } - override fun toString(): String { - return "InlineMutableSet(" + "ms=" + .#ms + ")" - } - - override fun hashCode(): Int { - return .#ms.hashCode() - } - - override operator fun equals(other: Any?): Boolean { - when { - other !is InlineMutableSet -> return false + override val size: Int + override get(): Int { + return .().() } - val tmp_1: InlineMutableSet = other as InlineMutableSet - when { - EQEQ(arg0 = .#ms, arg1 = tmp_1.#ms).not() -> return false - } - return true - } } + diff --git a/compiler/testData/ir/irText/declarations/interfaceProperties.ir.txt b/compiler/testData/ir/irText/declarations/interfaceProperties.ir.txt index 198d36f0945..8f897c5402f 100644 --- a/compiler/testData/ir/irText/declarations/interfaceProperties.ir.txt +++ b/compiler/testData/ir/irText/declarations/interfaceProperties.ir.txt @@ -1,6 +1,19 @@ FILE fqName: fileName:/interfaceProperties.kt CLASS INTERFACE name:C modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + 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: 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 PROPERTY name:test1 visibility:public modality:ABSTRACT [val] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.C) returnType:kotlin.Int correspondingProperty: PROPERTY name:test1 visibility:public modality:ABSTRACT [val] @@ -32,16 +45,3 @@ FILE fqName: fileName:/interfaceProperties.kt $this: VALUE_PARAMETER name: type:.C VALUE_PARAMETER name:value index:0 type:kotlin.Int BLOCK_BODY - 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: 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 diff --git a/compiler/testData/ir/irText/declarations/internalStdlibOverride.fir.ir.txt b/compiler/testData/ir/irText/declarations/internalStdlibOverride.fir.ir.txt deleted file mode 100644 index 6428ed3b08e..00000000000 --- a/compiler/testData/ir/irText/declarations/internalStdlibOverride.fir.ir.txt +++ /dev/null @@ -1,87 +0,0 @@ -FILE fqName: fileName:/internalStdlibOverride.kt - CLASS CLASS name:MyMap modality:FINAL visibility:public superTypes:[kotlin.collections.AbstractMap] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMap - CONSTRUCTOR visibility:public <> () returnType:.MyMap [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in kotlin.collections.AbstractMap' - : kotlin.Int - : kotlin.Int - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyMap modality:FINAL visibility:public superTypes:[kotlin.collections.AbstractMap]' - PROPERTY name:entries visibility:public modality:OPEN [val] - overridden: - public abstract entries: kotlin.collections.Set> - FIELD PROPERTY_BACKING_FIELD name:entries type:kotlin.collections.Set> visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun emptySet (): kotlin.collections.Set declared in kotlin.collections' type=kotlin.collections.Set> origin=null - : kotlin.collections.Map.Entry - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.MyMap) returnType:kotlin.collections.Set> - correspondingProperty: PROPERTY name:entries visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.collections.Set> declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:.MyMap - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Set> declared in .MyMap' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:entries type:kotlin.collections.Set> visibility:private [final]' type=kotlin.collections.Set> origin=null - receiver: GET_VAR ': .MyMap declared in .MyMap.' type=.MyMap origin=null - FUN name:containsEntry visibility:public modality:FINAL <> ($this:.MyMap, entry:kotlin.collections.Map.Entry<*, *>?) returnType:kotlin.Boolean - $this: VALUE_PARAMETER name: type:.MyMap - VALUE_PARAMETER name:entry index:0 type:kotlin.collections.Map.Entry<*, *>? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun containsEntry (entry: kotlin.collections.Map.Entry<*, *>?): kotlin.Boolean declared in .MyMap' - CONST Boolean type=kotlin.Boolean value=false - FUN FAKE_OVERRIDE name:containsKey visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap, key:kotlin.Int) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun containsKey (key: K of kotlin.collections.AbstractMap): kotlin.Boolean declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap - VALUE_PARAMETER name:key index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:containsValue visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap, value:kotlin.Int) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun containsValue (value: V of kotlin.collections.AbstractMap): kotlin.Boolean declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap - VALUE_PARAMETER name:value index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap, key:kotlin.Int) returnType:kotlin.Int? [fake_override,operator] - overridden: - public open fun get (key: K of kotlin.collections.AbstractMap): V of kotlin.collections.AbstractMap? declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap - VALUE_PARAMETER name:key index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun isEmpty (): kotlin.Boolean declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap - PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] - overridden: - public open keys: kotlin.collections.Set - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap) returnType:kotlin.collections.Set [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.Set declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.Int declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap - PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] - overridden: - public open values: kotlin.collections.Collection - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap) returnType:kotlin.collections.Collection [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.Collection declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap diff --git a/compiler/testData/ir/irText/declarations/internalStdlibOverride.fir.kt.txt b/compiler/testData/ir/irText/declarations/internalStdlibOverride.fir.kt.txt deleted file mode 100644 index 3d0c55dc414..00000000000 --- a/compiler/testData/ir/irText/declarations/internalStdlibOverride.fir.kt.txt +++ /dev/null @@ -1,16 +0,0 @@ -class MyMap : AbstractMap { - constructor() /* primary */ { - super/*AbstractMap*/() - /* () */ - - } - - override val entries: Set> - field = emptySet>() - override get - - fun containsEntry(entry: Entry<*, *>?): Boolean { - return false - } - -} diff --git a/compiler/testData/ir/irText/declarations/internalStdlibOverride.ir.txt b/compiler/testData/ir/irText/declarations/internalStdlibOverride.ir.txt index 33cb9324adb..05646788ef3 100644 --- a/compiler/testData/ir/irText/declarations/internalStdlibOverride.ir.txt +++ b/compiler/testData/ir/irText/declarations/internalStdlibOverride.ir.txt @@ -1,12 +1,6 @@ FILE fqName: fileName:/internalStdlibOverride.kt CLASS CLASS name:MyMap modality:FINAL visibility:public superTypes:[kotlin.collections.AbstractMap] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMap - CONSTRUCTOR visibility:public <> () returnType:.MyMap [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in kotlin.collections.AbstractMap' - : kotlin.Int - : kotlin.Int - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyMap modality:FINAL visibility:public superTypes:[kotlin.collections.AbstractMap]' PROPERTY name:entries visibility:public modality:OPEN [val] overridden: public abstract entries: kotlin.collections.Set> @@ -23,36 +17,12 @@ FILE fqName: fileName:/internalStdlibOverride.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Set> declared in .MyMap' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:entries type:kotlin.collections.Set> visibility:private [final]' type=kotlin.collections.Set> origin=null receiver: GET_VAR ': .MyMap declared in .MyMap.' type=.MyMap origin=null - FUN name:containsEntry visibility:public modality:FINAL <> ($this:.MyMap, entry:kotlin.collections.Map.Entry<*, *>?) returnType:kotlin.Boolean - $this: VALUE_PARAMETER name: type:.MyMap - VALUE_PARAMETER name:entry index:0 type:kotlin.collections.Map.Entry<*, *>? + CONSTRUCTOR visibility:public <> () returnType:.MyMap [primary] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun containsEntry (entry: kotlin.collections.Map.Entry<*, *>?): kotlin.Boolean declared in .MyMap' - CONST Boolean type=kotlin.Boolean value=false - PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] - overridden: - public open keys: kotlin.collections.Set - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap) returnType:kotlin.collections.Set [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.Set declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.Int declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap - PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] - overridden: - public open values: kotlin.collections.Collection - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap) returnType:kotlin.collections.Collection [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.Collection declared in kotlin.collections.AbstractMap - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in kotlin.collections.AbstractMap' + : kotlin.Int + : kotlin.Int + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyMap modality:FINAL visibility:public superTypes:[kotlin.collections.AbstractMap]' FUN FAKE_OVERRIDE name:containsKey visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap, key:kotlin.Int) returnType:kotlin.Boolean [fake_override] overridden: public open fun containsKey (key: K of kotlin.collections.AbstractMap): kotlin.Boolean declared in kotlin.collections.AbstractMap @@ -85,3 +55,33 @@ FILE fqName: fileName:/internalStdlibOverride.kt overridden: public open fun toString (): kotlin.String declared in kotlin.collections.AbstractMap $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap + FUN name:containsEntry visibility:public modality:FINAL <> ($this:.MyMap, entry:kotlin.collections.Map.Entry<*, *>?) returnType:kotlin.Boolean + $this: VALUE_PARAMETER name: type:.MyMap + VALUE_PARAMETER name:entry index:0 type:kotlin.collections.Map.Entry<*, *>? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun containsEntry (entry: kotlin.collections.Map.Entry<*, *>?): kotlin.Boolean declared in .MyMap' + CONST Boolean type=kotlin.Boolean value=false + PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] + overridden: + public open keys: kotlin.collections.Set + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap) returnType:kotlin.collections.Set [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.collections.Set declared in kotlin.collections.AbstractMap + $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.Int declared in kotlin.collections.AbstractMap + $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap + PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] + overridden: + public open values: kotlin.collections.Collection + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractMap) returnType:kotlin.collections.Collection [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.collections.Collection declared in kotlin.collections.AbstractMap + $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractMap diff --git a/compiler/testData/ir/irText/declarations/internalStdlibOverride.kt b/compiler/testData/ir/irText/declarations/internalStdlibOverride.kt index 9adace5b61e..ab291492306 100644 --- a/compiler/testData/ir/irText/declarations/internalStdlibOverride.kt +++ b/compiler/testData/ir/irText/declarations/internalStdlibOverride.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB // ENABLE_IR_FAKE_OVERRIDE_GENERATION // KT-64692 diff --git a/compiler/testData/ir/irText/declarations/internalStdlibOverride.kt.txt b/compiler/testData/ir/irText/declarations/internalStdlibOverride.kt.txt index 3d0c55dc414..270b683e07f 100644 --- a/compiler/testData/ir/irText/declarations/internalStdlibOverride.kt.txt +++ b/compiler/testData/ir/irText/declarations/internalStdlibOverride.kt.txt @@ -1,16 +1,17 @@ class MyMap : AbstractMap { + override val entries: Set> + field = emptySet>() + override get + constructor() /* primary */ { super/*AbstractMap*/() /* () */ } - override val entries: Set> - field = emptySet>() - override get - fun containsEntry(entry: Entry<*, *>?): Boolean { return false } } + diff --git a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.ir.txt b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.ir.txt index 7de3701e048..feabf957a82 100644 --- a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.ir.txt @@ -3,11 +3,6 @@ FILE fqName: fileName:/dataClassWithJvmRecord.kt annotations: JvmRecord $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyRec - CONSTRUCTOR visibility:public <> (name:kotlin.String) returnType:.MyRec [primary] - VALUE_PARAMETER name:name index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected/*protected and package*/ constructor () declared in java.lang.Record' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyRec modality:FINAL visibility:public [data] superTypes:[java.lang.Record]' PROPERTY name:name visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -19,6 +14,11 @@ FILE fqName: fileName:/dataClassWithJvmRecord.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .MyRec' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .MyRec declared in .MyRec.' type=.MyRec origin=null + CONSTRUCTOR visibility:public <> (name:kotlin.String) returnType:.MyRec [primary] + VALUE_PARAMETER name:name index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected/*protected and package*/ constructor () declared in java.lang.Record' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyRec modality:FINAL visibility:public [data] superTypes:[java.lang.Record]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.MyRec) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.MyRec BLOCK_BODY @@ -35,27 +35,6 @@ FILE fqName: fileName:/dataClassWithJvmRecord.kt RETURN type=kotlin.Nothing from='public final fun copy (name: kotlin.String): .MyRec declared in .MyRec' CONSTRUCTOR_CALL 'public constructor (name: kotlin.String) declared in .MyRec' type=.MyRec origin=null name: GET_VAR 'name: kotlin.String declared in .MyRec.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyRec) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.MyRec - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyRec' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="MyRec(" - CONST String type=kotlin.String value="name=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .MyRec declared in .MyRec.toString' type=.MyRec origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyRec) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.MyRec - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyRec' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .MyRec declared in .MyRec.hashCode' type=.MyRec origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.MyRec, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -90,6 +69,27 @@ FILE fqName: fileName:/dataClassWithJvmRecord.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyRec' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyRec) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.MyRec + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyRec' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .MyRec declared in .MyRec.hashCode' type=.MyRec origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyRec) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.MyRec + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyRec' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="MyRec(" + CONST String type=kotlin.String value="name=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .MyRec declared in .MyRec.toString' type=.MyRec origin=null + CONST String type=kotlin.String value=")" FUN name:test visibility:public modality:FINAL <> (rec:.MyRec) returnType:kotlin.Unit VALUE_PARAMETER name:rec index:0 type:.MyRec BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.kt.txt b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.kt.txt index 4fc5ca2a3fb..3af9b5a6d7f 100644 --- a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.kt.txt @@ -1,15 +1,15 @@ @JvmRecord data class MyRec : Record { + val name: String + field = name + get + constructor(name: String) /* primary */ { super/*Record*/() /* () */ } - val name: String - field = name - get - operator fun component1(): String { return .#name } @@ -18,14 +18,6 @@ data class MyRec : Record { return MyRec(name = name) } - override fun toString(): String { - return "MyRec(" + "name=" + .#name + ")" - } - - override fun hashCode(): Int { - return .#name.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -40,6 +32,14 @@ data class MyRec : Record { return true } + override fun hashCode(): Int { + return .#name.hashCode() + } + + override fun toString(): String { + return "MyRec(" + "name=" + .#name + ")" + } + } fun test(rec: MyRec) { diff --git a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.ir.txt b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.ir.txt index 218ee18dc96..597fdc883b6 100644 --- a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.ir.txt +++ b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.ir.txt @@ -3,11 +3,6 @@ FILE fqName: fileName:/dataClassWithJvmRecord.kt annotations: JvmRecord $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyRec - CONSTRUCTOR visibility:public <> (name:kotlin.String) returnType:.MyRec [primary] - VALUE_PARAMETER name:name index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected/*protected and package*/ constructor () declared in java.lang.Record' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyRec modality:FINAL visibility:public [data] superTypes:[java.lang.Record]' PROPERTY name:name visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -19,6 +14,11 @@ FILE fqName: fileName:/dataClassWithJvmRecord.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .MyRec' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .MyRec declared in .MyRec.' type=.MyRec origin=null + CONSTRUCTOR visibility:public <> (name:kotlin.String) returnType:.MyRec [primary] + VALUE_PARAMETER name:name index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected/*protected and package*/ constructor () declared in java.lang.Record' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyRec modality:FINAL visibility:public [data] superTypes:[java.lang.Record]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.MyRec) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.MyRec BLOCK_BODY @@ -35,27 +35,6 @@ FILE fqName: fileName:/dataClassWithJvmRecord.kt RETURN type=kotlin.Nothing from='public final fun copy (name: kotlin.String): .MyRec declared in .MyRec' CONSTRUCTOR_CALL 'public constructor (name: kotlin.String) declared in .MyRec' type=.MyRec origin=null name: GET_VAR 'name: kotlin.String declared in .MyRec.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyRec) returnType:kotlin.String - overridden: - public abstract fun toString (): @[EnhancedNullability] kotlin.String declared in java.lang.Record - $this: VALUE_PARAMETER name: type:.MyRec - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyRec' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="MyRec(" - CONST String type=kotlin.String value="name=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .MyRec declared in .MyRec.toString' type=.MyRec origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyRec) returnType:kotlin.Int - overridden: - public abstract fun hashCode (): kotlin.Int declared in java.lang.Record - $this: VALUE_PARAMETER name: type:.MyRec - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyRec' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .MyRec declared in .MyRec.hashCode' type=.MyRec origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.MyRec, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public abstract fun equals (other: @[EnhancedNullability] kotlin.Any?): kotlin.Boolean declared in java.lang.Record @@ -90,6 +69,27 @@ FILE fqName: fileName:/dataClassWithJvmRecord.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyRec' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyRec) returnType:kotlin.Int + overridden: + public abstract fun hashCode (): kotlin.Int declared in java.lang.Record + $this: VALUE_PARAMETER name: type:.MyRec + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyRec' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .MyRec declared in .MyRec.hashCode' type=.MyRec origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyRec) returnType:kotlin.String + overridden: + public abstract fun toString (): @[EnhancedNullability] kotlin.String declared in java.lang.Record + $this: VALUE_PARAMETER name: type:.MyRec + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyRec' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="MyRec(" + CONST String type=kotlin.String value="name=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .MyRec declared in .MyRec.toString' type=.MyRec origin=null + CONST String type=kotlin.String value=")" FUN name:test visibility:public modality:FINAL <> (rec:.MyRec) returnType:kotlin.Unit VALUE_PARAMETER name:rec index:0 type:.MyRec BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.kt.txt b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.kt.txt index 7c7c05a5ce5..3af9b5a6d7f 100644 --- a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.kt.txt +++ b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.kt.txt @@ -1,15 +1,15 @@ @JvmRecord data class MyRec : Record { + val name: String + field = name + get + constructor(name: String) /* primary */ { super/*Record*/() /* () */ } - val name: String - field = name - get - operator fun component1(): String { return .#name } @@ -18,14 +18,6 @@ data class MyRec : Record { return MyRec(name = name) } - override fun toString(): String { - return "MyRec(" + "name=" + .#name + ")" - } - - override fun hashCode(): Int { - return .#name.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -40,8 +32,17 @@ data class MyRec : Record { return true } + override fun hashCode(): Int { + return .#name.hashCode() + } + + override fun toString(): String { + return "MyRec(" + "name=" + .#name + ")" + } + } fun test(rec: MyRec) { rec.() /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/declarations/kt27005.ir.txt b/compiler/testData/ir/irText/declarations/kt27005.ir.txt index 185d86e988f..08622c1b899 100644 --- a/compiler/testData/ir/irText/declarations/kt27005.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt27005.ir.txt @@ -1,9 +1,4 @@ FILE fqName: fileName:/kt27005.kt - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit [suspend] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Unit declared in ' - CALL 'public final fun baz (): T of .baz declared in ' type=kotlin.Unit origin=null - : kotlin.Unit FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Any [suspend] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Any declared in ' @@ -13,3 +8,8 @@ FILE fqName: fileName:/kt27005.kt TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false BLOCK_BODY CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Unit declared in ' + CALL 'public final fun baz (): T of .baz declared in ' type=kotlin.Unit origin=null + : kotlin.Unit diff --git a/compiler/testData/ir/irText/declarations/kt27005.kt.txt b/compiler/testData/ir/irText/declarations/kt27005.kt.txt index 935498675a2..859748b088b 100644 --- a/compiler/testData/ir/irText/declarations/kt27005.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt27005.kt.txt @@ -1,7 +1,3 @@ -suspend fun foo() { - return baz() -} - suspend fun bar(): Any { return baz() } @@ -9,3 +5,8 @@ suspend fun bar(): Any { suspend fun baz(): T { TODO() } + +suspend fun foo() { + return baz() +} + diff --git a/compiler/testData/ir/irText/declarations/kt29833.fir.ir.txt b/compiler/testData/ir/irText/declarations/kt29833.fir.ir.txt index c8dd32c716d..7d92c174cf1 100644 --- a/compiler/testData/ir/irText/declarations/kt29833.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt29833.fir.ir.txt @@ -1,21 +1,6 @@ FILE fqName:interop fileName:/Definitions.kt CLASS OBJECT name:Definitions modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:interop.Definitions - CONSTRUCTOR visibility:private <> () returnType:interop.Definitions [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Definitions modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] - FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:kotlin.String visibility:public [final] - EXPRESSION_BODY - CONST String type=kotlin.String value="constant" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:interop.Definitions) returnType:kotlin.String - correspondingProperty: PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] - $this: VALUE_PARAMETER name: type:interop.Definitions - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in interop.Definitions' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:kotlin.String visibility:public [final]' type=kotlin.String origin=null - receiver: GET_VAR ': interop.Definitions declared in interop.Definitions.' type=interop.Definitions origin=null PROPERTY name:ktValue visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ktValue type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -27,6 +12,10 @@ FILE fqName:interop fileName:/Definitions.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in interop.Definitions' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ktValue type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': interop.Definitions declared in interop.Definitions.' type=interop.Definitions origin=null + CONSTRUCTOR visibility:private <> () returnType:interop.Definitions [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Definitions modality:FINAL visibility:public 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 declared in kotlin.Any @@ -40,3 +29,14 @@ FILE fqName:interop fileName:/Definitions.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:kotlin.String visibility:public [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="constant" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:interop.Definitions) returnType:kotlin.String + correspondingProperty: PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] + $this: VALUE_PARAMETER name: type:interop.Definitions + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in interop.Definitions' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:kotlin.String visibility:public [final]' type=kotlin.String origin=null + receiver: GET_VAR ': interop.Definitions declared in interop.Definitions.' type=interop.Definitions origin=null diff --git a/compiler/testData/ir/irText/declarations/kt29833.fir.kt.txt b/compiler/testData/ir/irText/declarations/kt29833.fir.kt.txt index fff97c14f7e..51fe4195de8 100644 --- a/compiler/testData/ir/irText/declarations/kt29833.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt29833.fir.kt.txt @@ -1,6 +1,10 @@ package interop object Definitions { + val ktValue: String + field = #CONSTANT + get + private constructor() /* primary */ { super/*Any*/() /* () */ @@ -11,9 +15,5 @@ object Definitions { field = "constant" get - val ktValue: String - field = #CONSTANT - get - } diff --git a/compiler/testData/ir/irText/declarations/kt29833.ir.txt b/compiler/testData/ir/irText/declarations/kt29833.ir.txt index 455bf87faa0..49834e5c31c 100644 --- a/compiler/testData/ir/irText/declarations/kt29833.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt29833.ir.txt @@ -1,21 +1,6 @@ FILE fqName:interop fileName:/Definitions.kt CLASS OBJECT name:Definitions modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:interop.Definitions - CONSTRUCTOR visibility:private <> () returnType:interop.Definitions [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Definitions modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] - FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:kotlin.String visibility:public [final] - EXPRESSION_BODY - CONST String type=kotlin.String value="constant" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:interop.Definitions) returnType:kotlin.String - correspondingProperty: PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] - $this: VALUE_PARAMETER name: type:interop.Definitions - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in interop.Definitions' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:kotlin.String visibility:public [final]' type=kotlin.String origin=null - receiver: GET_VAR ': interop.Definitions declared in interop.Definitions.' type=interop.Definitions origin=null PROPERTY name:ktValue visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ktValue type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -27,6 +12,10 @@ FILE fqName:interop fileName:/Definitions.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in interop.Definitions' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ktValue type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': interop.Definitions declared in interop.Definitions.' type=interop.Definitions origin=null + CONSTRUCTOR visibility:private <> () returnType:interop.Definitions [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Definitions modality:FINAL visibility:public 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 declared in kotlin.Any @@ -40,3 +29,14 @@ FILE fqName:interop fileName:/Definitions.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:kotlin.String visibility:public [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="constant" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:interop.Definitions) returnType:kotlin.String + correspondingProperty: PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] + $this: VALUE_PARAMETER name: type:interop.Definitions + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in interop.Definitions' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:kotlin.String visibility:public [final]' type=kotlin.String origin=null + receiver: GET_VAR ': interop.Definitions declared in interop.Definitions.' type=interop.Definitions origin=null diff --git a/compiler/testData/ir/irText/declarations/kt29833.kt.txt b/compiler/testData/ir/irText/declarations/kt29833.kt.txt index dcfc5bc963f..43419d1ec17 100644 --- a/compiler/testData/ir/irText/declarations/kt29833.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt29833.kt.txt @@ -1,6 +1,10 @@ package interop object Definitions { + val ktValue: String + field = "constant" + get + private constructor() /* primary */ { super/*Any*/() /* () */ @@ -11,9 +15,5 @@ object Definitions { field = "constant" get - val ktValue: String - field = "constant" - get - } diff --git a/compiler/testData/ir/irText/declarations/kt35550.ir.txt b/compiler/testData/ir/irText/declarations/kt35550.ir.txt index 47dfcf77943..7b389d3661b 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt35550.ir.txt @@ -1,38 +1,27 @@ FILE fqName: fileName:/kt35550.kt - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I - PROPERTY name:id visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN ($this:.I, $receiver:T of .I.) returnType:T of .I. - correspondingProperty: PROPERTY name:id visibility:public modality:OPEN [val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.I - $receiver: VALUE_PARAMETER name: type:T of .I. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): T of .I. declared in .I' - GET_VAR ': T of .I. declared in .I.' type=T of .I. 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: 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 CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + FIELD DELEGATE name:$$delegate_0 type:.I visibility:private [final] + EXPRESSION_BODY + GET_VAR 'i: .I declared in .A.' type=.I origin=null CONSTRUCTOR visibility:public <> (i:.I) returnType:.A [primary] VALUE_PARAMETER name:i index:0 type:.I BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I]' - FIELD DELEGATE name:$$delegate_0 type:.I visibility:private [final] - EXPRESSION_BODY - GET_VAR 'i: .I declared in .A.' type=.I 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 .I + $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 .I + $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 .I + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] overridden: public open id: T of .I. @@ -50,16 +39,27 @@ FILE fqName: fileName:/kt35550.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.I visibility:private [final]' type=.I origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null $receiver: GET_VAR ': T of .A. declared in .A.' type=T of .A. origin=null + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I 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 .I + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .I + 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 .I + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:id visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN ($this:.I, $receiver:T of .I.) returnType:T of .I. + correspondingProperty: PROPERTY name:id visibility:public modality:OPEN [val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.I + $receiver: VALUE_PARAMETER name: type:T of .I. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): T of .I. declared in .I' + GET_VAR ': T of .I. declared in .I.' type=T of .I. origin=null diff --git a/compiler/testData/ir/irText/declarations/kt35550.kt.txt b/compiler/testData/ir/irText/declarations/kt35550.kt.txt index 53a0d3d66f3..1ff0899999c 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt35550.kt.txt @@ -1,3 +1,18 @@ +class A : I { + private /* final field */ val $$delegate_0: I = i + constructor(i: I) /* primary */ { + super/*Any*/() + /* () */ + + } + + override val T.id: T + override get(): T { + return (.#$$delegate_0, ).() + } + +} + interface I { val T.id: T get(): T { @@ -6,17 +21,3 @@ interface I { } -class A : I { - constructor(i: I) /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: I = i - override val T.id: T - override get(): T { - return (.#$$delegate_0, ).() - } - -} diff --git a/compiler/testData/ir/irText/declarations/kt47527.fir.ir.txt b/compiler/testData/ir/irText/declarations/kt47527.fir.ir.txt index 44b527cef9a..7dfeef85bb3 100644 --- a/compiler/testData/ir/irText/declarations/kt47527.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt47527.fir.ir.txt @@ -1,15 +1,55 @@ FILE fqName: fileName:/kt47527.kt + 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 declared in .box' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: GET_VAR 'var result: kotlin.String declared in .box' type=kotlin.String origin=null + other: BLOCK type=kotlin.String origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_0 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_0: kotlin.String? 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_0: kotlin.String? declared in .box' type=kotlin.String? origin=null + SET_VAR 'var result: kotlin.String declared in .box' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: GET_VAR 'var result: kotlin.String declared in .box' type=kotlin.String origin=null + other: BLOCK type=kotlin.String origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_1 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_1: kotlin.String? 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_1: kotlin.String? 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 declared in .box' type=kotlin.String origin=null 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] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 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? declared in .test_1' type=kotlin.Any? origin=null + arg0: GET_VAR 'val tmp_2: kotlin.Any? 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 @@ -17,7 +57,7 @@ FILE fqName: fileName:/kt47527.kt then: CALL 'public final fun let (block: kotlin.Function1): R of kotlin.let declared in kotlin' type=kotlin.Nothing origin=null : kotlin.Any : kotlin.Nothing - $receiver: GET_VAR 'val tmp_0: kotlin.Any? declared in .test_1' type=kotlin.Any? origin=null + $receiver: GET_VAR 'val tmp_2: kotlin.Any? 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 @@ -35,12 +75,12 @@ FILE fqName: fileName:/kt47527.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.String? declared in .test_2' BLOCK type=kotlin.Nothing? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_3 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? declared in .test_2.' type=kotlin.Any? origin=null + arg0: GET_VAR 'val tmp_3: kotlin.Any? 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 @@ -48,50 +88,10 @@ FILE fqName: fileName:/kt47527.kt then: CALL 'public final fun let (block: kotlin.Function1): R of kotlin.let declared in kotlin' type=kotlin.Nothing origin=null : kotlin.Any : kotlin.Nothing - $receiver: GET_VAR 'val tmp_1: kotlin.Any? declared in .test_2.' type=kotlin.Any? origin=null + $receiver: GET_VAR 'val tmp_3: kotlin.Any? 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 declared in .box' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null - $this: GET_VAR 'var result: kotlin.String 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=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? 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? declared in .box' type=kotlin.String? origin=null - SET_VAR 'var result: kotlin.String declared in .box' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null - $this: GET_VAR 'var result: kotlin.String 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=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? 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? 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 declared in .box' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/declarations/kt47527.fir.kt.txt b/compiler/testData/ir/irText/declarations/kt47527.fir.kt.txt index eadc8c65adb..50780ef6d80 100644 --- a/compiler/testData/ir/irText/declarations/kt47527.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt47527.fir.kt.txt @@ -1,9 +1,28 @@ +fun box(): String { + var result: String = "" + result = result.plus(other = { // BLOCK + val tmp_0: String? = test_1(value = 1) + when { + EQEQ(arg0 = tmp_0, arg1 = null) -> return "fail 1" + else -> tmp_0 + } + }) + result = result.plus(other = { // BLOCK + val tmp_1: String? = test_2(value = 1) + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> return "fail 2" + else -> tmp_1 + } + }) + return result +} + fun test_1(value: Any?): String? { return { // BLOCK - val tmp_0: Any? = value + val tmp_2: Any? = value when { - EQEQ(arg0 = tmp_0, arg1 = null) -> null - else -> tmp_0.let(block = local fun (it: Any): Nothing { + EQEQ(arg0 = tmp_2, arg1 = null) -> null + else -> tmp_2.let(block = local fun (it: Any): Nothing { return "O" } ) @@ -14,10 +33,10 @@ fun test_1(value: Any?): String? { fun test_2(value: Any?): String? { return run(block = local fun (): String? { return { // BLOCK - val tmp_1: Any? = value + val tmp_3: Any? = value when { - EQEQ(arg0 = tmp_1, arg1 = null) -> null - else -> tmp_1.let(block = local fun (it: Any): Nothing { + EQEQ(arg0 = tmp_3, arg1 = null) -> null + else -> tmp_3.let(block = local fun (it: Any): Nothing { return "K" } ) @@ -27,21 +46,3 @@ fun test_2(value: Any?): String? { ) } -fun box(): String { - var result: String = "" - result = result.plus(other = { // BLOCK - val tmp_2: String? = test_1(value = 1) - when { - EQEQ(arg0 = tmp_2, arg1 = null) -> return "fail 1" - else -> tmp_2 - } - }) - result = result.plus(other = { // BLOCK - val tmp_3: String? = test_2(value = 1) - when { - EQEQ(arg0 = tmp_3, arg1 = null) -> return "fail 2" - else -> tmp_3 - } - }) - return result -} diff --git a/compiler/testData/ir/irText/declarations/kt47527.ir.txt b/compiler/testData/ir/irText/declarations/kt47527.ir.txt index fdea4228c02..2aee75de1e5 100644 --- a/compiler/testData/ir/irText/declarations/kt47527.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt47527.ir.txt @@ -1,15 +1,55 @@ FILE fqName: fileName:/kt47527.kt + 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 declared in .box' type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: GET_VAR 'var result: kotlin.String declared in .box' type=kotlin.String origin=PLUSEQ + other: BLOCK type=kotlin.String origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_0 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_0: kotlin.String? 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_0: kotlin.String? declared in .box' type=kotlin.String? origin=null + SET_VAR 'var result: kotlin.String declared in .box' type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: GET_VAR 'var result: kotlin.String declared in .box' type=kotlin.String origin=PLUSEQ + other: BLOCK type=kotlin.String origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_1 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_1: kotlin.String? 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_1: kotlin.String? 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 declared in .box' type=kotlin.String origin=null 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] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 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? declared in .test_1' type=kotlin.Any? origin=null + arg0: GET_VAR 'val tmp_2: kotlin.Any? 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 @@ -17,7 +57,7 @@ FILE fqName: fileName:/kt47527.kt then: CALL 'public final fun let (block: kotlin.Function1): R of kotlin.let declared in kotlin' type=kotlin.Nothing origin=null : kotlin.Any : kotlin.Nothing - $receiver: GET_VAR 'val tmp_0: kotlin.Any? declared in .test_1' type=kotlin.Any? origin=null + $receiver: GET_VAR 'val tmp_2: kotlin.Any? 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 @@ -35,12 +75,12 @@ FILE fqName: fileName:/kt47527.kt 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] + VAR IR_TEMPORARY_VARIABLE name:tmp_3 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? declared in .test_2.' type=kotlin.Any? origin=null + arg0: GET_VAR 'val tmp_3: kotlin.Any? 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 @@ -48,50 +88,10 @@ FILE fqName: fileName:/kt47527.kt then: CALL 'public final fun let (block: kotlin.Function1): R of kotlin.let declared in kotlin' type=kotlin.Nothing origin=null : kotlin.Any : kotlin.Nothing - $receiver: GET_VAR 'val tmp_1: kotlin.Any? declared in .test_2.' type=kotlin.Any? origin=null + $receiver: GET_VAR 'val tmp_3: kotlin.Any? 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 declared in .box' type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ - $this: GET_VAR 'var result: kotlin.String 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? 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? declared in .box' type=kotlin.String? origin=null - SET_VAR 'var result: kotlin.String declared in .box' type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ - $this: GET_VAR 'var result: kotlin.String 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? 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? 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 declared in .box' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/declarations/kt47527.kt.txt b/compiler/testData/ir/irText/declarations/kt47527.kt.txt index 42df742bc06..f3d98d73c12 100644 --- a/compiler/testData/ir/irText/declarations/kt47527.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt47527.kt.txt @@ -1,9 +1,28 @@ +fun box(): String { + var result: String = "" + result = result.plus(other = { // BLOCK + val tmp_0: String? = test_1(value = 1) + when { + EQEQ(arg0 = tmp_0, arg1 = null) -> return "fail 1" + else -> tmp_0 + } + }) + result = result.plus(other = { // BLOCK + val tmp_1: String? = test_2(value = 1) + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> return "fail 2" + else -> tmp_1 + } + }) + return result +} + fun test_1(value: Any?): String? { return { // BLOCK - val tmp_0: Any? = value + val tmp_2: Any? = value when { - EQEQ(arg0 = tmp_0, arg1 = null) -> null - else -> tmp_0.let(block = local fun (it: Any): Nothing { + EQEQ(arg0 = tmp_2, arg1 = null) -> null + else -> tmp_2.let(block = local fun (it: Any): Nothing { return "O" } ) @@ -14,10 +33,10 @@ fun test_1(value: Any?): String? { fun test_2(value: Any?): String? { return run(block = local fun (): Nothing? { return { // BLOCK - val tmp_1: Any? = value + val tmp_3: Any? = value when { - EQEQ(arg0 = tmp_1, arg1 = null) -> null - else -> tmp_1.let(block = local fun (it: Any): Nothing { + EQEQ(arg0 = tmp_3, arg1 = null) -> null + else -> tmp_3.let(block = local fun (it: Any): Nothing { return "K" } ) @@ -27,21 +46,3 @@ fun test_2(value: Any?): String? { ) } -fun box(): String { - var result: String = "" - result = result.plus(other = { // BLOCK - val tmp_2: String? = test_1(value = 1) - when { - EQEQ(arg0 = tmp_2, arg1 = null) -> return "fail 1" - else -> tmp_2 - } - }) - result = result.plus(other = { // BLOCK - val tmp_3: String? = test_2(value = 1) - when { - EQEQ(arg0 = tmp_3, arg1 = null) -> return "fail 2" - else -> tmp_3 - } - }) - return result -} diff --git a/compiler/testData/ir/irText/declarations/kt52677.ir.txt b/compiler/testData/ir/irText/declarations/kt52677.ir.txt index d6eea73c403..4ca6d305093 100644 --- a/compiler/testData/ir/irText/declarations/kt52677.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt52677.ir.txt @@ -3,11 +3,6 @@ FILE fqName: fileName:/kt52677.kt annotations: Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPE' type=kotlin.annotation.AnnotationTarget]) $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MySerializable - CONSTRUCTOR visibility:public <> (c:kotlin.reflect.KClass<*>) returnType:.MySerializable [primary] - VALUE_PARAMETER name:c index:0 type:kotlin.reflect.KClass<*> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:MySerializable modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:c visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.reflect.KClass<*> visibility:private [final] EXPRESSION_BODY @@ -19,6 +14,11 @@ FILE fqName: fileName:/kt52677.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass<*> declared in .MySerializable' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.reflect.KClass<*> visibility:private [final]' type=kotlin.reflect.KClass<*> origin=null receiver: GET_VAR ': .MySerializable declared in .MySerializable.' type=.MySerializable origin=null + CONSTRUCTOR visibility:public <> (c:kotlin.reflect.KClass<*>) returnType:.MySerializable [primary] + VALUE_PARAMETER name:c index:0 type:kotlin.reflect.KClass<*> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:MySerializable 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 declared in kotlin.Annotation @@ -34,11 +34,6 @@ FILE fqName: fileName:/kt52677.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:LoginSuccessPacket modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.LoginSuccessPacket - CONSTRUCTOR visibility:public <> (id:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1) returnType:.LoginSuccessPacket [primary] - VALUE_PARAMETER name:id index:0 type:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LoginSuccessPacket modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:id visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 visibility:private [final] EXPRESSION_BODY @@ -50,6 +45,11 @@ FILE fqName: fileName:/kt52677.kt RETURN type=kotlin.Nothing from='public final fun (): @[MySerializable(c = ...)] .Uuid1 declared in .LoginSuccessPacket' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.' type=.LoginSuccessPacket origin=null + CONSTRUCTOR visibility:public <> (id:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1) returnType:.LoginSuccessPacket [primary] + VALUE_PARAMETER name:id index:0 type:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LoginSuccessPacket modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.LoginSuccessPacket) returnType:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 [operator] $this: VALUE_PARAMETER name: type:.LoginSuccessPacket BLOCK_BODY @@ -66,27 +66,6 @@ FILE fqName: fileName:/kt52677.kt RETURN type=kotlin.Nothing from='public final fun copy (id: @[MySerializable(c = ...)] .Uuid1): .LoginSuccessPacket declared in .LoginSuccessPacket' CONSTRUCTOR_CALL 'public constructor (id: @[MySerializable(c = ...)] .Uuid1) declared in .LoginSuccessPacket' type=.LoginSuccessPacket origin=null id: GET_VAR 'id: @[MySerializable(c = ...)] .Uuid1 declared in .LoginSuccessPacket.copy' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.LoginSuccessPacket) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.LoginSuccessPacket - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .LoginSuccessPacket' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="LoginSuccessPacket(" - CONST String type=kotlin.String value="id=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null - receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.toString' type=.LoginSuccessPacket origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.LoginSuccessPacket) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.LoginSuccessPacket - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .LoginSuccessPacket' - CALL 'public open fun hashCode (): kotlin.Int declared in .Uuid1' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null - receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.hashCode' type=.LoginSuccessPacket origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.LoginSuccessPacket, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -121,7 +100,46 @@ FILE fqName: fileName:/kt52677.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .LoginSuccessPacket' CONST Boolean type=kotlin.Boolean value=true - TYPEALIAS name:Uuid visibility:public expandedType:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.LoginSuccessPacket) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.LoginSuccessPacket + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .LoginSuccessPacket' + CALL 'public open fun hashCode (): kotlin.Int declared in .Uuid1' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null + receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.hashCode' type=.LoginSuccessPacket origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.LoginSuccessPacket) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.LoginSuccessPacket + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .LoginSuccessPacket' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="LoginSuccessPacket(" + CONST String type=kotlin.String value="id=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null + receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.toString' type=.LoginSuccessPacket origin=null + CONST String type=kotlin.String value=")" + CLASS CLASS name:Uuid1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Uuid1 + CONSTRUCTOR visibility:public <> () returnType:.Uuid1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Uuid1 modality:FINAL visibility:public 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 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 CLASS INTERFACE name:MySerializer modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MySerializer.MySerializer> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -157,30 +175,12 @@ FILE fqName: fileName:/kt52677.kt overridden: public open fun toString (): kotlin.String declared in .MySerializer $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Uuid1 modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Uuid1 - CONSTRUCTOR visibility:public <> () returnType:.Uuid1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Uuid1 modality:FINAL visibility:public 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 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:foo visibility:public modality:FINAL <> () returnType:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor () declared in java.lang.RuntimeException' type=java.lang.RuntimeException origin=null FUN name:bar visibility:public modality:FINAL <> () returnType:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun bar (): @[MySerializable(c = ...)] .Uuid1 declared in ' CALL 'public final fun foo (): @[MySerializable(c = ...)] .Uuid1 declared in ' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null + FUN name:foo visibility:public modality:FINAL <> () returnType:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 + BLOCK_BODY + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor () declared in java.lang.RuntimeException' type=java.lang.RuntimeException origin=null + TYPEALIAS name:Uuid visibility:public expandedType:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 diff --git a/compiler/testData/ir/irText/declarations/kt52677.kt.txt b/compiler/testData/ir/irText/declarations/kt52677.kt.txt index 0f7ad5b4595..08ac168f2a5 100644 --- a/compiler/testData/ir/irText/declarations/kt52677.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt52677.kt.txt @@ -1,28 +1,28 @@ @Target(allowedTargets = [AnnotationTarget.TYPE]) open annotation class MySerializable : Annotation { + val c: KClass<*> + field = c + get + constructor(c: KClass<*>) /* primary */ { super/*Any*/() /* () */ } - val c: KClass<*> - field = c - get - } data class LoginSuccessPacket { + val id: @MySerializable(c = UuidSerializer::class) Uuid1 + field = id + get + constructor(id: @MySerializable(c = UuidSerializer::class) Uuid1) /* primary */ { super/*Any*/() /* () */ } - val id: @MySerializable(c = UuidSerializer::class) Uuid1 - field = id - get - operator fun component1(): @MySerializable(c = UuidSerializer::class) Uuid1 { return .#id } @@ -31,14 +31,6 @@ data class LoginSuccessPacket { return LoginSuccessPacket(id = id) } - override fun toString(): String { - return "LoginSuccessPacket(" + "id=" + .#id + ")" - } - - override fun hashCode(): Int { - return .#id.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -53,17 +45,12 @@ data class LoginSuccessPacket { return true } -} - -typealias Uuid = @MySerializable(c = UuidSerializer::class) Uuid1 -interface MySerializer { -} - -object UuidSerializer : MySerializer<@MySerializable(c = UuidSerializer::class) Uuid1> { - private constructor() /* primary */ { - super/*Any*/() - /* () */ + override fun hashCode(): Int { + return .#id.hashCode() + } + override fun toString(): String { + return "LoginSuccessPacket(" + "id=" + .#id + ")" } } @@ -77,10 +64,24 @@ class Uuid1 { } -fun foo(): @MySerializable(c = UuidSerializer::class) Uuid1 { - throw RuntimeException() +interface MySerializer { +} + +object UuidSerializer : MySerializer<@MySerializable(c = UuidSerializer::class) Uuid1> { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } fun bar(): @MySerializable(c = UuidSerializer::class) Uuid1 { return foo() } + +fun foo(): @MySerializable(c = UuidSerializer::class) Uuid1 { + throw RuntimeException() +} + +typealias Uuid = @MySerializable(c = UuidSerializer::class) Uuid1 diff --git a/compiler/testData/ir/irText/declarations/kt65236.ir.txt b/compiler/testData/ir/irText/declarations/kt65236.ir.txt index b7fc8e7651f..ead7110e368 100644 --- a/compiler/testData/ir/irText/declarations/kt65236.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt65236.ir.txt @@ -1,51 +1,10 @@ FILE fqName: fileName:/E.kt - CLASS INTERFACE name:II modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.II - FUN name:foo visibility:public modality:OPEN <> ($this:.II) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.II - BLOCK_BODY - 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: 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 - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[.II] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I - FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.II) returnType:kotlin.Unit [fake_override] - overridden: - public open fun foo (): kotlin.Unit declared in .II - $this: VALUE_PARAMETER name: type:.II - 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 .II - $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 .II - $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 .II - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[.I] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[.I]' - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.C) returnType:kotlin.Unit - overridden: - public open fun foo (): kotlin.Unit declared in .I - $this: VALUE_PARAMETER name: type:.C 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 .I @@ -59,23 +18,27 @@ FILE fqName: fileName:/E.kt overridden: public open fun toString (): kotlin.String declared in .I $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.C) returnType:kotlin.Unit + overridden: + public open fun foo (): kotlin.Unit declared in .I + $this: VALUE_PARAMETER name: type:.C CLASS CLASS name:D modality:ABSTRACT visibility:public superTypes:[.C; .J] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D CONSTRUCTOR visibility:public <> () returnType:.D [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .C' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:ABSTRACT visibility:public superTypes:[.C; .J]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.C) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (): kotlin.Unit declared in .C - public open fun foo (): kotlin.Unit declared in .J - $this: VALUE_PARAMETER name: type:.C 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 .C public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.C) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun foo (): kotlin.Unit declared in .C + public open fun foo (): kotlin.Unit declared in .J + $this: VALUE_PARAMETER name: type:.C 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 .C @@ -92,11 +55,6 @@ FILE fqName: fileName:/E.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .D' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:E modality:FINAL visibility:public superTypes:[.D]' - FUN name:foo visibility:public modality:OPEN <> ($this:.E) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .D - $this: VALUE_PARAMETER name: type:.E - BLOCK_BODY 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 .D @@ -110,6 +68,48 @@ FILE fqName: fileName:/E.kt overridden: public open fun toString (): kotlin.String declared in .D $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.E) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .D + $this: VALUE_PARAMETER name: type:.E + BLOCK_BODY + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[.II] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I + 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 .II + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.II) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (): kotlin.Unit declared in .II + $this: VALUE_PARAMETER name: type:.II + 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 .II + $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 .II + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:II modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.II + 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: 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:foo visibility:public modality:OPEN <> ($this:.II) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.II + BLOCK_BODY FUN name:foo visibility:public modality:FINAL <> (x:.I) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:.I BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/kt65236.kt.txt b/compiler/testData/ir/irText/declarations/kt65236.kt.txt index 0ff70e52cb5..6fa5bf227da 100644 --- a/compiler/testData/ir/irText/declarations/kt65236.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt65236.kt.txt @@ -1,12 +1,3 @@ -interface II { - fun foo() { - } - -} - -interface I : II { -} - abstract class C : I { constructor() /* primary */ { super/*Any*/() @@ -39,6 +30,16 @@ class E : D { } +interface I : II { +} + +interface II { + fun foo() { + } + +} + fun foo(x: I) { x.foo() } + diff --git a/compiler/testData/ir/irText/declarations/kt65273.fir.ir.txt b/compiler/testData/ir/irText/declarations/kt65273.fir.ir.txt index ce821864d22..a0c187ccdb1 100644 --- a/compiler/testData/ir/irText/declarations/kt65273.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt65273.fir.ir.txt @@ -1,16 +1,8 @@ FILE fqName: fileName:/kt65273.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:B modality:ABSTRACT visibility:private superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.B - CONSTRUCTOR visibility:public <> () returnType:.A.B [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:ABSTRACT visibility:private superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:s type:.A.B.s. visibility:private [final] EXPRESSION_BODY @@ -42,6 +34,10 @@ FILE fqName: fileName:/kt65273.kt RETURN type=kotlin.Nothing from='public final fun (): .A.B.s. declared in .A.B' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:.A.B.s. visibility:private [final]' type=.A.B.s. origin=null receiver: GET_VAR ': .A.B declared in .A.B.' type=.A.B origin=null + CONSTRUCTOR visibility:public <> () returnType:.A.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:ABSTRACT visibility:private 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 declared in kotlin.Any @@ -61,14 +57,6 @@ FILE fqName: fileName:/kt65273.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A.B' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:private superTypes:[.A.B]' - PROPERTY FAKE_OVERRIDE name:s visibility:public modality:FINAL [fake_override,val] - overridden: - public final s: .A.B.s. - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.A.B) returnType:.A.B.s. [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:s visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): .A.B.s. declared in .A.B - $this: VALUE_PARAMETER name: type:.A.B 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 .A.B @@ -82,6 +70,18 @@ FILE fqName: fileName:/kt65273.kt overridden: public open fun toString (): kotlin.String declared in .A.B $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:s visibility:public modality:FINAL [fake_override,val] + overridden: + public final s: .A.B.s. + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.A.B) returnType:.A.B.s. [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:s visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): .A.B.s. declared in .A.B + $this: VALUE_PARAMETER name: type:.A.B + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/kt65273.fir.kt.txt b/compiler/testData/ir/irText/declarations/kt65273.fir.kt.txt index d4487da97d6..01c1c02e987 100644 --- a/compiler/testData/ir/irText/declarations/kt65273.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt65273.fir.kt.txt @@ -1,17 +1,5 @@ class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - private abstract class B { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val s: field = { // BLOCK local class { @@ -27,6 +15,12 @@ class A { } get + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } private class C : B { @@ -38,4 +32,11 @@ class A { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/declarations/kt65273.ir.txt b/compiler/testData/ir/irText/declarations/kt65273.ir.txt index 6ec07eec069..4abfdced9d6 100644 --- a/compiler/testData/ir/irText/declarations/kt65273.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt65273.ir.txt @@ -1,16 +1,8 @@ FILE fqName: fileName:/kt65273.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:B modality:ABSTRACT visibility:private superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.B - CONSTRUCTOR visibility:public <> () returnType:.A.B [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:ABSTRACT visibility:private superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Any visibility:private [final] EXPRESSION_BODY @@ -42,6 +34,10 @@ FILE fqName: fileName:/kt65273.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .A.B' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR ': .A.B declared in .A.B.' type=.A.B origin=null + CONSTRUCTOR visibility:public <> () returnType:.A.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:ABSTRACT visibility:private 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 declared in kotlin.Any @@ -61,14 +57,6 @@ FILE fqName: fileName:/kt65273.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A.B' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:private superTypes:[.A.B]' - PROPERTY FAKE_OVERRIDE name:s visibility:public modality:FINAL [fake_override,val] - overridden: - public final s: kotlin.Any - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.A.B) returnType:kotlin.Any [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:s visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Any declared in .A.B - $this: VALUE_PARAMETER name: type:.A.B 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 .A.B @@ -82,6 +70,18 @@ FILE fqName: fileName:/kt65273.kt overridden: public open fun toString (): kotlin.String declared in .A.B $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:s visibility:public modality:FINAL [fake_override,val] + overridden: + public final s: kotlin.Any + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.A.B) returnType:kotlin.Any [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:s visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Any declared in .A.B + $this: VALUE_PARAMETER name: type:.A.B + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/kt65273.kt.txt b/compiler/testData/ir/irText/declarations/kt65273.kt.txt index 1482206f654..d120c4f0b48 100644 --- a/compiler/testData/ir/irText/declarations/kt65273.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt65273.kt.txt @@ -1,17 +1,5 @@ class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - private abstract class B { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val s: Any field = { // BLOCK local class { @@ -27,6 +15,12 @@ class A { } get + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } private class C : B { @@ -38,4 +32,11 @@ class A { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/declarations/kt65432.ir.txt b/compiler/testData/ir/irText/declarations/kt65432.ir.txt index 4349cfdf4c6..77d1ab985f5 100644 --- a/compiler/testData/ir/irText/declarations/kt65432.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt65432.ir.txt @@ -31,25 +31,10 @@ FILE fqName: fileName:/1.kt overridden: public open fun clear (): kotlin.Unit declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.Int> [fake_override,operator] + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] overridden: - public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.Int> declared in .Java1 + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun remove (element: @[EnhancedNullability] kotlin.Int): kotlin.Boolean declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>): kotlin.Boolean declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> - FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>): kotlin.Boolean declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun contains (element: @[EnhancedNullability] kotlin.Int): kotlin.Boolean declared in .Java1 @@ -60,47 +45,78 @@ FILE fqName: fileName:/1.kt public open fun containsAll (elements: kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>): kotlin.Boolean declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?> VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] overridden: - public open fun isEmpty (): kotlin.Boolean declared in .Java1 + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?>, other:@[EnhancedNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: @[EnhancedNullability] kotlin.Any?): kotlin.Boolean declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?> VALUE_PARAMETER name:other index:0 type:@[EnhancedNullability] kotlin.Any? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override,operator] + overridden: + public open fun get (index: kotlin.Int): @[EnhancedNullability] kotlin.Int declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?>) returnType:kotlin.Int [fake_override] overridden: public open fun hashCode (): kotlin.Int declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Int [fake_override] overridden: - public open fun toString (): @[EnhancedNullability] kotlin.String declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?> - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] - overridden: - public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in .Java1 + public open fun indexOf (element: @[EnhancedNullability] kotlin.Int): kotlin.Int declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList, p0:@[FlexibleNullability] kotlin.Array.A.toArray?>?) returnType:@[FlexibleNullability] kotlin.Array.A.toArray?>? [fake_override] + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] overridden: - public open fun toArray (p0: @[FlexibleNullability] kotlin.Array.Java1.toArray?>?): @[FlexibleNullability] kotlin.Array.Java1.toArray?>? declared in .Java1 - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + public open fun isEmpty (): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.Int> [fake_override,operator] + overridden: + public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.Int> declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Int [fake_override] + overridden: + public open fun lastIndexOf (element: @[EnhancedNullability] kotlin.Int): kotlin.Int declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> [fake_override] + overridden: + public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array.A.toArray?>? FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> [fake_override] overridden: public open fun listIterator (index: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> [fake_override] + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Boolean [fake_override] overridden: - public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> declared in .Java1 + public open fun remove (element: @[EnhancedNullability] kotlin.Int): kotlin.Boolean declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override] overridden: public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] kotlin.Int declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int, element:@[EnhancedNullability] kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override,operator] overridden: public open fun set (index: kotlin.Int, element: @[EnhancedNullability] kotlin.Int): @[EnhancedNullability] kotlin.Int declared in .Java1 @@ -113,40 +129,27 @@ FILE fqName: fileName:/1.kt $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override,operator] + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] overridden: - public open fun get (index: kotlin.Int): @[EnhancedNullability] kotlin.Int declared in .Java1 + public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Int [fake_override] + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList, p0:@[FlexibleNullability] kotlin.Array.A.toArray?>?) returnType:@[FlexibleNullability] kotlin.Array.A.toArray?>? [fake_override] overridden: - public open fun indexOf (element: @[EnhancedNullability] kotlin.Int): kotlin.Int declared in .Java1 + public open fun toArray (p0: @[FlexibleNullability] kotlin.Array.Java1.toArray?>?): @[FlexibleNullability] kotlin.Array.Java1.toArray?>? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Int [fake_override] + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array.A.toArray?>? + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] overridden: - public open fun lastIndexOf (element: @[EnhancedNullability] kotlin.Int): kotlin.Int declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int - FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - overridden: - public open fun clone (): @[EnhancedNullability] kotlin.Any declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList + public open fun toString (): @[EnhancedNullability] kotlin.String declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?> FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] overridden: public open fun trimToSize (): kotlin.Unit declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] overridden: - public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + protected/*protected and package*/ final modCount: kotlin.Int PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] overridden: public open size: kotlin.Int @@ -155,9 +158,6 @@ FILE fqName: fileName:/1.kt overridden: public open fun (): kotlin.Int declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList - PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] - overridden: - protected/*protected and package*/ final modCount: kotlin.Int CLASS CLASS name:KotlinClass modality:OPEN visibility:public superTypes:[java.util.ArrayList] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KotlinClass CONSTRUCTOR visibility:public <> () returnType:.KotlinClass [primary] @@ -191,25 +191,10 @@ FILE fqName: fileName:/1.kt overridden: public open fun clear (): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.Int> [fake_override,operator] + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] overridden: - public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun remove (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> - FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun contains (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList @@ -220,47 +205,78 @@ FILE fqName: fileName:/1.kt public open fun containsAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?> VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] overridden: - public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?>, other:@[EnhancedNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: @[EnhancedNullability] kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?> VALUE_PARAMETER name:other index:0 type:@[EnhancedNullability] kotlin.Any? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override,operator] + overridden: + public open fun get (index: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?>) returnType:kotlin.Int [fake_override] overridden: public open fun hashCode (): kotlin.Int declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Int [fake_override] overridden: - public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?> - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] - overridden: - public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in java.util.ArrayList + public open fun indexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList, p0:@[FlexibleNullability] kotlin.Array.KotlinClass.toArray?>?) returnType:@[FlexibleNullability] kotlin.Array.KotlinClass.toArray?>? [fake_override] + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] overridden: - public open fun toArray (p0: @[FlexibleNullability] kotlin.Array?): @[FlexibleNullability] kotlin.Array? declared in java.util.ArrayList - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.Int> [fake_override,operator] + overridden: + public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Int [fake_override] + overridden: + public open fun lastIndexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> [fake_override] + overridden: + public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array.KotlinClass.toArray?>? FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> [fake_override] overridden: public open fun listIterator (index: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> [fake_override] + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Boolean [fake_override] overridden: - public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + public open fun remove (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override] overridden: public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int, element:@[EnhancedNullability] kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override,operator] overridden: public open fun set (index: kotlin.Int, element: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList @@ -273,40 +289,27 @@ FILE fqName: fileName:/1.kt $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override,operator] + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] overridden: - public open fun get (index: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Int [fake_override] + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList, p0:@[FlexibleNullability] kotlin.Array.KotlinClass.toArray?>?) returnType:@[FlexibleNullability] kotlin.Array.KotlinClass.toArray?>? [fake_override] overridden: - public open fun indexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + public open fun toArray (p0: @[FlexibleNullability] kotlin.Array?): @[FlexibleNullability] kotlin.Array? declared in java.util.ArrayList + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Int [fake_override] + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array.KotlinClass.toArray?>? + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] overridden: - public open fun lastIndexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int - FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - overridden: - public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList + public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?> FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] overridden: public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] overridden: - public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + protected/*protected and package*/ final modCount: kotlin.Int PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] overridden: public open size: kotlin.Int @@ -315,6 +318,3 @@ FILE fqName: fileName:/1.kt overridden: public open fun (): kotlin.Int declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] - overridden: - protected/*protected and package*/ final modCount: kotlin.Int diff --git a/compiler/testData/ir/irText/declarations/localClassWithOverrides.ir.txt b/compiler/testData/ir/irText/declarations/localClassWithOverrides.ir.txt index 356a311af71..a1cdf51468a 100644 --- a/compiler/testData/ir/irText/declarations/localClassWithOverrides.ir.txt +++ b/compiler/testData/ir/irText/declarations/localClassWithOverrides.ir.txt @@ -7,6 +7,19 @@ FILE fqName: fileName:/localClassWithOverrides.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ALocal modality:ABSTRACT visibility:local 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 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:afun visibility:public modality:ABSTRACT <> ($this:.outer.ALocal) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.outer.ALocal PROPERTY name:aval visibility:public modality:ABSTRACT [val] @@ -21,30 +34,8 @@ FILE fqName: fileName:/localClassWithOverrides.kt correspondingProperty: PROPERTY name:avar visibility:public modality:ABSTRACT [var] $this: VALUE_PARAMETER name: type:.outer.ALocal VALUE_PARAMETER name: index:0 type:kotlin.Int - 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: 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 CLASS CLASS name:Local modality:FINAL visibility:local superTypes:[.outer.ALocal] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.outer.Local - CONSTRUCTOR visibility:public <> () returnType:.outer.Local [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .outer.ALocal' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Local modality:FINAL visibility:local superTypes:[.outer.ALocal]' - FUN name:afun visibility:public modality:OPEN <> ($this:.outer.Local) returnType:kotlin.Unit - overridden: - public abstract fun afun (): kotlin.Unit declared in .outer.ALocal - $this: VALUE_PARAMETER name: type:.outer.Local - BLOCK_BODY PROPERTY name:aval visibility:public modality:OPEN [val] overridden: public abstract aval: kotlin.Int @@ -85,6 +76,10 @@ FILE fqName: fileName:/localClassWithOverrides.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:avar type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .outer.Local declared in .outer.Local.' type=.outer.Local origin=null value: GET_VAR ': kotlin.Int declared in .outer.Local.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.outer.Local [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .outer.ALocal' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Local modality:FINAL visibility:local superTypes:[.outer.ALocal]' 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 .outer.ALocal @@ -98,3 +93,8 @@ FILE fqName: fileName:/localClassWithOverrides.kt overridden: public open fun toString (): kotlin.String declared in .outer.ALocal $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:afun visibility:public modality:OPEN <> ($this:.outer.Local) returnType:kotlin.Unit + overridden: + public abstract fun afun (): kotlin.Unit declared in .outer.ALocal + $this: VALUE_PARAMETER name: type:.outer.Local + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/localClassWithOverrides.kt.txt b/compiler/testData/ir/irText/declarations/localClassWithOverrides.kt.txt index a4d7864e511..13eeb831292 100644 --- a/compiler/testData/ir/irText/declarations/localClassWithOverrides.kt.txt +++ b/compiler/testData/ir/irText/declarations/localClassWithOverrides.kt.txt @@ -18,15 +18,6 @@ fun outer() { } local class Local : ALocal { - constructor() /* primary */ { - super/*ALocal*/() - /* () */ - - } - - override fun afun() { - } - override val aval: Int field = 1 override get @@ -36,6 +27,16 @@ fun outer() { override get override set + constructor() /* primary */ { + super/*ALocal*/() + /* () */ + + } + + override fun afun() { + } + } } + diff --git a/compiler/testData/ir/irText/declarations/mainFunctionMangling.ir.txt b/compiler/testData/ir/irText/declarations/mainFunctionMangling.ir.txt index 77e57906571..4fc0f00a61f 100644 --- a/compiler/testData/ir/irText/declarations/mainFunctionMangling.ir.txt +++ b/compiler/testData/ir/irText/declarations/mainFunctionMangling.ir.txt @@ -1,22 +1,23 @@ FILE fqName: fileName:/a.kt - FUN name:main visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="main()" - FUN name:main visibility:public modality:FINAL (t:T of .main) returnType:T of .main - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:t index:0 type:T of .main - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="main(T): T" - RETURN type=kotlin.Nothing from='public final fun main (t: T of .main): T of .main declared in ' - GET_VAR 't: T of .main declared in .main' type=T of .main origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 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:main visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.C BLOCK_BODY @@ -31,6 +32,12 @@ FILE fqName: fileName:/a.kt message: CONST String type=kotlin.String value="C.main(T): T" RETURN type=kotlin.Nothing from='public final fun main (t: T of .C.main): T of .C.main declared in .C' GET_VAR 't: T of .C.main declared in .C.main' type=T of .C.main origin=null + CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.O + CONSTRUCTOR visibility:private <> () returnType:.O [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:O modality:FINAL visibility:public 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 declared in kotlin.Any @@ -44,12 +51,6 @@ FILE fqName: fileName:/a.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.O - CONSTRUCTOR visibility:private <> () returnType:.O [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' FUN name:main visibility:public modality:FINAL <> ($this:.O) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.O BLOCK_BODY @@ -64,6 +65,25 @@ FILE fqName: fileName:/a.kt message: CONST String type=kotlin.String value="O.main(T): T" RETURN type=kotlin.Nothing from='public final fun main (t: T of .O.main): T of .O.main declared in .O' GET_VAR 't: T of .O.main declared in .O.main' type=T of .O.main origin=null + FUN name:main visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="main()" + FUN name:main visibility:public modality:FINAL (t:T of .main) returnType:T of .main + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:T of .main + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="main(T): T" + RETURN type=kotlin.Nothing from='public final fun main (t: T of .main): T of .main declared in ' + GET_VAR 't: T of .main declared in .main' type=T of .main origin=null +FILE fqName:foo fileName:/b.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.C + CONSTRUCTOR visibility:public <> () returnType:foo.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -77,25 +97,6 @@ FILE fqName: fileName:/a.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any -FILE fqName:foo fileName:/b.kt - FUN name:main visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="foo.main()" - FUN name:main visibility:public modality:FINAL (t:T of foo.main) returnType:T of foo.main - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:t index:0 type:T of foo.main - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="foo.main(T): T" - RETURN type=kotlin.Nothing from='public final fun main (t: T of foo.main): T of foo.main declared in foo' - GET_VAR 't: T of foo.main declared in foo.main' type=T of foo.main origin=null - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.C - CONSTRUCTOR visibility:public <> () returnType:foo.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' FUN name:main visibility:public modality:FINAL <> ($this:foo.C) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:foo.C BLOCK_BODY @@ -110,6 +111,12 @@ FILE fqName:foo fileName:/b.kt message: CONST String type=kotlin.String value="foo.C.main(T): T" RETURN type=kotlin.Nothing from='public final fun main (t: T of foo.C.main): T of foo.C.main declared in foo.C' GET_VAR 't: T of foo.C.main declared in foo.C.main' type=T of foo.C.main origin=null + CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.O + CONSTRUCTOR visibility:private <> () returnType:foo.O [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:O modality:FINAL visibility:public 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 declared in kotlin.Any @@ -123,12 +130,6 @@ FILE fqName:foo fileName:/b.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.O - CONSTRUCTOR visibility:private <> () returnType:foo.O [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' FUN name:main visibility:public modality:FINAL <> ($this:foo.O) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:foo.O BLOCK_BODY @@ -143,16 +144,15 @@ FILE fqName:foo fileName:/b.kt message: CONST String type=kotlin.String value="foo.O.main(T): T" RETURN type=kotlin.Nothing from='public final fun main (t: T of foo.O.main): T of foo.O.main declared in foo.O' GET_VAR 't: T of foo.O.main declared in foo.O.main' type=T of foo.O.main 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: 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:main visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="foo.main()" + FUN name:main visibility:public modality:FINAL (t:T of foo.main) returnType:T of foo.main + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:T of foo.main + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CONST String type=kotlin.String value="foo.main(T): T" + RETURN type=kotlin.Nothing from='public final fun main (t: T of foo.main): T of foo.main declared in foo' + GET_VAR 't: T of foo.main declared in foo.main' type=T of foo.main origin=null diff --git a/compiler/testData/ir/irText/declarations/mainFunctionMangling.kt.txt b/compiler/testData/ir/irText/declarations/mainFunctionMangling.kt.txt index 7e24cff7c26..b6006d99032 100644 --- a/compiler/testData/ir/irText/declarations/mainFunctionMangling.kt.txt +++ b/compiler/testData/ir/irText/declarations/mainFunctionMangling.kt.txt @@ -1,14 +1,5 @@ // FILE: a.kt -fun main() { - println(message = "main()") -} - -fun main(t: T): T { - println(message = "main(T): T") - return t -} - class C { constructor() /* primary */ { super/*Any*/() @@ -45,18 +36,18 @@ object O { } -// FILE: b.kt -package foo - fun main() { - println(message = "foo.main()") + println(message = "main()") } fun main(t: T): T { - println(message = "foo.main(T): T") + println(message = "main(T): T") return t } +// FILE: b.kt +package foo + class C { constructor() /* primary */ { super/*Any*/() @@ -93,3 +84,12 @@ object O { } +fun main() { + println(message = "foo.main()") +} + +fun main(t: T): T { + println(message = "foo.main(T): T") + return t +} + diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectClassInherited.ir.txt b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectClassInherited.ir.txt index 93e33a53678..454e8590c5b 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectClassInherited.ir.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectClassInherited.ir.txt @@ -2,8 +2,6 @@ FILE fqName: fileName:/expectClassInherited.kt CLASS CLASS name:A modality:ABSTRACT visibility:public [expect] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A CONSTRUCTOR visibility:protected <> () returnType:.A [primary,expect] - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [expect] - $this: VALUE_PARAMETER name: type:.A 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 @@ -17,17 +15,33 @@ FILE fqName: fileName:/expectClassInherited.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [expect] + $this: VALUE_PARAMETER name: type:.A + CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:protected <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public 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 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:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A CLASS CLASS name:B modality:OPEN visibility:public [expect] superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.B [primary,expect] VALUE_PARAMETER name:i index:0 type:kotlin.Int - FUN name:foo visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Unit [expect] - overridden: - public abstract fun foo (): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.B - FUN name:bar visibility:public modality:OPEN <> ($this:.B, s:kotlin.String) returnType:kotlin.Unit [expect] - $this: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name:s index:0 type:kotlin.String 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 .A @@ -41,27 +55,13 @@ FILE fqName: fileName:/expectClassInherited.kt overridden: public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:protected <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + FUN name:bar visibility:public modality:OPEN <> ($this:.B, s:kotlin.String) returnType:kotlin.Unit [expect] + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name:s index:0 type:kotlin.String + FUN name:foo visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Unit [expect] overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 + public abstract fun foo (): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.B CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.B [primary] @@ -69,15 +69,6 @@ FILE fqName: fileName:/expectClassInherited.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A]' - FUN name:foo visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - FUN name:bar visibility:public modality:OPEN <> ($this:.B, s:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY 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 .A @@ -91,3 +82,12 @@ FILE fqName: fileName:/expectClassInherited.kt overridden: public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:OPEN <> ($this:.B, s:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + FUN name:foo visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectClassInherited.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectClassInherited.kt.txt index c4380e45d90..bedb7fda0c0 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectClassInherited.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectClassInherited.kt.txt @@ -5,15 +5,6 @@ expect abstract class A { } -expect open class B : A { - expect constructor(i: Int) /* primary */ - - expect override fun foo() - - expect open fun bar(s: String) - -} - abstract class A { protected constructor() /* primary */ { super/*Any*/() @@ -25,6 +16,15 @@ abstract class A { } +expect open class B : A { + expect constructor(i: Int) /* primary */ + + expect open fun bar(s: String) + + expect override fun foo() + +} + open class B : A { constructor(i: Int) /* primary */ { super/*A*/() @@ -32,10 +32,11 @@ open class B : A { } - override fun foo() { - } - open fun bar(s: String) { } + override fun foo() { + } + } + diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectIntersectionOverride.ir.txt b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectIntersectionOverride.ir.txt index ed51b541c85..0b17dbf4d4f 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectIntersectionOverride.ir.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectIntersectionOverride.ir.txt @@ -1,54 +1,6 @@ FILE fqName: fileName:/expectIntersectionOverride.kt - CLASS INTERFACE name:I1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I1 - FUN name:f visibility:public modality:ABSTRACT <> ($this:.I1) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.I1 - PROPERTY name:p visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I1) returnType:kotlin.Int - correspondingProperty: PROPERTY name:p visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.I1 - 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: 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 - CLASS INTERFACE name:I2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I2 - FUN name:f visibility:public modality:ABSTRACT <> ($this:.I2) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.I2 - PROPERTY name:p visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I2) returnType:kotlin.Int - correspondingProperty: PROPERTY name:p visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.I2 - 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: 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 CLASS CLASS name:C modality:FINAL visibility:public [expect] superTypes:[.I1; .I2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary,expect] - FUN name:f visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String [expect] - overridden: - public abstract fun f (): kotlin.String declared in .I1 - public abstract fun f (): kotlin.String declared in .I2 - $this: VALUE_PARAMETER name: type:.C PROPERTY name:p visibility:public modality:OPEN [expect,val] overridden: public abstract p: kotlin.Int @@ -60,6 +12,7 @@ FILE fqName: fileName:/expectIntersectionOverride.kt public abstract fun (): kotlin.Int declared in .I1 public abstract fun (): kotlin.Int declared in .I2 $this: VALUE_PARAMETER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary,expect] 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 .I1 @@ -76,20 +29,13 @@ FILE fqName: fileName:/expectIntersectionOverride.kt public open fun toString (): kotlin.String declared in .I1 public open fun toString (): kotlin.String declared in .I2 $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I1; .I2] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I1; .I2]' - FUN name:f visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String + FUN name:f visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String [expect] overridden: public abstract fun f (): kotlin.String declared in .I1 public abstract fun f (): kotlin.String declared in .I2 $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun f (): kotlin.String declared in .C' - CONST String type=kotlin.String value="OK" + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I1; .I2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C PROPERTY name:p visibility:public modality:OPEN [val] overridden: public abstract p: kotlin.Int @@ -107,6 +53,10 @@ FILE fqName: fileName:/expectIntersectionOverride.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I1; .I2]' 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 .I1 @@ -123,3 +73,53 @@ FILE fqName: fileName:/expectIntersectionOverride.kt public open fun toString (): kotlin.String declared in .I1 public open fun toString (): kotlin.String declared in .I2 $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String + overridden: + public abstract fun f (): kotlin.String declared in .I1 + public abstract fun f (): kotlin.String declared in .I2 + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun f (): kotlin.String declared in .C' + CONST String type=kotlin.String value="OK" + CLASS INTERFACE name:I1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I1 + 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: 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:f visibility:public modality:ABSTRACT <> ($this:.I1) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.I1 + PROPERTY name:p visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I1) returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.I1 + CLASS INTERFACE name:I2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I2 + 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: 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:f visibility:public modality:ABSTRACT <> ($this:.I2) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.I2 + PROPERTY name:p visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I2) returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.I2 diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectIntersectionOverride.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectIntersectionOverride.kt.txt index 341a395fade..3c5a2396c37 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectIntersectionOverride.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectIntersectionOverride.kt.txt @@ -1,3 +1,30 @@ +expect class C : I1, I2 { + expect override val p: Int + override get + + expect constructor() /* primary */ + + expect override fun f(): String + +} + +class C : I1, I2 { + override val p: Int + field = 42 + override get + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override fun f(): String { + return "OK" + } + +} + interface I1 { abstract fun f(): String @@ -14,29 +41,3 @@ interface I2 { } -expect class C : I1, I2 { - expect constructor() /* primary */ - - expect override fun f(): String - - expect override val p: Int - override get - -} - -class C : I1, I2 { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun f(): String { - return "OK" - } - - override val p: Int - field = 42 - override get - -} diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectMemberInNotExpectClass.ir.txt b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectMemberInNotExpectClass.ir.txt index fe3ec7a7831..f58e1617978 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectMemberInNotExpectClass.ir.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectMemberInNotExpectClass.ir.txt @@ -1,14 +1,12 @@ FILE fqName: fileName:/expectMemberInNotExpectClass.kt CLASS CLASS name:C1 modality:OPEN visibility:public [expect] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C1 - CONSTRUCTOR visibility:public <> () returnType:.C1 [primary,expect] - FUN name:f visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.String [expect] - $this: VALUE_PARAMETER name: type:.C1 PROPERTY name:p visibility:public modality:FINAL [expect,val] FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.Int correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [expect,val] $this: VALUE_PARAMETER name: type:.C1 + CONSTRUCTOR visibility:public <> () returnType:.C1 [primary,expect] 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 @@ -22,48 +20,10 @@ FILE fqName: fileName:/expectMemberInNotExpectClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.C1] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C2 - CONSTRUCTOR visibility:public <> () returnType:.C2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .C1' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.C1]' - FUN FAKE_OVERRIDE name:f visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.String [fake_override] - overridden: - public final fun f (): kotlin.String declared in .C1 + FUN name:f visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.String [expect] $this: VALUE_PARAMETER name: type:.C1 - PROPERTY FAKE_OVERRIDE name:p visibility:public modality:FINAL [fake_override,val] - overridden: - public final p: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:p visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .C1 - $this: VALUE_PARAMETER name: type:.C1 - 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 .C1 - $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 .C1 - $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 .C1 - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:C1 modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C1 - CONSTRUCTOR visibility:public <> () returnType:.C1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C1 modality:OPEN visibility:public superTypes:[kotlin.Any]' - FUN name:f visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.C1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (): kotlin.String declared in .C1' - CONST String type=kotlin.String value="O" PROPERTY name:p visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -75,6 +35,10 @@ FILE fqName: fileName:/expectMemberInNotExpectClass.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .C1 declared in .C1.' type=.C1 origin=null + CONSTRUCTOR visibility:public <> () returnType:.C1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C1 modality:OPEN visibility:public 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 declared in kotlin.Any @@ -88,3 +52,39 @@ FILE fqName: fileName:/expectMemberInNotExpectClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.C1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (): kotlin.String declared in .C1' + CONST String type=kotlin.String value="O" + CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.C1] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C2 + CONSTRUCTOR visibility:public <> () returnType:.C2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .C1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.C1]' + 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 .C1 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:f visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.String [fake_override] + overridden: + public final fun f (): kotlin.String declared in .C1 + $this: VALUE_PARAMETER name: type:.C1 + 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 .C1 + $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 .C1 + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:p visibility:public modality:FINAL [fake_override,val] + overridden: + public final p: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:p visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .C1 + $this: VALUE_PARAMETER name: type:.C1 diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectMemberInNotExpectClass.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectMemberInNotExpectClass.kt.txt index 9667911623d..c405cf0eaa8 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectMemberInNotExpectClass.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectMemberInNotExpectClass.kt.txt @@ -1,11 +1,28 @@ expect open class C1 { + expect val p: Int + get + expect constructor() /* primary */ expect fun f(): String - expect val p: Int +} + +open class C1 { + val p: Int + field = 42 get + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun f(): String { + return "O" + } + } class C2 : C1 { @@ -17,19 +34,3 @@ class C2 : C1 { } -open class C1 { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun f(): String { - return "O" - } - - val p: Int - field = 42 - get - -} diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedEnumClass.ir.txt b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedEnumClass.ir.txt index 724ebd03537..785e6443f32 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedEnumClass.ir.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedEnumClass.ir.txt @@ -3,24 +3,11 @@ FILE fqName: fileName:/expectedEnumClass.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum ENUM_ENTRY name:FOO ENUM_ENTRY name:BAR - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyEnum + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>, other:.MyEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -39,22 +26,30 @@ FILE fqName: fileName:/expectedEnumClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyEnum - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyEnum> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum - CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .MyEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>]' ENUM_ENTRY name:FOO init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum' @@ -64,24 +59,16 @@ FILE fqName: fileName:/expectedEnumClass.kt ENUM_ENTRY name:BAZ init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .MyEnum + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyEnum + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>, other:.MyEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -100,12 +87,25 @@ FILE fqName: fileName:/expectedEnumClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyEnum - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyEnum> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedEnumClass.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedEnumClass.kt.txt index 21902285ff5..314aa7993f2 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedEnumClass.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedEnumClass.kt.txt @@ -3,33 +3,34 @@ expect enum class MyEnum : Enum { BAR - fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): MyEnum /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } enum class MyEnum : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - FOO = MyEnum() BAR = MyEnum() BAZ = MyEnum() - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): MyEnum /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } + diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedSealedClass.ir.txt b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedSealedClass.ir.txt index 932c1fb7b78..af0b7c3eb77 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedSealedClass.ir.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedSealedClass.ir.txt @@ -1,4 +1,39 @@ FILE fqName: fileName:/expectedSealedClass.kt + CLASS CLASS name:Add modality:FINAL visibility:public [expect] superTypes:[.Ops] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Add + CONSTRUCTOR visibility:public <> () returnType:.Add [primary,expect] + 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 .Ops + $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 .Ops + $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 .Ops + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Add + CONSTRUCTOR visibility:public <> () returnType:.Add [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .Ops' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops]' + 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 .Ops + $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 .Ops + $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 .Ops + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Ops modality:SEALED visibility:public [expect] superTypes:[kotlin.Any] sealedSubclasses: CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops] @@ -17,22 +52,6 @@ FILE fqName: fileName:/expectedSealedClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Add modality:FINAL visibility:public [expect] superTypes:[.Ops] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Add - CONSTRUCTOR visibility:public <> () returnType:.Add [primary,expect] - 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 .Ops - $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 .Ops - $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 .Ops - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Ops modality:SEALED visibility:public superTypes:[kotlin.Any] sealedSubclasses: CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops] @@ -54,22 +73,3 @@ FILE fqName: fileName:/expectedSealedClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Add - CONSTRUCTOR visibility:public <> () returnType:.Add [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .Ops' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops]' - 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 .Ops - $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 .Ops - $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 .Ops - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedSealedClass.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedSealedClass.kt.txt index 28ca0eeb57d..975081042f5 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedSealedClass.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k1/expectedSealedClass.kt.txt @@ -1,10 +1,19 @@ -expect sealed class Ops { - protected expect constructor() /* primary */ +expect class Add : Ops { + expect constructor() /* primary */ } -expect class Add : Ops { - expect constructor() /* primary */ +class Add : Ops { + constructor() /* primary */ { + super/*Ops*/() + /* () */ + + } + +} + +expect sealed class Ops { + protected expect constructor() /* primary */ } @@ -17,11 +26,3 @@ sealed class Ops { } -class Add : Ops { - constructor() /* primary */ { - super/*Ops*/() - /* () */ - - } - -} diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectClassInherited.ir.txt b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectClassInherited.ir.txt index e3b1b4b33ee..61340510c1d 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectClassInherited.ir.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectClassInherited.ir.txt @@ -6,8 +6,6 @@ FILE fqName: fileName:/platform.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A 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 @@ -21,6 +19,8 @@ FILE fqName: fileName:/platform.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.B [primary] @@ -28,15 +28,6 @@ FILE fqName: fileName:/platform.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A]' - FUN name:foo visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - FUN name:bar visibility:public modality:OPEN <> ($this:.B, s:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY 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 .A @@ -50,3 +41,12 @@ FILE fqName: fileName:/platform.kt overridden: public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:OPEN <> ($this:.B, s:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + FUN name:foo visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectClassInherited.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectClassInherited.kt.txt index a45d11a4822..12b8cc7c2c4 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectClassInherited.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectClassInherited.kt.txt @@ -20,10 +20,11 @@ open class B : A { } - override fun foo() { - } - open fun bar(s: String) { } + override fun foo() { + } + } + diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectIntersectionOverride.ir.txt b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectIntersectionOverride.ir.txt index 84f97ba23bb..dd5a6410299 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectIntersectionOverride.ir.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectIntersectionOverride.ir.txt @@ -1,12 +1,27 @@ FILE fqName: fileName:/common.kt CLASS INTERFACE name:I1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I1 + 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: 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:f visibility:public modality:ABSTRACT <> ($this:.I1) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.I1 PROPERTY name:p visibility:public modality:ABSTRACT [val] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I1) returnType:kotlin.Int correspondingProperty: PROPERTY name:p visibility:public modality:ABSTRACT [val] $this: VALUE_PARAMETER name: type:.I1 + CLASS INTERFACE name:I2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I2 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 @@ -20,42 +35,15 @@ FILE fqName: fileName:/common.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:I2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I2 FUN name:f visibility:public modality:ABSTRACT <> ($this:.I2) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.I2 PROPERTY name:p visibility:public modality:ABSTRACT [val] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I2) returnType:kotlin.Int correspondingProperty: PROPERTY name:p visibility:public modality:ABSTRACT [val] $this: VALUE_PARAMETER name: type:.I2 - 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: 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 FILE fqName: fileName:/platform.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I1; .I2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I1; .I2]' - FUN name:f visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String - overridden: - public abstract fun f (): kotlin.String declared in .I1 - public abstract fun f (): kotlin.String declared in .I2 - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun f (): kotlin.String declared in .C' - CONST String type=kotlin.String value="OK" PROPERTY name:p visibility:public modality:OPEN [val] overridden: public abstract p: kotlin.Int @@ -73,6 +61,10 @@ FILE fqName: fileName:/platform.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I1; .I2]' 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 .I1 @@ -89,3 +81,11 @@ FILE fqName: fileName:/platform.kt public open fun toString (): kotlin.String declared in .I1 public open fun toString (): kotlin.String declared in .I2 $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String + overridden: + public abstract fun f (): kotlin.String declared in .I1 + public abstract fun f (): kotlin.String declared in .I2 + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun f (): kotlin.String declared in .C' + CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectIntersectionOverride.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectIntersectionOverride.kt.txt index 008b73f0a1b..021897dcff0 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectIntersectionOverride.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectIntersectionOverride.kt.txt @@ -19,6 +19,10 @@ interface I2 { // FILE: platform.kt class C : I1, I2 { + override val p: Int + field = 42 + override get + constructor() /* primary */ { super/*Any*/() /* () */ @@ -29,8 +33,5 @@ class C : I1, I2 { return "OK" } - override val p: Int - field = 42 - override get - } + diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectMemberInNotExpectClass.ir.txt b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectMemberInNotExpectClass.ir.txt index d4d6cabc4d9..2eb719377a5 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectMemberInNotExpectClass.ir.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectMemberInNotExpectClass.ir.txt @@ -5,23 +5,15 @@ FILE fqName: fileName:/common.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .C1' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.C1]' - FUN FAKE_OVERRIDE name:f visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.String [fake_override] - overridden: - public final fun f (): kotlin.String declared in .C1 - $this: VALUE_PARAMETER name: type:.C1 - PROPERTY FAKE_OVERRIDE name:p visibility:public modality:FINAL [fake_override,val] - overridden: - public final p: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:p visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .C1 - $this: VALUE_PARAMETER name: type:.C1 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 .C1 $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:f visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.String [fake_override] + overridden: + public final fun f (): kotlin.String declared in .C1 + $this: VALUE_PARAMETER name: type:.C1 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 .C1 @@ -30,18 +22,17 @@ FILE fqName: fileName:/common.kt overridden: public open fun toString (): kotlin.String declared in .C1 $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:p visibility:public modality:FINAL [fake_override,val] + overridden: + public final p: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:p visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .C1 + $this: VALUE_PARAMETER name: type:.C1 FILE fqName: fileName:/platform.kt CLASS CLASS name:C1 modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C1 - CONSTRUCTOR visibility:public <> () returnType:.C1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C1 modality:OPEN visibility:public superTypes:[kotlin.Any]' - FUN name:f visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.C1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (): kotlin.String declared in .C1' - CONST String type=kotlin.String value="O" PROPERTY name:p visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -53,6 +44,10 @@ FILE fqName: fileName:/platform.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .C1 declared in .C1.' type=.C1 origin=null + CONSTRUCTOR visibility:public <> () returnType:.C1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C1 modality:OPEN visibility:public 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 declared in kotlin.Any @@ -66,3 +61,8 @@ FILE fqName: fileName:/platform.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.C1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (): kotlin.String declared in .C1' + CONST String type=kotlin.String value="O" diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectMemberInNotExpectClass.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectMemberInNotExpectClass.kt.txt index df36ea7129a..927e0bd6132 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectMemberInNotExpectClass.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectMemberInNotExpectClass.kt.txt @@ -12,6 +12,10 @@ class C2 : C1 { // FILE: platform.kt open class C1 { + val p: Int + field = 42 + get + constructor() /* primary */ { super/*Any*/() /* () */ @@ -22,8 +26,5 @@ open class C1 { return "O" } - val p: Int - field = 42 - get - } + diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedEnumClass.ir.txt b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedEnumClass.ir.txt index af1534e8632..c2644bd8363 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedEnumClass.ir.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedEnumClass.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/lib.kt FILE fqName: fileName:/main.kt CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum - CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .MyEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>]' ENUM_ENTRY name:FOO init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum' @@ -16,15 +11,16 @@ FILE fqName: fileName:/main.kt ENUM_ENTRY name:BAZ init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .MyEnum + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyEnum VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyEnum> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>, other:.MyEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -43,6 +39,10 @@ FILE fqName: fileName:/main.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyEnum> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedEnumClass.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedEnumClass.kt.txt index 9a3d83e5a96..a185f0c80f3 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedEnumClass.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedEnumClass.kt.txt @@ -3,23 +3,24 @@ // FILE: main.kt enum class MyEnum : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - FOO = MyEnum() BAR = MyEnum() BAZ = MyEnum() - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): MyEnum /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } + diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedSealedClass.ir.txt b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedSealedClass.ir.txt index ca63858c2a8..0fe090fd22f 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedSealedClass.ir.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedSealedClass.ir.txt @@ -1,5 +1,24 @@ FILE fqName: fileName:/common.kt FILE fqName: fileName:/platform.kt + CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Add + CONSTRUCTOR visibility:public <> () returnType:.Add [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .Ops' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops]' + 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 .Ops + $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 .Ops + $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 .Ops + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Ops modality:SEALED visibility:public superTypes:[kotlin.Any] sealedSubclasses: CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops] @@ -21,22 +40,3 @@ FILE fqName: fileName:/platform.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Add - CONSTRUCTOR visibility:public <> () returnType:.Add [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .Ops' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops]' - 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 .Ops - $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 .Ops - $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 .Ops - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedSealedClass.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedSealedClass.kt.txt index 6fc0573b7ef..d89f6b4bd00 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedSealedClass.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectedSealedClass.kt.txt @@ -2,6 +2,15 @@ // FILE: platform.kt +class Add : Ops { + constructor() /* primary */ { + super/*Ops*/() + /* () */ + + } + +} + sealed class Ops { protected constructor() /* primary */ { super/*Any*/() @@ -11,11 +20,3 @@ sealed class Ops { } -class Add : Ops { - constructor() /* primary */ { - super/*Ops*/() - /* () */ - - } - -} diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.ir.txt b/compiler/testData/ir/irText/declarations/packageLevelProperties.ir.txt index fa4f5b5114a..e3c81d29354 100644 --- a/compiler/testData/ir/irText/declarations/packageLevelProperties.ir.txt +++ b/compiler/testData/ir/irText/declarations/packageLevelProperties.ir.txt @@ -8,12 +8,6 @@ FILE fqName: fileName:/packageLevelProperties.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null - PROPERTY name:test2 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=0 PROPERTY name:test3 visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private [static] EXPRESSION_BODY @@ -114,3 +108,9 @@ FILE fqName: fileName:/packageLevelProperties.kt thisRef: CONST Null type=kotlin.Nothing? value=null property: PROPERTY_REFERENCE 'public final test8: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=0 diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.kt.txt b/compiler/testData/ir/irText/declarations/packageLevelProperties.kt.txt index 5db7671b429..be30f410503 100644 --- a/compiler/testData/ir/irText/declarations/packageLevelProperties.kt.txt +++ b/compiler/testData/ir/irText/declarations/packageLevelProperties.kt.txt @@ -2,11 +2,6 @@ val test1: Int field = 0 get -val test2: Int - get(): Int { - return 0 - } - var test3: Int field = 0 get @@ -45,3 +40,9 @@ var test8: Int /* by */ set(: Int) { return #test8$delegate.setValue(thisRef = null, property = ::test8, value = ) } + +val test2: Int + get(): Int { + return 0 + } + diff --git a/compiler/testData/ir/irText/declarations/parameters/class.ir.txt b/compiler/testData/ir/irText/declarations/parameters/class.ir.txt index e223db6f093..5b38529f51d 100644 --- a/compiler/testData/ir/irText/declarations/parameters/class.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/class.ir.txt @@ -1,4 +1,65 @@ FILE fqName: fileName:/class.kt + CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.Test> + TYPE_PARAMETER name:T0 index:0 variance: superTypes:[kotlin.Any?] reified:false + CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.TestInner.Test.TestInner, T0 of .Test> + TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> ($this:.Test.Test>) returnType:.Test.TestInner.Test.TestInner, T0 of .Test> [primary] + $outer: VALUE_PARAMETER name: type:.Test.Test> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] 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 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 + CLASS CLASS name:TestNested modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.TestNested.Test.TestNested> + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.Test.TestNested.Test.TestNested> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestNested modality:FINAL visibility:public 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 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 + CONSTRUCTOR visibility:public <> () returnType:.Test.Test> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public 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 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 CLASS INTERFACE name:TestInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInterface.TestInterface> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -31,64 +92,3 @@ FILE fqName: fileName:/class.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.Test> - TYPE_PARAMETER name:T0 index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Test.Test> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS CLASS name:TestNested modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.TestNested.Test.TestNested> - TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Test.TestNested.Test.TestNested> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestNested modality:FINAL visibility:public 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 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 - CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.TestInner.Test.TestInner, T0 of .Test> - TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> ($this:.Test.Test>) returnType:.Test.TestInner.Test.TestInner, T0 of .Test> [primary] - $outer: VALUE_PARAMETER name: type:.Test.Test> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] 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 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 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: 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 diff --git a/compiler/testData/ir/irText/declarations/parameters/class.kt.txt b/compiler/testData/ir/irText/declarations/parameters/class.kt.txt index a622d5e8fcf..dd9d63ed094 100644 --- a/compiler/testData/ir/irText/declarations/parameters/class.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/class.kt.txt @@ -1,13 +1,10 @@ -interface TestInterface { - interface TestNestedInterface { - } - -} - class Test { - constructor() /* primary */ { - super/*Any*/() - /* () */ + inner class TestInner { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } } @@ -20,13 +17,17 @@ class Test { } - inner class TestInner { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } + constructor() /* primary */ { + super/*Any*/() + /* () */ } } + +interface TestInterface { + interface TestNestedInterface { + } + +} + diff --git a/compiler/testData/ir/irText/declarations/parameters/constructor.fir.ir.txt b/compiler/testData/ir/irText/declarations/parameters/constructor.fir.ir.txt index 620ed6cccd0..2a3ab116c7b 100644 --- a/compiler/testData/ir/irText/declarations/parameters/constructor.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/constructor.fir.ir.txt @@ -3,12 +3,6 @@ FILE fqName: fileName:/constructor.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1.Test1, T2 of .Test1> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:T2 index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T1 of .Test1, y:T2 of .Test1) returnType:.Test1.Test1, T2 of .Test1> [primary] - VALUE_PARAMETER name:x index:0 type:T1 of .Test1 - VALUE_PARAMETER name:y index:1 type:T2 of .Test1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:T1 of .Test1 visibility:private [final] EXPRESSION_BODY @@ -31,6 +25,12 @@ FILE fqName: fileName:/constructor.kt RETURN type=kotlin.Nothing from='public final fun (): T2 of .Test1 declared in .Test1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:T2 of .Test1 visibility:private [final]' type=T2 of .Test1 origin=null receiver: GET_VAR ': .Test1.Test1, T2 of .Test1> declared in .Test1.' type=.Test1.Test1, T2 of .Test1> origin=null + CONSTRUCTOR visibility:public <> (x:T1 of .Test1, y:T2 of .Test1) returnType:.Test1.Test1, T2 of .Test1> [primary] + VALUE_PARAMETER name:x index:0 type:T1 of .Test1 + VALUE_PARAMETER name:y index:1 type:T2 of .Test1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -46,12 +46,6 @@ FILE fqName: fileName:/constructor.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String) returnType:.Test2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:y visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -66,12 +60,6 @@ FILE fqName: fileName:/constructor.kt CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2.TestInner.Test2.TestInner> TYPE_PARAMETER name:Z index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> ($this:.Test2, z:Z of .Test2.TestInner) returnType:.Test2.TestInner.Test2.TestInner> [primary] - $outer: VALUE_PARAMETER name: type:.Test2 - VALUE_PARAMETER name:z index:0 type:Z of .Test2.TestInner - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' PROPERTY name:z visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:z type:Z of .Test2.TestInner visibility:private [final] EXPRESSION_BODY @@ -83,6 +71,12 @@ FILE fqName: fileName:/constructor.kt RETURN type=kotlin.Nothing from='public final fun (): Z of .Test2.TestInner declared in .Test2.TestInner' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:Z of .Test2.TestInner visibility:private [final]' type=Z of .Test2.TestInner origin=null receiver: GET_VAR ': .Test2.TestInner.Test2.TestInner> declared in .Test2.TestInner.' type=.Test2.TestInner.Test2.TestInner> origin=null + CONSTRUCTOR visibility:public <> ($this:.Test2, z:Z of .Test2.TestInner) returnType:.Test2.TestInner.Test2.TestInner> [primary] + $outer: VALUE_PARAMETER name: type:.Test2 + VALUE_PARAMETER name:z index:0 type:Z of .Test2.TestInner + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' CONSTRUCTOR visibility:public <> ($this:.Test2, z:Z of .Test2.TestInner, i:kotlin.Int) returnType:.Test2.TestInner.Test2.TestInner> $outer: VALUE_PARAMETER name: type:.Test2 VALUE_PARAMETER name:z index:0 type:Z of .Test2.TestInner @@ -105,6 +99,12 @@ FILE fqName: fileName:/constructor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -120,14 +120,6 @@ FILE fqName: fileName:/constructor.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String) returnType:.Test3 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -150,6 +142,14 @@ FILE fqName: fileName:/constructor.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Test3' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String) returnType:.Test3 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -166,11 +166,6 @@ FILE fqName: fileName:/constructor.kt CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test4.Test4> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test4.Test4> [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -182,6 +177,11 @@ FILE fqName: fileName:/constructor.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test4' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test4.Test4> declared in .Test4.' type=.Test4.Test4> origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test4.Test4> [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any]' CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Test4.Test4> VALUE_PARAMETER name:x index:0 type:kotlin.Int VALUE_PARAMETER name:y index:1 type:kotlin.Int diff --git a/compiler/testData/ir/irText/declarations/parameters/constructor.fir.kt.txt b/compiler/testData/ir/irText/declarations/parameters/constructor.fir.kt.txt index 31503aa07fc..2d715fb0c4f 100644 --- a/compiler/testData/ir/irText/declarations/parameters/constructor.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/constructor.fir.kt.txt @@ -1,10 +1,4 @@ class Test1 { - constructor(x: T1, y: T2) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: T1 field = x get @@ -13,45 +7,45 @@ class Test1 { field = y get -} - -class Test2 { - constructor(x: Int, y: String) /* primary */ { + constructor(x: T1, y: T2) /* primary */ { super/*Any*/() /* () */ } +} + +class Test2 { val y: String field = y get inner class TestInner { + val z: Z + field = z + get + constructor(z: Z) /* primary */ { super/*Any*/() /* () */ } - val z: Z - field = z - get - constructor(z: Z, i: Int) { .this/*TestInner*/(z = z) } } -} - -class Test3 { - constructor(x: Int, y: String = "") /* primary */ { + constructor(x: Int, y: String) /* primary */ { super/*Any*/() /* () */ } +} + +class Test3 { val x: Int field = x get @@ -60,21 +54,28 @@ class Test3 { field = y get + constructor(x: Int, y: String = "") /* primary */ { + super/*Any*/() + /* () */ + + } + } class Test4 { + val x: Int + field = x + get + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } - val x: Int - field = x - get - constructor(x: Int, y: Int = 42) { this/*Test4*/(x = x.plus(other = y)) } } + diff --git a/compiler/testData/ir/irText/declarations/parameters/constructor.ir.txt b/compiler/testData/ir/irText/declarations/parameters/constructor.ir.txt index 5a9f6f4b551..4a3b3197a5a 100644 --- a/compiler/testData/ir/irText/declarations/parameters/constructor.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/constructor.ir.txt @@ -3,12 +3,6 @@ FILE fqName: fileName:/constructor.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1.Test1, T2 of .Test1> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:T2 index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T1 of .Test1, y:T2 of .Test1) returnType:.Test1.Test1, T2 of .Test1> [primary] - VALUE_PARAMETER name:x index:0 type:T1 of .Test1 - VALUE_PARAMETER name:y index:1 type:T2 of .Test1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:T1 of .Test1 visibility:private [final] EXPRESSION_BODY @@ -31,6 +25,12 @@ FILE fqName: fileName:/constructor.kt RETURN type=kotlin.Nothing from='public final fun (): T2 of .Test1 declared in .Test1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:T2 of .Test1 visibility:private [final]' type=T2 of .Test1 origin=null receiver: GET_VAR ': .Test1.Test1, T2 of .Test1> declared in .Test1.' type=.Test1.Test1, T2 of .Test1> origin=null + CONSTRUCTOR visibility:public <> (x:T1 of .Test1, y:T2 of .Test1) returnType:.Test1.Test1, T2 of .Test1> [primary] + VALUE_PARAMETER name:x index:0 type:T1 of .Test1 + VALUE_PARAMETER name:y index:1 type:T2 of .Test1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -46,12 +46,6 @@ FILE fqName: fileName:/constructor.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String) returnType:.Test2 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:y visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -66,12 +60,6 @@ FILE fqName: fileName:/constructor.kt CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2.TestInner.Test2.TestInner> TYPE_PARAMETER name:Z index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> ($this:.Test2, z:Z of .Test2.TestInner) returnType:.Test2.TestInner.Test2.TestInner> [primary] - $outer: VALUE_PARAMETER name: type:.Test2 - VALUE_PARAMETER name:z index:0 type:Z of .Test2.TestInner - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' PROPERTY name:z visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:z type:Z of .Test2.TestInner visibility:private [final] EXPRESSION_BODY @@ -83,6 +71,12 @@ FILE fqName: fileName:/constructor.kt RETURN type=kotlin.Nothing from='public final fun (): Z of .Test2.TestInner declared in .Test2.TestInner' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:Z of .Test2.TestInner visibility:private [final]' type=Z of .Test2.TestInner origin=null receiver: GET_VAR ': .Test2.TestInner.Test2.TestInner> declared in .Test2.TestInner.' type=.Test2.TestInner.Test2.TestInner> origin=null + CONSTRUCTOR visibility:public <> ($this:.Test2, z:Z of .Test2.TestInner) returnType:.Test2.TestInner.Test2.TestInner> [primary] + $outer: VALUE_PARAMETER name: type:.Test2 + VALUE_PARAMETER name:z index:0 type:Z of .Test2.TestInner + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' CONSTRUCTOR visibility:public <> ($this:.Test2, z:Z of .Test2.TestInner, i:kotlin.Int) returnType:.Test2.TestInner.Test2.TestInner> $outer: VALUE_PARAMETER name: type:.Test2 VALUE_PARAMETER name:z index:0 type:Z of .Test2.TestInner @@ -105,6 +99,12 @@ FILE fqName: fileName:/constructor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -120,14 +120,6 @@ FILE fqName: fileName:/constructor.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String) returnType:.Test3 [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -150,6 +142,14 @@ FILE fqName: fileName:/constructor.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Test3' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String) returnType:.Test3 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -166,11 +166,6 @@ FILE fqName: fileName:/constructor.kt CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test4.Test4> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test4.Test4> [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -182,6 +177,11 @@ FILE fqName: fileName:/constructor.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test4' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test4.Test4> declared in .Test4.' type=.Test4.Test4> origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test4.Test4> [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any]' CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Test4.Test4> VALUE_PARAMETER name:x index:0 type:kotlin.Int VALUE_PARAMETER name:y index:1 type:kotlin.Int diff --git a/compiler/testData/ir/irText/declarations/parameters/constructor.kt.txt b/compiler/testData/ir/irText/declarations/parameters/constructor.kt.txt index 31503aa07fc..2d715fb0c4f 100644 --- a/compiler/testData/ir/irText/declarations/parameters/constructor.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/constructor.kt.txt @@ -1,10 +1,4 @@ class Test1 { - constructor(x: T1, y: T2) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: T1 field = x get @@ -13,45 +7,45 @@ class Test1 { field = y get -} - -class Test2 { - constructor(x: Int, y: String) /* primary */ { + constructor(x: T1, y: T2) /* primary */ { super/*Any*/() /* () */ } +} + +class Test2 { val y: String field = y get inner class TestInner { + val z: Z + field = z + get + constructor(z: Z) /* primary */ { super/*Any*/() /* () */ } - val z: Z - field = z - get - constructor(z: Z, i: Int) { .this/*TestInner*/(z = z) } } -} - -class Test3 { - constructor(x: Int, y: String = "") /* primary */ { + constructor(x: Int, y: String) /* primary */ { super/*Any*/() /* () */ } +} + +class Test3 { val x: Int field = x get @@ -60,21 +54,28 @@ class Test3 { field = y get + constructor(x: Int, y: String = "") /* primary */ { + super/*Any*/() + /* () */ + + } + } class Test4 { + val x: Int + field = x + get + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } - val x: Int - field = x - get - constructor(x: Int, y: Int = 42) { this/*Test4*/(x = x.plus(other = y)) } } + diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.ir.txt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.ir.txt index b98bae6f326..b332ff3b448 100644 --- a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.ir.txt @@ -2,14 +2,6 @@ FILE fqName: fileName:/dataClassMembers.kt CLASS CLASS name:Test modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.Test> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T of .Test, y:kotlin.String) returnType:.Test.Test> [primary] - VALUE_PARAMETER name:x index:0 type:T of .Test - VALUE_PARAMETER name:y index:1 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final] EXPRESSION_BODY @@ -32,6 +24,14 @@ FILE fqName: fileName:/dataClassMembers.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Test' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Test.Test> declared in .Test.' type=.Test.Test> origin=null + CONSTRUCTOR visibility:public <> (x:T of .Test, y:kotlin.String) returnType:.Test.Test> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Test + VALUE_PARAMETER name:y index:1 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Test.Test>) returnType:T of .Test [operator] $this: VALUE_PARAMETER name: type:.Test.Test> BLOCK_BODY @@ -60,50 +60,6 @@ FILE fqName: fileName:/dataClassMembers.kt : T of .Test x: GET_VAR 'x: T of .Test declared in .Test.copy' type=T of .Test origin=null y: GET_VAR 'y: kotlin.String declared in .Test.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test.Test> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.toString' type=.Test.Test> origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="y=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.toString' type=.Test.Test> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Test.Test> - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null - SET_VAR 'var result: kotlin.Int declared in .Test.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Test.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test' - GET_VAR 'var result: kotlin.Int declared in .Test.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test.Test>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -148,3 +104,47 @@ FILE fqName: fileName:/dataClassMembers.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test.Test> + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null + receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null + receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null + SET_VAR 'var result: kotlin.Int declared in .Test.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Test.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test' + GET_VAR 'var result: kotlin.Int declared in .Test.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test.Test> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Test(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null + receiver: GET_VAR ': .Test.Test> declared in .Test.toString' type=.Test.Test> origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="y=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Test.Test> declared in .Test.toString' type=.Test.Test> origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt.txt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt.txt index 81c4cbb64f3..acbce6de9ce 100644 --- a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt.txt @@ -1,10 +1,4 @@ data class Test { - constructor(x: T, y: String = "") /* primary */ { - super/*Any*/() - /* () */ - - } - val x: T field = x get @@ -13,6 +7,12 @@ data class Test { field = y get + constructor(x: T, y: String = "") /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): T { return .#x } @@ -25,19 +25,6 @@ data class Test { return Test(x = x, y = y) } - override fun toString(): String { - return "Test(" + "x=" + .#x + ", " + "y=" + .#y + ")" - } - - override fun hashCode(): Int { - var result: Int = when { - EQEQ(arg0 = .#x, arg1 = null) -> 0 - else -> .#x.hashCode() - } - result = result.times(other = 31).plus(other = .#y.hashCode()) - return result - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -55,4 +42,18 @@ data class Test { return true } + override fun hashCode(): Int { + var result: Int = when { + EQEQ(arg0 = .#x, arg1 = null) -> 0 + else -> .#x.hashCode() + } + result = result.times(other = 31).plus(other = .#y.hashCode()) + return result + } + + override fun toString(): String { + return "Test(" + "x=" + .#x + ", " + "y=" + .#y + ")" + } + } + diff --git a/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.ir.txt b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.ir.txt index 21b55173b11..85f8b4ddc1c 100644 --- a/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.ir.txt @@ -25,10 +25,6 @@ FILE fqName: fileName:/defaultPropertyAccessors.kt value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:public <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:testMember1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:testMember1 type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -59,6 +55,10 @@ FILE fqName: fileName:/defaultPropertyAccessors.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testMember2 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null value: GET_VAR ': kotlin.Int declared in .Host.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public 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 declared in kotlin.Any @@ -75,14 +75,6 @@ FILE fqName: fileName:/defaultPropertyAccessors.kt CLASS CLASS name:InPrimaryCtor modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.InPrimaryCtor.InPrimaryCtor> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (testInPrimaryCtor1:T of .InPrimaryCtor, testInPrimaryCtor2:kotlin.Int) returnType:.InPrimaryCtor.InPrimaryCtor> [primary] - VALUE_PARAMETER name:testInPrimaryCtor1 index:0 type:T of .InPrimaryCtor - VALUE_PARAMETER name:testInPrimaryCtor2 index:1 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=42 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InPrimaryCtor modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:testInPrimaryCtor1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:testInPrimaryCtor1 type:T of .InPrimaryCtor visibility:private [final] EXPRESSION_BODY @@ -113,6 +105,14 @@ FILE fqName: fileName:/defaultPropertyAccessors.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testInPrimaryCtor2 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .InPrimaryCtor.InPrimaryCtor> declared in .InPrimaryCtor.' type=.InPrimaryCtor.InPrimaryCtor> origin=null value: GET_VAR ': kotlin.Int declared in .InPrimaryCtor.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (testInPrimaryCtor1:T of .InPrimaryCtor, testInPrimaryCtor2:kotlin.Int) returnType:.InPrimaryCtor.InPrimaryCtor> [primary] + VALUE_PARAMETER name:testInPrimaryCtor1 index:0 type:T of .InPrimaryCtor + VALUE_PARAMETER name:testInPrimaryCtor2 index:1 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InPrimaryCtor modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt.txt b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt.txt index bf55b08df1f..c675716b479 100644 --- a/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt.txt @@ -8,12 +8,6 @@ var test2: Int set class Host { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val testMember1: Int field = 42 get @@ -23,15 +17,15 @@ class Host { get set -} - -class InPrimaryCtor { - constructor(testInPrimaryCtor1: T, testInPrimaryCtor2: Int = 42) /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ } +} + +class InPrimaryCtor { val testInPrimaryCtor1: T field = testInPrimaryCtor1 get @@ -41,4 +35,11 @@ class InPrimaryCtor { get set + constructor(testInPrimaryCtor1: T, testInPrimaryCtor2: Int = 42) /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.ir.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.ir.txt deleted file mode 100644 index e600f60b9f1..00000000000 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.ir.txt +++ /dev/null @@ -1,90 +0,0 @@ -FILE fqName: fileName:/delegatedMembers.kt - CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase.IBase> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>, x:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IBase.IBase> - VALUE_PARAMETER name:x index:0 type:kotlin.Int - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IBase.IBase> - FUN name:qux visibility:public modality:ABSTRACT ($this:.IBase.IBase>, t:T of .IBase, x:X of .IBase.qux) returnType:kotlin.Unit - TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.IBase.IBase> - VALUE_PARAMETER name:t index:0 type:T of .IBase - VALUE_PARAMETER name:x index:1 type:X of .IBase.qux - 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: 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 - CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.IBase.Test>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.Test> - TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (impl:.IBase.Test>) returnType:.Test.Test> [primary] - VALUE_PARAMETER name:impl index:0 type:.IBase.Test> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.IBase.Test>]' - FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'impl: .IBase.Test> declared in .Test.' type=.IBase.Test> origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Test.Test>, x:kotlin.Int) returnType:kotlin.Unit - overridden: - public abstract fun foo (x: kotlin.Int): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER name: type:.Test.Test> - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public abstract fun foo (x: kotlin.Int): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:private [final]' type=.IBase.Test> origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.foo' type=.Test.Test> origin=null - x: GET_VAR 'x: kotlin.Int declared in .Test.foo' type=kotlin.Int origin=null - FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN ($this:.Test.Test>, t:TT of .Test, x:X of .Test.qux) returnType:kotlin.Unit - overridden: - public abstract fun qux (t: T of .IBase, x: X of .IBase.qux): kotlin.Unit declared in .IBase - TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.Test.Test> - VALUE_PARAMETER name:t index:0 type:TT of .Test - VALUE_PARAMETER name:x index:1 type:X of .Test.qux - BLOCK_BODY - CALL 'public abstract fun qux (t: T of .IBase, x: X of .IBase.qux): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null - : X of .Test.qux - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:private [final]' type=.IBase.Test> origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.qux' type=.Test.Test> origin=null - t: GET_VAR 't: TT of .Test declared in .Test.qux' type=TT of .Test origin=null - x: GET_VAR 'x: X of .Test.qux declared in .Test.qux' type=X of .Test.qux origin=null - PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract bar: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .IBase - $this: VALUE_PARAMETER name: type:.Test.Test> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test' - CALL 'public abstract fun (): kotlin.Int declared in .IBase' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:private [final]' type=.IBase.Test> origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.' type=.Test.Test> 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 .IBase - $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 .IBase - $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 .IBase - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt deleted file mode 100644 index 9ad1b4ff8af..00000000000 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt +++ /dev/null @@ -1,33 +0,0 @@ -interface IBase { - abstract fun foo(x: Int) - - abstract val bar: Int - abstract get - - abstract fun qux(t: T, x: X) - -} - -class Test : IBase { - constructor(impl: IBase) /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: IBase = impl - override fun foo(x: Int) { - .#$$delegate_0.foo(x = x) - } - - override fun qux(t: TT, x: X) { - .#$$delegate_0.qux(t = t, x = x) - } - - override val bar: Int - override get(): Int { - return .#$$delegate_0.() - } - -} - diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.ir.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.ir.txt index 462d54084dc..593d615a639 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.ir.txt @@ -1,56 +1,15 @@ FILE fqName: fileName:/delegatedMembers.kt - CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase.IBase> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>, x:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IBase.IBase> - VALUE_PARAMETER name:x index:0 type:kotlin.Int - PROPERTY name:bar visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IBase.IBase> - FUN name:qux visibility:public modality:ABSTRACT ($this:.IBase.IBase>, t:T of .IBase, x:X of .IBase.qux) returnType:kotlin.Unit - TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.IBase.IBase> - VALUE_PARAMETER name:t index:0 type:T of .IBase - VALUE_PARAMETER name:x index:1 type:X of .IBase.qux - 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: 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 CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.IBase.Test>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.Test> TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?] reified:false + FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'impl: .IBase.Test> declared in .Test.' type=.IBase.Test> origin=null CONSTRUCTOR visibility:public <> (impl:.IBase.Test>) returnType:.Test.Test> [primary] VALUE_PARAMETER name:impl index:0 type:.IBase.Test> BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.IBase.Test>]' - FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'impl: .IBase.Test> declared in .Test.' type=.IBase.Test> origin=null - PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract bar: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .IBase - $this: VALUE_PARAMETER name: type:.Test.Test> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test' - CALL 'public abstract fun (): kotlin.Int declared in .IBase' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:private [final]' type=.IBase.Test> origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.' type=.Test.Test> origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Test.Test>, x:kotlin.Int) returnType:kotlin.Unit overridden: public abstract fun foo (x: kotlin.Int): kotlin.Unit declared in .IBase @@ -88,3 +47,44 @@ FILE fqName: fileName:/delegatedMembers.kt overridden: public open fun toString (): kotlin.String declared in .IBase $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: kotlin.Int + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.Int + correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in .IBase + $this: VALUE_PARAMETER name: type:.Test.Test> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test' + CALL 'public abstract fun (): kotlin.Int declared in .IBase' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:private [final]' type=.IBase.Test> origin=null + receiver: GET_VAR ': .Test.Test> declared in .Test.' type=.Test.Test> origin=null + CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase.IBase> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>, x:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IBase.IBase> + VALUE_PARAMETER name:x index:0 type:kotlin.Int + FUN name:qux visibility:public modality:ABSTRACT ($this:.IBase.IBase>, t:T of .IBase, x:X of .IBase.qux) returnType:kotlin.Unit + TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.IBase.IBase> + VALUE_PARAMETER name:t index:0 type:T of .IBase + VALUE_PARAMETER name:x index:1 type:X of .IBase.qux + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.IBase.IBase> diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt index 701f9f662df..b8e38e0f412 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface IBase { fun foo(x: Int) val bar: Int diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt.txt index fa6cbe65972..2dd8a508b11 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt.txt @@ -1,26 +1,11 @@ -interface IBase { - abstract fun foo(x: Int) - - abstract val bar: Int - abstract get - - abstract fun qux(t: T, x: X) - -} - class Test : IBase { + private /* final field */ val $$delegate_0: IBase = impl constructor(impl: IBase) /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: IBase = impl - override val bar: Int - override get(): Int { - return .#$$delegate_0.() - } - override fun foo(x: Int) { .#$$delegate_0.foo(x = x) } @@ -29,4 +14,20 @@ class Test : IBase { .#$$delegate_0.qux(t = t, x = x) } + override val bar: Int + override get(): Int { + return .#$$delegate_0.() + } + } + +interface IBase { + abstract fun foo(x: Int) + + abstract fun qux(t: T, x: X) + + abstract val bar: Int + abstract get + +} + diff --git a/compiler/testData/ir/irText/declarations/parameters/fun.ir.txt b/compiler/testData/ir/irText/declarations/parameters/fun.ir.txt index 8e34a76ab23..d3019a8d296 100644 --- a/compiler/testData/ir/irText/declarations/parameters/fun.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/fun.ir.txt @@ -1,4 +1,36 @@ FILE fqName: fileName:/fun.kt + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:public <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public 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 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:testMembetExt1 visibility:public modality:FINAL <> ($this:.Host, $receiver:kotlin.String, i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Host + $receiver: VALUE_PARAMETER name: type:kotlin.String + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:j index:1 type:kotlin.String + BLOCK_BODY + FUN name:testMembetExt2 visibility:public modality:FINAL ($this:.Host, $receiver:kotlin.String, i:kotlin.Int, j:T of .Host.testMembetExt2) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.Host + $receiver: VALUE_PARAMETER name: type:kotlin.String + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:j index:1 type:T of .Host.testMembetExt2 + BLOCK_BODY FUN name:test1 visibility:public modality:FINAL (i:kotlin.Int, j:T of .test1) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:i index:0 type:kotlin.Int @@ -20,35 +52,3 @@ FILE fqName: fileName:/fun.kt VALUE_PARAMETER name:i index:0 type:kotlin.Int VALUE_PARAMETER name:j index:1 type:kotlin.String BLOCK_BODY - CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:public <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:testMembetExt1 visibility:public modality:FINAL <> ($this:.Host, $receiver:kotlin.String, i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Host - $receiver: VALUE_PARAMETER name: type:kotlin.String - VALUE_PARAMETER name:i index:0 type:kotlin.Int - VALUE_PARAMETER name:j index:1 type:kotlin.String - BLOCK_BODY - FUN name:testMembetExt2 visibility:public modality:FINAL ($this:.Host, $receiver:kotlin.String, i:kotlin.Int, j:T of .Host.testMembetExt2) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.Host - $receiver: VALUE_PARAMETER name: type:kotlin.String - VALUE_PARAMETER name:i index:0 type:kotlin.Int - VALUE_PARAMETER name:j index:1 type:T of .Host.testMembetExt2 - BLOCK_BODY - 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: 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 diff --git a/compiler/testData/ir/irText/declarations/parameters/fun.kt.txt b/compiler/testData/ir/irText/declarations/parameters/fun.kt.txt index 031726eb703..63bcbb5d13a 100644 --- a/compiler/testData/ir/irText/declarations/parameters/fun.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/fun.kt.txt @@ -1,15 +1,3 @@ -fun test1(i: Int, j: T) { -} - -fun test2(i: Int = 0, j: String = "") { -} - -fun test3(vararg args: String) { -} - -fun String.textExt1(i: Int, j: String) { -} - class Host { constructor() /* primary */ { super/*Any*/() @@ -24,3 +12,16 @@ class Host { } } + +fun test1(i: Int, j: T) { +} + +fun test2(i: Int = 0, j: String = "") { +} + +fun test3(vararg args: String) { +} + +fun String.textExt1(i: Int, j: String) { +} + diff --git a/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.ir.txt b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.ir.txt index a9862617988..bdc52430721 100644 --- a/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.ir.txt @@ -2,10 +2,6 @@ FILE fqName: fileName:/genericInnerClass.kt CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Outer.Outer> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -14,11 +10,6 @@ FILE fqName: fileName:/genericInnerClass.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer.Inner, T1 of .Outer>, x1:T1 of .Outer, x2:T2 of .Outer.Inner) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> - VALUE_PARAMETER name:x1 index:0 type:T1 of .Outer - VALUE_PARAMETER name:x2 index:1 type:T2 of .Outer.Inner - BLOCK_BODY 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 @@ -32,6 +23,15 @@ FILE fqName: fileName:/genericInnerClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer.Inner, T1 of .Outer>, x1:T1 of .Outer, x2:T2 of .Outer.Inner) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> + VALUE_PARAMETER name:x1 index:0 type:T1 of .Outer + VALUE_PARAMETER name:x2 index:1 type:T2 of .Outer.Inner + BLOCK_BODY + CONSTRUCTOR visibility:public <> () returnType:.Outer.Outer> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt.txt b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt.txt index d32e11338bf..ec46c8ebd8c 100644 --- a/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt.txt @@ -1,10 +1,4 @@ class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - inner class Inner { constructor() /* primary */ { super/*Any*/() @@ -17,4 +11,11 @@ class Outer { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.ir.txt b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.ir.txt index 92c45ba001a..d1b7f14e761 100644 --- a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.ir.txt @@ -1,61 +1,4 @@ FILE fqName: fileName:/propertyAccessors.kt - PROPERTY name:test1 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 - PROPERTY name:test2 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - PROPERTY name:testExt1 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Int - correspondingProperty: PROPERTY name:testExt1 visibility:public modality:FINAL [val] - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 - PROPERTY name:testExt2 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Int - correspondingProperty: PROPERTY name:testExt2 visibility:public modality:FINAL [var] - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String, value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:testExt2 visibility:public modality:FINAL [var] - $receiver: VALUE_PARAMETER name: type:kotlin.String - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - PROPERTY name:testExt3 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:kotlin.Int - correspondingProperty: PROPERTY name:testExt3 visibility:public modality:FINAL [val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:T of . - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 - PROPERTY name:testExt4 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:kotlin.Int - correspondingProperty: PROPERTY name:testExt4 visibility:public modality:FINAL [var] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:T of . - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL ($receiver:T of ., value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:testExt4 visibility:public modality:FINAL [var] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:T of . - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.Host> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -63,6 +6,19 @@ FILE fqName: fileName:/propertyAccessors.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public 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 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 PROPERTY name:testMem1 visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>) returnType:kotlin.Int correspondingProperty: PROPERTY name:testMem1 visibility:public modality:FINAL [val] @@ -129,16 +85,60 @@ FILE fqName: fileName:/propertyAccessors.kt $receiver: VALUE_PARAMETER name: type:TT of .Host. VALUE_PARAMETER name:value index:0 type:kotlin.Int BLOCK_BODY - 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: 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 + PROPERTY name:test1 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + PROPERTY name:test2 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + PROPERTY name:testExt1 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Int + correspondingProperty: PROPERTY name:testExt1 visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + PROPERTY name:testExt2 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Int + correspondingProperty: PROPERTY name:testExt2 visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String, value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testExt2 visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:kotlin.String + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + PROPERTY name:testExt3 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:kotlin.Int + correspondingProperty: PROPERTY name:testExt3 visibility:public modality:FINAL [val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:T of . + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + PROPERTY name:testExt4 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:kotlin.Int + correspondingProperty: PROPERTY name:testExt4 visibility:public modality:FINAL [var] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:T of . + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL ($receiver:T of ., value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testExt4 visibility:public modality:FINAL [var] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:T of . + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt.txt b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt.txt index 73ddf34fa13..b27da6b998d 100644 --- a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt.txt @@ -1,39 +1,3 @@ -val test1: Int - get(): Int { - return 42 - } - -var test2: Int - get(): Int { - return 42 - } - set(value: Int) { - } - -val String.testExt1: Int - get(): Int { - return 42 - } - -var String.testExt2: Int - get(): Int { - return 42 - } - set(value: Int) { - } - -val T.testExt3: Int - get(): Int { - return 42 - } - -var T.testExt4: Int - get(): Int { - return 42 - } - set(value: Int) { - } - class Host { constructor() /* primary */ { super/*Any*/() @@ -78,3 +42,40 @@ class Host { } } + +val test1: Int + get(): Int { + return 42 + } + +var test2: Int + get(): Int { + return 42 + } + set(value: Int) { + } + +val String.testExt1: Int + get(): Int { + return 42 + } + +var String.testExt2: Int + get(): Int { + return 42 + } + set(value: Int) { + } + +val T.testExt3: Int + get(): Int { + return 42 + } + +var T.testExt4: Int + get(): Int { + return 42 + } + set(value: Int) { + } + diff --git a/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.ir.txt b/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.ir.txt index e320e772d62..614e1065324 100644 --- a/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.ir.txt @@ -19,6 +19,30 @@ FILE fqName: fileName:/typeParameterBoundedBySubclass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Base2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base2 + CONSTRUCTOR visibility:public <> () returnType:.Base2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base2 modality:ABSTRACT visibility:public 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 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:foo visibility:public modality:FINAL ($this:.Base2, x:T of .Base2.foo) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[.Derived2] reified:false + $this: VALUE_PARAMETER name: type:.Base2 + VALUE_PARAMETER name:x index:0 type:T of .Base2.foo + BLOCK_BODY CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base1<.Derived1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived1 CONSTRUCTOR visibility:public <> () returnType:.Derived1 [primary] @@ -39,47 +63,23 @@ FILE fqName: fileName:/typeParameterBoundedBySubclass.kt overridden: public open fun toString (): kotlin.String declared in .Base1 $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Base2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base2 - CONSTRUCTOR visibility:public <> () returnType:.Base2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL ($this:.Base2, x:T of .Base2.foo) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[.Derived2] reified:false - $this: VALUE_PARAMETER name: type:.Base2 - VALUE_PARAMETER name:x index:0 type:T of .Base2.foo - BLOCK_BODY - 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: 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 CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Base2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived2 CONSTRUCTOR visibility:public <> () returnType:.Derived2 [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base2' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Base2]' + 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 .Base2 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL ($this:.Base2, x:T of .Derived2.foo) returnType:kotlin.Unit [fake_override] overridden: public final fun foo (x: T of .Base2.foo): kotlin.Unit declared in .Base2 TYPE_PARAMETER name:T index:0 variance: superTypes:[.Derived2] reified:false $this: VALUE_PARAMETER name: type:.Base2 VALUE_PARAMETER name:x index:0 type:T of .Derived2.foo - 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 .Base2 - $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 .Base2 diff --git a/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.kt.txt b/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.kt.txt index b070d0dcb67..638a761ff8f 100644 --- a/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.kt.txt @@ -7,15 +7,6 @@ abstract class Base1 { } -class Derived1 : Base1 { - constructor() /* primary */ { - super/*Base1*/() - /* () */ - - } - -} - abstract class Base2 { constructor() /* primary */ { super/*Any*/() @@ -28,6 +19,15 @@ abstract class Base2 { } +class Derived1 : Base1 { + constructor() /* primary */ { + super/*Base1*/() + /* () */ + + } + +} + class Derived2 : Base2 { constructor() /* primary */ { super/*Base2*/() @@ -36,3 +36,4 @@ class Derived2 : Base2 { } } + diff --git a/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.ir.txt b/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.ir.txt index 36aa2fc111a..60d5bf946e0 100644 --- a/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.ir.txt @@ -1,24 +1,4 @@ FILE fqName: fileName:/useNextParamInLambda.kt - FUN name:f visibility:public modality:FINAL <> (f1:kotlin.Function0, f2:kotlin.Function0) returnType:kotlin.String - VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 - EXPRESSION_BODY - FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .f' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.String origin=INVOKE - $this: GET_VAR 'f2: kotlin.Function0 declared in .f' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION - VALUE_PARAMETER name:f2 index:1 type:kotlin.Function0 - EXPRESSION_BODY - FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .f' - CONST String type=kotlin.String value="FAIL" - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (f1: kotlin.Function0, f2: kotlin.Function0): kotlin.String declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.String origin=INVOKE - $this: GET_VAR 'f1: kotlin.Function0 declared in .f' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:result type:kotlin.String [var] @@ -46,3 +26,23 @@ FILE fqName: fileName:/useNextParamInLambda.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' CONST String type=kotlin.String value="K" + FUN name:f visibility:public modality:FINAL <> (f1:kotlin.Function0, f2:kotlin.Function0) returnType:kotlin.String + VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 + EXPRESSION_BODY + FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .f' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.String origin=INVOKE + $this: GET_VAR 'f2: kotlin.Function0 declared in .f' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + VALUE_PARAMETER name:f2 index:1 type:kotlin.Function0 + EXPRESSION_BODY + FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .f' + CONST String type=kotlin.String value="FAIL" + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (f1: kotlin.Function0, f2: kotlin.Function0): kotlin.String declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.String origin=INVOKE + $this: GET_VAR 'f1: kotlin.Function0 declared in .f' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.kt.txt b/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.kt.txt index bdb53cea279..e7cd261f55a 100644 --- a/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.kt.txt @@ -1,13 +1,3 @@ -fun f(f1: Function0 = local fun (): String { - return f2.invoke() -} -, f2: Function0 = local fun (): String { - return "FAIL" -} -): String { - return f1.invoke() -} - fun box(): String { var result: String = "fail" try { // BLOCK @@ -25,3 +15,14 @@ fun box(): String { } )) } + +fun f(f1: Function0 = local fun (): String { + return f2.invoke() +} +, f2: Function0 = local fun (): String { + return "FAIL" +} +): String { + return f1.invoke() +} + diff --git a/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.ir.txt b/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.ir.txt index 86b136022db..c9569088e7a 100644 --- a/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.ir.txt +++ b/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.ir.txt @@ -1,13 +1,6 @@ FILE fqName: fileName:/primaryCtorDefaultArguments.kt CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -19,6 +12,13 @@ FILE fqName: fileName:/primaryCtorDefaultArguments.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.kt.txt b/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.kt.txt index 2f0fb68dcc1..23e198bff72 100644 --- a/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.kt.txt +++ b/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.kt.txt @@ -1,12 +1,13 @@ class Test { + val x: Int + field = x + get + constructor(x: Int = 0) /* primary */ { super/*Any*/() /* () */ } - val x: Int - field = x - get - } + diff --git a/compiler/testData/ir/irText/declarations/primaryCtorProperties.ir.txt b/compiler/testData/ir/irText/declarations/primaryCtorProperties.ir.txt index 61b76b71401..3a3cf28afc9 100644 --- a/compiler/testData/ir/irText/declarations/primaryCtorProperties.ir.txt +++ b/compiler/testData/ir/irText/declarations/primaryCtorProperties.ir.txt @@ -1,12 +1,6 @@ FILE fqName: fileName:/primaryCtorProperties.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (test1:kotlin.Int, test2:kotlin.Int) returnType:.C [primary] - VALUE_PARAMETER name:test1 index:0 type:kotlin.Int - VALUE_PARAMETER name:test2 index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -37,6 +31,12 @@ FILE fqName: fileName:/primaryCtorProperties.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (test1:kotlin.Int, test2:kotlin.Int) returnType:.C [primary] + VALUE_PARAMETER name:test1 index:0 type:kotlin.Int + VALUE_PARAMETER name:test2 index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/primaryCtorProperties.kt.txt b/compiler/testData/ir/irText/declarations/primaryCtorProperties.kt.txt index 45b14209c1f..3ac0777b59b 100644 --- a/compiler/testData/ir/irText/declarations/primaryCtorProperties.kt.txt +++ b/compiler/testData/ir/irText/declarations/primaryCtorProperties.kt.txt @@ -1,10 +1,4 @@ class C { - constructor(test1: Int, test2: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val test1: Int field = test1 get @@ -14,4 +8,11 @@ class C { get set + constructor(test1: Int, test2: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.ir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.ir.txt index 7dbd0aab1fd..d8b2e7f9110 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.ir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.ir.txt @@ -1,50 +1,4 @@ FILE fqName: fileName:/differentReceivers.kt - CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyClass - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.MyClass [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.String declared in .MyClass.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyClass) returnType:kotlin.String - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.MyClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .MyClass' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .MyClass declared in .MyClass.' type=.MyClass 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: 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:provideDelegate visibility:public modality:FINAL <> ($receiver:.MyClass, host:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String [operator] - $receiver: VALUE_PARAMETER name: type:.MyClass - VALUE_PARAMETER name:host index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' - CALL 'public final fun (): kotlin.String declared in .MyClass' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .MyClass declared in .provideDelegate' type=.MyClass origin=null - FUN name:getValue visibility:public modality:FINAL <> ($receiver:kotlin.String, receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String [operator] - $receiver: VALUE_PARAMETER name: type:kotlin.String - VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' - GET_VAR ': kotlin.String declared in .getValue' type=kotlin.String origin=null PROPERTY name:testO visibility:public modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:testO$delegate type:kotlin.String visibility:private [final,static] EXPRESSION_BODY @@ -84,3 +38,49 @@ FILE fqName: fileName:/differentReceivers.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testOK type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null + CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyClass + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .MyClass.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyClass) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.MyClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .MyClass' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .MyClass declared in .MyClass.' type=.MyClass origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.MyClass [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public 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 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:getValue visibility:public modality:FINAL <> ($receiver:kotlin.String, receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String [operator] + $receiver: VALUE_PARAMETER name: type:kotlin.String + VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' + GET_VAR ': kotlin.String declared in .getValue' type=kotlin.String origin=null + FUN name:provideDelegate visibility:public modality:FINAL <> ($receiver:.MyClass, host:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String [operator] + $receiver: VALUE_PARAMETER name: type:.MyClass + VALUE_PARAMETER name:host index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' + CALL 'public final fun (): kotlin.String declared in .MyClass' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .MyClass declared in .provideDelegate' type=.MyClass origin=null diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt.txt index 31861c9d41d..274079ced05 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt.txt @@ -1,24 +1,3 @@ -class MyClass { - constructor(value: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val value: String - field = value - get - -} - -operator fun MyClass.provideDelegate(host: Any?, p: Any): String { - return .() -} - -operator fun String.getValue(receiver: Any?, p: Any): String { - return -} - val testO: String /* by */ field = MyClass(value = "O").provideDelegate(host = null, p = ::testO) get(): String { @@ -34,3 +13,25 @@ val testK: String /* by */ val testOK: String field = ().plus(other = ()) get + +class MyClass { + val value: String + field = value + get + + constructor(value: String) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +operator fun String.getValue(receiver: Any?, p: Any): String { + return +} + +operator fun MyClass.provideDelegate(host: Any?, p: Any): String { + return .() +} + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/local.ir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/local.ir.txt index bbf3994dd65..3391bad447e 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/local.ir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/local.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/local.kt CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Delegate [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,14 +12,11 @@ FILE fqName: fileName:/local.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Delegate' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:kotlin.String [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.Any? + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Delegate [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' - CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .Delegate declared in .Delegate.getValue' type=.Delegate origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public 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 declared in kotlin.Any @@ -38,13 +30,16 @@ FILE fqName: fileName:/local.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:kotlin.String [operator] + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' + CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .Delegate declared in .Delegate.getValue' type=.Delegate origin=null CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DelegateProvider - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.DelegateProvider [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -56,15 +51,11 @@ FILE fqName: fileName:/local.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .DelegateProvider' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .DelegateProvider declared in .DelegateProvider.' type=.DelegateProvider origin=null - FUN name:provideDelegate visibility:public modality:FINAL <> ($this:.DelegateProvider, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:.Delegate [operator] - $this: VALUE_PARAMETER name: type:.DelegateProvider - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.Any? + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.DelegateProvider [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' - CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) declared in .Delegate' type=.Delegate origin=null - value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider.provideDelegate' type=.DelegateProvider origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegateProvider modality:FINAL visibility:public 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 declared in kotlin.Any @@ -78,6 +69,15 @@ FILE fqName: fileName:/local.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:provideDelegate visibility:public modality:FINAL <> ($this:.DelegateProvider, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:.Delegate [operator] + $this: VALUE_PARAMETER name: type:.DelegateProvider + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' + CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) declared in .Delegate' type=.Delegate origin=null + value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider.provideDelegate' type=.DelegateProvider origin=null FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY LOCAL_DELEGATED_PROPERTY name:testMember type:kotlin.String flags:val diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/local.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/local.kt.txt index 2774c2e6739..56e8e1e5707 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/local.kt.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/local.kt.txt @@ -1,14 +1,14 @@ class Delegate { + val value: String + field = value + get + constructor(value: String) /* primary */ { super/*Any*/() /* () */ } - val value: String - field = value - get - operator fun getValue(thisRef: Any?, property: Any?): String { return .() } @@ -16,16 +16,16 @@ class Delegate { } class DelegateProvider { + val value: String + field = value + get + constructor(value: String) /* primary */ { super/*Any*/() /* () */ } - val value: String - field = value - get - operator fun provideDelegate(thisRef: Any?, property: Any?): Delegate { return Delegate(value = .()) } @@ -40,3 +40,4 @@ fun foo() { } } + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.ir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.ir.txt index 7edf2f401ee..0dbcb9eaa9d 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.ir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/localDifferentReceivers.kt CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyClass - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.MyClass [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/localDifferentReceivers.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .MyClass' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .MyClass declared in .MyClass.' type=.MyClass origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.MyClass [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public 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 declared in kotlin.Any @@ -30,21 +30,6 @@ FILE fqName: fileName:/localDifferentReceivers.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:provideDelegate visibility:public modality:FINAL <> ($receiver:.MyClass, host:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String [operator] - $receiver: VALUE_PARAMETER name: type:.MyClass - VALUE_PARAMETER name:host index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' - CALL 'public final fun (): kotlin.String declared in .MyClass' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .MyClass declared in .provideDelegate' type=.MyClass origin=null - FUN name:getValue visibility:public modality:FINAL <> ($receiver:kotlin.String, receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String [operator] - $receiver: VALUE_PARAMETER name: type:kotlin.String - VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' - GET_VAR ': kotlin.String declared in .getValue' type=kotlin.String origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY LOCAL_DELEGATED_PROPERTY name:testO type:kotlin.String flags:val @@ -77,3 +62,18 @@ FILE fqName: fileName:/localDifferentReceivers.kt other: CALL 'local final fun (): kotlin.String declared in .box' type=kotlin.String origin=GET_LOCAL_PROPERTY RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' GET_VAR 'val testOK: kotlin.String declared in .box' type=kotlin.String origin=null + FUN name:getValue visibility:public modality:FINAL <> ($receiver:kotlin.String, receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String [operator] + $receiver: VALUE_PARAMETER name: type:kotlin.String + VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' + GET_VAR ': kotlin.String declared in .getValue' type=kotlin.String origin=null + FUN name:provideDelegate visibility:public modality:FINAL <> ($receiver:.MyClass, host:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String [operator] + $receiver: VALUE_PARAMETER name: type:.MyClass + VALUE_PARAMETER name:host index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' + CALL 'public final fun (): kotlin.String declared in .MyClass' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .MyClass declared in .provideDelegate' type=.MyClass origin=null diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.kt.txt index 613eccbfd1c..7df1091dd6a 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.kt.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.kt.txt @@ -1,22 +1,14 @@ class MyClass { + val value: String + field = value + get + constructor(value: String) /* primary */ { super/*Any*/() /* () */ } - val value: String - field = value - get - -} - -operator fun MyClass.provideDelegate(host: Any?, p: Any): String { - return .() -} - -operator fun String.getValue(receiver: Any?, p: Any): String { - return } fun box(): String { @@ -35,3 +27,12 @@ fun box(): String { val testOK: String = ().plus(other = ()) return testOK } + +operator fun String.getValue(receiver: Any?, p: Any): String { + return +} + +operator fun MyClass.provideDelegate(host: Any?, p: Any): String { + return .() +} + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/member.ir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/member.ir.txt index f7e89475472..4daaee73b0e 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/member.ir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/member.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/member.kt CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Delegate [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -17,14 +12,11 @@ FILE fqName: fileName:/member.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Delegate' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:kotlin.String [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.Any? + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Delegate [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' - CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .Delegate declared in .Delegate.getValue' type=.Delegate origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public 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 declared in kotlin.Any @@ -38,13 +30,16 @@ FILE fqName: fileName:/member.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:kotlin.String [operator] + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' + CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .Delegate declared in .Delegate.getValue' type=.Delegate origin=null CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DelegateProvider - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.DelegateProvider [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -56,15 +51,11 @@ FILE fqName: fileName:/member.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .DelegateProvider' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .DelegateProvider declared in .DelegateProvider.' type=.DelegateProvider origin=null - FUN name:provideDelegate visibility:public modality:FINAL <> ($this:.DelegateProvider, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:.Delegate [operator] - $this: VALUE_PARAMETER name: type:.DelegateProvider - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.Any? + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.DelegateProvider [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' - CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) declared in .Delegate' type=.Delegate origin=null - value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider.provideDelegate' type=.DelegateProvider origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegateProvider modality:FINAL visibility:public 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 declared in kotlin.Any @@ -78,12 +69,17 @@ FILE fqName: fileName:/member.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:provideDelegate visibility:public modality:FINAL <> ($this:.DelegateProvider, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:.Delegate [operator] + $this: VALUE_PARAMETER name: type:.DelegateProvider + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' + CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) declared in .Delegate' type=.Delegate origin=null + value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider.provideDelegate' type=.DelegateProvider origin=null CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:public <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:testMember visibility:public modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:testMember$delegate type:.Delegate visibility:private [final] EXPRESSION_BODY @@ -102,6 +98,10 @@ FILE fqName: fileName:/member.kt receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null thisRef: GET_VAR ': .Host declared in .Host.' type=.Host origin=null property: PROPERTY_REFERENCE 'public final testMember: kotlin.String' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty1<.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE + CONSTRUCTOR visibility:public <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/member.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/member.kt.txt index 73d6ed07b52..a2ee9feb41f 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/member.kt.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/member.kt.txt @@ -1,14 +1,14 @@ class Delegate { + val value: String + field = value + get + constructor(value: String) /* primary */ { super/*Any*/() /* () */ } - val value: String - field = value - get - operator fun getValue(thisRef: Any?, property: Any?): String { return .() } @@ -16,16 +16,16 @@ class Delegate { } class DelegateProvider { + val value: String + field = value + get + constructor(value: String) /* primary */ { super/*Any*/() /* () */ } - val value: String - field = value - get - operator fun provideDelegate(thisRef: Any?, property: Any?): Delegate { return Delegate(value = .()) } @@ -33,16 +33,17 @@ class DelegateProvider { } class Host { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val testMember: String /* by */ field = DelegateProvider(value = "OK").provideDelegate(thisRef = , property = Host::testMember) get(): String { return .#testMember$delegate.getValue(thisRef = , property = Host::testMember) } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.ir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.ir.txt index 8ac7f9fa5c6..d3d28a021bc 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.ir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.ir.txt @@ -1,60 +1,6 @@ FILE fqName: fileName:/memberExtension.kt CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:private <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS CLASS name:StringDelegate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.StringDelegate - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.Host.StringDelegate [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:StringDelegate modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:s visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 's: kotlin.String declared in .Host.StringDelegate.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host.StringDelegate) returnType:kotlin.String - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Host.StringDelegate - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Host.StringDelegate' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Host.StringDelegate declared in .Host.StringDelegate.' type=.Host.StringDelegate origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:.Host.StringDelegate, receiver:kotlin.String, p:kotlin.Any) returnType:kotlin.String [operator] - $this: VALUE_PARAMETER name: type:.Host.StringDelegate - VALUE_PARAMETER name:receiver index:0 type:kotlin.String - VALUE_PARAMETER name:p index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (receiver: kotlin.String, p: kotlin.Any): kotlin.String declared in .Host.StringDelegate' - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS - $this: GET_VAR 'receiver: kotlin.String declared in .Host.StringDelegate.getValue' type=kotlin.String origin=null - other: CALL 'public final fun (): kotlin.String declared in .Host.StringDelegate' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .Host.StringDelegate declared in .Host.StringDelegate.getValue' type=.Host.StringDelegate 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: 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:provideDelegate visibility:public modality:FINAL <> ($this:.Host, $receiver:kotlin.String, host:kotlin.Any?, p:kotlin.Any) returnType:.Host.StringDelegate [operator] - $this: VALUE_PARAMETER name: type:.Host - $receiver: VALUE_PARAMETER name: type:kotlin.String - VALUE_PARAMETER name:host index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): .Host.StringDelegate declared in .Host' - CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in .Host.StringDelegate' type=.Host.StringDelegate origin=null - s: GET_VAR ': kotlin.String declared in .Host.provideDelegate' type=kotlin.String origin=null PROPERTY name:plusK visibility:public modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:plusK$delegate type:.Host.StringDelegate visibility:private [final] EXPRESSION_BODY @@ -87,6 +33,51 @@ FILE fqName: fileName:/memberExtension.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Host' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null + CLASS CLASS name:StringDelegate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.StringDelegate + PROPERTY name:s visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 's: kotlin.String declared in .Host.StringDelegate.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host.StringDelegate) returnType:kotlin.String + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host.StringDelegate + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Host.StringDelegate' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Host.StringDelegate declared in .Host.StringDelegate.' type=.Host.StringDelegate origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.Host.StringDelegate [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:StringDelegate modality:FINAL visibility:public 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 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:getValue visibility:public modality:FINAL <> ($this:.Host.StringDelegate, receiver:kotlin.String, p:kotlin.Any) returnType:kotlin.String [operator] + $this: VALUE_PARAMETER name: type:.Host.StringDelegate + VALUE_PARAMETER name:receiver index:0 type:kotlin.String + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (receiver: kotlin.String, p: kotlin.Any): kotlin.String declared in .Host.StringDelegate' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS + $this: GET_VAR 'receiver: kotlin.String declared in .Host.StringDelegate.getValue' type=kotlin.String origin=null + other: CALL 'public final fun (): kotlin.String declared in .Host.StringDelegate' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .Host.StringDelegate declared in .Host.StringDelegate.getValue' type=.Host.StringDelegate origin=null + CONSTRUCTOR visibility:private <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public 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 declared in kotlin.Any @@ -100,3 +91,12 @@ FILE fqName: fileName:/memberExtension.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:provideDelegate visibility:public modality:FINAL <> ($this:.Host, $receiver:kotlin.String, host:kotlin.Any?, p:kotlin.Any) returnType:.Host.StringDelegate [operator] + $this: VALUE_PARAMETER name: type:.Host + $receiver: VALUE_PARAMETER name: type:kotlin.String + VALUE_PARAMETER name:host index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): .Host.StringDelegate declared in .Host' + CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in .Host.StringDelegate' type=.Host.StringDelegate origin=null + s: GET_VAR ': kotlin.String declared in .Host.provideDelegate' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.kt.txt index 175e23fdae8..421eb3a1d71 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.kt.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.kt.txt @@ -1,31 +1,4 @@ object Host { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - class StringDelegate { - constructor(s: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val s: String - field = s - get - - operator fun getValue(receiver: String, p: Any): String { - return receiver.plus(other = .()) - } - - } - - operator fun String.provideDelegate(host: Any?, p: Any): StringDelegate { - return StringDelegate(s = ) - } - val String.plusK: String /* by */ field = (, "K").provideDelegate(host = , p = Host::plusK) get(): String { @@ -36,4 +9,32 @@ object Host { field = (, "O").() get + class StringDelegate { + val s: String + field = s + get + + constructor(s: String) /* primary */ { + super/*Any*/() + /* () */ + + } + + operator fun getValue(receiver: String, p: Any): String { + return receiver.plus(other = .()) + } + + } + + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + operator fun String.provideDelegate(host: Any?, p: Any): StringDelegate { + return StringDelegate(s = ) + } + } + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.ir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.ir.txt index 80ea3a06281..d1a9d343a14 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.ir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.ir.txt @@ -1,83 +1,4 @@ FILE fqName: fileName:/topLevel.kt - CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Delegate [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.String declared in .Delegate.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Delegate) returnType:kotlin.String - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Delegate - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Delegate' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:kotlin.String [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' - CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .Delegate declared in .Delegate.getValue' type=.Delegate 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: 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 - CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DelegateProvider - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.DelegateProvider [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.String declared in .DelegateProvider.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DelegateProvider) returnType:kotlin.String - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.DelegateProvider - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .DelegateProvider' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .DelegateProvider declared in .DelegateProvider.' type=.DelegateProvider origin=null - FUN name:provideDelegate visibility:public modality:FINAL <> ($this:.DelegateProvider, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:.Delegate [operator] - $this: VALUE_PARAMETER name: type:.DelegateProvider - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' - CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) declared in .Delegate' type=.Delegate origin=null - value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider.provideDelegate' type=.DelegateProvider 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: 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 PROPERTY name:testTopLevel visibility:public modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:testTopLevel$delegate type:.Delegate visibility:private [final,static] EXPRESSION_BODY @@ -94,3 +15,82 @@ FILE fqName: fileName:/topLevel.kt $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:testTopLevel$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=null thisRef: CONST Null type=kotlin.Nothing? value=null property: PROPERTY_REFERENCE 'public final testTopLevel: kotlin.String' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .Delegate.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Delegate) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Delegate + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Delegate' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Delegate [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public 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 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:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:kotlin.String [operator] + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' + CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .Delegate declared in .Delegate.getValue' type=.Delegate origin=null + CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DelegateProvider + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .DelegateProvider.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DelegateProvider) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.DelegateProvider + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .DelegateProvider' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .DelegateProvider declared in .DelegateProvider.' type=.DelegateProvider origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.DelegateProvider [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegateProvider modality:FINAL visibility:public 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 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:provideDelegate visibility:public modality:FINAL <> ($this:.DelegateProvider, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:.Delegate [operator] + $this: VALUE_PARAMETER name: type:.DelegateProvider + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' + CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) declared in .Delegate' type=.Delegate origin=null + value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider.provideDelegate' type=.DelegateProvider origin=null diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt.txt index 71f73d8bf2f..e5e029378d5 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt.txt @@ -1,14 +1,20 @@ +val testTopLevel: String /* by */ + field = DelegateProvider(value = "OK").provideDelegate(thisRef = null, property = ::testTopLevel) + get(): String { + return #testTopLevel$delegate.getValue(thisRef = null, property = ::testTopLevel) + } + class Delegate { + val value: String + field = value + get + constructor(value: String) /* primary */ { super/*Any*/() /* () */ } - val value: String - field = value - get - operator fun getValue(thisRef: Any?, property: Any?): String { return .() } @@ -16,24 +22,19 @@ class Delegate { } class DelegateProvider { + val value: String + field = value + get + constructor(value: String) /* primary */ { super/*Any*/() /* () */ } - val value: String - field = value - get - operator fun provideDelegate(thisRef: Any?, property: Any?): Delegate { return Delegate(value = .()) } } -val testTopLevel: String /* by */ - field = DelegateProvider(value = "OK").provideDelegate(thisRef = null, property = ::testTopLevel) - get(): String { - return #testTopLevel$delegate.getValue(thisRef = null, property = ::testTopLevel) - } diff --git a/compiler/testData/ir/irText/declarations/typeAlias.fir.ir.txt b/compiler/testData/ir/irText/declarations/typeAlias.fir.ir.txt index 095a21c460d..eccc7d282cb 100644 --- a/compiler/testData/ir/irText/declarations/typeAlias.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/typeAlias.fir.ir.txt @@ -1,8 +1,4 @@ FILE fqName: fileName:/typeAlias.kt - TYPEALIAS name:Test1 visibility:public expandedType:kotlin.String - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - BLOCK type=kotlin.Unit origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] @@ -22,3 +18,7 @@ FILE fqName: fileName:/typeAlias.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + BLOCK type=kotlin.Unit origin=null + TYPEALIAS name:Test1 visibility:public expandedType:kotlin.String diff --git a/compiler/testData/ir/irText/declarations/typeAlias.fir.kt.txt b/compiler/testData/ir/irText/declarations/typeAlias.fir.kt.txt index f10bbf8eb16..bccb5159c44 100644 --- a/compiler/testData/ir/irText/declarations/typeAlias.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/typeAlias.fir.kt.txt @@ -1,9 +1,3 @@ -typealias Test1 = String -fun foo() { - { // BLOCK - } -} - class C { constructor() /* primary */ { super/*Any*/() @@ -12,3 +6,10 @@ class C { } } + +fun foo() { + { // BLOCK + } +} + +typealias Test1 = String diff --git a/compiler/testData/ir/irText/declarations/typeAlias.ir.txt b/compiler/testData/ir/irText/declarations/typeAlias.ir.txt index 751f419baed..1bdbf25eeec 100644 --- a/compiler/testData/ir/irText/declarations/typeAlias.ir.txt +++ b/compiler/testData/ir/irText/declarations/typeAlias.ir.txt @@ -1,17 +1,10 @@ FILE fqName: fileName:/typeAlias.kt - TYPEALIAS name:Test1 visibility:public expandedType:kotlin.String - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - BLOCK type=kotlin.Unit origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - TYPEALIAS name:TestNested visibility:public expandedType:kotlin.String - annotations: - Suppress(names = ["TOPLEVEL_TYPEALIASES_ONLY"]) 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 @@ -25,3 +18,10 @@ FILE fqName: fileName:/typeAlias.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + TYPEALIAS name:TestNested visibility:public expandedType:kotlin.String + annotations: + Suppress(names = ["TOPLEVEL_TYPEALIASES_ONLY"]) + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + BLOCK type=kotlin.Unit origin=null + TYPEALIAS name:Test1 visibility:public expandedType:kotlin.String diff --git a/compiler/testData/ir/irText/declarations/typeAlias.kt.txt b/compiler/testData/ir/irText/declarations/typeAlias.kt.txt index ff5649c6525..0f805d8884e 100644 --- a/compiler/testData/ir/irText/declarations/typeAlias.kt.txt +++ b/compiler/testData/ir/irText/declarations/typeAlias.kt.txt @@ -1,9 +1,3 @@ -typealias Test1 = String -fun foo() { - { // BLOCK - } -} - class C { constructor() /* primary */ { super/*Any*/() @@ -14,3 +8,10 @@ class C { @Suppress(names = ["TOPLEVEL_TYPEALIASES_ONLY"]) typealias TestNested = String } + +fun foo() { + { // BLOCK + } +} + +typealias Test1 = String diff --git a/compiler/testData/ir/irText/errors/suppressedNonPublicCall.ir.txt b/compiler/testData/ir/irText/errors/suppressedNonPublicCall.ir.txt index 5a66af2c878..b750e5087fe 100644 --- a/compiler/testData/ir/irText/errors/suppressedNonPublicCall.ir.txt +++ b/compiler/testData/ir/irText/errors/suppressedNonPublicCall.ir.txt @@ -5,9 +5,6 @@ FILE fqName: fileName:/suppressedNonPublicCall.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:bar visibility:internal modality:FINAL <> ($this:.C) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY 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 @@ -21,6 +18,9 @@ FILE fqName: fileName:/suppressedNonPublicCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:internal modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY FUN name:foo visibility:public modality:FINAL <> ($receiver:.C) returnType:kotlin.Unit [inline] $receiver: VALUE_PARAMETER name: type:.C BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.ir.txt b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.ir.txt index 90ccbc896c6..ec8f0c490d4 100644 --- a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.ir.txt @@ -1,17 +1,23 @@ FILE fqName:test fileName:/test.kt - FUN name:eval visibility:public modality:FINAL (f:kotlin.Function0) returnType:T of test.eval - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:f index:0 type:kotlin.Function0 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun eval (f: kotlin.Function0): T of test.eval declared in test' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of test.eval origin=INVOKE - $this: GET_VAR 'f: kotlin.Function0 declared in test.eval' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A.B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.C CONSTRUCTOR visibility:public <> () returnType:test.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A.B' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A.B]' + 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 .A.B + $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 .A.B + $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 .A.B + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:f visibility:public modality:FINAL <> ($this:test.C) returnType:@[FlexibleNullability] kotlin.String? $this: VALUE_PARAMETER name: type:test.C BLOCK_BODY @@ -36,16 +42,10 @@ FILE fqName:test fileName:/test.kt RETURN type=kotlin.Nothing from='local final fun (): @[FlexibleNullability] kotlin.String? declared in test.C.g' GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:y type:@[FlexibleNullability] kotlin.String? visibility:protected/*protected and package*/' type=@[FlexibleNullability] kotlin.String? origin=null receiver: GET_VAR ': test.C declared in test.C.g' type=test.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 declared in .A.B - $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 .A.B - $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 .A.B - $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:eval visibility:public modality:FINAL (f:kotlin.Function0) returnType:T of test.eval + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:f index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun eval (f: kotlin.Function0): T of test.eval declared in test' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of test.eval origin=INVOKE + $this: GET_VAR 'f: kotlin.Function0 declared in test.eval' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.kt.txt b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.kt.txt index bbc78289153..5eabcccbec7 100644 --- a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.kt.txt @@ -1,9 +1,5 @@ package test -fun eval(f: Function0): T { - return f.invoke() -} - class C : B { constructor() /* primary */ { super/*B*/() @@ -27,3 +23,7 @@ class C : B { } +fun eval(f: Function0): T { + return f.invoke() +} + diff --git a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.ir.txt b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.ir.txt index 0e4f9310671..da0f19ca060 100644 --- a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.ir.txt +++ b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.ir.txt @@ -1,17 +1,23 @@ FILE fqName:test fileName:/test.kt - FUN name:eval visibility:public modality:FINAL (f:kotlin.Function0) returnType:T of test.eval - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:f index:0 type:kotlin.Function0 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun eval (f: kotlin.Function0): T of test.eval declared in test' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of test.eval origin=INVOKE - $this: GET_VAR 'f: kotlin.Function0 declared in test.eval' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A.B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.C CONSTRUCTOR visibility:public <> () returnType:test.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A.B' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A.B]' + 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 .A.B + $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 .A.B + $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 .A.B + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:f visibility:public modality:FINAL <> ($this:test.C) returnType:@[FlexibleNullability] kotlin.String? $this: VALUE_PARAMETER name: type:test.C BLOCK_BODY @@ -36,22 +42,16 @@ FILE fqName:test fileName:/test.kt RETURN type=kotlin.Nothing from='local final fun (): @[FlexibleNullability] kotlin.String? declared in test.C.g' GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:y type:@[FlexibleNullability] kotlin.String? visibility:protected/*protected and package*/' type=@[FlexibleNullability] kotlin.String? origin=null receiver: GET_VAR ': test.C declared in test.C.g' type=test.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 declared in .A.B - $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 .A.B - $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 .A.B - $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY FAKE_OVERRIDE name:y visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] - overridden: - protected/*protected and package*/ final y: @[FlexibleNullability] kotlin.String? PROPERTY FAKE_OVERRIDE name:x visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] overridden: protected/*protected and package*/ final x: @[FlexibleNullability] kotlin.String? + PROPERTY FAKE_OVERRIDE name:y visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] + overridden: + protected/*protected and package*/ final y: @[FlexibleNullability] kotlin.String? + FUN name:eval visibility:public modality:FINAL (f:kotlin.Function0) returnType:T of test.eval + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:f index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun eval (f: kotlin.Function0): T of test.eval declared in test' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of test.eval origin=INVOKE + $this: GET_VAR 'f: kotlin.Function0 declared in test.eval' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt.txt b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt.txt index 9ca60a6ecd9..3cef1545122 100644 --- a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt.txt +++ b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt.txt @@ -1,9 +1,5 @@ package test -fun eval(f: Function0): T { - return f.invoke() -} - class C : B { constructor() /* primary */ { super/*B*/() @@ -27,3 +23,7 @@ class C : B { } +fun eval(f: Function0): T { + return f.invoke() +} + diff --git a/compiler/testData/ir/irText/expressions/arrayAssignment.fir.ir.txt b/compiler/testData/ir/irText/expressions/arrayAssignment.fir.ir.txt index 6453e12a4b3..75b4a4f3bb3 100644 --- a/compiler/testData/ir/irText/expressions/arrayAssignment.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/arrayAssignment.fir.ir.txt @@ -1,4 +1,8 @@ FILE fqName: fileName:/arrayAssignment.kt + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:x type:kotlin.IntArray [val] @@ -11,10 +15,6 @@ FILE fqName: fileName:/arrayAssignment.kt $this: GET_VAR 'val x: kotlin.IntArray declared in .test' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value=1 value: CONST Int type=kotlin.Int value=0 - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=1 FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/arrayAssignment.fir.kt.txt b/compiler/testData/ir/irText/expressions/arrayAssignment.fir.kt.txt index b3e3170c83c..cea223f6620 100644 --- a/compiler/testData/ir/irText/expressions/arrayAssignment.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/arrayAssignment.fir.kt.txt @@ -1,12 +1,13 @@ +fun foo(): Int { + return 1 +} + fun test() { val x: IntArray = intArrayOf(elements = [1, 2, 3]) x.set(index = 1, value = 0) } -fun foo(): Int { - return 1 -} - fun test2() { intArrayOf(elements = [1, 2, 3]).set(index = foo(), value = 1) } + diff --git a/compiler/testData/ir/irText/expressions/arrayAssignment.ir.txt b/compiler/testData/ir/irText/expressions/arrayAssignment.ir.txt index 984ce2db4c8..802fc5696c9 100644 --- a/compiler/testData/ir/irText/expressions/arrayAssignment.ir.txt +++ b/compiler/testData/ir/irText/expressions/arrayAssignment.ir.txt @@ -1,4 +1,8 @@ FILE fqName: fileName:/arrayAssignment.kt + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:x type:kotlin.IntArray [val] @@ -11,10 +15,6 @@ FILE fqName: fileName:/arrayAssignment.kt $this: GET_VAR 'val x: kotlin.IntArray declared in .test' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value=1 value: CONST Int type=kotlin.Int value=0 - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=1 FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=EQ diff --git a/compiler/testData/ir/irText/expressions/arrayAssignment.kt.txt b/compiler/testData/ir/irText/expressions/arrayAssignment.kt.txt index b3e3170c83c..cea223f6620 100644 --- a/compiler/testData/ir/irText/expressions/arrayAssignment.kt.txt +++ b/compiler/testData/ir/irText/expressions/arrayAssignment.kt.txt @@ -1,12 +1,13 @@ +fun foo(): Int { + return 1 +} + fun test() { val x: IntArray = intArrayOf(elements = [1, 2, 3]) x.set(index = 1, value = 0) } -fun foo(): Int { - return 1 -} - fun test2() { intArrayOf(elements = [1, 2, 3]).set(index = foo(), value = 1) } + diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.ir.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.ir.txt index 688135d6371..0d701f43779 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.ir.txt @@ -1,23 +1,6 @@ FILE fqName: fileName:/arrayAugmentedAssignment1.kt - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.IntArray - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.IntArray declared in ' - CALL 'public final fun intArrayOf (vararg elements: kotlin.Int): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null - elements: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - CONST Int type=kotlin.Int value=1 - CONST Int type=kotlin.Int value=2 - CONST Int type=kotlin.Int value=3 - FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (x:kotlin.IntArray) returnType:.C [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.IntArray - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:private [final] EXPRESSION_BODY @@ -29,6 +12,11 @@ FILE fqName: fileName:/arrayAugmentedAssignment1.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.IntArray) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.IntArray + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -42,54 +30,66 @@ FILE fqName: fileName:/arrayAugmentedAssignment1.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.IntArray + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.IntArray declared in ' + CALL 'public final fun intArrayOf (vararg elements: kotlin.Int): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null + elements: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + CONST Int type=kotlin.Int value=1 + CONST Int type=kotlin.Int value=2 + CONST Int type=kotlin.Int value=3 + FUN name:testCall visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + BLOCK type=kotlin.Unit origin=MULTEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val] + CALL 'public final fun foo (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] + CALL 'public final fun bar (): kotlin.Int declared in ' type=kotlin.Int origin=null + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=MULTEQ + $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .testCall' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_1: kotlin.Int declared in .testCall' type=kotlin.Int origin=null + value: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MULTEQ + $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=MULTEQ + $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .testCall' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_1: kotlin.Int declared in .testCall' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=2 + FUN name:testMember visibility:public modality:FINAL <> (c:.C) returnType:kotlin.Unit + VALUE_PARAMETER name:c index:0 type:.C + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.IntArray [val] + CALL 'public final fun (): kotlin.IntArray declared in .C' type=kotlin.IntArray origin=GET_PROPERTY + $this: GET_VAR 'c: .C declared in .testMember' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_2: kotlin.IntArray declared in .testMember' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_3: kotlin.Int declared in .testMember' type=kotlin.Int origin=null + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_2: kotlin.IntArray declared in .testMember' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_3: kotlin.Int declared in .testMember' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_4: kotlin.Int declared in .testMember' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_4: kotlin.Int declared in .testMember' type=kotlin.Int origin=null FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:x type:kotlin.IntArray [var] CALL 'public final fun foo (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null BLOCK type=kotlin.Unit origin=PLUSEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.IntArray [val] GET_VAR 'var x: kotlin.IntArray declared in .testVariable' type=kotlin.IntArray origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=PLUSEQ - $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .testVariable' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_1: kotlin.Int declared in .testVariable' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_5: kotlin.IntArray declared in .testVariable' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_6: kotlin.Int declared in .testVariable' type=kotlin.Int origin=null value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PLUSEQ - $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .testVariable' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_1: kotlin.Int declared in .testVariable' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_5: kotlin.IntArray declared in .testVariable' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_6: kotlin.Int declared in .testVariable' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=1 - FUN name:testCall visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - BLOCK type=kotlin.Unit origin=MULTEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.IntArray [val] - CALL 'public final fun foo (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] - CALL 'public final fun bar (): kotlin.Int declared in ' type=kotlin.Int origin=null - CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=MULTEQ - $this: GET_VAR 'val tmp_2: kotlin.IntArray declared in .testCall' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_3: kotlin.Int declared in .testCall' type=kotlin.Int origin=null - value: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MULTEQ - $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=MULTEQ - $this: GET_VAR 'val tmp_2: kotlin.IntArray declared in .testCall' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_3: kotlin.Int declared in .testCall' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=2 - FUN name:testMember visibility:public modality:FINAL <> (c:.C) returnType:kotlin.Unit - VALUE_PARAMETER name:c index:0 type:.C - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.IntArray [val] - CALL 'public final fun (): kotlin.IntArray declared in .C' type=kotlin.IntArray origin=GET_PROPERTY - $this: GET_VAR 'c: .C declared in .testMember' type=.C origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] - CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_4: kotlin.IntArray declared in .testMember' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_5: kotlin.Int declared in .testMember' type=kotlin.Int origin=null - CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_4: kotlin.IntArray declared in .testMember' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_5: kotlin.Int declared in .testMember' type=kotlin.Int origin=null - value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_6: kotlin.Int declared in .testMember' type=kotlin.Int origin=null - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - GET_VAR 'val tmp_6: kotlin.Int declared in .testMember' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.kt.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.kt.txt index 3230f3a99fc..531f6ff0811 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.kt.txt @@ -1,45 +1,46 @@ -fun foo(): IntArray { - return intArrayOf(elements = [1, 2, 3]) -} - -fun bar(): Int { - return 42 -} - class C { + val x: IntArray + field = x + get + constructor(x: IntArray) /* primary */ { super/*Any*/() /* () */ } - val x: IntArray - field = x - get +} +fun bar(): Int { + return 42 +} + +fun foo(): IntArray { + return intArrayOf(elements = [1, 2, 3]) +} + +fun testCall() { + { // BLOCK + val tmp_0: IntArray = foo() + val tmp_1: Int = bar() + tmp_0.set(index = tmp_1, value = tmp_0.get(index = tmp_1).times(other = 2)) + } +} + +fun testMember(c: C) { + val tmp_2: IntArray = c.() + val tmp_3: Int = 0 + val tmp_4: Int = tmp_2.get(index = tmp_3) + tmp_2.set(index = tmp_3, value = tmp_4.inc()) + tmp_4 /*~> Unit */ } fun testVariable() { var x: IntArray = foo() { // BLOCK - val tmp_0: IntArray = x - val tmp_1: Int = 0 - tmp_0.set(index = tmp_1, value = tmp_0.get(index = tmp_1).plus(other = 1)) + val tmp_5: IntArray = x + val tmp_6: Int = 0 + tmp_5.set(index = tmp_6, value = tmp_5.get(index = tmp_6).plus(other = 1)) } } -fun testCall() { - { // BLOCK - val tmp_2: IntArray = foo() - val tmp_3: Int = bar() - tmp_2.set(index = tmp_3, value = tmp_2.get(index = tmp_3).times(other = 2)) - } -} - -fun testMember(c: C) { - val tmp_4: IntArray = c.() - val tmp_5: Int = 0 - val tmp_6: Int = tmp_4.get(index = tmp_5) - tmp_4.set(index = tmp_5, value = tmp_6.inc()) - tmp_6 /*~> Unit */ -} diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.ir.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.ir.txt index 5591b9d0ff5..027e93803bf 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.ir.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.ir.txt @@ -1,23 +1,6 @@ FILE fqName: fileName:/arrayAugmentedAssignment1.kt - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.IntArray - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.IntArray declared in ' - CALL 'public final fun intArrayOf (vararg elements: kotlin.Int): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null - elements: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - CONST Int type=kotlin.Int value=1 - CONST Int type=kotlin.Int value=2 - CONST Int type=kotlin.Int value=3 - FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (x:kotlin.IntArray) returnType:.C [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.IntArray - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:private [final] EXPRESSION_BODY @@ -29,6 +12,11 @@ FILE fqName: fileName:/arrayAugmentedAssignment1.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.IntArray) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.IntArray + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -42,55 +30,67 @@ FILE fqName: fileName:/arrayAugmentedAssignment1.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Int BLOCK_BODY - VAR name:x type:kotlin.IntArray [var] - CALL 'public final fun foo (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null - BLOCK type=kotlin.Unit origin=PLUSEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val] - GET_VAR 'var x: kotlin.IntArray declared in .testVariable' type=kotlin.IntArray origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=PLUSEQ - $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .testVariable' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_1: kotlin.Int declared in .testVariable' type=kotlin.Int origin=null - value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PLUSEQ - $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .testVariable' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_1: kotlin.Int declared in .testVariable' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=1 + RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.IntArray + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.IntArray declared in ' + CALL 'public final fun intArrayOf (vararg elements: kotlin.Int): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null + elements: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + CONST Int type=kotlin.Int value=1 + CONST Int type=kotlin.Int value=2 + CONST Int type=kotlin.Int value=3 FUN name:testCall visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY BLOCK type=kotlin.Unit origin=MULTEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.IntArray [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val] CALL 'public final fun foo (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] CALL 'public final fun bar (): kotlin.Int declared in ' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=MULTEQ - $this: GET_VAR 'val tmp_2: kotlin.IntArray declared in .testCall' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_3: kotlin.Int declared in .testCall' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .testCall' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_1: kotlin.Int declared in .testCall' type=kotlin.Int origin=null value: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MULTEQ $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=MULTEQ - $this: GET_VAR 'val tmp_2: kotlin.IntArray declared in .testCall' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_3: kotlin.Int declared in .testCall' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .testCall' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_1: kotlin.Int declared in .testCall' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=2 FUN name:testMember visibility:public modality:FINAL <> (c:.C) returnType:kotlin.Unit VALUE_PARAMETER name:c index:0 type:.C BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.IntArray [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.IntArray [val] CALL 'public final fun (): kotlin.IntArray declared in .C' type=kotlin.IntArray origin=GET_PROPERTY $this: GET_VAR 'c: .C declared in .testMember' type=.C origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_4: kotlin.IntArray declared in .testMember' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_5: kotlin.Int declared in .testMember' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_2: kotlin.IntArray declared in .testMember' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_3: kotlin.Int declared in .testMember' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_4: kotlin.IntArray declared in .testMember' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_5: kotlin.Int declared in .testMember' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_2: kotlin.IntArray declared in .testMember' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_3: kotlin.Int declared in .testMember' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_6: kotlin.Int declared in .testMember' type=kotlin.Int origin=null - GET_VAR 'val tmp_6: kotlin.Int declared in .testMember' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_4: kotlin.Int declared in .testMember' type=kotlin.Int origin=null + GET_VAR 'val tmp_4: kotlin.Int declared in .testMember' type=kotlin.Int origin=null + FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.IntArray [var] + CALL 'public final fun foo (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null + BLOCK type=kotlin.Unit origin=PLUSEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.IntArray [val] + GET_VAR 'var x: kotlin.IntArray declared in .testVariable' type=kotlin.IntArray origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=PLUSEQ + $this: GET_VAR 'val tmp_5: kotlin.IntArray declared in .testVariable' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_6: kotlin.Int declared in .testVariable' type=kotlin.Int origin=null + value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PLUSEQ + $this: GET_VAR 'val tmp_5: kotlin.IntArray declared in .testVariable' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_6: kotlin.Int declared in .testVariable' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.kt.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.kt.txt index b9b3a354624..bd5a61cc79c 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.kt.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.kt.txt @@ -1,47 +1,48 @@ -fun foo(): IntArray { - return intArrayOf(elements = [1, 2, 3]) -} - -fun bar(): Int { - return 42 -} - class C { + val x: IntArray + field = x + get + constructor(x: IntArray) /* primary */ { super/*Any*/() /* () */ } - val x: IntArray - field = x - get - } -fun testVariable() { - var x: IntArray = foo() - { // BLOCK - val tmp_0: IntArray = x - val tmp_1: Int = 0 - tmp_0.set(index = tmp_1, value = tmp_0.get(index = tmp_1).plus(other = 1)) - } +fun bar(): Int { + return 42 +} + +fun foo(): IntArray { + return intArrayOf(elements = [1, 2, 3]) } fun testCall() { { // BLOCK - val tmp_2: IntArray = foo() - val tmp_3: Int = bar() - tmp_2.set(index = tmp_3, value = tmp_2.get(index = tmp_3).times(other = 2)) + val tmp_0: IntArray = foo() + val tmp_1: Int = bar() + tmp_0.set(index = tmp_1, value = tmp_0.get(index = tmp_1).times(other = 2)) } } fun testMember(c: C) { { // BLOCK - val tmp_4: IntArray = c.() - val tmp_5: Int = 0 - val tmp_6: Int = tmp_4.get(index = tmp_5) - tmp_4.set(index = tmp_5, value = tmp_6.inc()) - tmp_6 + val tmp_2: IntArray = c.() + val tmp_3: Int = 0 + val tmp_4: Int = tmp_2.get(index = tmp_3) + tmp_2.set(index = tmp_3, value = tmp_4.inc()) + tmp_4 } /*~> Unit */ } + +fun testVariable() { + var x: IntArray = foo() + { // BLOCK + val tmp_5: IntArray = x + val tmp_6: Int = 0 + tmp_5.set(index = tmp_6, value = tmp_5.get(index = tmp_6).plus(other = 1)) + } +} + diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.ir.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.ir.txt index 852693046bb..8e8556b161b 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.ir.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.ir.txt @@ -1,9 +1,6 @@ FILE fqName: fileName:/arrayAugmentedAssignment2.kt CLASS INTERFACE name:IA modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IA - FUN name:get visibility:public modality:ABSTRACT <> ($this:.IA, index:kotlin.String) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.IA - VALUE_PARAMETER name:index index:0 type:kotlin.String 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 @@ -17,26 +14,29 @@ FILE fqName: fileName:/arrayAugmentedAssignment2.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:get visibility:public modality:ABSTRACT <> ($this:.IA, index:kotlin.String) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.IA + VALUE_PARAMETER name:index index:0 type:kotlin.String CLASS INTERFACE name:IB modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IB + 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: 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:set visibility:public modality:ABSTRACT <> ($this:.IB, $receiver:.IA, index:kotlin.String, value:kotlin.Int) returnType:kotlin.Unit [operator] $this: VALUE_PARAMETER name: type:.IB $receiver: VALUE_PARAMETER name: type:.IA VALUE_PARAMETER name:index index:0 type:kotlin.String VALUE_PARAMETER name:value index:1 type:kotlin.Int - 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: 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:test visibility:public modality:FINAL <> ($receiver:.IB, a:.IA) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.IB VALUE_PARAMETER name:a index:0 type:.IA diff --git a/compiler/testData/ir/irText/expressions/assignments.ir.txt b/compiler/testData/ir/irText/expressions/assignments.ir.txt index 08fdb944feb..8426eb3e92c 100644 --- a/compiler/testData/ir/irText/expressions/assignments.ir.txt +++ b/compiler/testData/ir/irText/expressions/assignments.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/assignments.kt CLASS CLASS name:Ref modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ref - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Ref [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Ref modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private EXPRESSION_BODY @@ -25,6 +20,11 @@ FILE fqName: fileName:/assignments.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Ref declared in .Ref.' type=.Ref origin=null value: GET_VAR ': kotlin.Int declared in .Ref.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Ref [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Ref modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/assignments.kt.txt b/compiler/testData/ir/irText/expressions/assignments.kt.txt index ca01aad27ef..18e9087ccc9 100644 --- a/compiler/testData/ir/irText/expressions/assignments.kt.txt +++ b/compiler/testData/ir/irText/expressions/assignments.kt.txt @@ -1,15 +1,15 @@ class Ref { + var x: Int + field = x + get + set + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } - var x: Int - field = x - get - set - } fun test1() { @@ -21,3 +21,4 @@ fun test1() { fun test2(r: Ref) { r.( = 0) } + diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.ir.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.ir.txt index 795cba07a80..ce4d4fe3985 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.ir.txt @@ -14,6 +14,28 @@ FILE fqName: fileName:/augmentedAssignment1.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + FUN name:testProperty visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: CONST Int type=kotlin.Int value=2 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: CONST Int type=kotlin.Int value=3 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: CONST Int type=kotlin.Int value=4 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + other: CONST Int type=kotlin.Int value=5 FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:x type:kotlin.Int [var] @@ -38,25 +60,3 @@ FILE fqName: fileName:/augmentedAssignment1.kt CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=5 - FUN name:testProperty visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: CONST Int type=kotlin.Int value=1 - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: CONST Int type=kotlin.Int value=2 - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: CONST Int type=kotlin.Int value=3 - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: CONST Int type=kotlin.Int value=4 - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: CONST Int type=kotlin.Int value=5 diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.kt.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.kt.txt index 245950f4c16..27dad3210d6 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.kt.txt @@ -3,6 +3,14 @@ var p: Int get set +fun testProperty() { + ( = ().plus(other = 1)) + ( = ().minus(other = 2)) + ( = ().times(other = 3)) + ( = ().div(other = 4)) + ( = ().rem(other = 5)) +} + fun testVariable() { var x: Int = 0 x = x.plus(other = 1) @@ -12,10 +20,3 @@ fun testVariable() { x = x.rem(other = 5) } -fun testProperty() { - ( = ().plus(other = 1)) - ( = ().minus(other = 2)) - ( = ().times(other = 3)) - ( = ().div(other = 4)) - ( = ().rem(other = 5)) -} diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment1.ir.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment1.ir.txt index 658dd886f90..fae94fefe4d 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment1.ir.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment1.ir.txt @@ -14,30 +14,6 @@ FILE fqName: fileName:/augmentedAssignment1.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:x type:kotlin.Int [var] - CONST Int type=kotlin.Int value=0 - SET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: GET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Int origin=PLUSEQ - other: CONST Int type=kotlin.Int value=1 - SET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Unit origin=MINUSEQ - CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUSEQ - $this: GET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Int origin=MINUSEQ - other: CONST Int type=kotlin.Int value=2 - SET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Unit origin=MULTEQ - CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MULTEQ - $this: GET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Int origin=MULTEQ - other: CONST Int type=kotlin.Int value=3 - SET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Unit origin=DIVEQ - CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=DIVEQ - $this: GET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Int origin=DIVEQ - other: CONST Int type=kotlin.Int value=4 - SET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Unit origin=PERCEQ - CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PERCEQ - $this: GET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Int origin=PERCEQ - other: CONST Int type=kotlin.Int value=5 FUN name:testProperty visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ @@ -65,3 +41,27 @@ FILE fqName: fileName:/augmentedAssignment1.kt : CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PERCEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PERCEQ other: CONST Int type=kotlin.Int value=5 + FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + SET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: GET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Int origin=PLUSEQ + other: CONST Int type=kotlin.Int value=1 + SET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Unit origin=MINUSEQ + CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUSEQ + $this: GET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Int origin=MINUSEQ + other: CONST Int type=kotlin.Int value=2 + SET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Unit origin=MULTEQ + CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MULTEQ + $this: GET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Int origin=MULTEQ + other: CONST Int type=kotlin.Int value=3 + SET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Unit origin=DIVEQ + CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=DIVEQ + $this: GET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Int origin=DIVEQ + other: CONST Int type=kotlin.Int value=4 + SET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Unit origin=PERCEQ + CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PERCEQ + $this: GET_VAR 'var x: kotlin.Int declared in .testVariable' type=kotlin.Int origin=PERCEQ + other: CONST Int type=kotlin.Int value=5 diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment1.kt.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment1.kt.txt index 407c751ea9a..26a323a220e 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment1.kt.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment1.kt.txt @@ -3,15 +3,6 @@ var p: Int get set -fun testVariable() { - var x: Int = 0 - x = x.plus(other = 1) - x = x.minus(other = 2) - x = x.times(other = 3) - x = x.div(other = 4) - x = x.rem(other = 5) -} - fun testProperty() { { // BLOCK ( = ().plus(other = 1)) @@ -29,3 +20,13 @@ fun testProperty() { ( = ().rem(other = 5)) } } + +fun testVariable() { + var x: Int = 0 + x = x.plus(other = 1) + x = x.minus(other = 2) + x = x.times(other = 3) + x = x.div(other = 4) + x = x.rem(other = 5) +} + diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment2.fir.ir.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment2.fir.ir.txt index f21dd559feb..834e28ff81f 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment2.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment2.fir.ir.txt @@ -1,4 +1,13 @@ FILE fqName: fileName:/augmentedAssignment2.kt + PROPERTY name:p visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:private [final,static] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.A + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .A declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:private [final,static]' type=.A origin=null CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A CONSTRUCTOR visibility:public <> () returnType:.A [primary] @@ -18,7 +27,7 @@ FILE fqName: fileName:/augmentedAssignment2.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.A, s:kotlin.String) returnType:kotlin.Unit [operator] + FUN name:divAssign visibility:public modality:FINAL <> ($receiver:.A, s:kotlin.String) returnType:kotlin.Unit [operator] $receiver: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY @@ -26,11 +35,7 @@ FILE fqName: fileName:/augmentedAssignment2.kt $receiver: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY - FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:.A, s:kotlin.String) returnType:kotlin.Unit [operator] - $receiver: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - FUN name:divAssign visibility:public modality:FINAL <> ($receiver:.A, s:kotlin.String) returnType:kotlin.Unit [operator] + FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.A, s:kotlin.String) returnType:kotlin.Unit [operator] $receiver: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY @@ -38,15 +43,23 @@ FILE fqName: fileName:/augmentedAssignment2.kt $receiver: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY - PROPERTY name:p visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.A - correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .A declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:private [final,static]' type=.A origin=null + FUN name:testProperty visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun plusAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + $receiver: CALL 'public final fun (): .A declared in ' type=.A origin=GET_PROPERTY + s: CONST String type=kotlin.String value="+=" + CALL 'public final fun minusAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=MINUSEQ + $receiver: CALL 'public final fun (): .A declared in ' type=.A origin=GET_PROPERTY + s: CONST String type=kotlin.String value="-=" + CALL 'public final fun timesAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=MULTEQ + $receiver: CALL 'public final fun (): .A declared in ' type=.A origin=GET_PROPERTY + s: CONST String type=kotlin.String value="*=" + CALL 'public final fun divAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=DIVEQ + $receiver: CALL 'public final fun (): .A declared in ' type=.A origin=GET_PROPERTY + s: CONST String type=kotlin.String value="/=" + CALL 'public final fun remAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=PERCEQ + $receiver: CALL 'public final fun (): .A declared in ' type=.A origin=GET_PROPERTY + s: CONST String type=kotlin.String value="%=" FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a type:.A [val] @@ -66,20 +79,7 @@ FILE fqName: fileName:/augmentedAssignment2.kt CALL 'public final fun remAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=PERCEQ $receiver: GET_VAR 'val a: .A declared in .testVariable' type=.A origin=null s: CONST String type=kotlin.String value="*=" - FUN name:testProperty visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:.A, s:kotlin.String) returnType:kotlin.Unit [operator] + $receiver: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY - CALL 'public final fun plusAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - $receiver: CALL 'public final fun (): .A declared in ' type=.A origin=GET_PROPERTY - s: CONST String type=kotlin.String value="+=" - CALL 'public final fun minusAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=MINUSEQ - $receiver: CALL 'public final fun (): .A declared in ' type=.A origin=GET_PROPERTY - s: CONST String type=kotlin.String value="-=" - CALL 'public final fun timesAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=MULTEQ - $receiver: CALL 'public final fun (): .A declared in ' type=.A origin=GET_PROPERTY - s: CONST String type=kotlin.String value="*=" - CALL 'public final fun divAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=DIVEQ - $receiver: CALL 'public final fun (): .A declared in ' type=.A origin=GET_PROPERTY - s: CONST String type=kotlin.String value="/=" - CALL 'public final fun remAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=PERCEQ - $receiver: CALL 'public final fun (): .A declared in ' type=.A origin=GET_PROPERTY - s: CONST String type=kotlin.String value="%=" diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment2.fir.kt.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment2.fir.kt.txt index 553f4cec3e5..c609cf94526 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment2.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment2.fir.kt.txt @@ -1,3 +1,7 @@ +val p: A + field = A() + get + class A { constructor() /* primary */ { super/*Any*/() @@ -7,24 +11,25 @@ class A { } -operator fun A.plusAssign(s: String) { +operator fun A.divAssign(s: String) { } operator fun A.minusAssign(s: String) { } -operator fun A.timesAssign(s: String) { -} - -operator fun A.divAssign(s: String) { +operator fun A.plusAssign(s: String) { } operator fun A.remAssign(s: String) { } -val p: A - field = A() - get +fun testProperty() { + ().plusAssign(s = "+=") + ().minusAssign(s = "-=") + ().timesAssign(s = "*=") + ().divAssign(s = "/=") + ().remAssign(s = "%=") +} fun testVariable() { val a: A = A() @@ -35,10 +40,6 @@ fun testVariable() { a.remAssign(s = "*=") } -fun testProperty() { - ().plusAssign(s = "+=") - ().minusAssign(s = "-=") - ().timesAssign(s = "*=") - ().divAssign(s = "/=") - ().remAssign(s = "%=") +operator fun A.timesAssign(s: String) { } + diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment2.ir.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment2.ir.txt index 2780582f5b0..0cb905aff9e 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment2.ir.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment2.ir.txt @@ -1,4 +1,13 @@ FILE fqName: fileName:/augmentedAssignment2.kt + PROPERTY name:p visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:private [final,static] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.A + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .A declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:private [final,static]' type=.A origin=null CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A CONSTRUCTOR visibility:public <> () returnType:.A [primary] @@ -18,7 +27,7 @@ FILE fqName: fileName:/augmentedAssignment2.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.A, s:kotlin.String) returnType:kotlin.Unit [operator] + FUN name:divAssign visibility:public modality:FINAL <> ($receiver:.A, s:kotlin.String) returnType:kotlin.Unit [operator] $receiver: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY @@ -26,11 +35,7 @@ FILE fqName: fileName:/augmentedAssignment2.kt $receiver: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY - FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:.A, s:kotlin.String) returnType:kotlin.Unit [operator] - $receiver: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - FUN name:divAssign visibility:public modality:FINAL <> ($receiver:.A, s:kotlin.String) returnType:kotlin.Unit [operator] + FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.A, s:kotlin.String) returnType:kotlin.Unit [operator] $receiver: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY @@ -38,34 +43,6 @@ FILE fqName: fileName:/augmentedAssignment2.kt $receiver: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY - PROPERTY name:p visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.A - correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .A declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:private [final,static]' type=.A origin=null - FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:a type:.A [val] - CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null - CALL 'public final fun plusAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - $receiver: GET_VAR 'val a: .A declared in .testVariable' type=.A origin=PLUSEQ - s: CONST String type=kotlin.String value="+=" - CALL 'public final fun minusAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=MINUSEQ - $receiver: GET_VAR 'val a: .A declared in .testVariable' type=.A origin=MINUSEQ - s: CONST String type=kotlin.String value="-=" - CALL 'public final fun timesAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=MULTEQ - $receiver: GET_VAR 'val a: .A declared in .testVariable' type=.A origin=MULTEQ - s: CONST String type=kotlin.String value="*=" - CALL 'public final fun divAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=DIVEQ - $receiver: GET_VAR 'val a: .A declared in .testVariable' type=.A origin=DIVEQ - s: CONST String type=kotlin.String value="/=" - CALL 'public final fun remAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=PERCEQ - $receiver: GET_VAR 'val a: .A declared in .testVariable' type=.A origin=PERCEQ - s: CONST String type=kotlin.String value="*=" FUN name:testProperty visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ @@ -88,3 +65,26 @@ FILE fqName: fileName:/augmentedAssignment2.kt CALL 'public final fun remAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=PERCEQ $receiver: CALL 'public final fun (): .A declared in ' type=.A origin=PERCEQ s: CONST String type=kotlin.String value="%=" + FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a type:.A [val] + CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null + CALL 'public final fun plusAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + $receiver: GET_VAR 'val a: .A declared in .testVariable' type=.A origin=PLUSEQ + s: CONST String type=kotlin.String value="+=" + CALL 'public final fun minusAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=MINUSEQ + $receiver: GET_VAR 'val a: .A declared in .testVariable' type=.A origin=MINUSEQ + s: CONST String type=kotlin.String value="-=" + CALL 'public final fun timesAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=MULTEQ + $receiver: GET_VAR 'val a: .A declared in .testVariable' type=.A origin=MULTEQ + s: CONST String type=kotlin.String value="*=" + CALL 'public final fun divAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=DIVEQ + $receiver: GET_VAR 'val a: .A declared in .testVariable' type=.A origin=DIVEQ + s: CONST String type=kotlin.String value="/=" + CALL 'public final fun remAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=PERCEQ + $receiver: GET_VAR 'val a: .A declared in .testVariable' type=.A origin=PERCEQ + s: CONST String type=kotlin.String value="*=" + FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:.A, s:kotlin.String) returnType:kotlin.Unit [operator] + $receiver: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment2.kt.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment2.kt.txt index 8c3b714bb48..0c1c73ea7d2 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment2.kt.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment2.kt.txt @@ -1,3 +1,7 @@ +val p: A + field = A() + get + class A { constructor() /* primary */ { super/*Any*/() @@ -7,34 +11,18 @@ class A { } -operator fun A.plusAssign(s: String) { +operator fun A.divAssign(s: String) { } operator fun A.minusAssign(s: String) { } -operator fun A.timesAssign(s: String) { -} - -operator fun A.divAssign(s: String) { +operator fun A.plusAssign(s: String) { } operator fun A.remAssign(s: String) { } -val p: A - field = A() - get - -fun testVariable() { - val a: A = A() - a.plusAssign(s = "+=") - a.minusAssign(s = "-=") - a.timesAssign(s = "*=") - a.divAssign(s = "/=") - a.remAssign(s = "*=") -} - fun testProperty() { { // BLOCK ().plusAssign(s = "+=") @@ -52,3 +40,16 @@ fun testProperty() { ().remAssign(s = "%=") } } + +fun testVariable() { + val a: A = A() + a.plusAssign(s = "+=") + a.minusAssign(s = "-=") + a.timesAssign(s = "*=") + a.divAssign(s = "/=") + a.remAssign(s = "*=") +} + +operator fun A.timesAssign(s: String) { +} + diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.fir.ir.txt b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.fir.ir.txt index 470f0dfd1bc..9dfdfc5920d 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.fir.ir.txt @@ -5,16 +5,6 @@ FILE fqName: fileName:/augmentedAssignmentWithExpression.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:plusAssign visibility:public modality:FINAL <> ($this:.Host, x:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.Host - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - FUN name:test1 visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Host - BLOCK_BODY - CALL 'public final fun plusAssign (x: kotlin.Int): kotlin.Unit declared in .Host' type=kotlin.Unit origin=PLUSEQ - $this: GET_VAR ': .Host declared in .Host.test1' type=.Host origin=null - x: CONST Int type=kotlin.Int value=1 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 @@ -28,6 +18,16 @@ FILE fqName: fileName:/augmentedAssignmentWithExpression.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:plusAssign visibility:public modality:FINAL <> ($this:.Host, x:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + FUN name:test1 visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + CALL 'public final fun plusAssign (x: kotlin.Int): kotlin.Unit declared in .Host' type=kotlin.Unit origin=PLUSEQ + $this: GET_VAR ': .Host declared in .Host.test1' type=.Host origin=null + x: CONST Int type=kotlin.Int value=1 FUN name:foo visibility:public modality:FINAL <> () returnType:.Host BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo (): .Host declared in ' diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.ir.txt b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.ir.txt index e9734d7d62c..332d1b337e4 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.ir.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.ir.txt @@ -5,16 +5,6 @@ FILE fqName: fileName:/augmentedAssignmentWithExpression.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:plusAssign visibility:public modality:FINAL <> ($this:.Host, x:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.Host - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - FUN name:test1 visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Host - BLOCK_BODY - CALL 'public final fun plusAssign (x: kotlin.Int): kotlin.Unit declared in .Host' type=kotlin.Unit origin=PLUSEQ - $this: GET_VAR ': .Host declared in .Host.test1' type=.Host origin=PLUSEQ - x: CONST Int type=kotlin.Int value=1 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 @@ -28,6 +18,16 @@ FILE fqName: fileName:/augmentedAssignmentWithExpression.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:plusAssign visibility:public modality:FINAL <> ($this:.Host, x:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + FUN name:test1 visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + CALL 'public final fun plusAssign (x: kotlin.Int): kotlin.Unit declared in .Host' type=kotlin.Unit origin=PLUSEQ + $this: GET_VAR ': .Host declared in .Host.test1' type=.Host origin=PLUSEQ + x: CONST Int type=kotlin.Int value=1 FUN name:foo visibility:public modality:FINAL <> () returnType:.Host BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo (): .Host declared in ' diff --git a/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.fir.ir.txt b/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.fir.ir.txt index 7ceb2a76aef..14df4b047f9 100644 --- a/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.fir.ir.txt @@ -1,9 +1,4 @@ FILE fqName: fileName:/badInlinedBreakContinue.kt - FUN name:foo visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit [inline] - VALUE_PARAMETER name:block index:0 type:kotlin.Function0 - BLOCK_BODY - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE - $this: GET_VAR 'block: kotlin.Function0 declared in .foo' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:bar visibility:public modality:FINAL <> (block1:kotlin.Function0, block2:kotlin.Function0) returnType:kotlin.Unit [inline] VALUE_PARAMETER name:block1 index:0 type:kotlin.Function0 VALUE_PARAMETER name:block2 index:1 type:kotlin.Function0 [noinline] @@ -17,6 +12,11 @@ FILE fqName: fileName:/badInlinedBreakContinue.kt BLOCK_BODY CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'block: kotlin.Function0 declared in .baz' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + FUN name:foo visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit [inline] + VALUE_PARAMETER name:block index:0 type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE + $this: GET_VAR 'block: kotlin.Function0 declared in .foo' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:myForEach visibility:public modality:FINAL ($receiver:kotlin.collections.Iterable.myForEach>, action:kotlin.Function1.myForEach, kotlin.Unit>) returnType:kotlin.Unit [inline] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false $receiver: VALUE_PARAMETER name: type:kotlin.collections.Iterable.myForEach> diff --git a/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.fir.kt.txt b/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.fir.kt.txt index 848d09cab0d..1f48a192248 100644 --- a/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.fir.kt.txt @@ -1,7 +1,3 @@ -inline fun foo(block: Function0) { - block.invoke() -} - inline fun bar(block1: Function0, noinline block2: Function0) { block1.invoke() block2.invoke() @@ -11,6 +7,10 @@ inline fun baz(crossinline block: Function0) { block.invoke() } +inline fun foo(block: Function0) { + block.invoke() +} + inline fun Iterable.myForEach(action: Function1) { { // BLOCK val tmp_0: Iterator = .iterator() @@ -241,3 +241,4 @@ fun test8() { ) } } + diff --git a/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.ir.txt b/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.ir.txt index adfb049a51e..6393f96e4b6 100644 --- a/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.ir.txt +++ b/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.ir.txt @@ -1,9 +1,4 @@ FILE fqName: fileName:/badInlinedBreakContinue.kt - FUN name:foo visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit [inline] - VALUE_PARAMETER name:block index:0 type:kotlin.Function0 - BLOCK_BODY - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE - $this: GET_VAR 'block: kotlin.Function0 declared in .foo' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:bar visibility:public modality:FINAL <> (block1:kotlin.Function0, block2:kotlin.Function0) returnType:kotlin.Unit [inline] VALUE_PARAMETER name:block1 index:0 type:kotlin.Function0 VALUE_PARAMETER name:block2 index:1 type:kotlin.Function0 [noinline] @@ -17,6 +12,11 @@ FILE fqName: fileName:/badInlinedBreakContinue.kt BLOCK_BODY CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'block: kotlin.Function0 declared in .baz' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + FUN name:foo visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit [inline] + VALUE_PARAMETER name:block index:0 type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE + $this: GET_VAR 'block: kotlin.Function0 declared in .foo' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:myForEach visibility:public modality:FINAL ($receiver:kotlin.collections.Iterable.myForEach>, action:kotlin.Function1.myForEach, kotlin.Unit>) returnType:kotlin.Unit [inline] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false $receiver: VALUE_PARAMETER name: type:kotlin.collections.Iterable.myForEach> diff --git a/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.kt.txt b/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.kt.txt index 2887866c587..3aebd95c637 100644 --- a/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.kt.txt +++ b/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.kt.txt @@ -1,7 +1,3 @@ -inline fun foo(block: Function0) { - block.invoke() -} - inline fun bar(block1: Function0, noinline block2: Function0) { block1.invoke() block2.invoke() @@ -11,6 +7,10 @@ inline fun baz(crossinline block: Function0) { block.invoke() } +inline fun foo(block: Function0) { + block.invoke() +} + inline fun Iterable.myForEach(action: Function1) { { // BLOCK val tmp_0: Iterator = .iterator() diff --git a/compiler/testData/ir/irText/expressions/bangbang.fir.ir.txt b/compiler/testData/ir/irText/expressions/bangbang.fir.ir.txt index bf2c426eac6..dd485cf2f91 100644 --- a/compiler/testData/ir/irText/expressions/bangbang.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/bangbang.fir.ir.txt @@ -33,9 +33,6 @@ FILE fqName: fileName:/bangbang.kt CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type={X of .test3 & Any} origin=EXCLEXCL : {X of .test3 & Any} arg0: GET_VAR 'a: X of .test3 declared in .test3' type=X of .test3 origin=null - FUN name:useString visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY FUN name:test4 visibility:public modality:FINAL (a:X of .test4) returnType:kotlin.Unit TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:a index:0 type:X of .test4 @@ -57,3 +54,6 @@ FILE fqName: fileName:/bangbang.kt : kotlin.Any arg0: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any GET_VAR 'a: X of .test4 declared in .test4' type=X of .test4 origin=null + FUN name:useString visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/bangbang.fir.kt.txt b/compiler/testData/ir/irText/expressions/bangbang.fir.kt.txt index a2f3e8ce7fe..d389c69831b 100644 --- a/compiler/testData/ir/irText/expressions/bangbang.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/bangbang.fir.kt.txt @@ -16,9 +16,6 @@ fun test3(a: X): (X & Any) { return CHECK_NOT_NULL<(X & Any)>(arg0 = a) } -fun useString(s: String) { -} - fun test4(a: X) { when { a is String? -> CHECK_NOT_NULL(arg0 = a) /*~> Unit */ @@ -28,3 +25,6 @@ fun test4(a: X) { } } +fun useString(s: String) { +} + diff --git a/compiler/testData/ir/irText/expressions/bangbang.ir.txt b/compiler/testData/ir/irText/expressions/bangbang.ir.txt index 2d9eff2dadf..2833327d8db 100644 --- a/compiler/testData/ir/irText/expressions/bangbang.ir.txt +++ b/compiler/testData/ir/irText/expressions/bangbang.ir.txt @@ -33,9 +33,6 @@ FILE fqName: fileName:/bangbang.kt CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=X of .test3 origin=EXCLEXCL : X of .test3 arg0: GET_VAR 'a: X of .test3 declared in .test3' type=X of .test3 origin=null - FUN name:useString visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY FUN name:test4 visibility:public modality:FINAL (a:X of .test4) returnType:kotlin.Unit TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:a index:0 type:X of .test4 @@ -57,3 +54,6 @@ FILE fqName: fileName:/bangbang.kt CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=X of .test4 origin=EXCLEXCL : X of .test4 arg0: GET_VAR 'a: X of .test4 declared in .test4' type=X of .test4 origin=null + FUN name:useString visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/bangbang.kt.txt b/compiler/testData/ir/irText/expressions/bangbang.kt.txt index 2c7f6fa4daa..1d3274f48b4 100644 --- a/compiler/testData/ir/irText/expressions/bangbang.kt.txt +++ b/compiler/testData/ir/irText/expressions/bangbang.kt.txt @@ -16,9 +16,6 @@ fun test3(a: X): (X & Any) { return CHECK_NOT_NULL(arg0 = a) } -fun useString(s: String) { -} - fun test4(a: X) { when { a is String? -> CHECK_NOT_NULL(arg0 = a) /*~> Unit */ @@ -27,3 +24,7 @@ fun test4(a: X) { a is String? -> useString(s = CHECK_NOT_NULL(arg0 = a) /*as String */) } } + +fun useString(s: String) { +} + diff --git a/compiler/testData/ir/irText/expressions/booleanOperators.ir.txt b/compiler/testData/ir/irText/expressions/booleanOperators.ir.txt index 55a2108c32c..e31947e8407 100644 --- a/compiler/testData/ir/irText/expressions/booleanOperators.ir.txt +++ b/compiler/testData/ir/irText/expressions/booleanOperators.ir.txt @@ -11,6 +11,14 @@ FILE fqName: fileName:/booleanOperators.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test1x visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Boolean + VALUE_PARAMETER name:b index:1 type:kotlin.Boolean + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1x (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in ' + CALL 'public final fun and (other: kotlin.Boolean): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null + $this: GET_VAR 'a: kotlin.Boolean declared in .test1x' type=kotlin.Boolean origin=null + other: GET_VAR 'b: kotlin.Boolean declared in .test1x' type=kotlin.Boolean origin=null FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean VALUE_PARAMETER name:a index:0 type:kotlin.Boolean VALUE_PARAMETER name:b index:1 type:kotlin.Boolean @@ -23,14 +31,6 @@ FILE fqName: fileName:/booleanOperators.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: GET_VAR 'b: kotlin.Boolean declared in .test2' type=kotlin.Boolean origin=null - FUN name:test1x visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Boolean - VALUE_PARAMETER name:b index:1 type:kotlin.Boolean - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1x (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in ' - CALL 'public final fun and (other: kotlin.Boolean): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null - $this: GET_VAR 'a: kotlin.Boolean declared in .test1x' type=kotlin.Boolean origin=null - other: GET_VAR 'b: kotlin.Boolean declared in .test1x' type=kotlin.Boolean origin=null FUN name:test2x visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean VALUE_PARAMETER name:a index:0 type:kotlin.Boolean VALUE_PARAMETER name:b index:1 type:kotlin.Boolean diff --git a/compiler/testData/ir/irText/expressions/booleanOperators.kt.txt b/compiler/testData/ir/irText/expressions/booleanOperators.kt.txt index f9828aa853e..669249ab96a 100644 --- a/compiler/testData/ir/irText/expressions/booleanOperators.kt.txt +++ b/compiler/testData/ir/irText/expressions/booleanOperators.kt.txt @@ -5,6 +5,10 @@ fun test1(a: Boolean, b: Boolean): Boolean { } } +fun test1x(a: Boolean, b: Boolean): Boolean { + return a.and(other = b) +} + fun test2(a: Boolean, b: Boolean): Boolean { return when { a -> true @@ -12,10 +16,7 @@ fun test2(a: Boolean, b: Boolean): Boolean { } } -fun test1x(a: Boolean, b: Boolean): Boolean { - return a.and(other = b) -} - fun test2x(a: Boolean, b: Boolean): Boolean { return a.or(other = b) } + diff --git a/compiler/testData/ir/irText/expressions/boundCallableReferences.ir.txt b/compiler/testData/ir/irText/expressions/boundCallableReferences.ir.txt index f0746468215..f8cd6aa5e1d 100644 --- a/compiler/testData/ir/irText/expressions/boundCallableReferences.ir.txt +++ b/compiler/testData/ir/irText/expressions/boundCallableReferences.ir.txt @@ -1,40 +1,4 @@ FILE fqName: fileName:/boundCallableReferences.kt - CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - PROPERTY name:bar visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int - correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.' type=.A 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: 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:qux visibility:public modality:FINAL <> ($receiver:.A) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:.A - BLOCK_BODY PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.reflect.KFunction0 visibility:private [final,static] EXPRESSION_BODY @@ -65,3 +29,39 @@ FILE fqName: fileName:/boundCallableReferences.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KFunction0 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.reflect.KFunction0 visibility:private [final,static]' type=kotlin.reflect.KFunction0 origin=null + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + PROPERTY name:bar visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 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:foo visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + FUN name:qux visibility:public modality:FINAL <> ($receiver:.A) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:.A + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/boundCallableReferences.kt.txt b/compiler/testData/ir/irText/expressions/boundCallableReferences.kt.txt index 2a528f9994b..57d527b2196 100644 --- a/compiler/testData/ir/irText/expressions/boundCallableReferences.kt.txt +++ b/compiler/testData/ir/irText/expressions/boundCallableReferences.kt.txt @@ -1,22 +1,3 @@ -class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun foo() { - } - - val bar: Int - field = 0 - get - -} - -fun A.qux() { -} - val test1: KFunction0 field = A()::foo get @@ -28,3 +9,23 @@ val test2: KProperty0 val test3: KFunction0 field = A()::qux get + +class A { + val bar: Int + field = 0 + get + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun foo() { + } + +} + +fun A.qux() { +} + diff --git a/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.ir.txt b/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.ir.txt index f4657921c5d..fea24a107f0 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.ir.txt @@ -1,4 +1,20 @@ FILE fqName: fileName:/breakContinueInWhen.kt + FUN name:testBreakDoWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:k type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + BLOCK type=kotlin.Unit origin=null + DO_WHILE label=null origin=DO_WHILE_LOOP + body: COMPOSITE type=kotlin.Unit origin=null + WHEN type=kotlin.Unit origin=WHEN + BRANCH + if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT + arg0: GET_VAR 'var k: kotlin.Int declared in .testBreakDoWhile' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=2 + then: BREAK label=null loop.label=null + condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'var k: kotlin.Int declared in .testBreakDoWhile' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=10 FUN name:testBreakFor visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:xs type:kotlin.IntArray [val] @@ -45,22 +61,45 @@ FILE fqName: fileName:/breakContinueInWhen.kt arg0: GET_VAR 'var k: kotlin.Int declared in .testBreakWhile' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=2 then: BREAK label=null loop.label=null - FUN name:testBreakDoWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:testContinueDoWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:k type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 + VAR name:s type:kotlin.String [var] + CONST String type=kotlin.String value="" BLOCK type=kotlin.Unit origin=null DO_WHILE label=null origin=DO_WHILE_LOOP body: COMPOSITE type=kotlin.Unit origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Int origin=PREFIX_INCR + SET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Unit origin=PREFIX_INCR + CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=PREFIX_INCR + GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=PREFIX_INCR WHEN type=kotlin.Unit origin=WHEN BRANCH if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT - arg0: GET_VAR 'var k: kotlin.Int declared in .testBreakDoWhile' type=kotlin.Int origin=null + arg0: GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=2 - then: BREAK label=null loop.label=null + then: CONTINUE label=null loop.label=null + SET_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: GET_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.String origin=null + other: STRING_CONCATENATION type=kotlin.String + GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=null + CONST String type=kotlin.String value=";" condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: GET_VAR 'var k: kotlin.Int declared in .testBreakDoWhile' type=kotlin.Int origin=null + arg0: GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=10 + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean 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_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="1;2;" + then: THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor (p0: @[FlexibleNullability] kotlin.Any?) declared in java.lang.AssertionError' type=java.lang.AssertionError origin=null + p0: GET_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.String origin=null FUN name:testContinueFor visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:xs type:kotlin.IntArray [val] @@ -107,42 +146,3 @@ FILE fqName: fileName:/breakContinueInWhen.kt arg0: GET_VAR 'var k: kotlin.Int declared in .testContinueWhile' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=2 then: CONTINUE label=null loop.label=null - FUN name:testContinueDoWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:k type:kotlin.Int [var] - CONST Int type=kotlin.Int value=0 - VAR name:s type:kotlin.String [var] - CONST String type=kotlin.String value="" - BLOCK type=kotlin.Unit origin=null - DO_WHILE label=null origin=DO_WHILE_LOOP - body: COMPOSITE type=kotlin.Unit origin=null - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Int origin=PREFIX_INCR - SET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Unit origin=PREFIX_INCR - CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=PREFIX_INCR - GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=PREFIX_INCR - WHEN type=kotlin.Unit origin=WHEN - BRANCH - if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT - arg0: GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=null - arg1: CONST Int type=kotlin.Int value=2 - then: CONTINUE label=null loop.label=null - SET_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null - $this: GET_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.String origin=null - other: STRING_CONCATENATION type=kotlin.String - GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=null - CONST String type=kotlin.String value=";" - condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=null - arg1: CONST Int type=kotlin.Int value=10 - WHEN type=kotlin.Unit origin=IF - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean 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_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.String origin=null - arg1: CONST String type=kotlin.String value="1;2;" - then: THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor (p0: @[FlexibleNullability] kotlin.Any?) declared in java.lang.AssertionError' type=java.lang.AssertionError origin=null - p0: GET_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.kt.txt b/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.kt.txt index eda72100900..b892f8a7256 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.kt.txt @@ -1,3 +1,14 @@ +fun testBreakDoWhile() { + var k: Int = 0 + { // BLOCK + do// COMPOSITE { + when { + greater(arg0 = k, arg1 = 2) -> break + } + // } while (less(arg0 = k, arg1 = 10)) + } +} + fun testBreakFor() { val xs: IntArray = IntArray(size = 10, init = local fun (i: Int): Int { return i @@ -26,15 +37,24 @@ fun testBreakWhile() { } } -fun testBreakDoWhile() { +fun testContinueDoWhile() { var k: Int = 0 + var s: String = "" { // BLOCK do// COMPOSITE { + { // BLOCK + k = k.inc() + k + } /*~> Unit */ when { - greater(arg0 = k, arg1 = 2) -> break + greater(arg0 = k, arg1 = 2) -> continue } + s = s.plus(other = k + ";") // } while (less(arg0 = k, arg1 = 10)) } + when { + EQEQ(arg0 = s, arg1 = "1;2;").not() -> throw AssertionError(p0 = s) + } } fun testContinueFor() { @@ -65,23 +85,3 @@ fun testContinueWhile() { } } -fun testContinueDoWhile() { - var k: Int = 0 - var s: String = "" - { // BLOCK - do// COMPOSITE { - { // BLOCK - k = k.inc() - k - } /*~> Unit */ - when { - greater(arg0 = k, arg1 = 2) -> continue - } - s = s.plus(other = k + ";") - // } while (less(arg0 = k, arg1 = 10)) - } - when { - EQEQ(arg0 = s, arg1 = "1;2;").not() -> throw AssertionError(p0 = s) - } -} - diff --git a/compiler/testData/ir/irText/expressions/breakContinueInWhen.ir.txt b/compiler/testData/ir/irText/expressions/breakContinueInWhen.ir.txt index 5df2cdba1fa..b9612d1b8ef 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInWhen.ir.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInWhen.ir.txt @@ -1,4 +1,20 @@ FILE fqName: fileName:/breakContinueInWhen.kt + FUN name:testBreakDoWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:k type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + BLOCK type=kotlin.Unit origin=null + DO_WHILE label=null origin=DO_WHILE_LOOP + body: COMPOSITE type=kotlin.Unit origin=null + WHEN type=kotlin.Unit origin=WHEN + BRANCH + if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT + arg0: GET_VAR 'var k: kotlin.Int declared in .testBreakDoWhile' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=2 + then: BREAK label=null loop.label=null + condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'var k: kotlin.Int declared in .testBreakDoWhile' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=10 FUN name:testBreakFor visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:xs type:kotlin.IntArray [val] @@ -45,22 +61,45 @@ FILE fqName: fileName:/breakContinueInWhen.kt arg0: GET_VAR 'var k: kotlin.Int declared in .testBreakWhile' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=2 then: BREAK label=null loop.label=null - FUN name:testBreakDoWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:testContinueDoWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:k type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 + VAR name:s type:kotlin.String [var] + CONST String type=kotlin.String value="" BLOCK type=kotlin.Unit origin=null DO_WHILE label=null origin=DO_WHILE_LOOP body: COMPOSITE type=kotlin.Unit origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Int origin=PREFIX_INCR + SET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Unit origin=PREFIX_INCR + CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=PREFIX_INCR + GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=PREFIX_INCR WHEN type=kotlin.Unit origin=WHEN BRANCH if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT - arg0: GET_VAR 'var k: kotlin.Int declared in .testBreakDoWhile' type=kotlin.Int origin=null + arg0: GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=2 - then: BREAK label=null loop.label=null + then: CONTINUE label=null loop.label=null + SET_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: GET_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.String origin=PLUSEQ + other: STRING_CONCATENATION type=kotlin.String + GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=null + CONST String type=kotlin.String value=";" condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: GET_VAR 'var k: kotlin.Int declared in .testBreakDoWhile' type=kotlin.Int origin=null + arg0: GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=10 + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean 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_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="1;2;" + then: THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor (p0: @[FlexibleNullability] kotlin.Any?) declared in java.lang.AssertionError' type=java.lang.AssertionError origin=null + p0: GET_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.String origin=null FUN name:testContinueFor visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:xs type:kotlin.IntArray [val] @@ -107,42 +146,3 @@ FILE fqName: fileName:/breakContinueInWhen.kt arg0: GET_VAR 'var k: kotlin.Int declared in .testContinueWhile' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=2 then: CONTINUE label=null loop.label=null - FUN name:testContinueDoWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:k type:kotlin.Int [var] - CONST Int type=kotlin.Int value=0 - VAR name:s type:kotlin.String [var] - CONST String type=kotlin.String value="" - BLOCK type=kotlin.Unit origin=null - DO_WHILE label=null origin=DO_WHILE_LOOP - body: COMPOSITE type=kotlin.Unit origin=null - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Int origin=PREFIX_INCR - SET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Unit origin=PREFIX_INCR - CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=PREFIX_INCR - GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=PREFIX_INCR - WHEN type=kotlin.Unit origin=WHEN - BRANCH - if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT - arg0: GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=null - arg1: CONST Int type=kotlin.Int value=2 - then: CONTINUE label=null loop.label=null - SET_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.Unit origin=PLUSEQ - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ - $this: GET_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.String origin=PLUSEQ - other: STRING_CONCATENATION type=kotlin.String - GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=null - CONST String type=kotlin.String value=";" - condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: GET_VAR 'var k: kotlin.Int declared in .testContinueDoWhile' type=kotlin.Int origin=null - arg1: CONST Int type=kotlin.Int value=10 - WHEN type=kotlin.Unit origin=IF - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean 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_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.String origin=null - arg1: CONST String type=kotlin.String value="1;2;" - then: THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor (p0: @[FlexibleNullability] kotlin.Any?) declared in java.lang.AssertionError' type=java.lang.AssertionError origin=null - p0: GET_VAR 'var s: kotlin.String declared in .testContinueDoWhile' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/breakContinueInWhen.kt.txt b/compiler/testData/ir/irText/expressions/breakContinueInWhen.kt.txt index 26d364adaa7..b892f8a7256 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInWhen.kt.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInWhen.kt.txt @@ -1,3 +1,14 @@ +fun testBreakDoWhile() { + var k: Int = 0 + { // BLOCK + do// COMPOSITE { + when { + greater(arg0 = k, arg1 = 2) -> break + } + // } while (less(arg0 = k, arg1 = 10)) + } +} + fun testBreakFor() { val xs: IntArray = IntArray(size = 10, init = local fun (i: Int): Int { return i @@ -26,15 +37,24 @@ fun testBreakWhile() { } } -fun testBreakDoWhile() { +fun testContinueDoWhile() { var k: Int = 0 + var s: String = "" { // BLOCK do// COMPOSITE { + { // BLOCK + k = k.inc() + k + } /*~> Unit */ when { - greater(arg0 = k, arg1 = 2) -> break + greater(arg0 = k, arg1 = 2) -> continue } + s = s.plus(other = k + ";") // } while (less(arg0 = k, arg1 = 10)) } + when { + EQEQ(arg0 = s, arg1 = "1;2;").not() -> throw AssertionError(p0 = s) + } } fun testContinueFor() { @@ -65,22 +85,3 @@ fun testContinueWhile() { } } -fun testContinueDoWhile() { - var k: Int = 0 - var s: String = "" - { // BLOCK - do// COMPOSITE { - { // BLOCK - k = k.inc() - k - } /*~> Unit */ - when { - greater(arg0 = k, arg1 = 2) -> continue - } - s = s.plus(other = k + ";") - // } while (less(arg0 = k, arg1 = 10)) - } - when { - EQEQ(arg0 = s, arg1 = "1;2;").not() -> throw AssertionError(p0 = s) - } -} diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.ir.txt index 91002acef8d..d9324377a89 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.ir.txt @@ -1,7 +1,4 @@ FILE fqName: fileName:/adaptedExtensionFunctions.kt - FUN name:use visibility:public modality:FINAL <> (f:@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>) returnType:kotlin.Unit - VALUE_PARAMETER name:f index:0 type:@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> - BLOCK_BODY CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] @@ -21,18 +18,6 @@ FILE fqName: fileName:/adaptedExtensionFunctions.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:extensionVararg visibility:public modality:FINAL <> ($receiver:.C, i:kotlin.Int, s:kotlin.Array) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:i index:0 type:kotlin.Int - VALUE_PARAMETER name:s index:1 type:kotlin.Array varargElementType:kotlin.String [vararg] - BLOCK_BODY - FUN name:extensionDefault visibility:public modality:FINAL <> ($receiver:.C, i:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:i index:0 type:kotlin.Int - VALUE_PARAMETER name:s index:1 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - BLOCK_BODY FUN name:extensionBoth visibility:public modality:FINAL <> ($receiver:.C, i:kotlin.Int, s:kotlin.String, t:kotlin.Array) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.C VALUE_PARAMETER name:i index:0 type:kotlin.Int @@ -41,30 +26,18 @@ FILE fqName: fileName:/adaptedExtensionFunctions.kt CONST String type=kotlin.String value="" VALUE_PARAMETER name:t index:2 type:kotlin.Array varargElementType:kotlin.String [vararg] BLOCK_BODY - FUN name:testExtensionVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:extensionDefault visibility:public modality:FINAL <> ($receiver:.C, i:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:s index:1 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" BLOCK_BODY - CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - f: BLOCK type=@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:extensionVararg visibility:local modality:FINAL <> (p0:.C, p1:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:.C - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p1 index:1 type:kotlin.Int - BLOCK_BODY - CALL 'public final fun extensionVararg (i: kotlin.Int, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'p0: .C declared in .testExtensionVararg.extensionVararg' type=.C origin=null - i: GET_VAR 'p1: kotlin.Int declared in .testExtensionVararg.extensionVararg' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun extensionVararg (p0: .C, p1: kotlin.Int): kotlin.Unit declared in .testExtensionVararg' type=@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun extensionVararg (i: kotlin.Int, vararg s: kotlin.String): kotlin.Unit declared in - FUN name:testExtensionDefault visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:extensionVararg visibility:public modality:FINAL <> ($receiver:.C, i:kotlin.Int, s:kotlin.Array) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:s index:1 type:kotlin.Array varargElementType:kotlin.String [vararg] BLOCK_BODY - CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - f: BLOCK type=@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:extensionDefault visibility:local modality:FINAL <> (p0:.C, p1:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:.C - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p1 index:1 type:kotlin.Int - BLOCK_BODY - CALL 'public final fun extensionDefault (i: kotlin.Int, s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'p0: .C declared in .testExtensionDefault.extensionDefault' type=.C origin=null - i: GET_VAR 'p1: kotlin.Int declared in .testExtensionDefault.extensionDefault' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun extensionDefault (p0: .C, p1: kotlin.Int): kotlin.Unit declared in .testExtensionDefault' type=@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun extensionDefault (i: kotlin.Int, s: kotlin.String): kotlin.Unit declared in FUN name:testExtensionBoth visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -77,3 +50,30 @@ FILE fqName: fileName:/adaptedExtensionFunctions.kt $receiver: GET_VAR 'p0: .C declared in .testExtensionBoth.extensionBoth' type=.C origin=null i: GET_VAR 'p1: kotlin.Int declared in .testExtensionBoth.extensionBoth' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun extensionBoth (p0: .C, p1: kotlin.Int): kotlin.Unit declared in .testExtensionBoth' type=@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun extensionBoth (i: kotlin.Int, s: kotlin.String, vararg t: kotlin.String): kotlin.Unit declared in + FUN name:testExtensionDefault visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + f: BLOCK type=@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:extensionDefault visibility:local modality:FINAL <> (p0:.C, p1:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:.C + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p1 index:1 type:kotlin.Int + BLOCK_BODY + CALL 'public final fun extensionDefault (i: kotlin.Int, s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $receiver: GET_VAR 'p0: .C declared in .testExtensionDefault.extensionDefault' type=.C origin=null + i: GET_VAR 'p1: kotlin.Int declared in .testExtensionDefault.extensionDefault' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun extensionDefault (p0: .C, p1: kotlin.Int): kotlin.Unit declared in .testExtensionDefault' type=@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun extensionDefault (i: kotlin.Int, s: kotlin.String): kotlin.Unit declared in + FUN name:testExtensionVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + f: BLOCK type=@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:extensionVararg visibility:local modality:FINAL <> (p0:.C, p1:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:.C + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p1 index:1 type:kotlin.Int + BLOCK_BODY + CALL 'public final fun extensionVararg (i: kotlin.Int, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $receiver: GET_VAR 'p0: .C declared in .testExtensionVararg.extensionVararg' type=.C origin=null + i: GET_VAR 'p1: kotlin.Int declared in .testExtensionVararg.extensionVararg' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun extensionVararg (p0: .C, p1: kotlin.Int): kotlin.Unit declared in .testExtensionVararg' type=@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun extensionVararg (i: kotlin.Int, vararg s: kotlin.String): kotlin.Unit declared in + FUN name:use visibility:public modality:FINAL <> (f:@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>) returnType:kotlin.Unit + VALUE_PARAMETER name:f index:0 type:@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.kt.txt index b28c2fbf482..7eaf532fd24 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.kt.txt @@ -1,6 +1,3 @@ -fun use(f: @ExtensionFunctionType Function2) { -} - class C { constructor() /* primary */ { super/*Any*/() @@ -10,22 +7,22 @@ class C { } -fun C.extensionVararg(i: Int, vararg s: String) { +fun C.extensionBoth(i: Int, s: String = "", vararg t: String) { } fun C.extensionDefault(i: Int, s: String = "") { } -fun C.extensionBoth(i: Int, s: String = "", vararg t: String) { +fun C.extensionVararg(i: Int, vararg s: String) { } -fun testExtensionVararg() { +fun testExtensionBoth() { use(f = { // BLOCK - local fun extensionVararg(p0: C, p1: Int) { - p0.extensionVararg(i = p1) + local fun extensionBoth(p0: C, p1: Int) { + p0.extensionBoth(i = p1) } - ::extensionVararg + ::extensionBoth }) } @@ -39,13 +36,16 @@ fun testExtensionDefault() { }) } -fun testExtensionBoth() { +fun testExtensionVararg() { use(f = { // BLOCK - local fun extensionBoth(p0: C, p1: Int) { - p0.extensionBoth(i = p1) + local fun extensionVararg(p0: C, p1: Int) { + p0.extensionVararg(i = p1) } - ::extensionBoth + ::extensionVararg }) } +fun use(f: @ExtensionFunctionType Function2) { +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.ir.txt index 5bf5c833d1b..d1646b896e5 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.ir.txt @@ -1,7 +1,4 @@ FILE fqName: fileName:/adaptedExtensionFunctions.kt - FUN name:use visibility:public modality:FINAL <> (f:@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>) returnType:kotlin.Unit - VALUE_PARAMETER name:f index:0 type:@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> - BLOCK_BODY CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] @@ -21,18 +18,6 @@ FILE fqName: fileName:/adaptedExtensionFunctions.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:extensionVararg visibility:public modality:FINAL <> ($receiver:.C, i:kotlin.Int, s:kotlin.Array) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:i index:0 type:kotlin.Int - VALUE_PARAMETER name:s index:1 type:kotlin.Array varargElementType:kotlin.String [vararg] - BLOCK_BODY - FUN name:extensionDefault visibility:public modality:FINAL <> ($receiver:.C, i:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:i index:0 type:kotlin.Int - VALUE_PARAMETER name:s index:1 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - BLOCK_BODY FUN name:extensionBoth visibility:public modality:FINAL <> ($receiver:.C, i:kotlin.Int, s:kotlin.String, t:kotlin.Array) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.C VALUE_PARAMETER name:i index:0 type:kotlin.Int @@ -41,30 +26,18 @@ FILE fqName: fileName:/adaptedExtensionFunctions.kt CONST String type=kotlin.String value="" VALUE_PARAMETER name:t index:2 type:kotlin.Array varargElementType:kotlin.String [vararg] BLOCK_BODY - FUN name:testExtensionVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:extensionDefault visibility:public modality:FINAL <> ($receiver:.C, i:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:s index:1 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" BLOCK_BODY - CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - f: BLOCK type=kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:extensionVararg visibility:local modality:FINAL <> (p0:.C, p1:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:.C - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p1 index:1 type:kotlin.Int - BLOCK_BODY - CALL 'public final fun extensionVararg (i: kotlin.Int, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'p0: .C declared in .testExtensionVararg.extensionVararg' type=.C origin=null - i: GET_VAR 'p1: kotlin.Int declared in .testExtensionVararg.extensionVararg' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun extensionVararg (p0: .C, p1: kotlin.Int): kotlin.Unit declared in .testExtensionVararg' type=kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun extensionVararg (i: kotlin.Int, vararg s: kotlin.String): kotlin.Unit declared in - FUN name:testExtensionDefault visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:extensionVararg visibility:public modality:FINAL <> ($receiver:.C, i:kotlin.Int, s:kotlin.Array) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:s index:1 type:kotlin.Array varargElementType:kotlin.String [vararg] BLOCK_BODY - CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - f: BLOCK type=kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:extensionDefault visibility:local modality:FINAL <> (p0:.C, p1:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:.C - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p1 index:1 type:kotlin.Int - BLOCK_BODY - CALL 'public final fun extensionDefault (i: kotlin.Int, s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'p0: .C declared in .testExtensionDefault.extensionDefault' type=.C origin=null - i: GET_VAR 'p1: kotlin.Int declared in .testExtensionDefault.extensionDefault' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun extensionDefault (p0: .C, p1: kotlin.Int): kotlin.Unit declared in .testExtensionDefault' type=kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun extensionDefault (i: kotlin.Int, s: kotlin.String): kotlin.Unit declared in FUN name:testExtensionBoth visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -77,3 +50,30 @@ FILE fqName: fileName:/adaptedExtensionFunctions.kt $receiver: GET_VAR 'p0: .C declared in .testExtensionBoth.extensionBoth' type=.C origin=null i: GET_VAR 'p1: kotlin.Int declared in .testExtensionBoth.extensionBoth' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun extensionBoth (p0: .C, p1: kotlin.Int): kotlin.Unit declared in .testExtensionBoth' type=kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun extensionBoth (i: kotlin.Int, s: kotlin.String, vararg t: kotlin.String): kotlin.Unit declared in + FUN name:testExtensionDefault visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + f: BLOCK type=kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:extensionDefault visibility:local modality:FINAL <> (p0:.C, p1:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:.C + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p1 index:1 type:kotlin.Int + BLOCK_BODY + CALL 'public final fun extensionDefault (i: kotlin.Int, s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $receiver: GET_VAR 'p0: .C declared in .testExtensionDefault.extensionDefault' type=.C origin=null + i: GET_VAR 'p1: kotlin.Int declared in .testExtensionDefault.extensionDefault' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun extensionDefault (p0: .C, p1: kotlin.Int): kotlin.Unit declared in .testExtensionDefault' type=kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun extensionDefault (i: kotlin.Int, s: kotlin.String): kotlin.Unit declared in + FUN name:testExtensionVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + f: BLOCK type=kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:extensionVararg visibility:local modality:FINAL <> (p0:.C, p1:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:.C + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p1 index:1 type:kotlin.Int + BLOCK_BODY + CALL 'public final fun extensionVararg (i: kotlin.Int, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $receiver: GET_VAR 'p0: .C declared in .testExtensionVararg.extensionVararg' type=.C origin=null + i: GET_VAR 'p1: kotlin.Int declared in .testExtensionVararg.extensionVararg' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun extensionVararg (p0: .C, p1: kotlin.Int): kotlin.Unit declared in .testExtensionVararg' type=kotlin.Function2<.C, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun extensionVararg (i: kotlin.Int, vararg s: kotlin.String): kotlin.Unit declared in + FUN name:use visibility:public modality:FINAL <> (f:@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>) returnType:kotlin.Unit + VALUE_PARAMETER name:f index:0 type:@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.kt.txt index 7d7a72fd25c..7eaf532fd24 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.kt.txt @@ -1,6 +1,3 @@ -fun use(f: @ExtensionFunctionType Function2) { -} - class C { constructor() /* primary */ { super/*Any*/() @@ -10,22 +7,22 @@ class C { } -fun C.extensionVararg(i: Int, vararg s: String) { +fun C.extensionBoth(i: Int, s: String = "", vararg t: String) { } fun C.extensionDefault(i: Int, s: String = "") { } -fun C.extensionBoth(i: Int, s: String = "", vararg t: String) { +fun C.extensionVararg(i: Int, vararg s: String) { } -fun testExtensionVararg() { +fun testExtensionBoth() { use(f = { // BLOCK - local fun extensionVararg(p0: C, p1: Int) { - p0.extensionVararg(i = p1) + local fun extensionBoth(p0: C, p1: Int) { + p0.extensionBoth(i = p1) } - ::extensionVararg + ::extensionBoth }) } @@ -39,12 +36,16 @@ fun testExtensionDefault() { }) } -fun testExtensionBoth() { +fun testExtensionVararg() { use(f = { // BLOCK - local fun extensionBoth(p0: C, p1: Int) { - p0.extensionBoth(i = p1) + local fun extensionVararg(p0: C, p1: Int) { + p0.extensionVararg(i = p1) } - ::extensionBoth + ::extensionVararg }) } + +fun use(f: @ExtensionFunctionType Function2) { +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.ir.txt index f7701b314e0..0dc4a486750 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.ir.txt @@ -1,10 +1,4 @@ FILE fqName: fileName:/adaptedWithCoercionToUnit.kt - FUN name:useUnit0 visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 - BLOCK_BODY - FUN name:useUnit1 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY FUN name:fn0 visibility:public modality:FINAL <> () returnType:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun fn0 (): kotlin.Int declared in ' @@ -64,3 +58,9 @@ FILE fqName: fileName:/adaptedWithCoercionToUnit.kt xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int GET_VAR 'p0: kotlin.Int declared in .testV1.fnv' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun fnv (p0: kotlin.Int): kotlin.Unit declared in .testV1' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun fnv (vararg xs: kotlin.Int): kotlin.Int declared in + FUN name:useUnit0 visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 + BLOCK_BODY + FUN name:useUnit1 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.kt.txt index be9607dcd33..999393f1694 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.kt.txt @@ -1,9 +1,3 @@ -fun useUnit0(fn: Function0) { -} - -fun useUnit1(fn: Function1) { -} - fun fn0(): Int { return 1 } @@ -55,3 +49,10 @@ fun testV1() { ::fnv }) } + +fun useUnit0(fn: Function0) { +} + +fun useUnit1(fn: Function1) { +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.ir.txt index 828f15c529c..9b32e5b507e 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.ir.txt @@ -2,20 +2,9 @@ FILE fqName:test fileName:/boundInnerGenericConstructor.kt CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Foo TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:test.Foo [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Foo.Inner

TYPE_PARAMETER name:P index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> ($this:test.Foo, a:T of test.Foo, b:P of test.Foo.Inner) returnType:test.Foo.Inner

[primary] - $outer: VALUE_PARAMETER name: type:test.Foo - VALUE_PARAMETER name:a index:0 type:T of test.Foo - VALUE_PARAMETER name:b index:1 type:P of test.Foo.Inner - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:T of test.Foo visibility:private [final] EXPRESSION_BODY @@ -38,6 +27,13 @@ FILE fqName:test fileName:/boundInnerGenericConstructor.kt RETURN type=kotlin.Nothing from='public final fun (): P of test.Foo.Inner declared in test.Foo.Inner' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:P of test.Foo.Inner visibility:private [final]' type=P of test.Foo.Inner origin=null receiver: GET_VAR ': test.Foo.Inner

declared in test.Foo.Inner.' type=test.Foo.Inner

origin=null + CONSTRUCTOR visibility:public <> ($this:test.Foo, a:T of test.Foo, b:P of test.Foo.Inner) returnType:test.Foo.Inner

[primary] + $outer: VALUE_PARAMETER name: type:test.Foo + VALUE_PARAMETER name:a index:0 type:T of test.Foo + VALUE_PARAMETER name:b index:1 type:P of test.Foo.Inner + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] 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 declared in kotlin.Any @@ -51,6 +47,10 @@ FILE fqName:test fileName:/boundInnerGenericConstructor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:test.Foo [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public 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 declared in kotlin.Any @@ -64,18 +64,6 @@ FILE fqName:test fileName:/boundInnerGenericConstructor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:foo visibility:public modality:FINAL (a:A of test.foo, b:B of test.foo, x:kotlin.Function2>) returnType:test.Foo.Inner [inline] - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:a index:0 type:A of test.foo - VALUE_PARAMETER name:b index:1 type:B of test.foo - VALUE_PARAMETER name:x index:2 type:kotlin.Function2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (a: A of test.foo, b: B of test.foo, x: kotlin.Function2>): test.Foo.Inner declared in test' - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function2, p2: P2 of kotlin.Function2): R of kotlin.Function2 declared in kotlin.Function2' type=test.Foo.Inner origin=INVOKE - $this: GET_VAR 'x: kotlin.Function2> declared in test.foo' type=kotlin.Function2> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR 'a: A of test.foo declared in test.foo' type=A of test.foo origin=null - p2: GET_VAR 'b: B of test.foo declared in test.foo' type=B of test.foo origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:z type:test.Foo [val] @@ -96,3 +84,15 @@ FILE fqName:test fileName:/boundInnerGenericConstructor.kt $this: GET_VAR 'val foo: test.Foo.Inner declared in test.box' type=test.Foo.Inner origin=null other: CALL 'public final fun (): P of test.Foo.Inner declared in test.Foo.Inner' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR 'val foo: test.Foo.Inner declared in test.box' type=test.Foo.Inner origin=null + FUN name:foo visibility:public modality:FINAL (a:A of test.foo, b:B of test.foo, x:kotlin.Function2>) returnType:test.Foo.Inner [inline] + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:a index:0 type:A of test.foo + VALUE_PARAMETER name:b index:1 type:B of test.foo + VALUE_PARAMETER name:x index:2 type:kotlin.Function2> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (a: A of test.foo, b: B of test.foo, x: kotlin.Function2>): test.Foo.Inner declared in test' + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function2, p2: P2 of kotlin.Function2): R of kotlin.Function2 declared in kotlin.Function2' type=test.Foo.Inner origin=INVOKE + $this: GET_VAR 'x: kotlin.Function2> declared in test.foo' type=kotlin.Function2> origin=VARIABLE_AS_FUNCTION + p1: GET_VAR 'a: A of test.foo declared in test.foo' type=A of test.foo origin=null + p2: GET_VAR 'b: B of test.foo declared in test.foo' type=B of test.foo origin=null diff --git a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt.txt index f8f2c9ac77f..60609b43bb5 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt.txt @@ -1,19 +1,7 @@ package test class Foo { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - inner class Inner

{ - constructor(a: T, b: P) /* primary */ { - super/*Any*/() - /* () */ - - } - val a: T field = a get @@ -22,12 +10,20 @@ class Foo { field = b get + constructor(a: T, b: P) /* primary */ { + super/*Any*/() + /* () */ + + } + } -} + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } -inline fun foo(a: A, b: B, x: Function2>): Inner { - return x.invoke(p1 = a, p2 = b) } fun box(): String { @@ -35,3 +31,8 @@ fun box(): String { val foo: Inner = foo(a = "O", b = "K", x = z::/*()*/) return foo.().plus(other = foo.()) } + +inline fun foo(a: A, b: B, x: Function2>): Inner { + return x.invoke(p1 = a, p2 = b) +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.ir.txt index 1ba9596fc19..6a5dffaafb2 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.ir.txt @@ -1,9 +1,6 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFoo - VALUE_PARAMETER name:i index:0 type:kotlin.Int 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 @@ -17,18 +14,21 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IFoo2 modality:ABSTRACT visibility:public [fun] superTypes:[.IFoo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo2 - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (i: kotlin.Int): kotlin.Unit declared in .IFoo + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.IFoo VALUE_PARAMETER name:i index:0 type:kotlin.Int + CLASS INTERFACE name:IFoo2 modality:ABSTRACT visibility:public [fun] superTypes:[.IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo2 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 .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun foo (i: kotlin.Int): kotlin.Unit declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo + VALUE_PARAMETER name:i index:0 type:kotlin.Int 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 .IFoo @@ -81,27 +81,22 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun get (i: .IFoo): kotlin.Int declared in ' CONST Int type=kotlin.Int value=1 - FUN name:set visibility:public modality:FINAL <> ($receiver:.A, i:.IFoo, newValue:kotlin.Int) returnType:kotlin.Unit [operator] - $receiver: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:i index:0 type:.IFoo - VALUE_PARAMETER name:newValue index:1 type:kotlin.Int - BLOCK_BODY FUN name:get visibility:public modality:FINAL <> ($receiver:.B, i:.IFoo) returnType:kotlin.Int [operator] $receiver: VALUE_PARAMETER name: type:.B VALUE_PARAMETER name:i index:0 type:.IFoo BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun get (i: .IFoo): kotlin.Int declared in ' CONST Int type=kotlin.Int value=1 + FUN name:set visibility:public modality:FINAL <> ($receiver:.A, i:.IFoo, newValue:kotlin.Int) returnType:kotlin.Unit [operator] + $receiver: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:i index:0 type:.IFoo + VALUE_PARAMETER name:newValue index:1 type:kotlin.Int + BLOCK_BODY FUN name:set visibility:public modality:FINAL <> ($receiver:.B, i:.IFoo2, newValue:kotlin.Int) returnType:kotlin.Unit [operator] $receiver: VALUE_PARAMETER name: type:.B VALUE_PARAMETER name:i index:0 type:.IFoo2 VALUE_PARAMETER name:newValue index:1 type:kotlin.Int BLOCK_BODY - FUN name:withVararg visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ @@ -236,3 +231,8 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt $receiver: GET_VAR 'val tmp_10: .A declared in .test6' type=.A origin=null i: GET_VAR 'val tmp_11: kotlin.Any declared in .test6' type=kotlin.Any origin=null other: CONST Int type=kotlin.Int value=1 + FUN name:withVararg visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.kt.txt index 80ecc198ca7..23d8dd9bd95 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.kt.txt @@ -28,18 +28,14 @@ operator fun A.get(i: IFoo): Int { return 1 } -operator fun A.set(i: IFoo, newValue: Int) { -} - operator fun B.get(i: IFoo): Int { return 1 } -operator fun B.set(i: IFoo2, newValue: Int) { +operator fun A.set(i: IFoo, newValue: Int) { } -fun withVararg(vararg xs: Int): Int { - return 42 +operator fun B.set(i: IFoo2, newValue: Int) { } fun test1() { @@ -109,3 +105,7 @@ fun test6(a: Any) { } } +fun withVararg(vararg xs: Int): Int { + return 42 +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.ir.txt index c98f7de8af5..f39bee45b85 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.ir.txt @@ -1,9 +1,6 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFoo - VALUE_PARAMETER name:i index:0 type:kotlin.Int 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 @@ -17,18 +14,21 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IFoo2 modality:ABSTRACT visibility:public [fun] superTypes:[.IFoo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo2 - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (i: kotlin.Int): kotlin.Unit declared in .IFoo + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.IFoo VALUE_PARAMETER name:i index:0 type:kotlin.Int + CLASS INTERFACE name:IFoo2 modality:ABSTRACT visibility:public [fun] superTypes:[.IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo2 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 .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun foo (i: kotlin.Int): kotlin.Unit declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo + VALUE_PARAMETER name:i index:0 type:kotlin.Int 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 .IFoo @@ -81,27 +81,22 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun get (i: .IFoo): kotlin.Int declared in ' CONST Int type=kotlin.Int value=1 - FUN name:set visibility:public modality:FINAL <> ($receiver:.A, i:.IFoo, newValue:kotlin.Int) returnType:kotlin.Unit [operator] - $receiver: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:i index:0 type:.IFoo - VALUE_PARAMETER name:newValue index:1 type:kotlin.Int - BLOCK_BODY FUN name:get visibility:public modality:FINAL <> ($receiver:.B, i:.IFoo) returnType:kotlin.Int [operator] $receiver: VALUE_PARAMETER name: type:.B VALUE_PARAMETER name:i index:0 type:.IFoo BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun get (i: .IFoo): kotlin.Int declared in ' CONST Int type=kotlin.Int value=1 + FUN name:set visibility:public modality:FINAL <> ($receiver:.A, i:.IFoo, newValue:kotlin.Int) returnType:kotlin.Unit [operator] + $receiver: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:i index:0 type:.IFoo + VALUE_PARAMETER name:newValue index:1 type:kotlin.Int + BLOCK_BODY FUN name:set visibility:public modality:FINAL <> ($receiver:.B, i:.IFoo2, newValue:kotlin.Int) returnType:kotlin.Unit [operator] $receiver: VALUE_PARAMETER name: type:.B VALUE_PARAMETER name:i index:0 type:.IFoo2 VALUE_PARAMETER name:newValue index:1 type:kotlin.Int BLOCK_BODY - FUN name:withVararg visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ @@ -235,3 +230,8 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt i: TYPE_OP type=.IFoo origin=IMPLICIT_CAST typeOperand=.IFoo GET_VAR 'val tmp_11: kotlin.Any declared in .test6' type=kotlin.Any origin=null other: CONST Int type=kotlin.Int value=1 + FUN name:withVararg visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.kt.txt index ab79b56c7df..3ebf4b049a7 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.kt.txt @@ -28,18 +28,14 @@ operator fun A.get(i: IFoo): Int { return 1 } -operator fun A.set(i: IFoo, newValue: Int) { -} - operator fun B.get(i: IFoo): Int { return 1 } -operator fun B.set(i: IFoo2, newValue: Int) { +operator fun A.set(i: IFoo, newValue: Int) { } -fun withVararg(vararg xs: Int): Int { - return 42 +operator fun B.set(i: IFoo2, newValue: Int) { } fun test1() { @@ -108,3 +104,8 @@ fun test6(a: Any) { tmp_10.set(i = tmp_11 /*as IFoo */, newValue = tmp_10.get(i = tmp_11 /*as IFoo */).plus(other = 1)) } } + +fun withVararg(vararg xs: Int): Int { + return 42 +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.ir.txt index 037900c3a6e..3b252ebc715 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.ir.txt @@ -1,11 +1,4 @@ FILE fqName: fileName:/constructorWithAdaptedArguments.kt - FUN name:use visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Any - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun use (fn: kotlin.Function1): kotlin.Any declared in ' - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Any origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function1 declared in .use' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION - p1: CONST Int type=kotlin.Int value=42 CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:.C [primary] @@ -28,10 +21,6 @@ FILE fqName: fileName:/constructorWithAdaptedArguments.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner CONSTRUCTOR visibility:public <> ($this:.Outer, xs:kotlin.IntArray) returnType:.Outer.Inner [primary] @@ -53,6 +42,10 @@ FILE fqName: fileName:/constructorWithAdaptedArguments.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any @@ -112,3 +105,10 @@ FILE fqName: fileName:/constructorWithAdaptedArguments.kt GET_VAR 'p0: kotlin.Int declared in .testInnerClassConstructorCapturingOuter.' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun (p0: kotlin.Int): .Outer.Inner declared in .testInnerClassConstructorCapturingOuter' type=kotlin.Function1.Outer.Inner> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public constructor (vararg xs: kotlin.Int) declared in .Outer.Inner $receiver: CONSTRUCTOR_CALL 'public constructor () declared in .Outer' type=.Outer origin=null + FUN name:use visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Any + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun use (fn: kotlin.Function1): kotlin.Any declared in ' + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Any origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function1 declared in .use' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + p1: CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt.txt index 28e3b0cca7c..c7d53946e07 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt.txt @@ -1,7 +1,3 @@ -fun use(fn: Function1): Any { - return fn.invoke(p1 = 42) -} - class C { constructor(vararg xs: Int) /* primary */ { super/*Any*/() @@ -12,12 +8,6 @@ class C { } class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - inner class Inner { constructor(vararg xs: Int) /* primary */ { super/*Any*/() @@ -27,6 +17,12 @@ class Outer { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } fun testConstructor(): Any { @@ -58,3 +54,8 @@ fun testInnerClassConstructorCapturingOuter(): Any { Outer():: }) } + +fun use(fn: Function1): Any { + return fn.invoke(p1 = 42) +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.ir.txt index 1609ef6a9a6..4f845c61063 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.ir.txt @@ -1,4 +1,37 @@ FILE fqName: fileName:/funWithDefaultParametersAsKCallableStar.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .C.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 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:defaultsOnly visibility:public modality:FINAL <> (x:kotlin.String) returnType:kotlin.Int VALUE_PARAMETER name:x index:0 type:kotlin.String EXPRESSION_BODY @@ -14,47 +47,10 @@ FILE fqName: fileName:/funWithDefaultParametersAsKCallableStar.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun regularAndDefaults (x1: kotlin.String, x2: kotlin.String): kotlin.Int declared in ' CONST Int type=kotlin.Int value=1 - FUN name:varargs visibility:public modality:FINAL <> (xs:kotlin.Array) returnType:kotlin.Int - VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun varargs (vararg xs: kotlin.String): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=1 - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.C [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.String declared in .C.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.String - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .C declared in .C.' type=.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 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:useKCallableStar visibility:public modality:FINAL <> (fn:kotlin.reflect.KCallable<*>) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.reflect.KCallable<*> + FUN name:testCtorStar visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY + CALL 'public final fun useKCallableStar (fn: kotlin.reflect.KCallable<*>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: FUNCTION_REFERENCE 'public constructor (x: kotlin.String) declared in .C' type=kotlin.reflect.KFunction1.C> origin=null reflectionTarget= FUN name:testDefaultsOnlyStar visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useKCallableStar (fn: kotlin.reflect.KCallable<*>): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -67,7 +63,11 @@ FILE fqName: fileName:/funWithDefaultParametersAsKCallableStar.kt BLOCK_BODY CALL 'public final fun useKCallableStar (fn: kotlin.reflect.KCallable<*>): kotlin.Unit declared in ' type=kotlin.Unit origin=null fn: FUNCTION_REFERENCE 'public final fun varargs (vararg xs: kotlin.String): kotlin.Int declared in ' type=kotlin.reflect.KFunction1, kotlin.Int> origin=null reflectionTarget= - FUN name:testCtorStar visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:useKCallableStar visibility:public modality:FINAL <> (fn:kotlin.reflect.KCallable<*>) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.reflect.KCallable<*> BLOCK_BODY - CALL 'public final fun useKCallableStar (fn: kotlin.reflect.KCallable<*>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: FUNCTION_REFERENCE 'public constructor (x: kotlin.String) declared in .C' type=kotlin.reflect.KFunction1.C> origin=null reflectionTarget= + FUN name:varargs visibility:public modality:FINAL <> (xs:kotlin.Array) returnType:kotlin.Int + VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun varargs (vararg xs: kotlin.String): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.kt.txt index 579e9c67e23..38bd5a53f45 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.kt.txt @@ -1,3 +1,16 @@ +class C { + val x: String + field = x + get + + constructor(x: String = "") /* primary */ { + super/*Any*/() + /* () */ + + } + +} + fun defaultsOnly(x: String = ""): Int { return 1 } @@ -6,24 +19,8 @@ fun regularAndDefaults(x1: String, x2: String = ""): Int { return 1 } -fun varargs(vararg xs: String): Int { - return 1 -} - -class C { - constructor(x: String = "") /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: String - field = x - get - -} - -fun useKCallableStar(fn: KCallable<*>) { +fun testCtorStar() { + useKCallableStar(fn = C::) } fun testDefaultsOnlyStar() { @@ -38,6 +35,10 @@ fun testVarargsStar() { useKCallableStar(fn = ::varargs) } -fun testCtorStar() { - useKCallableStar(fn = C::) +fun useKCallableStar(fn: KCallable<*>) { } + +fun varargs(vararg xs: String): Int { + return 1 +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.fir.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.fir.ir.txt index bdd24e981c8..3bef7074999 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.fir.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt CLASS CLASS name:L modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.L.L> TYPE_PARAMETER name:LL index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (ll:LL of .L) returnType:.L.L> [primary] - VALUE_PARAMETER name:ll index:0 type:LL of .L - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:L modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:ll visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ll type:LL of .L visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,11 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt RETURN type=kotlin.Nothing from='public final fun (): LL of .L declared in .L' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ll type:LL of .L visibility:private [final]' type=LL of .L origin=null receiver: GET_VAR ': .L.L> declared in .L.' type=.L.L> origin=null + CONSTRUCTOR visibility:public <> (ll:LL of .L) returnType:.L.L> [primary] + VALUE_PARAMETER name:ll index:0 type:LL of .L + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:L modality:OPEN visibility:public 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 declared in kotlin.Any @@ -34,11 +34,6 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt CLASS CLASS name:Rec modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Rec.Rec> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (rt:T of .Rec) returnType:.Rec.Rec> [primary] - VALUE_PARAMETER name:rt index:0 type:T of .Rec - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Rec modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:rt visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:rt type:T of .Rec visibility:private [final] EXPRESSION_BODY @@ -50,6 +45,11 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Rec declared in .Rec' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:rt type:T of .Rec visibility:private [final]' type=T of .Rec origin=null receiver: GET_VAR ': .Rec.Rec> declared in .Rec.' type=.Rec.Rec> origin=null + CONSTRUCTOR visibility:public <> (rt:T of .Rec) returnType:.Rec.Rec> [primary] + VALUE_PARAMETER name:rt index:0 type:T of .Rec + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Rec modality:FINAL visibility:public 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 declared in kotlin.Any @@ -63,66 +63,6 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:p visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($receiver:.Rec.>) returnType:.L.> - correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] - TYPE_PARAMETER name:PT index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Rec.> - BLOCK_BODY - CLASS CLASS name:PLocal modality:FINAL visibility:local superTypes:[.L..PLocal>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:..PLocal..PLocal, PT of .> - TYPE_PARAMETER name:LT index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (lt:LT of ..PLocal, pt:PT of .) returnType:..PLocal..PLocal, PT of .> [primary] - VALUE_PARAMETER name:lt index:0 type:LT of ..PLocal - VALUE_PARAMETER name:pt index:1 type:PT of . - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (ll: LL of .L) declared in .L' - : LT of ..PLocal - ll: GET_VAR 'lt: LT of ..PLocal declared in ..PLocal.' type=LT of ..PLocal origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PLocal modality:FINAL visibility:local superTypes:[.L..PLocal>]' - PROPERTY name:pt visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:pt type:PT of . visibility:private [final] - EXPRESSION_BODY - GET_VAR 'pt: PT of . declared in ..PLocal.' type=PT of . origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:..PLocal..PLocal, PT of .>) returnType:PT of . - correspondingProperty: PROPERTY name:pt visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:..PLocal..PLocal, PT of .> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): PT of . declared in ..PLocal' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:pt type:PT of . visibility:private [final]' type=PT of . origin=null - receiver: GET_VAR ': ..PLocal..PLocal, PT of .> declared in ..PLocal.' type=..PLocal..PLocal, PT of .> origin=null - PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] - overridden: - public final ll: LL of .L - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.L..PLocal>) returnType:LT of ..PLocal [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): LL of .L declared in .L - $this: VALUE_PARAMETER name: type:.L..PLocal> - 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 .L - $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 .L - $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 .L - $this: VALUE_PARAMETER name: type:kotlin.Any - RETURN type=kotlin.Nothing from='public final fun (): .L.> declared in ' - CALL 'public final fun foo2 (t1: T1 of .foo2, t2: T2 of .foo2, bb: kotlin.Function2.foo2, T2 of .foo2, R of .foo2>): R of .foo2 declared in ' type=..PLocal., PT of .> origin=null - : PT of . - : PT of . - : ..PLocal., PT of .> - t1: CALL 'public final fun (): T of .Rec declared in .Rec' type=PT of . origin=GET_PROPERTY - $this: GET_VAR ': .Rec.> declared in .' type=.Rec.> origin=null - t2: CALL 'public final fun (): T of .Rec declared in .Rec' type=PT of . origin=GET_PROPERTY - $this: GET_VAR ': .Rec.> declared in .' type=.Rec.> origin=null - bb: FUNCTION_REFERENCE 'public constructor (lt: LT of ..PLocal, pt: PT of .) declared in ..PLocal' type=kotlin.reflect.KFunction2., PT of ., ..PLocal., PT of .>> origin=null reflectionTarget= - : PT of . FUN name:fn visibility:public modality:FINAL ($receiver:.Rec.fn>) returnType:.L.fn> TYPE_PARAMETER name:FT index:0 variance: superTypes:[kotlin.Any?] reified:false $receiver: VALUE_PARAMETER name: type:.Rec.fn> @@ -130,14 +70,6 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt CLASS CLASS name:FLocal modality:FINAL visibility:local superTypes:[.L.fn.FLocal>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.fn.FLocal.fn.FLocal, FT of .fn> TYPE_PARAMETER name:LT index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (lt:LT of .fn.FLocal, pt:FT of .fn) returnType:.fn.FLocal.fn.FLocal, FT of .fn> [primary] - VALUE_PARAMETER name:lt index:0 type:LT of .fn.FLocal - VALUE_PARAMETER name:pt index:1 type:FT of .fn - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (ll: LL of .L) declared in .L' - : LT of .fn.FLocal - ll: GET_VAR 'lt: LT of .fn.FLocal declared in .fn.FLocal.' type=LT of .fn.FLocal origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FLocal modality:FINAL visibility:local superTypes:[.L.fn.FLocal>]' PROPERTY name:pt visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:pt type:FT of .fn visibility:private [final] EXPRESSION_BODY @@ -149,14 +81,14 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt RETURN type=kotlin.Nothing from='public final fun (): FT of .fn declared in .fn.FLocal' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:pt type:FT of .fn visibility:private [final]' type=FT of .fn origin=null receiver: GET_VAR ': .fn.FLocal.fn.FLocal, FT of .fn> declared in .fn.FLocal.' type=.fn.FLocal.fn.FLocal, FT of .fn> origin=null - PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] - overridden: - public final ll: LL of .L - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.L.fn.FLocal>) returnType:LT of .fn.FLocal [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): LL of .L declared in .L - $this: VALUE_PARAMETER name: type:.L.fn.FLocal> + CONSTRUCTOR visibility:public <> (lt:LT of .fn.FLocal, pt:FT of .fn) returnType:.fn.FLocal.fn.FLocal, FT of .fn> [primary] + VALUE_PARAMETER name:lt index:0 type:LT of .fn.FLocal + VALUE_PARAMETER name:pt index:1 type:FT of .fn + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (ll: LL of .L) declared in .L' + : LT of .fn.FLocal + ll: GET_VAR 'lt: LT of .fn.FLocal declared in .fn.FLocal.' type=LT of .fn.FLocal origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FLocal modality:FINAL visibility:local superTypes:[.L.fn.FLocal>]' 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 .L @@ -170,6 +102,14 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in .L $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] + overridden: + public final ll: LL of .L + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.L.fn.FLocal>) returnType:LT of .fn.FLocal [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): LL of .L declared in .L + $this: VALUE_PARAMETER name: type:.L.fn.FLocal> RETURN type=kotlin.Nothing from='public final fun fn (): .L.fn> declared in ' CALL 'public final fun foo2 (t1: T1 of .foo2, t2: T2 of .foo2, bb: kotlin.Function2.foo2, T2 of .foo2, R of .foo2>): R of .foo2 declared in ' type=.fn.FLocal.fn, FT of .fn> origin=null : FT of .fn @@ -194,3 +134,63 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt $this: GET_VAR 'bb: kotlin.Function2.foo2, T2 of .foo2, R of .foo2> declared in .foo2' type=kotlin.Function2.foo2, T2 of .foo2, R of .foo2> origin=VARIABLE_AS_FUNCTION p1: GET_VAR 't1: T1 of .foo2 declared in .foo2' type=T1 of .foo2 origin=null p2: GET_VAR 't2: T2 of .foo2 declared in .foo2' type=T2 of .foo2 origin=null + PROPERTY name:p visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL ($receiver:.Rec.>) returnType:.L.> + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] + TYPE_PARAMETER name:PT index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Rec.> + BLOCK_BODY + CLASS CLASS name:PLocal modality:FINAL visibility:local superTypes:[.L..PLocal>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:..PLocal..PLocal, PT of .> + TYPE_PARAMETER name:LT index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:pt visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:pt type:PT of . visibility:private [final] + EXPRESSION_BODY + GET_VAR 'pt: PT of . declared in ..PLocal.' type=PT of . origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:..PLocal..PLocal, PT of .>) returnType:PT of . + correspondingProperty: PROPERTY name:pt visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:..PLocal..PLocal, PT of .> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): PT of . declared in ..PLocal' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:pt type:PT of . visibility:private [final]' type=PT of . origin=null + receiver: GET_VAR ': ..PLocal..PLocal, PT of .> declared in ..PLocal.' type=..PLocal..PLocal, PT of .> origin=null + CONSTRUCTOR visibility:public <> (lt:LT of ..PLocal, pt:PT of .) returnType:..PLocal..PLocal, PT of .> [primary] + VALUE_PARAMETER name:lt index:0 type:LT of ..PLocal + VALUE_PARAMETER name:pt index:1 type:PT of . + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (ll: LL of .L) declared in .L' + : LT of ..PLocal + ll: GET_VAR 'lt: LT of ..PLocal declared in ..PLocal.' type=LT of ..PLocal origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PLocal modality:FINAL visibility:local superTypes:[.L..PLocal>]' + 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 .L + $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 .L + $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 .L + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] + overridden: + public final ll: LL of .L + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.L..PLocal>) returnType:LT of ..PLocal [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): LL of .L declared in .L + $this: VALUE_PARAMETER name: type:.L..PLocal> + RETURN type=kotlin.Nothing from='public final fun (): .L.> declared in ' + CALL 'public final fun foo2 (t1: T1 of .foo2, t2: T2 of .foo2, bb: kotlin.Function2.foo2, T2 of .foo2, R of .foo2>): R of .foo2 declared in ' type=..PLocal., PT of .> origin=null + : PT of . + : PT of . + : ..PLocal., PT of .> + t1: CALL 'public final fun (): T of .Rec declared in .Rec' type=PT of . origin=GET_PROPERTY + $this: GET_VAR ': .Rec.> declared in .' type=.Rec.> origin=null + t2: CALL 'public final fun (): T of .Rec declared in .Rec' type=PT of . origin=GET_PROPERTY + $this: GET_VAR ': .Rec.> declared in .' type=.Rec.> origin=null + bb: FUNCTION_REFERENCE 'public constructor (lt: LT of ..PLocal, pt: PT of .) declared in ..PLocal' type=kotlin.reflect.KFunction2., PT of ., ..PLocal., PT of .>> origin=null reflectionTarget= + : PT of . diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.fir.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.fir.kt.txt index dd3d4028785..83ff4681037 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.fir.kt.txt @@ -1,59 +1,41 @@ open class L { + val ll: LL + field = ll + get + constructor(ll: LL) /* primary */ { super/*Any*/() /* () */ } - val ll: LL - field = ll - get - } class Rec { + val rt: T + field = rt + get + constructor(rt: T) /* primary */ { super/*Any*/() /* () */ } - val rt: T - field = rt - get - } -val Rec.p: L - get(): L { - local class PLocal : L { - constructor(lt: LT, pt: PT) /* primary */ { - super/*L*/(ll = lt) - /* () */ - - } - - val pt: PT - field = pt - get - - } - - return foo2>(t1 = .(), t2 = .(), bb = PLocal::/*()*/) - } - fun Rec.fn(): L { local class FLocal : L { + val pt: FT + field = pt + get + constructor(lt: LT, pt: FT) /* primary */ { super/*L*/(ll = lt) /* () */ } - val pt: FT - field = pt - get - } return foo2>(t1 = .(), t2 = .(), bb = FLocal::/*()*/) @@ -63,3 +45,21 @@ fun foo2(t1: T1, t2: T2, bb: Function2 Rec.p: L + get(): L { + local class PLocal : L { + val pt: PT + field = pt + get + + constructor(lt: LT, pt: PT) /* primary */ { + super/*L*/(ll = lt) + /* () */ + + } + + } + + return foo2>(t1 = .(), t2 = .(), bb = PLocal::/*()*/) + } + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.ir.txt index 75476587e9c..bc33d829640 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt CLASS CLASS name:L modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.L.L> TYPE_PARAMETER name:LL index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (ll:LL of .L) returnType:.L.L> [primary] - VALUE_PARAMETER name:ll index:0 type:LL of .L - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:L modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:ll visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ll type:LL of .L visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,11 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt RETURN type=kotlin.Nothing from='public final fun (): LL of .L declared in .L' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ll type:LL of .L visibility:private [final]' type=LL of .L origin=null receiver: GET_VAR ': .L.L> declared in .L.' type=.L.L> origin=null + CONSTRUCTOR visibility:public <> (ll:LL of .L) returnType:.L.L> [primary] + VALUE_PARAMETER name:ll index:0 type:LL of .L + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:L modality:OPEN visibility:public 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 declared in kotlin.Any @@ -34,11 +34,6 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt CLASS CLASS name:Rec modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Rec.Rec> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (rt:T of .Rec) returnType:.Rec.Rec> [primary] - VALUE_PARAMETER name:rt index:0 type:T of .Rec - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Rec modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:rt visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:rt type:T of .Rec visibility:private [final] EXPRESSION_BODY @@ -50,6 +45,11 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Rec declared in .Rec' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:rt type:T of .Rec visibility:private [final]' type=T of .Rec origin=null receiver: GET_VAR ': .Rec.Rec> declared in .Rec.' type=.Rec.Rec> origin=null + CONSTRUCTOR visibility:public <> (rt:T of .Rec) returnType:.Rec.Rec> [primary] + VALUE_PARAMETER name:rt index:0 type:T of .Rec + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Rec modality:FINAL visibility:public 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 declared in kotlin.Any @@ -63,66 +63,6 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:p visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($receiver:.Rec.>) returnType:.L.> - correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] - TYPE_PARAMETER name:PT index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Rec.> - BLOCK_BODY - CLASS CLASS name:PLocal modality:FINAL visibility:local superTypes:[.L..PLocal>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:..PLocal..PLocal> - TYPE_PARAMETER name:LT index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (lt:LT of ..PLocal, pt:PT of .) returnType:..PLocal..PLocal> [primary] - VALUE_PARAMETER name:lt index:0 type:LT of ..PLocal - VALUE_PARAMETER name:pt index:1 type:PT of . - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (ll: LL of .L) declared in .L' - : LT of ..PLocal - ll: GET_VAR 'lt: LT of ..PLocal declared in ..PLocal.' type=LT of ..PLocal origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PLocal modality:FINAL visibility:local superTypes:[.L..PLocal>]' - PROPERTY name:pt visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:pt type:PT of . visibility:private [final] - EXPRESSION_BODY - GET_VAR 'pt: PT of . declared in ..PLocal.' type=PT of . origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:..PLocal..PLocal>) returnType:PT of . - correspondingProperty: PROPERTY name:pt visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:..PLocal..PLocal> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): PT of . declared in ..PLocal' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:pt type:PT of . visibility:private [final]' type=PT of . origin=null - receiver: GET_VAR ': ..PLocal..PLocal> declared in ..PLocal.' type=..PLocal..PLocal> origin=null - PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] - overridden: - public final ll: LL of .L - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.L..PLocal>) returnType:LT of ..PLocal [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): LL of .L declared in .L - $this: VALUE_PARAMETER name: type:.L..PLocal> - 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 .L - $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 .L - $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 .L - $this: VALUE_PARAMETER name: type:kotlin.Any - RETURN type=kotlin.Nothing from='public final fun (): .L.> declared in ' - CALL 'public final fun foo2 (t1: T1 of .foo2, t2: T2 of .foo2, bb: kotlin.Function2.foo2, T2 of .foo2, R of .foo2>): R of .foo2 declared in ' type=..PLocal.> origin=null - : PT of . - : PT of . - : ..PLocal.> - t1: CALL 'public final fun (): T of .Rec declared in .Rec' type=PT of . origin=GET_PROPERTY - $this: GET_VAR ': .Rec.> declared in .' type=.Rec.> origin=null - t2: CALL 'public final fun (): T of .Rec declared in .Rec' type=PT of . origin=GET_PROPERTY - $this: GET_VAR ': .Rec.> declared in .' type=.Rec.> origin=null - bb: FUNCTION_REFERENCE 'public constructor (lt: LT of ..PLocal, pt: PT of .) declared in ..PLocal' type=kotlin.reflect.KFunction2., PT of ., ..PLocal.>> origin=null reflectionTarget= - : PT of . FUN name:fn visibility:public modality:FINAL ($receiver:.Rec.fn>) returnType:.L.fn> TYPE_PARAMETER name:FT index:0 variance: superTypes:[kotlin.Any?] reified:false $receiver: VALUE_PARAMETER name: type:.Rec.fn> @@ -130,14 +70,6 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt CLASS CLASS name:FLocal modality:FINAL visibility:local superTypes:[.L.fn.FLocal>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.fn.FLocal.fn.FLocal, FT of .fn> TYPE_PARAMETER name:LT index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (lt:LT of .fn.FLocal, pt:FT of .fn) returnType:.fn.FLocal.fn.FLocal, FT of .fn> [primary] - VALUE_PARAMETER name:lt index:0 type:LT of .fn.FLocal - VALUE_PARAMETER name:pt index:1 type:FT of .fn - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (ll: LL of .L) declared in .L' - : LT of .fn.FLocal - ll: GET_VAR 'lt: LT of .fn.FLocal declared in .fn.FLocal.' type=LT of .fn.FLocal origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FLocal modality:FINAL visibility:local superTypes:[.L.fn.FLocal>]' PROPERTY name:pt visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:pt type:FT of .fn visibility:private [final] EXPRESSION_BODY @@ -149,14 +81,14 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt RETURN type=kotlin.Nothing from='public final fun (): FT of .fn declared in .fn.FLocal' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:pt type:FT of .fn visibility:private [final]' type=FT of .fn origin=null receiver: GET_VAR ': .fn.FLocal.fn.FLocal, FT of .fn> declared in .fn.FLocal.' type=.fn.FLocal.fn.FLocal, FT of .fn> origin=null - PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] - overridden: - public final ll: LL of .L - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.L.fn.FLocal>) returnType:LT of .fn.FLocal [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): LL of .L declared in .L - $this: VALUE_PARAMETER name: type:.L.fn.FLocal> + CONSTRUCTOR visibility:public <> (lt:LT of .fn.FLocal, pt:FT of .fn) returnType:.fn.FLocal.fn.FLocal, FT of .fn> [primary] + VALUE_PARAMETER name:lt index:0 type:LT of .fn.FLocal + VALUE_PARAMETER name:pt index:1 type:FT of .fn + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (ll: LL of .L) declared in .L' + : LT of .fn.FLocal + ll: GET_VAR 'lt: LT of .fn.FLocal declared in .fn.FLocal.' type=LT of .fn.FLocal origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FLocal modality:FINAL visibility:local superTypes:[.L.fn.FLocal>]' 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 .L @@ -170,6 +102,14 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in .L $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] + overridden: + public final ll: LL of .L + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.L.fn.FLocal>) returnType:LT of .fn.FLocal [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): LL of .L declared in .L + $this: VALUE_PARAMETER name: type:.L.fn.FLocal> RETURN type=kotlin.Nothing from='public final fun fn (): .L.fn> declared in ' CALL 'public final fun foo2 (t1: T1 of .foo2, t2: T2 of .foo2, bb: kotlin.Function2.foo2, T2 of .foo2, R of .foo2>): R of .foo2 declared in ' type=.fn.FLocal.fn, FT of .fn> origin=null : FT of .fn @@ -194,3 +134,63 @@ FILE fqName: fileName:/genericLocalClassConstructorReference.kt $this: GET_VAR 'bb: kotlin.Function2.foo2, T2 of .foo2, R of .foo2> declared in .foo2' type=kotlin.Function2.foo2, T2 of .foo2, R of .foo2> origin=VARIABLE_AS_FUNCTION p1: GET_VAR 't1: T1 of .foo2 declared in .foo2' type=T1 of .foo2 origin=null p2: GET_VAR 't2: T2 of .foo2 declared in .foo2' type=T2 of .foo2 origin=null + PROPERTY name:p visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL ($receiver:.Rec.>) returnType:.L.> + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] + TYPE_PARAMETER name:PT index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Rec.> + BLOCK_BODY + CLASS CLASS name:PLocal modality:FINAL visibility:local superTypes:[.L..PLocal>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:..PLocal..PLocal> + TYPE_PARAMETER name:LT index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:pt visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:pt type:PT of . visibility:private [final] + EXPRESSION_BODY + GET_VAR 'pt: PT of . declared in ..PLocal.' type=PT of . origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:..PLocal..PLocal>) returnType:PT of . + correspondingProperty: PROPERTY name:pt visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:..PLocal..PLocal> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): PT of . declared in ..PLocal' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:pt type:PT of . visibility:private [final]' type=PT of . origin=null + receiver: GET_VAR ': ..PLocal..PLocal> declared in ..PLocal.' type=..PLocal..PLocal> origin=null + CONSTRUCTOR visibility:public <> (lt:LT of ..PLocal, pt:PT of .) returnType:..PLocal..PLocal> [primary] + VALUE_PARAMETER name:lt index:0 type:LT of ..PLocal + VALUE_PARAMETER name:pt index:1 type:PT of . + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (ll: LL of .L) declared in .L' + : LT of ..PLocal + ll: GET_VAR 'lt: LT of ..PLocal declared in ..PLocal.' type=LT of ..PLocal origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PLocal modality:FINAL visibility:local superTypes:[.L..PLocal>]' + 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 .L + $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 .L + $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 .L + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] + overridden: + public final ll: LL of .L + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.L..PLocal>) returnType:LT of ..PLocal [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ll visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): LL of .L declared in .L + $this: VALUE_PARAMETER name: type:.L..PLocal> + RETURN type=kotlin.Nothing from='public final fun (): .L.> declared in ' + CALL 'public final fun foo2 (t1: T1 of .foo2, t2: T2 of .foo2, bb: kotlin.Function2.foo2, T2 of .foo2, R of .foo2>): R of .foo2 declared in ' type=..PLocal.> origin=null + : PT of . + : PT of . + : ..PLocal.> + t1: CALL 'public final fun (): T of .Rec declared in .Rec' type=PT of . origin=GET_PROPERTY + $this: GET_VAR ': .Rec.> declared in .' type=.Rec.> origin=null + t2: CALL 'public final fun (): T of .Rec declared in .Rec' type=PT of . origin=GET_PROPERTY + $this: GET_VAR ': .Rec.> declared in .' type=.Rec.> origin=null + bb: FUNCTION_REFERENCE 'public constructor (lt: LT of ..PLocal, pt: PT of .) declared in ..PLocal' type=kotlin.reflect.KFunction2., PT of ., ..PLocal.>> origin=null reflectionTarget= + : PT of . diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt.txt index 1411fda426f..ee5a6f2d77d 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt.txt @@ -1,59 +1,41 @@ open class L { + val ll: LL + field = ll + get + constructor(ll: LL) /* primary */ { super/*Any*/() /* () */ } - val ll: LL - field = ll - get - } class Rec { + val rt: T + field = rt + get + constructor(rt: T) /* primary */ { super/*Any*/() /* () */ } - val rt: T - field = rt - get - } -val Rec.p: L - get(): L { - local class PLocal : L { - constructor(lt: LT, pt: PT) /* primary */ { - super/*L*/(ll = lt) - /* () */ - - } - - val pt: PT - field = pt - get - - } - - return foo2>(t1 = .(), t2 = .(), bb = PLocal::/*()*/) - } - fun Rec.fn(): L { local class FLocal : L { + val pt: FT + field = pt + get + constructor(lt: LT, pt: FT) /* primary */ { super/*L*/(ll = lt) /* () */ } - val pt: FT - field = pt - get - } return foo2>(t1 = .(), t2 = .(), bb = FLocal::/*()*/) @@ -62,3 +44,22 @@ fun Rec.fn(): L { fun foo2(t1: T1, t2: T2, bb: Function2): R { return bb.invoke(p1 = t1, p2 = t2) } + +val Rec.p: L + get(): L { + local class PLocal : L { + val pt: PT + field = pt + get + + constructor(lt: LT, pt: PT) /* primary */ { + super/*L*/(ll = lt) + /* () */ + + } + + } + + return foo2>(t1 = .(), t2 = .(), bb = PLocal::/*()*/) + } + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.ir.txt index c88c38b47d8..97ef08a599a 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.ir.txt @@ -1,38 +1,4 @@ FILE fqName: fileName:/genericMember.kt - CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.A.A> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.A.A>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A.A> - BLOCK_BODY - PROPERTY name:bar visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=42 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A.A>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A.A> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A.A> declared in .A.' type=.A.A> 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: 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 PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.reflect.KFunction1<.A, kotlin.Unit> visibility:private [final,static] EXPRESSION_BODY @@ -51,3 +17,37 @@ FILE fqName: fileName:/genericMember.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KProperty1<.A, kotlin.Int> declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.reflect.KProperty1<.A, kotlin.Int> visibility:private [final,static]' type=kotlin.reflect.KProperty1<.A, kotlin.Int> origin=null + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:bar visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A.A>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A.A> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A.A> declared in .A.' type=.A.A> origin=null + CONSTRUCTOR visibility:public <> () returnType:.A.A> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 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:foo visibility:public modality:FINAL <> ($this:.A.A>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A.A> + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt.txt index 4f577c4842c..ace48214bd4 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt.txt @@ -1,4 +1,16 @@ +val test1: KFunction1, Unit> + field = A::foo + get + +val test2: KProperty1, Int> + field = A::bar + get + class A { + val bar: Int + field = 42 + get + constructor() /* primary */ { super/*Any*/() /* () */ @@ -8,16 +20,5 @@ class A { fun foo() { } - val bar: Int - field = 42 - get - } -val test1: KFunction1, Unit> - field = A::foo - get - -val test2: KProperty1, Int> - field = A::bar - get diff --git a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.ir.txt index 324007f0eab..4d1483e2039 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.ir.txt @@ -1,39 +1,4 @@ FILE fqName:test fileName:/importedFromObject.kt - CLASS OBJECT name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Foo - CONSTRUCTOR visibility:private <> () returnType:test.Foo [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:a visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final] - EXPRESSION_BODY - CONST String type=kotlin.String value="" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Foo) returnType:kotlin.String - correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:test.Foo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in test.Foo' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': test.Foo declared in test.Foo.' type=test.Foo origin=null - FUN name:foo visibility:public modality:FINAL <> ($this:test.Foo) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:test.Foo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in test.Foo' - CONST String type=kotlin.String value="" - 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: 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 PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.reflect.KProperty0 visibility:private [final,static] EXPRESSION_BODY @@ -74,3 +39,38 @@ FILE fqName:test fileName:/importedFromObject.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KFunction0 declared in test' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2a type:kotlin.reflect.KFunction0 visibility:private [final,static]' type=kotlin.reflect.KFunction0 origin=null + CLASS OBJECT name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Foo + PROPERTY name:a visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Foo) returnType:kotlin.String + correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:test.Foo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in test.Foo' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': test.Foo declared in test.Foo.' type=test.Foo origin=null + CONSTRUCTOR visibility:private <> () returnType:test.Foo [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Foo modality:FINAL visibility:public 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 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:foo visibility:public modality:FINAL <> ($this:test.Foo) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:test.Foo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in test.Foo' + CONST String type=kotlin.String value="" diff --git a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt.txt index 4a7e20584ff..c51ca8c1bea 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt.txt @@ -1,22 +1,5 @@ package test -object Foo { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - val a: String - field = "" - get - - fun foo(): String { - return "" - } - -} - val test1: KProperty0 field = Foo::a get @@ -32,3 +15,21 @@ val test2: KFunction0 val test2a: KFunction0 field = Foo::foo get + +object Foo { + val a: String + field = "" + get + + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun foo(): String { + return "" + } + +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/kt37131.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/kt37131.ir.txt index 286ac82b1a3..b23e1ede1d1 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/kt37131.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/kt37131.ir.txt @@ -1,20 +1,6 @@ FILE fqName: fileName:/kt37131.kt - FUN name:foo visibility:public modality:FINAL <> (x:kotlin.String) returnType:kotlin.String - VALUE_PARAMETER name:x index:0 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (x: kotlin.String): kotlin.String declared in ' - GET_VAR 'x: kotlin.String declared in .foo' type=kotlin.String origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.C [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -26,6 +12,13 @@ FILE fqName: fileName:/kt37131.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -39,22 +32,13 @@ FILE fqName: fileName:/kt37131.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:use visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 + FUN name:foo visibility:public modality:FINAL <> (x:kotlin.String) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun use (fn: kotlin.Function0): kotlin.Any declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .use' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION - FUN name:testFn visibility:public modality:FINAL <> () returnType:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testFn (): kotlin.Any declared in ' - CALL 'public final fun use (fn: kotlin.Function0): kotlin.Any declared in ' type=kotlin.Any origin=null - fn: BLOCK type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo visibility:local modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun foo (): kotlin.String declared in .testFn' - CALL 'public final fun foo (x: kotlin.String): kotlin.String declared in ' type=kotlin.String origin=null - FUNCTION_REFERENCE 'local final fun foo (): kotlin.String declared in .testFn' type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo (x: kotlin.String): kotlin.String declared in + RETURN type=kotlin.Nothing from='public final fun foo (x: kotlin.String): kotlin.String declared in ' + GET_VAR 'x: kotlin.String declared in .foo' type=kotlin.String origin=null FUN name:testCtor visibility:public modality:FINAL <> () returnType:kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testCtor (): kotlin.Any declared in ' @@ -65,3 +49,19 @@ FILE fqName: fileName:/kt37131.kt RETURN type=kotlin.Nothing from='local final fun (): .C declared in .testCtor' CONSTRUCTOR_CALL 'public constructor (x: kotlin.String) declared in .C' type=.C origin=null FUNCTION_REFERENCE 'local final fun (): .C declared in .testCtor' type=kotlin.Function0<.C> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public constructor (x: kotlin.String) declared in .C + FUN name:testFn visibility:public modality:FINAL <> () returnType:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testFn (): kotlin.Any declared in ' + CALL 'public final fun use (fn: kotlin.Function0): kotlin.Any declared in ' type=kotlin.Any origin=null + fn: BLOCK type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo visibility:local modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun foo (): kotlin.String declared in .testFn' + CALL 'public final fun foo (x: kotlin.String): kotlin.String declared in ' type=kotlin.String origin=null + FUNCTION_REFERENCE 'local final fun foo (): kotlin.String declared in .testFn' type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo (x: kotlin.String): kotlin.String declared in + FUN name:use visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun use (fn: kotlin.Function0): kotlin.Any declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0 declared in .use' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/expressions/callableReferences/kt37131.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/kt37131.kt.txt index b61324f0920..296a6f2b910 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/kt37131.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/kt37131.kt.txt @@ -1,22 +1,28 @@ -fun foo(x: String = ""): String { - return x -} - class C { + val x: String + field = x + get + constructor(x: String = "") /* primary */ { super/*Any*/() /* () */ } - val x: String - field = x - get - } -fun use(fn: Function0): Any { - return fn.invoke() +fun foo(x: String = ""): String { + return x +} + +fun testCtor(): Any { + return use(fn = { // BLOCK + local fun (): C { + return C() + } + + :: + }) } fun testFn(): Any { @@ -29,12 +35,7 @@ fun testFn(): Any { }) } -fun testCtor(): Any { - return use(fn = { // BLOCK - local fun (): C { - return C() - } - - :: - }) +fun use(fn: Function0): Any { + return fn.invoke() } + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/kt46069.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/kt46069.ir.txt index 7f795b6c589..946bf1d6259 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/kt46069.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/kt46069.ir.txt @@ -6,13 +6,6 @@ FILE fqName: fileName:/kt46069.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ObjectAssert modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:describedAs visibility:public modality:FINAL <> ($this:.ObjectAssert.ObjectAssert>, description:kotlin.String?, args:kotlin.Array) returnType:.ObjectAssert.ObjectAssert>? - $this: VALUE_PARAMETER name: type:.ObjectAssert.ObjectAssert> - VALUE_PARAMETER name:description index:0 type:kotlin.String? - VALUE_PARAMETER name:args index:1 type:kotlin.Array varargElementType:kotlin.Any? [vararg] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun describedAs (description: kotlin.String?, vararg args: kotlin.Any?): .ObjectAssert.ObjectAssert>? declared in .ObjectAssert' - CONST Null type=kotlin.Nothing? value=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 @@ -26,12 +19,32 @@ FILE fqName: fileName:/kt46069.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:describedAs visibility:public modality:FINAL <> ($this:.ObjectAssert.ObjectAssert>, description:kotlin.String?, args:kotlin.Array) returnType:.ObjectAssert.ObjectAssert>? + $this: VALUE_PARAMETER name: type:.ObjectAssert.ObjectAssert> + VALUE_PARAMETER name:description index:0 type:kotlin.String? + VALUE_PARAMETER name:args index:1 type:kotlin.Array varargElementType:kotlin.Any? [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun describedAs (description: kotlin.String?, vararg args: kotlin.Any?): .ObjectAssert.ObjectAssert>? declared in .ObjectAssert' + CONST Null type=kotlin.Nothing? value=null CLASS OBJECT name:Assertions modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Assertions CONSTRUCTOR visibility:private <> () returnType:.Assertions [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Assertions modality:FINAL visibility:public 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 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:assertThat visibility:public modality:FINAL ($this:.Assertions, actual:S of .Assertions.assertThat) returnType:.ObjectAssert.Assertions.assertThat> TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:.Assertions @@ -40,19 +53,6 @@ FILE fqName: fileName:/kt46069.kt RETURN type=kotlin.Nothing from='public final fun assertThat (actual: S of .Assertions.assertThat): .ObjectAssert.Assertions.assertThat> declared in .Assertions' CONSTRUCTOR_CALL 'public constructor () declared in .ObjectAssert' type=.ObjectAssert.Assertions.assertThat> origin=null : S of .Assertions.assertThat - 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: 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:assertNotNull visibility:public modality:FINAL ($receiver:T of .assertNotNull?, description:kotlin.String?) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false $receiver: VALUE_PARAMETER name: type:T of .assertNotNull? diff --git a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.ir.txt index bad21efe3d6..4cac0ddec19 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.ir.txt @@ -1,44 +1,10 @@ FILE fqName: fileName:/suspendConversion.kt - FUN name:useSuspend visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction0) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction0 - BLOCK_BODY - FUN name:useSuspendNullable visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction0?) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction0? - BLOCK_BODY - FUN name:useSuspendNestedNullable visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction0?) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction0? - BLOCK_BODY - FUN name:useSuspendInt visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction1 - BLOCK_BODY - FUN name:foo0 visibility:public modality:FINAL <> () returnType:kotlin.Unit [suspend] - BLOCK_BODY - FUN name:foo1 visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - FUN name:fooInt visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - FUN name:foo2 visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Unit - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] - BLOCK_BODY - FUN name:foo3 visibility:public modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo3 (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 - FUN name:foo4 visibility:public modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER name:i index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=42 - BLOCK_BODY CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:bar visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY 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 @@ -52,6 +18,28 @@ FILE fqName: fileName:/suspendConversion.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + FUN name:foo0 visibility:public modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + FUN name:foo1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:foo2 visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Unit + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY + FUN name:foo3 visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo3 (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + FUN name:foo4 visibility:public modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:i index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + BLOCK_BODY + FUN name:fooInt visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY FUN name:testLambda visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useSuspend (fn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -59,10 +47,26 @@ FILE fqName: fileName:/suspendConversion.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] BLOCK_BODY CALL 'public final fun foo1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + FUN name:testNestedNullableParam visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun useSuspendNestedNullable (fn: kotlin.coroutines.SuspendFunction0?): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo1 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + CALL 'public final fun foo1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + FUNCTION_REFERENCE 'local final fun foo1 (): kotlin.Unit declared in .testNestedNullableParam' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo1 (): kotlin.Unit declared in FUN name:testNoCoversion visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useSuspend (fn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null fn: FUNCTION_REFERENCE 'public final fun foo0 (): kotlin.Unit declared in ' type=kotlin.reflect.KSuspendFunction0 origin=null reflectionTarget= + FUN name:testNullableParam visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun useSuspendNullable (fn: kotlin.coroutines.SuspendFunction0?): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo1 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + CALL 'public final fun foo1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + FUNCTION_REFERENCE 'local final fun foo1 (): kotlin.Unit declared in .testNullableParam' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo1 (): kotlin.Unit declared in FUN name:testSuspendPlain visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useSuspend (fn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -81,6 +85,34 @@ FILE fqName: fileName:/suspendConversion.kt CALL 'public final fun fooInt (x: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null x: GET_VAR 'p0: kotlin.Int declared in .testSuspendWithArgs.fooInt' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun fooInt (p0: kotlin.Int): kotlin.Unit declared in .testSuspendWithArgs' type=kotlin.coroutines.SuspendFunction1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun fooInt (x: kotlin.Int): kotlin.Unit declared in + FUN name:testWithBoundReceiver visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun useSuspend (fn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:bar visibility:local modality:FINAL <> ($receiver:.C) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:receiver type:.C + BLOCK_BODY + CALL 'public final fun bar (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'receiver: .C declared in .testWithBoundReceiver.bar' type=.C origin=ADAPTED_FUNCTION_REFERENCE + FUNCTION_REFERENCE 'local final fun bar (): kotlin.Unit declared in .testWithBoundReceiver' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun bar (): kotlin.Unit declared in .C + $receiver: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + FUN name:testWithCoercionToUnit visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun useSuspend (fn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo3 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun foo3 (): kotlin.Int declared in ' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun foo3 (): kotlin.Unit declared in .testWithCoercionToUnit' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo3 (): kotlin.Int declared in + FUN name:testWithDefaults visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun useSuspend (fn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo4 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + CALL 'public final fun foo4 (i: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + FUNCTION_REFERENCE 'local final fun foo4 (): kotlin.Unit declared in .testWithDefaults' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo4 (i: kotlin.Int): kotlin.Unit declared in FUN name:testWithVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useSuspend (fn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -100,47 +132,15 @@ FILE fqName: fileName:/suspendConversion.kt xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int GET_VAR 'p0: kotlin.Int declared in .testWithVarargMapped.foo2' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun foo2 (p0: kotlin.Int): kotlin.Unit declared in .testWithVarargMapped' type=kotlin.coroutines.SuspendFunction1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo2 (vararg xs: kotlin.Int): kotlin.Unit declared in - FUN name:testWithCoercionToUnit visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:useSuspend visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction0) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction0 BLOCK_BODY - CALL 'public final fun useSuspend (fn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo3 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun foo3 (): kotlin.Int declared in ' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun foo3 (): kotlin.Unit declared in .testWithCoercionToUnit' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo3 (): kotlin.Int declared in - FUN name:testWithDefaults visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:useSuspendInt visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction1 BLOCK_BODY - CALL 'public final fun useSuspend (fn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo4 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] - BLOCK_BODY - CALL 'public final fun foo4 (i: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null - FUNCTION_REFERENCE 'local final fun foo4 (): kotlin.Unit declared in .testWithDefaults' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo4 (i: kotlin.Int): kotlin.Unit declared in - FUN name:testWithBoundReceiver visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:useSuspendNestedNullable visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction0?) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction0? BLOCK_BODY - CALL 'public final fun useSuspend (fn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:bar visibility:local modality:FINAL <> ($receiver:.C) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:receiver type:.C - BLOCK_BODY - CALL 'public final fun bar (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null - $this: GET_VAR 'receiver: .C declared in .testWithBoundReceiver.bar' type=.C origin=ADAPTED_FUNCTION_REFERENCE - FUNCTION_REFERENCE 'local final fun bar (): kotlin.Unit declared in .testWithBoundReceiver' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun bar (): kotlin.Unit declared in .C - $receiver: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - FUN name:testNullableParam visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:useSuspendNullable visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction0?) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction0? BLOCK_BODY - CALL 'public final fun useSuspendNullable (fn: kotlin.coroutines.SuspendFunction0?): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo1 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] - BLOCK_BODY - CALL 'public final fun foo1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null - FUNCTION_REFERENCE 'local final fun foo1 (): kotlin.Unit declared in .testNullableParam' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo1 (): kotlin.Unit declared in - FUN name:testNestedNullableParam visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun useSuspendNestedNullable (fn: kotlin.coroutines.SuspendFunction0?): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo1 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] - BLOCK_BODY - CALL 'public final fun foo1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null - FUNCTION_REFERENCE 'local final fun foo1 (): kotlin.Unit declared in .testNestedNullableParam' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo1 (): kotlin.Unit declared in diff --git a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt.txt index bb9d391b534..e7f9c003e22 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt.txt @@ -1,34 +1,3 @@ -fun useSuspend(fn: SuspendFunction0) { -} - -fun useSuspendNullable(fn: SuspendFunction0?) { -} - -fun useSuspendNestedNullable(fn: SuspendFunction0?) { -} - -fun useSuspendInt(fn: SuspendFunction1) { -} - -suspend fun foo0() { -} - -fun foo1() { -} - -fun fooInt(x: Int) { -} - -fun foo2(vararg xs: Int) { -} - -fun foo3(): Int { - return 42 -} - -fun foo4(i: Int = 42) { -} - class C { constructor() /* primary */ { super/*Any*/() @@ -41,6 +10,25 @@ class C { } +suspend fun foo0() { +} + +fun foo1() { +} + +fun foo2(vararg xs: Int) { +} + +fun foo3(): Int { + return 42 +} + +fun foo4(i: Int = 42) { +} + +fun fooInt(x: Int) { +} + fun testLambda() { useSuspend(fn = local suspend fun () { foo1() @@ -48,10 +36,30 @@ fun testLambda() { ) } +fun testNestedNullableParam() { + useSuspendNestedNullable(fn = { // BLOCK + local suspend fun foo1() { + foo1() + } + + ::foo1 + }) +} + fun testNoCoversion() { useSuspend(fn = ::foo0) } +fun testNullableParam() { + useSuspendNullable(fn = { // BLOCK + local suspend fun foo1() { + foo1() + } + + ::foo1 + }) +} + fun testSuspendPlain() { useSuspend(fn = { // BLOCK local suspend fun foo1() { @@ -72,23 +80,13 @@ fun testSuspendWithArgs() { }) } -fun testWithVararg() { +fun testWithBoundReceiver() { useSuspend(fn = { // BLOCK - local suspend fun foo2() { - foo2() + local suspend fun C.bar() { + receiver.bar() } - ::foo2 - }) -} - -fun testWithVarargMapped() { - useSuspendInt(fn = { // BLOCK - local suspend fun foo2(p0: Int) { - foo2(xs = [p0]) - } - - ::foo2 + C()::bar }) } @@ -112,32 +110,35 @@ fun testWithDefaults() { }) } -fun testWithBoundReceiver() { +fun testWithVararg() { useSuspend(fn = { // BLOCK - local suspend fun C.bar() { - receiver.bar() + local suspend fun foo2() { + foo2() } - C()::bar + ::foo2 }) } -fun testNullableParam() { - useSuspendNullable(fn = { // BLOCK - local suspend fun foo1() { - foo1() +fun testWithVarargMapped() { + useSuspendInt(fn = { // BLOCK + local suspend fun foo2(p0: Int) { + foo2(xs = [p0]) } - ::foo1 + ::foo2 }) } -fun testNestedNullableParam() { - useSuspendNestedNullable(fn = { // BLOCK - local suspend fun foo1() { - foo1() - } - - ::foo1 - }) +fun useSuspend(fn: SuspendFunction0) { } + +fun useSuspendInt(fn: SuspendFunction1) { +} + +fun useSuspendNestedNullable(fn: SuspendFunction0?) { +} + +fun useSuspendNullable(fn: SuspendFunction0?) { +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.fir.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.fir.ir.txt index 77cbe5f6818..132c44b677b 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.fir.ir.txt @@ -1,36 +1,4 @@ FILE fqName: fileName:/typeArguments.kt - CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:private <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:objectMember visibility:public modality:FINAL ($this:.Host, x:T of .Host.objectMember) returnType:kotlin.Unit [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true - $this: VALUE_PARAMETER name: type:.Host - VALUE_PARAMETER name:x index:0 type:T of .Host.objectMember - BLOCK_BODY - 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: 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:topLevel1 visibility:public modality:FINAL (x:T of .topLevel1) returnType:kotlin.Unit [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true - VALUE_PARAMETER name:x index:0 type:T of .topLevel1 - BLOCK_BODY - FUN name:topLevel2 visibility:public modality:FINAL (x:kotlin.collections.List.topLevel2>) returnType:kotlin.Unit [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true - VALUE_PARAMETER name:x index:0 type:kotlin.collections.List.topLevel2> - BLOCK_BODY PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1 visibility:private [final,static] EXPRESSION_BODY @@ -62,3 +30,35 @@ FILE fqName: fileName:/typeArguments.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Function1 visibility:private [final,static]' type=kotlin.Function1 origin=null + CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:private <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public 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 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:objectMember visibility:public modality:FINAL ($this:.Host, x:T of .Host.objectMember) returnType:kotlin.Unit [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:x index:0 type:T of .Host.objectMember + BLOCK_BODY + FUN name:topLevel1 visibility:public modality:FINAL (x:T of .topLevel1) returnType:kotlin.Unit [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true + VALUE_PARAMETER name:x index:0 type:T of .topLevel1 + BLOCK_BODY + FUN name:topLevel2 visibility:public modality:FINAL (x:kotlin.collections.List.topLevel2>) returnType:kotlin.Unit [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true + VALUE_PARAMETER name:x index:0 type:kotlin.collections.List.topLevel2> + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.fir.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.fir.kt.txt index b77a45000ec..62250740e87 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.fir.kt.txt @@ -1,3 +1,15 @@ +val test1: Function1 + field = ::topLevel1/*()*/ + get + +val test2: Function1, Unit> + field = ::topLevel2/*()*/ + get + +val test3: Function1 + field = Host::objectMember/*()*/ + get + object Host { private constructor() /* primary */ { super/*Any*/() @@ -16,14 +28,3 @@ inline fun topLevel1(x: T) { inline fun topLevel2(x: List) { } -val test1: Function1 - field = ::topLevel1/*()*/ - get - -val test2: Function1, Unit> - field = ::topLevel2/*()*/ - get - -val test3: Function1 - field = Host::objectMember/*()*/ - get diff --git a/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.ir.txt index 84a3e581088..a5cc4a61fb5 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.ir.txt @@ -1,36 +1,4 @@ FILE fqName: fileName:/typeArguments.kt - CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:private <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:objectMember visibility:public modality:FINAL ($this:.Host, x:T of .Host.objectMember) returnType:kotlin.Unit [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true - $this: VALUE_PARAMETER name: type:.Host - VALUE_PARAMETER name:x index:0 type:T of .Host.objectMember - BLOCK_BODY - 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: 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:topLevel1 visibility:public modality:FINAL (x:T of .topLevel1) returnType:kotlin.Unit [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true - VALUE_PARAMETER name:x index:0 type:T of .topLevel1 - BLOCK_BODY - FUN name:topLevel2 visibility:public modality:FINAL (x:kotlin.collections.List.topLevel2>) returnType:kotlin.Unit [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true - VALUE_PARAMETER name:x index:0 type:kotlin.collections.List.topLevel2> - BLOCK_BODY PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1 visibility:private [final,static] EXPRESSION_BODY @@ -62,3 +30,35 @@ FILE fqName: fileName:/typeArguments.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Function1 visibility:private [final,static]' type=kotlin.Function1 origin=null + CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:private <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public 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 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:objectMember visibility:public modality:FINAL ($this:.Host, x:T of .Host.objectMember) returnType:kotlin.Unit [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:x index:0 type:T of .Host.objectMember + BLOCK_BODY + FUN name:topLevel1 visibility:public modality:FINAL (x:T of .topLevel1) returnType:kotlin.Unit [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true + VALUE_PARAMETER name:x index:0 type:T of .topLevel1 + BLOCK_BODY + FUN name:topLevel2 visibility:public modality:FINAL (x:kotlin.collections.List.topLevel2>) returnType:kotlin.Unit [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true + VALUE_PARAMETER name:x index:0 type:kotlin.collections.List.topLevel2> + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt.txt index b77a45000ec..62250740e87 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt.txt @@ -1,3 +1,15 @@ +val test1: Function1 + field = ::topLevel1/*()*/ + get + +val test2: Function1, Unit> + field = ::topLevel2/*()*/ + get + +val test3: Function1 + field = Host::objectMember/*()*/ + get + object Host { private constructor() /* primary */ { super/*Any*/() @@ -16,14 +28,3 @@ inline fun topLevel1(x: T) { inline fun topLevel2(x: List) { } -val test1: Function1 - field = ::topLevel1/*()*/ - get - -val test2: Function1, Unit> - field = ::topLevel2/*()*/ - get - -val test3: Function1 - field = Host::objectMember/*()*/ - get diff --git a/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.ir.txt index c0a985504a0..4a0fdd894a2 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.ir.txt @@ -1,22 +1,10 @@ FILE fqName: fileName:/unboundMemberReferenceWithAdaptedArguments.kt - FUN name:use1 visibility:public modality:FINAL <> (fn:kotlin.Function2<.A, kotlin.Int, kotlin.Unit>) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function2<.A, kotlin.Int, kotlin.Unit> - BLOCK_BODY - FUN name:use2 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A CONSTRUCTOR visibility:public <> () returnType:.A [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:OPEN <> ($this:.A, xs:kotlin.IntArray) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A' - CONST Int type=kotlin.Int value=1 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 @@ -30,20 +18,18 @@ FILE fqName: fileName:/unboundMemberReferenceWithAdaptedArguments.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.A, xs:kotlin.IntArray) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A' + CONST Int type=kotlin.Int value=1 CLASS OBJECT name:Obj modality:FINAL visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Obj CONSTRUCTOR visibility:private <> () returnType:.Obj [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Obj modality:FINAL visibility:public superTypes:[.A]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Obj, xs:kotlin.IntArray) returnType:kotlin.Int - overridden: - public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A - $this: VALUE_PARAMETER name: type:.Obj - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .Obj' - CONST Int type=kotlin.Int value=1 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 .A @@ -57,20 +43,14 @@ FILE fqName: fileName:/unboundMemberReferenceWithAdaptedArguments.kt overridden: public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testUnbound visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun use1 (fn: kotlin.Function2<.A, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: BLOCK type=kotlin.Function2<.A, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo visibility:local modality:FINAL <> (p0:.A, p1:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:.A - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p1 index:1 type:kotlin.Int - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A' type=kotlin.Int origin=null - $this: GET_VAR 'p0: .A declared in .testUnbound.foo' type=.A origin=null - xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - GET_VAR 'p1: kotlin.Int declared in .testUnbound.foo' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun foo (p0: .A, p1: kotlin.Int): kotlin.Unit declared in .testUnbound' type=kotlin.Function2<.A, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A + FUN name:foo visibility:public modality:OPEN <> ($this:.Obj, xs:kotlin.IntArray) returnType:kotlin.Int + overridden: + public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A + $this: VALUE_PARAMETER name: type:.Obj + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .Obj' + CONST Int type=kotlin.Int value=1 FUN name:testBound visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY @@ -102,3 +82,23 @@ FILE fqName: fileName:/unboundMemberReferenceWithAdaptedArguments.kt GET_VAR 'p0: kotlin.Int declared in .testObject.foo' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun foo (p0: kotlin.Int): kotlin.Unit declared in .testObject' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .Obj $receiver: GET_OBJECT 'CLASS OBJECT name:Obj modality:FINAL visibility:public superTypes:[.A]' type=.Obj + FUN name:testUnbound visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun use1 (fn: kotlin.Function2<.A, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: BLOCK type=kotlin.Function2<.A, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo visibility:local modality:FINAL <> (p0:.A, p1:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:.A + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p1 index:1 type:kotlin.Int + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A' type=kotlin.Int origin=null + $this: GET_VAR 'p0: .A declared in .testUnbound.foo' type=.A origin=null + xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + GET_VAR 'p1: kotlin.Int declared in .testUnbound.foo' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun foo (p0: .A, p1: kotlin.Int): kotlin.Unit declared in .testUnbound' type=kotlin.Function2<.A, kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A + FUN name:use1 visibility:public modality:FINAL <> (fn:kotlin.Function2<.A, kotlin.Int, kotlin.Unit>) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function2<.A, kotlin.Int, kotlin.Unit> + BLOCK_BODY + FUN name:use2 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.kt.txt index 29287f7a315..f635ece9800 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.kt.txt @@ -1,9 +1,3 @@ -fun use1(fn: Function2) { -} - -fun use2(fn: Function1) { -} - open class A { constructor() /* primary */ { super/*Any*/() @@ -30,16 +24,6 @@ object Obj : A { } -fun testUnbound() { - use1(fn = { // BLOCK - local fun foo(p0: A, p1: Int) { - p0.foo(xs = [p1]) /*~> Unit */ - } - - ::foo - }) -} - fun testBound(a: A) { use2(fn = { // BLOCK local fun A.foo(p0: Int) { @@ -59,3 +43,20 @@ fun testObject() { Obj::foo }) } + +fun testUnbound() { + use1(fn = { // BLOCK + local fun foo(p0: A, p1: Int) { + p0.foo(xs = [p1]) /*~> Unit */ + } + + ::foo + }) +} + +fun use1(fn: Function2) { +} + +fun use2(fn: Function1) { +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/varargFunImportedFromObject.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/varargFunImportedFromObject.ir.txt index 0f2de808922..8bb147c6a7b 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/varargFunImportedFromObject.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/varargFunImportedFromObject.ir.txt @@ -1,23 +1,10 @@ FILE fqName: fileName:/varargFunImportedFromObject.kt - FUN name:withO visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.String - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withO (fn: kotlin.Function1): kotlin.String declared in ' - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function1 declared in .withO' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION - p1: CONST String type=kotlin.String value="O" CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host CONSTRUCTOR visibility:private <> () returnType:.Host [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Host, x:kotlin.Array) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Host - VALUE_PARAMETER name:x index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (vararg x: kotlin.String): kotlin.String declared in .Host' - CONST String type=kotlin.String value="K" 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 @@ -31,6 +18,12 @@ FILE fqName: fileName:/varargFunImportedFromObject.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.Host, x:kotlin.Array) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:x index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (vararg x: kotlin.String): kotlin.String declared in .Host' + CONST String type=kotlin.String value="K" FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.String declared in ' @@ -63,3 +56,10 @@ FILE fqName: fileName:/varargFunImportedFromObject.kt GET_VAR 'p0: kotlin.String declared in .test2.foo' type=kotlin.String origin=null FUNCTION_REFERENCE 'local final fun foo (p0: kotlin.String): kotlin.String declared in .test2' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo (vararg x: kotlin.String): kotlin.String declared in .Host $receiver: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Host + FUN name:withO visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.String + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun withO (fn: kotlin.Function1): kotlin.String declared in ' + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function1 declared in .withO' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + p1: CONST String type=kotlin.String value="O" diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.ir.txt index c5761ea0bb1..b626bbe4da9 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.ir.txt @@ -1,9 +1,6 @@ FILE fqName: fileName:/withAdaptationForSam.kt CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFoo - VALUE_PARAMETER name:i index:0 type:kotlin.Int 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 @@ -17,14 +14,9 @@ FILE fqName: fileName:/withAdaptationForSam.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:useFoo visibility:public modality:FINAL <> (foo:.IFoo) returnType:kotlin.Unit - VALUE_PARAMETER name:foo index:0 type:.IFoo - BLOCK_BODY - FUN name:withVararg visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFoo + VALUE_PARAMETER name:i index:0 type:kotlin.Int FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useFoo (foo: .IFoo): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -38,3 +30,11 @@ FILE fqName: fileName:/withAdaptationForSam.kt GET_VAR 'p0: kotlin.Int declared in .test.withVararg' type=kotlin.Int origin=null TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo FUNCTION_REFERENCE 'local final fun withVararg (p0: kotlin.Int): kotlin.Unit declared in .test' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in + FUN name:useFoo visibility:public modality:FINAL <> (foo:.IFoo) returnType:kotlin.Unit + VALUE_PARAMETER name:foo index:0 type:.IFoo + BLOCK_BODY + FUN name:withVararg visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt.txt index dd400079991..cf0faa22677 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt.txt @@ -3,13 +3,6 @@ fun interface IFoo { } -fun useFoo(foo: IFoo) { -} - -fun withVararg(vararg xs: Int): Int { - return 42 -} - fun test() { useFoo(foo = { // BLOCK local fun withVararg(p0: Int) { @@ -19,3 +12,11 @@ fun test() { ::withVararg /*-> IFoo */ }) } + +fun useFoo(foo: IFoo) { +} + +fun withVararg(vararg xs: Int): Int { + return 42 +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.ir.txt index a1a4e17c3bb..b1bcc0c9c30 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.ir.txt @@ -1,17 +1,29 @@ FILE fqName: fileName:/withAdaptedArguments.kt - FUN name:use visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.String - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun use (fn: kotlin.Function1): kotlin.String declared in ' - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function1 declared in .use' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION - p1: CONST Int type=kotlin.Int value=1 - FUN name:use0 visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.String - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun use0 (fn: kotlin.Function0): kotlin.String declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.String origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .use0' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:private <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public 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 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:importedObjectMemberWithVarargs visibility:public modality:FINAL <> ($this:.Host, xs:kotlin.IntArray) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun importedObjectMemberWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in .Host' + CONST String type=kotlin.String value="abc" FUN name:coerceToUnit visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY @@ -38,56 +50,6 @@ FILE fqName: fileName:/withAdaptedArguments.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in ' CONST String type=kotlin.String value="abc" - CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:private <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:importedObjectMemberWithVarargs visibility:public modality:FINAL <> ($this:.Host, xs:kotlin.IntArray) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Host - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun importedObjectMemberWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in .Host' - CONST String type=kotlin.String value="abc" - 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: 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:testDefault visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testDefault (): kotlin.String declared in ' - CALL 'public final fun use (fn: kotlin.Function1): kotlin.String declared in ' type=kotlin.String origin=null - fn: BLOCK type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:fnWithDefault visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.String - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun fnWithDefault (p0: kotlin.Int): kotlin.String declared in .testDefault' - CALL 'public final fun fnWithDefault (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null - a: GET_VAR 'p0: kotlin.Int declared in .testDefault.fnWithDefault' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun fnWithDefault (p0: kotlin.Int): kotlin.String declared in .testDefault' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun fnWithDefault (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in - FUN name:testVararg visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testVararg (): kotlin.String declared in ' - CALL 'public final fun use (fn: kotlin.Function1): kotlin.String declared in ' type=kotlin.String origin=null - fn: BLOCK type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:fnWithVarargs visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.String - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun fnWithVarargs (p0: kotlin.Int): kotlin.String declared in .testVararg' - CALL 'public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null - xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - GET_VAR 'p0: kotlin.Int declared in .testVararg.fnWithVarargs' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun fnWithVarargs (p0: kotlin.Int): kotlin.String declared in .testVararg' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in FUN name:testCoercionToUnit visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testCoercionToUnit (): kotlin.Unit declared in ' @@ -100,6 +62,28 @@ FILE fqName: fileName:/withAdaptedArguments.kt CALL 'public final fun fnWithDefault (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null a: GET_VAR 'p0: kotlin.Int declared in .testCoercionToUnit.fnWithDefault' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun fnWithDefault (p0: kotlin.Int): kotlin.Unit declared in .testCoercionToUnit' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun fnWithDefault (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in + FUN name:testDefault visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testDefault (): kotlin.String declared in ' + CALL 'public final fun use (fn: kotlin.Function1): kotlin.String declared in ' type=kotlin.String origin=null + fn: BLOCK type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:fnWithDefault visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.String + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun fnWithDefault (p0: kotlin.Int): kotlin.String declared in .testDefault' + CALL 'public final fun fnWithDefault (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null + a: GET_VAR 'p0: kotlin.Int declared in .testDefault.fnWithDefault' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun fnWithDefault (p0: kotlin.Int): kotlin.String declared in .testDefault' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun fnWithDefault (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in + FUN name:testDefault0 visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testDefault0 (): kotlin.String declared in ' + CALL 'public final fun use0 (fn: kotlin.Function0): kotlin.String declared in ' type=kotlin.String origin=null + fn: BLOCK type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:fnWithDefaults visibility:local modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun fnWithDefaults (): kotlin.String declared in .testDefault0' + CALL 'public final fun fnWithDefaults (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null + FUNCTION_REFERENCE 'local final fun fnWithDefaults (): kotlin.String declared in .testDefault0' type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun fnWithDefaults (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in FUN name:testImportedObjectMember visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testImportedObjectMember (): kotlin.String declared in ' @@ -116,16 +100,19 @@ FILE fqName: fileName:/withAdaptedArguments.kt GET_VAR 'p0: kotlin.Int declared in .testImportedObjectMember.importedObjectMemberWithVarargs' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun importedObjectMemberWithVarargs (p0: kotlin.Int): kotlin.String declared in .testImportedObjectMember' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun importedObjectMemberWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in .Host $receiver: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Host - FUN name:testDefault0 visibility:public modality:FINAL <> () returnType:kotlin.String + FUN name:testVararg visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testDefault0 (): kotlin.String declared in ' - CALL 'public final fun use0 (fn: kotlin.Function0): kotlin.String declared in ' type=kotlin.String origin=null - fn: BLOCK type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:fnWithDefaults visibility:local modality:FINAL <> () returnType:kotlin.String + RETURN type=kotlin.Nothing from='public final fun testVararg (): kotlin.String declared in ' + CALL 'public final fun use (fn: kotlin.Function1): kotlin.String declared in ' type=kotlin.String origin=null + fn: BLOCK type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:fnWithVarargs visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.String + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun fnWithDefaults (): kotlin.String declared in .testDefault0' - CALL 'public final fun fnWithDefaults (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null - FUNCTION_REFERENCE 'local final fun fnWithDefaults (): kotlin.String declared in .testDefault0' type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun fnWithDefaults (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in + RETURN type=kotlin.Nothing from='local final fun fnWithVarargs (p0: kotlin.Int): kotlin.String declared in .testVararg' + CALL 'public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null + xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + GET_VAR 'p0: kotlin.Int declared in .testVararg.fnWithVarargs' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun fnWithVarargs (p0: kotlin.Int): kotlin.String declared in .testVararg' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in FUN name:testVararg0 visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testVararg0 (): kotlin.String declared in ' @@ -136,3 +123,16 @@ FILE fqName: fileName:/withAdaptedArguments.kt RETURN type=kotlin.Nothing from='local final fun fnWithVarargs (): kotlin.String declared in .testVararg0' CALL 'public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null FUNCTION_REFERENCE 'local final fun fnWithVarargs (): kotlin.String declared in .testVararg0' type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in + FUN name:use visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.String + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun use (fn: kotlin.Function1): kotlin.String declared in ' + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function1 declared in .use' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + p1: CONST Int type=kotlin.Int value=1 + FUN name:use0 visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.String + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun use0 (fn: kotlin.Function0): kotlin.String declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.String origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0 declared in .use0' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.kt.txt index 2996ec5bbc6..04dc265d399 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.kt.txt @@ -1,9 +1,14 @@ -fun use(fn: Function1): String { - return fn.invoke(p1 = 1) -} +object Host { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun importedObjectMemberWithVarargs(vararg xs: Int): String { + return "abc" + } -fun use0(fn: Function0): String { - return fn.invoke() } fun coerceToUnit(fn: Function1) { @@ -21,39 +26,6 @@ fun fnWithVarargs(vararg xs: Int): String { return "abc" } -object Host { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun importedObjectMemberWithVarargs(vararg xs: Int): String { - return "abc" - } - -} - -fun testDefault(): String { - return use(fn = { // BLOCK - local fun fnWithDefault(p0: Int): String { - return fnWithDefault(a = p0) - } - - ::fnWithDefault - }) -} - -fun testVararg(): String { - return use(fn = { // BLOCK - local fun fnWithVarargs(p0: Int): String { - return fnWithVarargs(xs = [p0]) - } - - ::fnWithVarargs - }) -} - fun testCoercionToUnit() { return coerceToUnit(fn = { // BLOCK local fun fnWithDefault(p0: Int) { @@ -64,13 +36,13 @@ fun testCoercionToUnit() { }) } -fun testImportedObjectMember(): String { +fun testDefault(): String { return use(fn = { // BLOCK - local fun Host.importedObjectMemberWithVarargs(p0: Int): String { - return receiver.importedObjectMemberWithVarargs(xs = [p0]) + local fun fnWithDefault(p0: Int): String { + return fnWithDefault(a = p0) } - Host::importedObjectMemberWithVarargs + ::fnWithDefault }) } @@ -84,6 +56,26 @@ fun testDefault0(): String { }) } +fun testImportedObjectMember(): String { + return use(fn = { // BLOCK + local fun Host.importedObjectMemberWithVarargs(p0: Int): String { + return receiver.importedObjectMemberWithVarargs(xs = [p0]) + } + + Host::importedObjectMemberWithVarargs + }) +} + +fun testVararg(): String { + return use(fn = { // BLOCK + local fun fnWithVarargs(p0: Int): String { + return fnWithVarargs(xs = [p0]) + } + + ::fnWithVarargs + }) +} + fun testVararg0(): String { return use0(fn = { // BLOCK local fun fnWithVarargs(): String { @@ -93,3 +85,12 @@ fun testVararg0(): String { ::fnWithVarargs }) } + +fun use(fn: Function1): String { + return fn.invoke(p1 = 1) +} + +fun use0(fn: Function0): String { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.ir.txt index 711101420f9..7cc312a5836 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.ir.txt @@ -1,23 +1,24 @@ FILE fqName: fileName:/withArgumentAdaptationAndReceiver.kt - FUN name:use visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function1 declared in .use' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION - p1: CONST Int type=kotlin.Int value=1 CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host CONSTRUCTOR visibility:public <> () returnType:.Host [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:withVararg visibility:public modality:FINAL <> ($this:.Host, xs:kotlin.IntArray) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Host - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' - CONST String type=kotlin.String value="" - FUN name:testImplicitThis visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit + 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: 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:testBoundReceiverExpression visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host BLOCK_BODY CALL 'public final fun use (fn: kotlin.Function1): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -28,11 +29,11 @@ FILE fqName: fileName:/withArgumentAdaptationAndReceiver.kt BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.String origin=null - $this: GET_VAR 'receiver: .Host declared in .Host.testImplicitThis.withVararg' type=.Host origin=ADAPTED_FUNCTION_REFERENCE + $this: GET_VAR 'receiver: .Host declared in .Host.testBoundReceiverExpression.withVararg' type=.Host origin=ADAPTED_FUNCTION_REFERENCE xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - GET_VAR 'p0: kotlin.Int declared in .Host.testImplicitThis.withVararg' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun withVararg (p0: kotlin.Int): kotlin.Unit declared in .Host.testImplicitThis' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host - $receiver: GET_VAR ': .Host declared in .Host.testImplicitThis' type=.Host origin=null + GET_VAR 'p0: kotlin.Int declared in .Host.testBoundReceiverExpression.withVararg' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun withVararg (p0: kotlin.Int): kotlin.Unit declared in .Host.testBoundReceiverExpression' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host + $receiver: CONSTRUCTOR_CALL 'public constructor () declared in .Host' type=.Host origin=null FUN name:testBoundReceiverLocalVal visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host BLOCK_BODY @@ -86,7 +87,7 @@ FILE fqName: fileName:/withArgumentAdaptationAndReceiver.kt GET_VAR 'p0: kotlin.Int declared in .Host.testBoundReceiverParameter.withVararg' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun withVararg (p0: kotlin.Int): kotlin.Unit declared in .Host.testBoundReceiverParameter' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host $receiver: GET_VAR 'h: .Host declared in .Host.testBoundReceiverParameter' type=.Host origin=null - FUN name:testBoundReceiverExpression visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit + FUN name:testImplicitThis visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host BLOCK_BODY CALL 'public final fun use (fn: kotlin.Function1): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -97,21 +98,20 @@ FILE fqName: fileName:/withArgumentAdaptationAndReceiver.kt BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.String origin=null - $this: GET_VAR 'receiver: .Host declared in .Host.testBoundReceiverExpression.withVararg' type=.Host origin=ADAPTED_FUNCTION_REFERENCE + $this: GET_VAR 'receiver: .Host declared in .Host.testImplicitThis.withVararg' type=.Host origin=ADAPTED_FUNCTION_REFERENCE xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - GET_VAR 'p0: kotlin.Int declared in .Host.testBoundReceiverExpression.withVararg' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun withVararg (p0: kotlin.Int): kotlin.Unit declared in .Host.testBoundReceiverExpression' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host - $receiver: CONSTRUCTOR_CALL 'public constructor () declared in .Host' type=.Host 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: 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 + GET_VAR 'p0: kotlin.Int declared in .Host.testImplicitThis.withVararg' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun withVararg (p0: kotlin.Int): kotlin.Unit declared in .Host.testImplicitThis' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host + $receiver: GET_VAR ': .Host declared in .Host.testImplicitThis' type=.Host origin=null + FUN name:withVararg visibility:public modality:FINAL <> ($this:.Host, xs:kotlin.IntArray) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' + CONST String type=kotlin.String value="" + FUN name:use visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function1 declared in .use' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + p1: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt.txt index 788d0dc4bff..d896eee0f97 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt.txt @@ -1,7 +1,3 @@ -fun use(fn: Function1) { - fn.invoke(p1 = 1) -} - class Host { constructor() /* primary */ { super/*Any*/() @@ -9,17 +5,13 @@ class Host { } - fun withVararg(vararg xs: Int): String { - return "" - } - - fun testImplicitThis() { + fun testBoundReceiverExpression() { use(fn = { // BLOCK local fun Host.withVararg(p0: Int) { receiver.withVararg(xs = [p0]) /*~> Unit */ } - ::withVararg + Host()::withVararg }) } @@ -55,14 +47,23 @@ class Host { }) } - fun testBoundReceiverExpression() { + fun testImplicitThis() { use(fn = { // BLOCK local fun Host.withVararg(p0: Int) { receiver.withVararg(xs = [p0]) /*~> Unit */ } - Host()::withVararg + ::withVararg }) } + fun withVararg(vararg xs: Int): String { + return "" + } + } + +fun use(fn: Function1) { + fn.invoke(p1 = 1) +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.ir.txt index 055cb92126e..632536e66db 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.ir.txt @@ -1,4 +1,23 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt + FUN name:nsum visibility:public modality:FINAL <> (args:kotlin.Array) returnType:kotlin.Int + VALUE_PARAMETER name:args index:0 type:kotlin.Array varargElementType:kotlin.Number [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun nsum (vararg args: kotlin.Number): kotlin.Int declared in ' + CALL 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + args: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + SPREAD_ELEMENT + CONSTRUCTOR_CALL 'public constructor (size: kotlin.Int, init: kotlin.Function1) declared in kotlin.IntArray' type=kotlin.IntArray origin=null + size: CALL 'public final fun (): kotlin.Int declared in kotlin.Array' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'args: kotlin.Array declared in .nsum' type=kotlin.Array origin=null + init: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:it index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Int declared in .nsum' + CALL 'public abstract fun toInt (): kotlin.Int declared in kotlin.Number' type=kotlin.Int origin=null + $this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Number origin=GET_ARRAY_ELEMENT + $this: GET_VAR 'args: kotlin.Array declared in .nsum' type=kotlin.Array origin=null + index: GET_VAR 'it: kotlin.Int declared in .nsum.' type=kotlin.Int origin=null FUN name:sum visibility:public modality:FINAL <> (args:kotlin.IntArray) returnType:kotlin.Int VALUE_PARAMETER name:args index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY @@ -21,43 +40,22 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt other: GET_VAR 'val arg: kotlin.Int declared in .sum' type=kotlin.Int origin=null RETURN type=kotlin.Nothing from='public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' GET_VAR 'var result: kotlin.Int declared in .sum' type=kotlin.Int origin=null - FUN name:nsum visibility:public modality:FINAL <> (args:kotlin.Array) returnType:kotlin.Int - VALUE_PARAMETER name:args index:0 type:kotlin.Array varargElementType:kotlin.Number [vararg] + FUN name:testArrayAndDefaults visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun nsum (vararg args: kotlin.Number): kotlin.Int declared in ' - CALL 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null - args: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - SPREAD_ELEMENT - CONSTRUCTOR_CALL 'public constructor (size: kotlin.Int, init: kotlin.Function1) declared in kotlin.IntArray' type=kotlin.IntArray origin=null - size: CALL 'public final fun (): kotlin.Int declared in kotlin.Array' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'args: kotlin.Array declared in .nsum' type=kotlin.Array origin=null - init: FUN_EXPR type=kotlin.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Int - VALUE_PARAMETER name:it index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Int declared in .nsum' - CALL 'public abstract fun toInt (): kotlin.Int declared in kotlin.Number' type=kotlin.Int origin=null - $this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Number origin=GET_ARRAY_ELEMENT - $this: GET_VAR 'args: kotlin.Array declared in .nsum' type=kotlin.Array origin=null - index: GET_VAR 'it: kotlin.Int declared in .nsum.' type=kotlin.Int origin=null - FUN name:zap visibility:public modality:FINAL <> (b:kotlin.Array, k:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER name:b index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] - VALUE_PARAMETER name:k index:1 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=42 - BLOCK_BODY - FUN name:usePlainArgs visibility:public modality:FINAL <> (fn:kotlin.Function2) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function2 - BLOCK_BODY - FUN name:usePrimitiveArray visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - FUN name:useArray visibility:public modality:FINAL <> (fn:kotlin.Function1, kotlin.Int>) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1, kotlin.Int> - BLOCK_BODY - FUN name:useStringArray visibility:public modality:FINAL <> (fn:kotlin.Function1, kotlin.Unit>) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1, kotlin.Unit> + CALL 'public final fun useStringArray (fn: kotlin.Function1, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: BLOCK type=kotlin.Function1, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:zap visibility:local modality:FINAL <> (p0:kotlin.Array) returnType:kotlin.Unit + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Array + BLOCK_BODY + CALL 'public final fun zap (vararg b: kotlin.String, k: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + b: VARARG type=kotlin.Array varargElementType=kotlin.String + SPREAD_ELEMENT + GET_VAR 'p0: kotlin.Array declared in .testArrayAndDefaults.zap' type=kotlin.Array origin=null + FUNCTION_REFERENCE 'local final fun zap (p0: kotlin.Array): kotlin.Unit declared in .testArrayAndDefaults' type=kotlin.Function1, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun zap (vararg b: kotlin.String, k: kotlin.Int): kotlin.Unit declared in + FUN name:testArrayAsVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY + CALL 'public final fun useArray (fn: kotlin.Function1, kotlin.Int>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: FUNCTION_REFERENCE 'public final fun nsum (vararg args: kotlin.Number): kotlin.Int declared in ' type=kotlin.reflect.KFunction1, kotlin.Int> origin=null reflectionTarget= FUN name:testPlainArgs visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun usePlainArgs (fn: kotlin.Function2): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -76,19 +74,21 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt BLOCK_BODY CALL 'public final fun usePrimitiveArray (fn: kotlin.Function1): kotlin.Unit declared in ' type=kotlin.Unit origin=null fn: FUNCTION_REFERENCE 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - FUN name:testArrayAsVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:useArray visibility:public modality:FINAL <> (fn:kotlin.Function1, kotlin.Int>) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1, kotlin.Int> BLOCK_BODY - CALL 'public final fun useArray (fn: kotlin.Function1, kotlin.Int>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: FUNCTION_REFERENCE 'public final fun nsum (vararg args: kotlin.Number): kotlin.Int declared in ' type=kotlin.reflect.KFunction1, kotlin.Int> origin=null reflectionTarget= - FUN name:testArrayAndDefaults visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:usePlainArgs visibility:public modality:FINAL <> (fn:kotlin.Function2) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function2 + BLOCK_BODY + FUN name:usePrimitiveArray visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + FUN name:useStringArray visibility:public modality:FINAL <> (fn:kotlin.Function1, kotlin.Unit>) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1, kotlin.Unit> + BLOCK_BODY + FUN name:zap visibility:public modality:FINAL <> (b:kotlin.Array, k:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:b index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] + VALUE_PARAMETER name:k index:1 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 BLOCK_BODY - CALL 'public final fun useStringArray (fn: kotlin.Function1, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: BLOCK type=kotlin.Function1, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:zap visibility:local modality:FINAL <> (p0:kotlin.Array) returnType:kotlin.Unit - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Array - BLOCK_BODY - CALL 'public final fun zap (vararg b: kotlin.String, k: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null - b: VARARG type=kotlin.Array varargElementType=kotlin.String - SPREAD_ELEMENT - GET_VAR 'p0: kotlin.Array declared in .testArrayAndDefaults.zap' type=kotlin.Array origin=null - FUNCTION_REFERENCE 'local final fun zap (p0: kotlin.Array): kotlin.Unit declared in .testArrayAndDefaults' type=kotlin.Function1, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun zap (vararg b: kotlin.String, k: kotlin.Int): kotlin.Unit declared in diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.kt.txt index 8bbcd8deaac..0efc3c3c939 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.kt.txt @@ -1,3 +1,10 @@ +fun nsum(vararg args: Number): Int { + return sum(args = [*IntArray(size = args.(), init = local fun (it: Int): Int { + return args.get(index = it).toInt() + } +)]) +} + fun sum(vararg args: Int): Int { var result: Int = 0 { // BLOCK @@ -10,26 +17,18 @@ fun sum(vararg args: Int): Int { return result } -fun nsum(vararg args: Number): Int { - return sum(args = [*IntArray(size = args.(), init = local fun (it: Int): Int { - return args.get(index = it).toInt() - } -)]) +fun testArrayAndDefaults() { + useStringArray(fn = { // BLOCK + local fun zap(p0: Array) { + zap(b = [*p0]) + } + + ::zap + }) } -fun zap(vararg b: String, k: Int = 42) { -} - -fun usePlainArgs(fn: Function2) { -} - -fun usePrimitiveArray(fn: Function1) { -} - -fun useArray(fn: Function1, Int>) { -} - -fun useStringArray(fn: Function1, Unit>) { +fun testArrayAsVararg() { + useArray(fn = ::nsum) } fun testPlainArgs() { @@ -46,17 +45,18 @@ fun testPrimitiveArrayAsVararg() { usePrimitiveArray(fn = ::sum) } -fun testArrayAsVararg() { - useArray(fn = ::nsum) +fun useArray(fn: Function1, Int>) { } -fun testArrayAndDefaults() { - useStringArray(fn = { // BLOCK - local fun zap(p0: Array) { - zap(b = [*p0]) - } - - ::zap - }) +fun usePlainArgs(fn: Function2) { +} + +fun usePrimitiveArray(fn: Function1) { +} + +fun useStringArray(fn: Function1, Unit>) { +} + +fun zap(vararg b: String, k: Int = 42) { } diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.ir.txt index ec061cd0a92..c8cfe5bc4df 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.ir.txt @@ -1,4 +1,23 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt + FUN name:nsum visibility:public modality:FINAL <> (args:kotlin.Array) returnType:kotlin.Int + VALUE_PARAMETER name:args index:0 type:kotlin.Array varargElementType:kotlin.Number [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun nsum (vararg args: kotlin.Number): kotlin.Int declared in ' + CALL 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + args: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + SPREAD_ELEMENT + CONSTRUCTOR_CALL 'public constructor (size: kotlin.Int, init: kotlin.Function1) declared in kotlin.IntArray' type=kotlin.IntArray origin=null + size: CALL 'public final fun (): kotlin.Int declared in kotlin.Array' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'args: kotlin.Array declared in .nsum' type=kotlin.Array origin=null + init: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:it index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Int declared in .nsum' + CALL 'public abstract fun toInt (): kotlin.Int declared in kotlin.Number' type=kotlin.Int origin=null + $this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Number origin=GET_ARRAY_ELEMENT + $this: GET_VAR 'args: kotlin.Array declared in .nsum' type=kotlin.Array origin=null + index: GET_VAR 'it: kotlin.Int declared in .nsum.' type=kotlin.Int origin=null FUN name:sum visibility:public modality:FINAL <> (args:kotlin.IntArray) returnType:kotlin.Int VALUE_PARAMETER name:args index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY @@ -21,43 +40,22 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt other: GET_VAR 'val arg: kotlin.Int declared in .sum' type=kotlin.Int origin=null RETURN type=kotlin.Nothing from='public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' GET_VAR 'var result: kotlin.Int declared in .sum' type=kotlin.Int origin=null - FUN name:nsum visibility:public modality:FINAL <> (args:kotlin.Array) returnType:kotlin.Int - VALUE_PARAMETER name:args index:0 type:kotlin.Array varargElementType:kotlin.Number [vararg] + FUN name:testArrayAndDefaults visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun nsum (vararg args: kotlin.Number): kotlin.Int declared in ' - CALL 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null - args: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - SPREAD_ELEMENT - CONSTRUCTOR_CALL 'public constructor (size: kotlin.Int, init: kotlin.Function1) declared in kotlin.IntArray' type=kotlin.IntArray origin=null - size: CALL 'public final fun (): kotlin.Int declared in kotlin.Array' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'args: kotlin.Array declared in .nsum' type=kotlin.Array origin=null - init: FUN_EXPR type=kotlin.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Int - VALUE_PARAMETER name:it index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Int declared in .nsum' - CALL 'public abstract fun toInt (): kotlin.Int declared in kotlin.Number' type=kotlin.Int origin=null - $this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Number origin=GET_ARRAY_ELEMENT - $this: GET_VAR 'args: kotlin.Array declared in .nsum' type=kotlin.Array origin=null - index: GET_VAR 'it: kotlin.Int declared in .nsum.' type=kotlin.Int origin=null - FUN name:zap visibility:public modality:FINAL <> (b:kotlin.Array, k:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER name:b index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] - VALUE_PARAMETER name:k index:1 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=42 - BLOCK_BODY - FUN name:usePlainArgs visibility:public modality:FINAL <> (fn:kotlin.Function2) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function2 - BLOCK_BODY - FUN name:usePrimitiveArray visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - FUN name:useArray visibility:public modality:FINAL <> (fn:kotlin.Function1, kotlin.Int>) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1, kotlin.Int> - BLOCK_BODY - FUN name:useStringArray visibility:public modality:FINAL <> (fn:kotlin.Function1, kotlin.Unit>) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1, kotlin.Unit> + CALL 'public final fun useStringArray (fn: kotlin.Function1, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: BLOCK type=kotlin.Function1, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:zap visibility:local modality:FINAL <> (p0:kotlin.Array) returnType:kotlin.Unit + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Array + BLOCK_BODY + CALL 'public final fun zap (vararg b: kotlin.String, k: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + b: VARARG type=kotlin.Array varargElementType=kotlin.String + SPREAD_ELEMENT + GET_VAR 'p0: kotlin.Array declared in .testArrayAndDefaults.zap' type=kotlin.Array origin=null + FUNCTION_REFERENCE 'local final fun zap (p0: kotlin.Array): kotlin.Unit declared in .testArrayAndDefaults' type=kotlin.Function1, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun zap (vararg b: kotlin.String, k: kotlin.Int): kotlin.Unit declared in + FUN name:testArrayAsVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY + CALL 'public final fun useArray (fn: kotlin.Function1, kotlin.Int>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: FUNCTION_REFERENCE 'public final fun nsum (vararg args: kotlin.Number): kotlin.Int declared in ' type=kotlin.reflect.KFunction1, kotlin.Int> origin=null reflectionTarget= FUN name:testPlainArgs visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun usePlainArgs (fn: kotlin.Function2): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -76,19 +74,21 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt BLOCK_BODY CALL 'public final fun usePrimitiveArray (fn: kotlin.Function1): kotlin.Unit declared in ' type=kotlin.Unit origin=null fn: FUNCTION_REFERENCE 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - FUN name:testArrayAsVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:useArray visibility:public modality:FINAL <> (fn:kotlin.Function1, kotlin.Int>) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1, kotlin.Int> BLOCK_BODY - CALL 'public final fun useArray (fn: kotlin.Function1, kotlin.Int>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: FUNCTION_REFERENCE 'public final fun nsum (vararg args: kotlin.Number): kotlin.Int declared in ' type=kotlin.reflect.KFunction1, kotlin.Int> origin=null reflectionTarget= - FUN name:testArrayAndDefaults visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:usePlainArgs visibility:public modality:FINAL <> (fn:kotlin.Function2) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function2 + BLOCK_BODY + FUN name:usePrimitiveArray visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + FUN name:useStringArray visibility:public modality:FINAL <> (fn:kotlin.Function1, kotlin.Unit>) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1, kotlin.Unit> + BLOCK_BODY + FUN name:zap visibility:public modality:FINAL <> (b:kotlin.Array, k:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:b index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] + VALUE_PARAMETER name:k index:1 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 BLOCK_BODY - CALL 'public final fun useStringArray (fn: kotlin.Function1, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: BLOCK type=kotlin.Function1, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:zap visibility:local modality:FINAL <> (p0:kotlin.Array) returnType:kotlin.Unit - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Array - BLOCK_BODY - CALL 'public final fun zap (vararg b: kotlin.String, k: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null - b: VARARG type=kotlin.Array varargElementType=kotlin.String - SPREAD_ELEMENT - GET_VAR 'p0: kotlin.Array declared in .testArrayAndDefaults.zap' type=kotlin.Array origin=null - FUNCTION_REFERENCE 'local final fun zap (p0: kotlin.Array): kotlin.Unit declared in .testArrayAndDefaults' type=kotlin.Function1, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun zap (vararg b: kotlin.String, k: kotlin.Int): kotlin.Unit declared in diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.kt.txt index 04ade2b48d6..0efc3c3c939 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.kt.txt @@ -1,3 +1,10 @@ +fun nsum(vararg args: Number): Int { + return sum(args = [*IntArray(size = args.(), init = local fun (it: Int): Int { + return args.get(index = it).toInt() + } +)]) +} + fun sum(vararg args: Int): Int { var result: Int = 0 { // BLOCK @@ -10,26 +17,18 @@ fun sum(vararg args: Int): Int { return result } -fun nsum(vararg args: Number): Int { - return sum(args = [*IntArray(size = args.(), init = local fun (it: Int): Int { - return args.get(index = it).toInt() - } -)]) +fun testArrayAndDefaults() { + useStringArray(fn = { // BLOCK + local fun zap(p0: Array) { + zap(b = [*p0]) + } + + ::zap + }) } -fun zap(vararg b: String, k: Int = 42) { -} - -fun usePlainArgs(fn: Function2) { -} - -fun usePrimitiveArray(fn: Function1) { -} - -fun useArray(fn: Function1, Int>) { -} - -fun useStringArray(fn: Function1, Unit>) { +fun testArrayAsVararg() { + useArray(fn = ::nsum) } fun testPlainArgs() { @@ -46,16 +45,18 @@ fun testPrimitiveArrayAsVararg() { usePrimitiveArray(fn = ::sum) } -fun testArrayAsVararg() { - useArray(fn = ::nsum) +fun useArray(fn: Function1, Int>) { } -fun testArrayAndDefaults() { - useStringArray(fn = { // BLOCK - local fun zap(p0: Array) { - zap(b = [*p0]) - } - - ::zap - }) +fun usePlainArgs(fn: Function2) { } + +fun usePrimitiveArray(fn: Function1) { +} + +fun useStringArray(fn: Function1, Unit>) { +} + +fun zap(vararg b: String, k: Int = 42) { +} + diff --git a/compiler/testData/ir/irText/expressions/calls.ir.txt b/compiler/testData/ir/irText/expressions/calls.ir.txt index 347beb9fa62..d585c513088 100644 --- a/compiler/testData/ir/irText/expressions/calls.ir.txt +++ b/compiler/testData/ir/irText/expressions/calls.ir.txt @@ -1,10 +1,4 @@ FILE fqName: fileName:/calls.kt - FUN name:foo visibility:public modality:FINAL <> (x:kotlin.Int, y:kotlin.Int) returnType:kotlin.Int - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' - GET_VAR 'x: kotlin.Int declared in .foo' type=kotlin.Int origin=null FUN name:bar visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY @@ -12,15 +6,6 @@ FILE fqName: fileName:/calls.kt CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null x: GET_VAR 'x: kotlin.Int declared in .bar' type=kotlin.Int origin=null y: CONST Int type=kotlin.Int value=1 - FUN name:qux visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Int - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun qux (x: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null - x: CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null - x: GET_VAR 'x: kotlin.Int declared in .qux' type=kotlin.Int origin=null - y: GET_VAR 'x: kotlin.Int declared in .qux' type=kotlin.Int origin=null - y: GET_VAR 'x: kotlin.Int declared in .qux' type=kotlin.Int origin=null FUN name:ext1 visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:kotlin.Int BLOCK_BODY @@ -43,3 +28,18 @@ FILE fqName: fileName:/calls.kt x: CALL 'public final fun ext1 (): kotlin.Int declared in ' type=kotlin.Int origin=null $receiver: GET_VAR ': kotlin.Int declared in .ext3' type=kotlin.Int origin=null y: GET_VAR 'x: kotlin.Int declared in .ext3' type=kotlin.Int origin=null + FUN name:foo visibility:public modality:FINAL <> (x:kotlin.Int, y:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' + GET_VAR 'x: kotlin.Int declared in .foo' type=kotlin.Int origin=null + FUN name:qux visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux (x: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + x: CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + x: GET_VAR 'x: kotlin.Int declared in .qux' type=kotlin.Int origin=null + y: GET_VAR 'x: kotlin.Int declared in .qux' type=kotlin.Int origin=null + y: GET_VAR 'x: kotlin.Int declared in .qux' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/calls.kt.txt b/compiler/testData/ir/irText/expressions/calls.kt.txt index 665bfaacb3e..51f450dd19c 100644 --- a/compiler/testData/ir/irText/expressions/calls.kt.txt +++ b/compiler/testData/ir/irText/expressions/calls.kt.txt @@ -1,15 +1,7 @@ -fun foo(x: Int, y: Int): Int { - return x -} - fun bar(x: Int): Int { return foo(x = x, y = 1) } -fun qux(x: Int): Int { - return foo(x = foo(x = x, y = x), y = x) -} - fun Int.ext1(): Int { return } @@ -21,3 +13,12 @@ fun Int.ext2(x: Int): Int { fun Int.ext3(x: Int): Int { return foo(x = .ext1(), y = x) } + +fun foo(x: Int, y: Int): Int { + return x +} + +fun qux(x: Int): Int { + return foo(x = foo(x = x, y = x), y = x) +} + diff --git a/compiler/testData/ir/irText/expressions/castToTypeParameter.ir.txt b/compiler/testData/ir/irText/expressions/castToTypeParameter.ir.txt index dd5a3ff40aa..1de9331ac14 100644 --- a/compiler/testData/ir/irText/expressions/castToTypeParameter.ir.txt +++ b/compiler/testData/ir/irText/expressions/castToTypeParameter.ir.txt @@ -1,27 +1,4 @@ FILE fqName: fileName:/castToTypeParameter.kt - FUN name:castFun visibility:public modality:FINAL (x:kotlin.Any) returnType:T of .castFun - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun castFun (x: kotlin.Any): T of .castFun declared in ' - TYPE_OP type=T of .castFun origin=CAST typeOperand=T of .castFun - GET_VAR 'x: kotlin.Any declared in .castFun' type=kotlin.Any origin=null - FUN name:castExtFun visibility:public modality:FINAL ($receiver:kotlin.Any) returnType:T of .castExtFun - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun castExtFun (): T of .castExtFun declared in ' - TYPE_OP type=T of .castExtFun origin=CAST typeOperand=T of .castExtFun - GET_VAR ': kotlin.Any declared in .castExtFun' type=kotlin.Any origin=null - PROPERTY name:castExtVal visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:T of . - correspondingProperty: PROPERTY name:castExtVal visibility:public modality:FINAL [val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:T of . - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of . declared in ' - TYPE_OP type=T of . origin=CAST typeOperand=T of . - GET_VAR ': T of . declared in .' type=T of . origin=null CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.Host> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -29,13 +6,27 @@ FILE fqName: fileName:/castToTypeParameter.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:castMemberFun visibility:public modality:FINAL <> ($this:.Host.Host>, x:kotlin.Any) returnType:T of .Host + 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: 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:castGenericMemberExtFun visibility:public modality:FINAL ($this:.Host.Host>, $receiver:kotlin.Any) returnType:TF of .Host.castGenericMemberExtFun + TYPE_PARAMETER name:TF index:0 variance: superTypes:[kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:.Host.Host> - VALUE_PARAMETER name:x index:0 type:kotlin.Any + $receiver: VALUE_PARAMETER name: type:kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun castMemberFun (x: kotlin.Any): T of .Host declared in .Host' - TYPE_OP type=T of .Host origin=CAST typeOperand=T of .Host - GET_VAR 'x: kotlin.Any declared in .Host.castMemberFun' type=kotlin.Any origin=null + RETURN type=kotlin.Nothing from='public final fun castGenericMemberExtFun (): TF of .Host.castGenericMemberExtFun declared in .Host' + TYPE_OP type=TF of .Host.castGenericMemberExtFun origin=CAST typeOperand=TF of .Host.castGenericMemberExtFun + GET_VAR ': kotlin.Any declared in .Host.castGenericMemberExtFun' type=kotlin.Any origin=null FUN name:castGenericMemberFun visibility:public modality:FINAL ($this:.Host.Host>, x:kotlin.Any) returnType:TF of .Host.castGenericMemberFun TYPE_PARAMETER name:TF index:0 variance: superTypes:[kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:.Host.Host> @@ -51,23 +42,13 @@ FILE fqName: fileName:/castToTypeParameter.kt RETURN type=kotlin.Nothing from='public final fun castMemberExtFun (): T of .Host declared in .Host' TYPE_OP type=T of .Host origin=CAST typeOperand=T of .Host GET_VAR ': kotlin.Any declared in .Host.castMemberExtFun' type=kotlin.Any origin=null - FUN name:castGenericMemberExtFun visibility:public modality:FINAL ($this:.Host.Host>, $receiver:kotlin.Any) returnType:TF of .Host.castGenericMemberExtFun - TYPE_PARAMETER name:TF index:0 variance: superTypes:[kotlin.Any?] reified:false + FUN name:castMemberFun visibility:public modality:FINAL <> ($this:.Host.Host>, x:kotlin.Any) returnType:T of .Host $this: VALUE_PARAMETER name: type:.Host.Host> - $receiver: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun castGenericMemberExtFun (): TF of .Host.castGenericMemberExtFun declared in .Host' - TYPE_OP type=TF of .Host.castGenericMemberExtFun origin=CAST typeOperand=TF of .Host.castGenericMemberExtFun - GET_VAR ': kotlin.Any declared in .Host.castGenericMemberExtFun' type=kotlin.Any origin=null - PROPERTY name:castMemberExtVal visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>, $receiver:kotlin.Any) returnType:T of .Host - correspondingProperty: PROPERTY name:castMemberExtVal visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Host.Host> - $receiver: VALUE_PARAMETER name: type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .Host declared in .Host' - TYPE_OP type=T of .Host origin=CAST typeOperand=T of .Host - GET_VAR ': kotlin.Any declared in .Host.' type=kotlin.Any origin=null + RETURN type=kotlin.Nothing from='public final fun castMemberFun (x: kotlin.Any): T of .Host declared in .Host' + TYPE_OP type=T of .Host origin=CAST typeOperand=T of .Host + GET_VAR 'x: kotlin.Any declared in .Host.castMemberFun' type=kotlin.Any origin=null PROPERTY name:castGenericMemberExtVal visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL ($this:.Host.Host>, $receiver:TV of .Host.) returnType:TV of .Host. correspondingProperty: PROPERTY name:castGenericMemberExtVal visibility:public modality:FINAL [val] @@ -78,16 +59,35 @@ FILE fqName: fileName:/castToTypeParameter.kt RETURN type=kotlin.Nothing from='public final fun (): TV of .Host. declared in .Host' TYPE_OP type=TV of .Host. origin=CAST typeOperand=TV of .Host. GET_VAR ': TV of .Host. declared in .Host.' type=TV of .Host. 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: 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 + PROPERTY name:castMemberExtVal visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>, $receiver:kotlin.Any) returnType:T of .Host + correspondingProperty: PROPERTY name:castMemberExtVal visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host.Host> + $receiver: VALUE_PARAMETER name: type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Host declared in .Host' + TYPE_OP type=T of .Host origin=CAST typeOperand=T of .Host + GET_VAR ': kotlin.Any declared in .Host.' type=kotlin.Any origin=null + FUN name:castExtFun visibility:public modality:FINAL ($receiver:kotlin.Any) returnType:T of .castExtFun + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun castExtFun (): T of .castExtFun declared in ' + TYPE_OP type=T of .castExtFun origin=CAST typeOperand=T of .castExtFun + GET_VAR ': kotlin.Any declared in .castExtFun' type=kotlin.Any origin=null + FUN name:castFun visibility:public modality:FINAL (x:kotlin.Any) returnType:T of .castFun + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun castFun (x: kotlin.Any): T of .castFun declared in ' + TYPE_OP type=T of .castFun origin=CAST typeOperand=T of .castFun + GET_VAR 'x: kotlin.Any declared in .castFun' type=kotlin.Any origin=null + PROPERTY name:castExtVal visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:T of . + correspondingProperty: PROPERTY name:castExtVal visibility:public modality:FINAL [val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:T of . + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of . declared in ' + TYPE_OP type=T of . origin=CAST typeOperand=T of . + GET_VAR ': T of . declared in .' type=T of . origin=null diff --git a/compiler/testData/ir/irText/expressions/castToTypeParameter.kt.txt b/compiler/testData/ir/irText/expressions/castToTypeParameter.kt.txt index 2ac989998f6..70530c763a1 100644 --- a/compiler/testData/ir/irText/expressions/castToTypeParameter.kt.txt +++ b/compiler/testData/ir/irText/expressions/castToTypeParameter.kt.txt @@ -1,16 +1,3 @@ -fun castFun(x: Any): T { - return x as T -} - -fun Any.castExtFun(): T { - return as T -} - -val T.castExtVal: T - get(): T { - return as T - } - class Host { constructor() /* primary */ { super/*Any*/() @@ -18,8 +5,8 @@ class Host { } - fun castMemberFun(x: Any): T { - return x as T + fun Any.castGenericMemberExtFun(): TF { + return as TF } fun castGenericMemberFun(x: Any): TF { @@ -30,18 +17,32 @@ class Host { return as T } - fun Any.castGenericMemberExtFun(): TF { - return as TF + fun castMemberFun(x: Any): T { + return x as T } - val Any.castMemberExtVal: T - get(): T { - return as T - } - val TV.castGenericMemberExtVal: TV get(): TV { return as TV } + val Any.castMemberExtVal: T + get(): T { + return as T + } + } + +fun Any.castExtFun(): T { + return as T +} + +fun castFun(x: Any): T { + return x as T +} + +val T.castExtVal: T + get(): T { + return as T + } + diff --git a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.ir.txt b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.ir.txt index ffa4e50d9a6..d6eb6b0a9a7 100644 --- a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.ir.txt +++ b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.ir.txt @@ -5,16 +5,6 @@ FILE fqName: fileName:/chainOfSafeCalls.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.C) returnType:.C - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): .C declared in .C' - GET_VAR ': .C declared in .C.foo' type=.C origin=null - FUN name:bar visibility:public modality:FINAL <> ($this:.C) returnType:.C? - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun bar (): .C? declared in .C' - GET_VAR ': .C declared in .C.bar' type=.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 declared in kotlin.Any @@ -28,6 +18,16 @@ FILE fqName: fileName:/chainOfSafeCalls.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> ($this:.C) returnType:.C? + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (): .C? declared in .C' + GET_VAR ': .C declared in .C.bar' type=.C origin=null + FUN name:foo visibility:public modality:FINAL <> ($this:.C) returnType:.C + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): .C declared in .C' + GET_VAR ': .C declared in .C.foo' type=.C origin=null FUN name:test visibility:public modality:FINAL <> (nc:.C?) returnType:.C? VALUE_PARAMETER name:nc index:0 type:.C? BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt.txt b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt.txt index 2d73a1a1c67..732b2f9a20f 100644 --- a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt.txt +++ b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt.txt @@ -5,11 +5,11 @@ class C { } - fun foo(): C { + fun bar(): C? { return } - fun bar(): C? { + fun foo(): C { return } @@ -42,3 +42,4 @@ fun test(nc: C?): C? { } } } + diff --git a/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.fir.ir.txt b/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.fir.ir.txt index 2968bdea80c..26e704c67d9 100644 --- a/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.fir.ir.txt @@ -1,8 +1,6 @@ FILE fqName: fileName:/chainedFunSuspendConversionForSimpleExpression.kt CLASS INTERFACE name:SuspendRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SuspendRunnable - FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.SuspendRunnable) returnType:kotlin.Unit [suspend] - $this: VALUE_PARAMETER name: type:.SuspendRunnable 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 @@ -16,9 +14,8 @@ FILE fqName: fileName:/chainedFunSuspendConversionForSimpleExpression.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:foo visibility:public modality:FINAL <> (s:.SuspendRunnable) returnType:kotlin.Unit - VALUE_PARAMETER name:s index:0 type:.SuspendRunnable - BLOCK_BODY + FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.SuspendRunnable) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.SuspendRunnable FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Function0 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Function0 declared in ' @@ -27,6 +24,9 @@ FILE fqName: fileName:/chainedFunSuspendConversionForSimpleExpression.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .bar' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUN name:foo visibility:public modality:FINAL <> (s:.SuspendRunnable) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:.SuspendRunnable + BLOCK_BODY FUN name:test visibility:public modality:FINAL <> (f:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:f index:0 type:kotlin.Function0 BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.ir.txt b/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.ir.txt index b3d6e2e7886..4d7272a498f 100644 --- a/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.ir.txt +++ b/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.ir.txt @@ -1,8 +1,6 @@ FILE fqName: fileName:/chainedFunSuspendConversionForSimpleExpression.kt CLASS INTERFACE name:SuspendRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SuspendRunnable - FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.SuspendRunnable) returnType:kotlin.Unit [suspend] - $this: VALUE_PARAMETER name: type:.SuspendRunnable 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 @@ -16,9 +14,8 @@ FILE fqName: fileName:/chainedFunSuspendConversionForSimpleExpression.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:foo visibility:public modality:FINAL <> (s:.SuspendRunnable) returnType:kotlin.Unit - VALUE_PARAMETER name:s index:0 type:.SuspendRunnable - BLOCK_BODY + FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.SuspendRunnable) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.SuspendRunnable FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Function0 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Function0 declared in ' @@ -27,6 +24,9 @@ FILE fqName: fileName:/chainedFunSuspendConversionForSimpleExpression.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .bar' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUN name:foo visibility:public modality:FINAL <> (s:.SuspendRunnable) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:.SuspendRunnable + BLOCK_BODY FUN name:test visibility:public modality:FINAL <> (f:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:f index:0 type:kotlin.Function0 BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.ir.txt b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.ir.txt index 72a6844a390..5d954351324 100644 --- a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.ir.txt @@ -1,10 +1,78 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt - CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X1 - CONSTRUCTOR visibility:private <> () returnType:.X1 [primary] + CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + PROPERTY name:s visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private + EXPRESSION_BODY + GET_VAR 's: kotlin.Int declared in .B.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Int + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .B' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .B declared in .B.' type=.B origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .B declared in .B.' type=.B origin=null + value: GET_VAR ': kotlin.Int declared in .B.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.Int) returnType:.B [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public 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 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 + CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:private <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public 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 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:plusAssign visibility:public modality:FINAL <> ($this:.Host, $receiver:.B, b:.B) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.Host + $receiver: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name:b index:0 type:.B + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .B' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .B declared in .Host.plusAssign' type=.B origin=null + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in .B' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .B declared in .Host.plusAssign' type=.B origin=null + other: CALL 'public final fun (): kotlin.Int declared in .B' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'b: .B declared in .Host.plusAssign' type=.B origin=null + CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X1 PROPERTY name:x1 visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x1 type:kotlin.Int visibility:private EXPRESSION_BODY @@ -26,10 +94,6 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt value: GET_VAR ': kotlin.Int declared in .X1.' type=kotlin.Int origin=null CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X1.X2 - CONSTRUCTOR visibility:private <> () returnType:.X1.X2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x2 visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x2 type:kotlin.Int visibility:private EXPRESSION_BODY @@ -51,10 +115,6 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt value: GET_VAR ': kotlin.Int declared in .X1.X2.' type=kotlin.Int origin=null CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X1.X2.X3 - CONSTRUCTOR visibility:private <> () returnType:.X1.X2.X3 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x3 visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x3 type:kotlin.Int visibility:private EXPRESSION_BODY @@ -74,6 +134,10 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x3 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .X1.X2.X3 declared in .X1.X2.X3.' type=.X1.X2.X3 origin=null value: GET_VAR ': kotlin.Int declared in .X1.X2.X3.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:private <> () returnType:.X1.X2.X3 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X3 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -87,6 +151,10 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:private <> () returnType:.X1.X2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X2 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -100,6 +168,10 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:private <> () returnType:.X1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X1 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -171,78 +243,6 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR $this: GET_VAR 'val tmp_6: kotlin.Int declared in .test2' type=kotlin.Int origin=null GET_VAR 'val tmp_6: kotlin.Int declared in .test2' type=kotlin.Int origin=null - CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - CONSTRUCTOR visibility:public <> (s:kotlin.Int) returnType:.B [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:s visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private - EXPRESSION_BODY - GET_VAR 's: kotlin.Int declared in .B.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Int - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .B' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .B declared in .B.' type=.B origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .B declared in .B.' type=.B origin=null - value: GET_VAR ': kotlin.Int declared in .B.' type=kotlin.Int 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: 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 - CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:private <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:plusAssign visibility:public modality:FINAL <> ($this:.Host, $receiver:.B, b:.B) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.Host - $receiver: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name:b index:0 type:.B - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .B' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .B declared in .Host.plusAssign' type=.B origin=null - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in .B' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .B declared in .Host.plusAssign' type=.B origin=null - other: CALL 'public final fun (): kotlin.Int declared in .B' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'b: .B declared in .Host.plusAssign' type=.B 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: 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:test3 visibility:public modality:FINAL <> ($receiver:.Host, v:.B) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.Host VALUE_PARAMETER name:v index:0 type:.B diff --git a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.kt.txt b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.kt.txt index aa0050f4279..e8ce0dc8cd5 100644 --- a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.kt.txt @@ -1,43 +1,70 @@ -object X1 { +class B { + var s: Int + field = s + get + set + + constructor(s: Int = 0) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +object Host { private constructor() /* primary */ { super/*Any*/() /* () */ } + operator fun B.plusAssign(b: B) { + .( = .().plus(other = b.())) + } + +} + +object X1 { var x1: Int field = 0 get set object X2 { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - var x2: Int field = 0 get set object X3 { + var x3: Int + field = 0 + get + set + private constructor() /* primary */ { super/*Any*/() /* () */ } - var x3: Int - field = 0 - get - set + } + + private constructor() /* primary */ { + super/*Any*/() + /* () */ } } + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } fun test1(a: IntArray) { @@ -71,33 +98,7 @@ fun test2() { } /*~> Unit */ } -class B { - constructor(s: Int = 0) /* primary */ { - super/*Any*/() - /* () */ - - } - - var s: Int - field = s - get - set - -} - -object Host { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - operator fun B.plusAssign(b: B) { - .( = .().plus(other = b.())) - } - -} - fun Host.test3(v: B) { (, v).plusAssign(b = B(s = 1000)) } + diff --git a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.ir.txt b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.ir.txt index 0bca71ab801..1362e83c615 100644 --- a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.ir.txt +++ b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.ir.txt @@ -1,10 +1,81 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt - CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X1 - CONSTRUCTOR visibility:private <> () returnType:.X1 [primary] + CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + PROPERTY name:s visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private + EXPRESSION_BODY + GET_VAR 's: kotlin.Int declared in .B.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Int + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .B' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .B declared in .B.' type=.B origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .B declared in .B.' type=.B origin=null + value: GET_VAR ': kotlin.Int declared in .B.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.Int) returnType:.B [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public 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 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 + CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:private <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public 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 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:plusAssign visibility:public modality:FINAL <> ($this:.Host, $receiver:.B, b:.B) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.Host + $receiver: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name:b index:0 type:.B + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.B [val] + GET_VAR ': .B declared in .Host.plusAssign' type=.B origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .B' type=kotlin.Unit origin=PLUSEQ + $this: GET_VAR 'val tmp_0: .B declared in .Host.plusAssign' type=.B origin=null + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.Int declared in .B' type=kotlin.Int origin=PLUSEQ + $this: GET_VAR 'val tmp_0: .B declared in .Host.plusAssign' type=.B origin=null + other: CALL 'public final fun (): kotlin.Int declared in .B' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'b: .B declared in .Host.plusAssign' type=.B origin=null + CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X1 PROPERTY name:x1 visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x1 type:kotlin.Int visibility:private EXPRESSION_BODY @@ -26,10 +97,6 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt value: GET_VAR ': kotlin.Int declared in .X1.' type=kotlin.Int origin=null CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X1.X2 - CONSTRUCTOR visibility:private <> () returnType:.X1.X2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x2 visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x2 type:kotlin.Int visibility:private EXPRESSION_BODY @@ -51,10 +118,6 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt value: GET_VAR ': kotlin.Int declared in .X1.X2.' type=kotlin.Int origin=null CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X1.X2.X3 - CONSTRUCTOR visibility:private <> () returnType:.X1.X2.X3 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x3 visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x3 type:kotlin.Int visibility:private EXPRESSION_BODY @@ -74,6 +137,10 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x3 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .X1.X2.X3 declared in .X1.X2.X3.' type=.X1.X2.X3 origin=null value: GET_VAR ': kotlin.Int declared in .X1.X2.X3.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:private <> () returnType:.X1.X2.X3 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X3 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -87,6 +154,10 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:private <> () returnType:.X1.X2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X2 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -100,6 +171,10 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:private <> () returnType:.X1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X1 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -120,142 +195,67 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt CONST Int type=kotlin.Int value=0 TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.IntArray [val] GET_VAR 'a: kotlin.IntArray declared in .test1' type=kotlin.IntArray origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] GET_VAR 'var i: kotlin.Int declared in .test1' type=kotlin.Int origin=POSTFIX_INCR SET_VAR 'var i: kotlin.Int declared in .test1' type=kotlin.Unit origin=POSTFIX_INCR CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_2: kotlin.Int declared in .test1' type=kotlin.Int origin=null - GET_VAR 'val tmp_2: kotlin.Int declared in .test1' type=kotlin.Int origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] + $this: GET_VAR 'val tmp_3: kotlin.Int declared in .test1' type=kotlin.Int origin=null + GET_VAR 'val tmp_3: kotlin.Int declared in .test1' type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .test1' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_1: kotlin.Int declared in .test1' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_1: kotlin.IntArray declared in .test1' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_2: kotlin.Int declared in .test1' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .test1' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_1: kotlin.Int declared in .test1' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_1: kotlin.IntArray declared in .test1' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_2: kotlin.Int declared in .test1' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_3: kotlin.Int declared in .test1' type=kotlin.Int origin=null - GET_VAR 'val tmp_3: kotlin.Int declared in .test1' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_4: kotlin.Int declared in .test1' type=kotlin.Int origin=null + GET_VAR 'val tmp_4: kotlin.Int declared in .test1' type=kotlin.Int origin=null FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.X1 [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:.X1 [val] GET_OBJECT 'CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1 BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .X1' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_4: .X1 declared in .test2' type=.X1 origin=null + $this: GET_VAR 'val tmp_5: .X1 declared in .test2' type=.X1 origin=null CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .X1' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_4: .X1 declared in .test2' type=.X1 origin=null + $this: GET_VAR 'val tmp_5: .X1 declared in .test2' type=.X1 origin=null : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_5: kotlin.Int declared in .test2' type=kotlin.Int origin=null - GET_VAR 'val tmp_5: kotlin.Int declared in .test2' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_6: kotlin.Int declared in .test2' type=kotlin.Int origin=null + GET_VAR 'val tmp_6: kotlin.Int declared in .test2' type=kotlin.Int origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.X1.X2 [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:.X1.X2 [val] GET_OBJECT 'CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1.X2 BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .X1.X2' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_6: .X1.X2 declared in .test2' type=.X1.X2 origin=null + $this: GET_VAR 'val tmp_7: .X1.X2 declared in .test2' type=.X1.X2 origin=null CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .X1.X2' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_6: .X1.X2 declared in .test2' type=.X1.X2 origin=null + $this: GET_VAR 'val tmp_7: .X1.X2 declared in .test2' type=.X1.X2 origin=null : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_7: kotlin.Int declared in .test2' type=kotlin.Int origin=null - GET_VAR 'val tmp_7: kotlin.Int declared in .test2' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_8: kotlin.Int declared in .test2' type=kotlin.Int origin=null + GET_VAR 'val tmp_8: kotlin.Int declared in .test2' type=kotlin.Int origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:.X1.X2.X3 [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:.X1.X2.X3 [val] GET_OBJECT 'CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1.X2.X3 BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .X1.X2.X3' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_8: .X1.X2.X3 declared in .test2' type=.X1.X2.X3 origin=null + $this: GET_VAR 'val tmp_9: .X1.X2.X3 declared in .test2' type=.X1.X2.X3 origin=null CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .X1.X2.X3' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_8: .X1.X2.X3 declared in .test2' type=.X1.X2.X3 origin=null + $this: GET_VAR 'val tmp_9: .X1.X2.X3 declared in .test2' type=.X1.X2.X3 origin=null : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_9: kotlin.Int declared in .test2' type=kotlin.Int origin=null - GET_VAR 'val tmp_9: kotlin.Int declared in .test2' type=kotlin.Int origin=null - CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - CONSTRUCTOR visibility:public <> (s:kotlin.Int) returnType:.B [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:s visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private - EXPRESSION_BODY - GET_VAR 's: kotlin.Int declared in .B.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Int - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .B' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .B declared in .B.' type=.B origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .B declared in .B.' type=.B origin=null - value: GET_VAR ': kotlin.Int declared in .B.' type=kotlin.Int 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: 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 - CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:private <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:plusAssign visibility:public modality:FINAL <> ($this:.Host, $receiver:.B, b:.B) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.Host - $receiver: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name:b index:0 type:.B - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:.B [val] - GET_VAR ': .B declared in .Host.plusAssign' type=.B origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .B' type=kotlin.Unit origin=PLUSEQ - $this: GET_VAR 'val tmp_10: .B declared in .Host.plusAssign' type=.B origin=null - : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.Int declared in .B' type=kotlin.Int origin=PLUSEQ - $this: GET_VAR 'val tmp_10: .B declared in .Host.plusAssign' type=.B origin=null - other: CALL 'public final fun (): kotlin.Int declared in .B' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'b: .B declared in .Host.plusAssign' type=.B 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: 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 + $this: GET_VAR 'val tmp_10: kotlin.Int declared in .test2' type=kotlin.Int origin=null + GET_VAR 'val tmp_10: kotlin.Int declared in .test2' type=kotlin.Int origin=null FUN name:test3 visibility:public modality:FINAL <> ($receiver:.Host, v:.B) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.Host VALUE_PARAMETER name:v index:0 type:.B diff --git a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.kt.txt b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.kt.txt index ec704e2d2f8..e7bad0bb345 100644 --- a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.kt.txt +++ b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.kt.txt @@ -1,99 +1,15 @@ -object X1 { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - var x1: Int - field = 0 +class B { + var s: Int + field = s get set - object X2 { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - var x2: Int - field = 0 - get - set - - object X3 { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - var x3: Int - field = 0 - get - set - - } - - } - -} - -fun test1(a: IntArray) { - var i: Int = 0 - { // BLOCK - val tmp_0: IntArray = a - val tmp_1: Int = { // BLOCK - val tmp_2: Int = i - i = tmp_2.inc() - tmp_2 - } - val tmp_3: Int = tmp_0.get(index = tmp_1) - tmp_0.set(index = tmp_1, value = tmp_3.inc()) - tmp_3 - } /*~> Unit */ -} - -fun test2() { - { // BLOCK - val tmp_4: X1 = X1 - { // BLOCK - val tmp_5: Int = tmp_4.() - tmp_4.( = tmp_5.inc()) - tmp_5 - } - } /*~> Unit */ - { // BLOCK - val tmp_6: X2 = X2 - { // BLOCK - val tmp_7: Int = tmp_6.() - tmp_6.( = tmp_7.inc()) - tmp_7 - } - } /*~> Unit */ - { // BLOCK - val tmp_8: X3 = X3 - { // BLOCK - val tmp_9: Int = tmp_8.() - tmp_8.( = tmp_9.inc()) - tmp_9 - } - } /*~> Unit */ -} - -class B { constructor(s: Int = 0) /* primary */ { super/*Any*/() /* () */ } - var s: Int - field = s - get - set - } object Host { @@ -105,13 +21,98 @@ object Host { operator fun B.plusAssign(b: B) { { // BLOCK - val tmp_10: B = - tmp_10.( = tmp_10.().plus(other = b.())) + val tmp_0: B = + tmp_0.( = tmp_0.().plus(other = b.())) } } } +object X1 { + var x1: Int + field = 0 + get + set + + object X2 { + var x2: Int + field = 0 + get + set + + object X3 { + var x3: Int + field = 0 + get + set + + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + } + + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + } + + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +fun test1(a: IntArray) { + var i: Int = 0 + { // BLOCK + val tmp_1: IntArray = a + val tmp_2: Int = { // BLOCK + val tmp_3: Int = i + i = tmp_3.inc() + tmp_3 + } + val tmp_4: Int = tmp_1.get(index = tmp_2) + tmp_1.set(index = tmp_2, value = tmp_4.inc()) + tmp_4 + } /*~> Unit */ +} + +fun test2() { + { // BLOCK + val tmp_5: X1 = X1 + { // BLOCK + val tmp_6: Int = tmp_5.() + tmp_5.( = tmp_6.inc()) + tmp_6 + } + } /*~> Unit */ + { // BLOCK + val tmp_7: X2 = X2 + { // BLOCK + val tmp_8: Int = tmp_7.() + tmp_7.( = tmp_8.inc()) + tmp_8 + } + } /*~> Unit */ + { // BLOCK + val tmp_9: X3 = X3 + { // BLOCK + val tmp_10: Int = tmp_9.() + tmp_9.( = tmp_10.inc()) + tmp_10 + } + } /*~> Unit */ +} + fun Host.test3(v: B) { (, v).plusAssign(b = B(s = 1000)) } + diff --git a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.fir.ir.txt b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.fir.ir.txt index 3c545638f75..2e0e7a90ca4 100644 --- a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.fir.ir.txt @@ -1,27 +1,7 @@ FILE fqName: fileName:/constructorWithOwnTypeParametersCall.kt - FUN name:testKotlin visibility:public modality:FINAL <> () returnType:.K1.K2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testKotlin (): .K1.K2 declared in ' - CONSTRUCTOR_CALL 'public constructor () declared in .K1.K2' type=.K1.K2 origin=null - : kotlin.String - $outer: CONSTRUCTOR_CALL 'public constructor () declared in .K1' type=.K1 origin=null - : kotlin.Int - FUN name:testJava visibility:public modality:FINAL <> () returnType:.J1.J2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testJava (): .J1.J2 declared in ' - CONSTRUCTOR_CALL 'public constructor () declared in .J1.J2' type=.J1.J2 origin=null - : kotlin.Double - : kotlin.CharSequence - $outer: CONSTRUCTOR_CALL 'public constructor () declared in .J1' type=.J1 origin=null - : kotlin.Int - : kotlin.String CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K1.K1> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Number] reified:false - CONSTRUCTOR visibility:public <> () returnType:.K1.K1> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:K2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K1.K2.K1.K2, T1 of .K1> TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.CharSequence] reified:false @@ -43,6 +23,10 @@ FILE fqName: fileName:/constructorWithOwnTypeParametersCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.K1.K1> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K1 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -56,3 +40,19 @@ FILE fqName: fileName:/constructorWithOwnTypeParametersCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testJava visibility:public modality:FINAL <> () returnType:.J1.J2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testJava (): .J1.J2 declared in ' + CONSTRUCTOR_CALL 'public constructor () declared in .J1.J2' type=.J1.J2 origin=null + : kotlin.Double + : kotlin.CharSequence + $outer: CONSTRUCTOR_CALL 'public constructor () declared in .J1' type=.J1 origin=null + : kotlin.Int + : kotlin.String + FUN name:testKotlin visibility:public modality:FINAL <> () returnType:.K1.K2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testKotlin (): .K1.K2 declared in ' + CONSTRUCTOR_CALL 'public constructor () declared in .K1.K2' type=.K1.K2 origin=null + : kotlin.String + $outer: CONSTRUCTOR_CALL 'public constructor () declared in .K1' type=.K1 origin=null + : kotlin.Int diff --git a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.fir.kt.txt b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.fir.kt.txt index f2a25f75596..b411c716cc5 100644 --- a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.fir.kt.txt @@ -1,18 +1,4 @@ -fun testKotlin(): K2 { - return K1().K2() -} - -fun testJava(): J2 { - return J1().J2() -} - class K1 { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - inner class K2 { constructor() /* primary */ { super/*Any*/() @@ -22,4 +8,19 @@ class K1 { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + +fun testJava(): J2 { + return J1().J2() +} + +fun testKotlin(): K2 { + return K1().K2() +} + diff --git a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.ir.txt b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.ir.txt index 3b01df4fa8f..0c58e87c7a7 100644 --- a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.ir.txt +++ b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.ir.txt @@ -1,27 +1,7 @@ FILE fqName: fileName:/constructorWithOwnTypeParametersCall.kt - FUN name:testKotlin visibility:public modality:FINAL <> () returnType:.K1.K2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testKotlin (): .K1.K2 declared in ' - CONSTRUCTOR_CALL 'public constructor () declared in .K1.K2' type=.K1.K2 origin=null - : kotlin.String - $outer: CONSTRUCTOR_CALL 'public constructor () declared in .K1' type=.K1 origin=null - : kotlin.Int - FUN name:testJava visibility:public modality:FINAL <> () returnType:.J1.J2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testJava (): .J1.J2 declared in ' - CONSTRUCTOR_CALL 'public constructor () declared in .J1.J2' type=.J1.J2 origin=null - : @[FlexibleNullability] kotlin.Double? - : @[FlexibleNullability] kotlin.CharSequence? - $outer: CONSTRUCTOR_CALL 'public constructor () declared in .J1' type=.J1 origin=null - : @[FlexibleNullability] kotlin.Int? - : @[FlexibleNullability] kotlin.String? CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K1.K1> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Number] reified:false - CONSTRUCTOR visibility:public <> () returnType:.K1.K1> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:K2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K1.K2.K1.K2, T1 of .K1> TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.CharSequence] reified:false @@ -43,6 +23,10 @@ FILE fqName: fileName:/constructorWithOwnTypeParametersCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.K1.K1> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K1 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -56,3 +40,19 @@ FILE fqName: fileName:/constructorWithOwnTypeParametersCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testJava visibility:public modality:FINAL <> () returnType:.J1.J2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testJava (): .J1.J2 declared in ' + CONSTRUCTOR_CALL 'public constructor () declared in .J1.J2' type=.J1.J2 origin=null + : @[FlexibleNullability] kotlin.Double? + : @[FlexibleNullability] kotlin.CharSequence? + $outer: CONSTRUCTOR_CALL 'public constructor () declared in .J1' type=.J1 origin=null + : @[FlexibleNullability] kotlin.Int? + : @[FlexibleNullability] kotlin.String? + FUN name:testKotlin visibility:public modality:FINAL <> () returnType:.K1.K2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testKotlin (): .K1.K2 declared in ' + CONSTRUCTOR_CALL 'public constructor () declared in .K1.K2' type=.K1.K2 origin=null + : kotlin.String + $outer: CONSTRUCTOR_CALL 'public constructor () declared in .K1' type=.K1 origin=null + : kotlin.Int diff --git a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.kt.txt b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.kt.txt index 25246dfe2cd..9a1ad10ca4d 100644 --- a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.kt.txt +++ b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.kt.txt @@ -1,18 +1,4 @@ -fun testKotlin(): K2 { - return K1().K2() -} - -fun testJava(): J2 { - return J1<@FlexibleNullability Int?, @FlexibleNullability String?>().J2<@FlexibleNullability Double?, @FlexibleNullability CharSequence?>() -} - class K1 { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - inner class K2 { constructor() /* primary */ { super/*Any*/() @@ -22,4 +8,19 @@ class K1 { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + +fun testJava(): J2 { + return J1<@FlexibleNullability Int?, @FlexibleNullability String?>().J2<@FlexibleNullability Double?, @FlexibleNullability CharSequence?>() +} + +fun testKotlin(): K2 { + return K1().K2() +} + diff --git a/compiler/testData/ir/irText/expressions/contructorCall.ir.txt b/compiler/testData/ir/irText/expressions/contructorCall.ir.txt index 642d62a68e6..78b71fab893 100644 --- a/compiler/testData/ir/irText/expressions/contructorCall.ir.txt +++ b/compiler/testData/ir/irText/expressions/contructorCall.ir.txt @@ -1,4 +1,13 @@ FILE fqName: fileName:/contructorCall.kt + PROPERTY name:test visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test type:.A visibility:private [final,static] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.A + correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .A declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:.A visibility:private [final,static]' type=.A origin=null CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A CONSTRUCTOR visibility:public <> () returnType:.A [primary] @@ -18,12 +27,3 @@ FILE fqName: fileName:/contructorCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:test visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test type:.A visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.A - correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .A declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:.A visibility:private [final,static]' type=.A origin=null diff --git a/compiler/testData/ir/irText/expressions/contructorCall.kt.txt b/compiler/testData/ir/irText/expressions/contructorCall.kt.txt index 2dd9249a2bf..ce60c782b9f 100644 --- a/compiler/testData/ir/irText/expressions/contructorCall.kt.txt +++ b/compiler/testData/ir/irText/expressions/contructorCall.kt.txt @@ -1,3 +1,7 @@ +val test: A + field = A() + get + class A { constructor() /* primary */ { super/*Any*/() @@ -7,6 +11,3 @@ class A { } -val test: A - field = A() - get diff --git a/compiler/testData/ir/irText/expressions/conventionComparisons.fir.ir.txt b/compiler/testData/ir/irText/expressions/conventionComparisons.fir.ir.txt index 6b46c0fd1e8..cef71ef6e45 100644 --- a/compiler/testData/ir/irText/expressions/conventionComparisons.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/conventionComparisons.fir.ir.txt @@ -16,10 +16,6 @@ FILE fqName: fileName:/conventionComparisons.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:IB modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IB - FUN name:compareTo visibility:public modality:ABSTRACT <> ($this:.IB, $receiver:.IA, other:.IA) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.IB - $receiver: VALUE_PARAMETER name: type:.IA - VALUE_PARAMETER name:other index:0 type:.IA 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 @@ -33,6 +29,10 @@ FILE fqName: fileName:/conventionComparisons.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:compareTo visibility:public modality:ABSTRACT <> ($this:.IB, $receiver:.IA, other:.IA) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.IB + $receiver: VALUE_PARAMETER name: type:.IA + VALUE_PARAMETER name:other index:0 type:.IA FUN name:test1 visibility:public modality:FINAL <> ($receiver:.IB, a1:.IA, a2:.IA) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:.IB VALUE_PARAMETER name:a1 index:0 type:.IA diff --git a/compiler/testData/ir/irText/expressions/conventionComparisons.ir.txt b/compiler/testData/ir/irText/expressions/conventionComparisons.ir.txt index 07a3ac21870..3df8d9bd34e 100644 --- a/compiler/testData/ir/irText/expressions/conventionComparisons.ir.txt +++ b/compiler/testData/ir/irText/expressions/conventionComparisons.ir.txt @@ -16,10 +16,6 @@ FILE fqName: fileName:/conventionComparisons.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:IB modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IB - FUN name:compareTo visibility:public modality:ABSTRACT <> ($this:.IB, $receiver:.IA, other:.IA) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.IB - $receiver: VALUE_PARAMETER name: type:.IA - VALUE_PARAMETER name:other index:0 type:.IA 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 @@ -33,6 +29,10 @@ FILE fqName: fileName:/conventionComparisons.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:compareTo visibility:public modality:ABSTRACT <> ($this:.IB, $receiver:.IA, other:.IA) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.IB + $receiver: VALUE_PARAMETER name: type:.IA + VALUE_PARAMETER name:other index:0 type:.IA FUN name:test1 visibility:public modality:FINAL <> ($receiver:.IB, a1:.IA, a2:.IA) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:.IB VALUE_PARAMETER name:a1 index:0 type:.IA diff --git a/compiler/testData/ir/irText/expressions/destructuring1.fir.ir.txt b/compiler/testData/ir/irText/expressions/destructuring1.fir.ir.txt index e6144cc3e97..09c6c94c4ef 100644 --- a/compiler/testData/ir/irText/expressions/destructuring1.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/destructuring1.fir.ir.txt @@ -24,18 +24,6 @@ FILE fqName: fileName:/destructuring1.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:component1 visibility:public modality:FINAL <> ($this:.B, $receiver:.A) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.B - $receiver: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .B' - CONST Int type=kotlin.Int value=1 - FUN name:component2 visibility:public modality:FINAL <> ($this:.B, $receiver:.A) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.B - $receiver: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in .B' - CONST Int type=kotlin.Int value=2 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 @@ -49,6 +37,18 @@ FILE fqName: fileName:/destructuring1.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:component1 visibility:public modality:FINAL <> ($this:.B, $receiver:.A) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.B + $receiver: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .B' + CONST Int type=kotlin.Int value=1 + FUN name:component2 visibility:public modality:FINAL <> ($this:.B, $receiver:.A) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.B + $receiver: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in .B' + CONST Int type=kotlin.Int value=2 FUN name:test visibility:public modality:FINAL <> ($receiver:.B) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.B BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/destructuring1.ir.txt b/compiler/testData/ir/irText/expressions/destructuring1.ir.txt index 59371caf725..16902cb5212 100644 --- a/compiler/testData/ir/irText/expressions/destructuring1.ir.txt +++ b/compiler/testData/ir/irText/expressions/destructuring1.ir.txt @@ -24,18 +24,6 @@ FILE fqName: fileName:/destructuring1.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:component1 visibility:public modality:FINAL <> ($this:.B, $receiver:.A) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.B - $receiver: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .B' - CONST Int type=kotlin.Int value=1 - FUN name:component2 visibility:public modality:FINAL <> ($this:.B, $receiver:.A) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.B - $receiver: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in .B' - CONST Int type=kotlin.Int value=2 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 @@ -49,6 +37,18 @@ FILE fqName: fileName:/destructuring1.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:component1 visibility:public modality:FINAL <> ($this:.B, $receiver:.A) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.B + $receiver: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .B' + CONST Int type=kotlin.Int value=1 + FUN name:component2 visibility:public modality:FINAL <> ($this:.B, $receiver:.A) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.B + $receiver: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in .B' + CONST Int type=kotlin.Int value=2 FUN name:test visibility:public modality:FINAL <> ($receiver:.B) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.B BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.ir.txt b/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.ir.txt index 6c4688eed22..16eeb568fd0 100644 --- a/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.ir.txt @@ -24,6 +24,19 @@ FILE fqName: fileName:/destructuringWithUnderscore.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:B modality:FINAL visibility:public 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 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:component1 visibility:public modality:FINAL <> ($this:.B, $receiver:.A) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.B $receiver: VALUE_PARAMETER name: type:.A @@ -42,19 +55,6 @@ FILE fqName: fileName:/destructuringWithUnderscore.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun component3 (): kotlin.Int declared in .B' CONST Int type=kotlin.Int value=3 - 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: 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:test visibility:public modality:FINAL <> ($receiver:.B) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.B BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.ir.txt b/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.ir.txt index f62eced8d91..c07ae8f15bc 100644 --- a/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.ir.txt +++ b/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.ir.txt @@ -24,6 +24,19 @@ FILE fqName: fileName:/destructuringWithUnderscore.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:B modality:FINAL visibility:public 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 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:component1 visibility:public modality:FINAL <> ($this:.B, $receiver:.A) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.B $receiver: VALUE_PARAMETER name: type:.A @@ -42,19 +55,6 @@ FILE fqName: fileName:/destructuringWithUnderscore.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun component3 (): kotlin.Int declared in .B' CONST Int type=kotlin.Int value=3 - 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: 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:test visibility:public modality:FINAL <> ($receiver:.B) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.B BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.ir.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.ir.txt index ffff3a8b81c..846f1329f9d 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.ir.txt @@ -1,20 +1,11 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt CLASS ENUM_CLASS name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.X>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X - CONSTRUCTOR visibility:private <> () returnType:.X [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .X - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.X>]' ENUM_ENTRY name:B init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .X.B' class: CLASS ENUM_ENTRY name:B modality:FINAL visibility:private superTypes:[.X] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X.B - CONSTRUCTOR visibility:private <> () returnType:.X.B [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .X' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:B modality:FINAL visibility:private superTypes:[.X]' PROPERTY name:value2 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -46,6 +37,10 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.Function0 declared in .X.B' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0 visibility:private [final]' type=kotlin.Function0 origin=null receiver: GET_VAR ': .X.B declared in .X.B.' type=.X.B origin=null + CONSTRUCTOR visibility:private <> () returnType:.X.B [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .X' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:B modality:FINAL visibility:private superTypes:[.X]' FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.X>, other:.X) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .X): kotlin.Int declared in .X @@ -82,19 +77,16 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt overridden: public final fun (): kotlin.Int declared in .X $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> - PROPERTY name:value visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.Function0 - correspondingProperty: PROPERTY name:value visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.X - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.X> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> () returnType:.X [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .X + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.X>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.X VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.X> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.X> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.X>, other:.X) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -113,6 +105,10 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.X> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -131,6 +127,10 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> + PROPERTY name:value visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.Function0 + correspondingProperty: PROPERTY name:value visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.X 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 ' diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.kt.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.kt.txt index dac77e5b3a7..88348f94dae 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.kt.txt @@ -1,18 +1,7 @@ abstract enum class X : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } B = B() private enum entry class B : X { - private constructor() /* primary */ { - super/*X*/() - /* () */ - - } - val value2: String field = "OK" get @@ -24,20 +13,33 @@ abstract enum class X : Enum { override get + private constructor() /* primary */ { + super/*X*/() + /* () */ + + } + } - abstract val value: Function0 - abstract get + private constructor() /* primary */ { + super/*Enum*/() + /* () */ - fun values(): Array /* Synthetic body for ENUM_VALUES */ + } fun valueOf(value: String): X /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ + abstract val value: Function0 + abstract get + } fun box(): String { return X.B.().invoke() } + diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.ir.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.ir.txt index 799bb73a0b2..0d20f1b41d3 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.ir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.ir.txt @@ -1,21 +1,11 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt CLASS ENUM_CLASS name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.X>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X - CONSTRUCTOR visibility:private <> () returnType:.X [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .X - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.X>]' ENUM_ENTRY name:B init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .X.B' class: CLASS ENUM_ENTRY name:B modality:FINAL visibility:private superTypes:[.X] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X.B - CONSTRUCTOR visibility:private <> () returnType:.X.B [primary] - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .X' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:B modality:FINAL visibility:private superTypes:[.X]' PROPERTY name:value2 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -47,24 +37,11 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.Function0 declared in .X.B' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0 visibility:private [final]' type=kotlin.Function0 origin=null receiver: GET_VAR ': .X.B declared in .X.B.' type=.X.B origin=null - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.X>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .X - $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.X>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .X - $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> + CONSTRUCTOR visibility:private <> () returnType:.X.B [primary] + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .X' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:B modality:FINAL visibility:private superTypes:[.X]' FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.X>, other:.X) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .X): kotlin.Int declared in .X @@ -83,28 +60,34 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt overridden: public open fun toString (): kotlin.String declared in .X $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> - PROPERTY name:value visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.Function0 - correspondingProperty: PROPERTY name:value visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.X - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.X>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.X>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.X>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .X + $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.X>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .X + $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> + CONSTRUCTOR visibility:private <> () returnType:.X [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .X + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.X>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.X + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.X> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.X>, other:.X) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -123,15 +106,32 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.X> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.X - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.X> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.X>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.X>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.X> + PROPERTY name:value visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.Function0 + correspondingProperty: PROPERTY name:value visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.X 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 ' diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt.txt index cd7fb27a0eb..2e1f3c40f60 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt.txt @@ -1,18 +1,7 @@ abstract enum class X : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } B = B() private enum entry class B : X { - private constructor() /* primary */ { - super/*X*/() /*~> Unit */ - /* () */ - - } - val value2: String field = "OK" get @@ -24,20 +13,33 @@ abstract enum class X : Enum { override get + private constructor() /* primary */ { + super/*X*/() /*~> Unit */ + /* () */ + + } + } - abstract val value: Function0 - abstract get + private constructor() /* primary */ { + super/*Enum*/() + /* () */ - fun values(): Array /* Synthetic body for ENUM_VALUES */ + } fun valueOf(value: String): X /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ + abstract val value: Function0 + abstract get + } fun box(): String { return X.B.().invoke() } + diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.ir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.ir.txt index e268c0295ee..784b7f71f75 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.ir.txt @@ -1,20 +1,11 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt CLASS ENUM_CLASS name:MyEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.MyEnum>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum - CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .MyEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.MyEnum>]' ENUM_ENTRY name:Z init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum.Z' class: CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[.MyEnum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.Z - CONSTRUCTOR visibility:private <> () returnType:.MyEnum.Z [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[.MyEnum]' PROPERTY name:counter visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private EXPRESSION_BODY @@ -34,17 +25,6 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.' type=.MyEnum.Z origin=null value: GET_VAR ': kotlin.Int declared in .MyEnum.Z.' type=kotlin.Int origin=null - FUN name:foo visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.MyEnum.Z - BLOCK_BODY - FUN name:bar visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.MyEnum.Z - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.bar' type=.MyEnum.Z origin=null - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null - $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.bar' type=.MyEnum.Z origin=null PROPERTY name:aLambda visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0 visibility:private [final] EXPRESSION_BODY @@ -69,10 +49,6 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt BLOCK type=.MyEnum.Z.anObject. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.Z.anObject. - CONSTRUCTOR visibility:public <> () returnType:.MyEnum.Z.anObject. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ @@ -80,14 +56,10 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null - FUN name:test visibility:public modality:FINAL <> ($this:.MyEnum.Z.anObject.) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.MyEnum.Z.anObject. + CONSTRUCTOR visibility:public <> () returnType:.MyEnum.Z.anObject. [primary] BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null - $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local 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 declared in kotlin.Any @@ -101,6 +73,14 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> ($this:.MyEnum.Z.anObject.) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.MyEnum.Z.anObject. + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null CONSTRUCTOR_CALL 'public constructor () declared in .MyEnum.Z.anObject.' type=.MyEnum.Z.anObject. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:.MyEnum.Z.anObject. correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] @@ -109,6 +89,10 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt RETURN type=kotlin.Nothing from='public final fun (): .MyEnum.Z.anObject. declared in .MyEnum.Z' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:.MyEnum.Z.anObject. visibility:private [final]' type=.MyEnum.Z.anObject. origin=null receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.' type=.MyEnum.Z origin=null + CONSTRUCTOR visibility:private <> () returnType:.MyEnum.Z [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[.MyEnum]' FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>, other:.MyEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .MyEnum): kotlin.Int declared in .MyEnum @@ -127,6 +111,17 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt overridden: public open fun toString (): kotlin.String declared in .MyEnum $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + FUN name:bar visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.MyEnum.Z + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.bar' type=.MyEnum.Z origin=null + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.bar' type=.MyEnum.Z origin=null + FUN name:foo visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.MyEnum.Z + BLOCK_BODY PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -145,15 +140,16 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt overridden: public final fun (): kotlin.Int declared in .MyEnum $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .MyEnum + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.MyEnum>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyEnum VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyEnum> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>, other:.MyEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -172,6 +168,10 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyEnum> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.kt.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.kt.txt index c803ce97113..73c63f24502 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.kt.txt @@ -1,31 +1,12 @@ open enum class MyEnum : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } Z = Z() private enum entry class Z : MyEnum { - private constructor() /* primary */ { - super/*MyEnum*/() - /* () */ - - } - var counter: Int field = 0 get set - fun foo() { - } - - fun bar() { - .( = 1) - .foo() - } - val aLambda: Function0 field = local fun () { .( = 1) @@ -37,17 +18,17 @@ open enum class MyEnum : Enum { val anObject: field = { // BLOCK local class { + init { + .( = 1) + .foo() + } + constructor() /* primary */ { super/*Any*/() /* () */ } - init { - .( = 1) - .foo() - } - fun test() { .( = 1) .foo() @@ -59,13 +40,34 @@ open enum class MyEnum : Enum { } get + private constructor() /* primary */ { + super/*MyEnum*/() + /* () */ + + } + + fun bar() { + .( = 1) + .foo() + } + + fun foo() { + } + } - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): MyEnum /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } + diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.ir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.ir.txt index 33e5a481cd7..d6a59c51721 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.ir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.ir.txt @@ -1,21 +1,11 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt CLASS ENUM_CLASS name:MyEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.MyEnum>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum - CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .MyEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.MyEnum>]' ENUM_ENTRY name:Z init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum.Z' class: CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[.MyEnum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.Z - CONSTRUCTOR visibility:private <> () returnType:.MyEnum.Z [primary] - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[.MyEnum]' PROPERTY name:counter visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private EXPRESSION_BODY @@ -35,17 +25,6 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.' type=.MyEnum.Z origin=null value: GET_VAR ': kotlin.Int declared in .MyEnum.Z.' type=kotlin.Int origin=null - FUN name:foo visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.MyEnum.Z - BLOCK_BODY - FUN name:bar visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.MyEnum.Z - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.bar' type=.MyEnum.Z origin=null - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null - $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.bar' type=.MyEnum.Z origin=null PROPERTY name:aLambda visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0 visibility:private [final] EXPRESSION_BODY @@ -70,10 +49,6 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt BLOCK type=.MyEnum.Z.anObject. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.Z.anObject. - CONSTRUCTOR visibility:public <> () returnType:.MyEnum.Z.anObject. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ @@ -81,14 +56,10 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null $this: GET_ENUM 'ENUM_ENTRY name:Z' type=.MyEnum.Z - FUN name:test visibility:public modality:FINAL <> ($this:.MyEnum.Z.anObject.) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.MyEnum.Z.anObject. + CONSTRUCTOR visibility:public <> () returnType:.MyEnum.Z.anObject. [primary] BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ - $this: GET_ENUM 'ENUM_ENTRY name:Z' type=.MyEnum.Z - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null - $this: GET_ENUM 'ENUM_ENTRY name:Z' type=.MyEnum.Z + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local 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 declared in kotlin.Any @@ -102,6 +73,14 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> ($this:.MyEnum.Z.anObject.) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.MyEnum.Z.anObject. + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ + $this: GET_ENUM 'ENUM_ENTRY name:Z' type=.MyEnum.Z + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null + $this: GET_ENUM 'ENUM_ENTRY name:Z' type=.MyEnum.Z CONSTRUCTOR_CALL 'public constructor () declared in .MyEnum.Z.anObject.' type=.MyEnum.Z.anObject. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Any correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] @@ -110,24 +89,11 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .MyEnum.Z' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.' type=.MyEnum.Z origin=null - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .MyEnum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .MyEnum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + CONSTRUCTOR visibility:private <> () returnType:.MyEnum.Z [primary] + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyEnum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[.MyEnum]' FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>, other:.MyEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .MyEnum): kotlin.Int declared in .MyEnum @@ -146,24 +112,45 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt overridden: public open fun toString (): kotlin.String declared in .MyEnum $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + FUN name:bar visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.MyEnum.Z + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.bar' type=.MyEnum.Z origin=null + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.bar' type=.MyEnum.Z origin=null + FUN name:foo visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.MyEnum.Z + BLOCK_BODY + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .MyEnum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .MyEnum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .MyEnum + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.MyEnum>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyEnum + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>, other:.MyEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -182,12 +169,25 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyEnum> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyEnum - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.MyEnum> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.MyEnum>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.MyEnum> diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.kt.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.kt.txt index 090b7bf57fa..d2eb0ed7cf9 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.kt.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.kt.txt @@ -1,31 +1,12 @@ open enum class MyEnum : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } Z = Z() private enum entry class Z : MyEnum { - private constructor() /* primary */ { - super/*MyEnum*/() /*~> Unit */ - /* () */ - - } - var counter: Int field = 0 get set - fun foo() { - } - - fun bar() { - .( = 1) - .foo() - } - val aLambda: Function0 field = local fun () { MyEnum.Z.( = 1) @@ -37,17 +18,17 @@ open enum class MyEnum : Enum { val anObject: Any field = { // BLOCK local class { + init { + MyEnum.Z.( = 1) + MyEnum.Z.foo() + } + constructor() /* primary */ { super/*Any*/() /* () */ } - init { - MyEnum.Z.( = 1) - MyEnum.Z.foo() - } - fun test() { MyEnum.Z.( = 1) MyEnum.Z.foo() @@ -59,13 +40,34 @@ open enum class MyEnum : Enum { } get + private constructor() /* primary */ { + super/*MyEnum*/() /*~> Unit */ + /* () */ + + } + + fun bar() { + .( = 1) + .foo() + } + + fun foo() { + } + } - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): MyEnum /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } + diff --git a/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.fir.ir.txt b/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.fir.ir.txt index 30364fadc49..8ead21bf727 100644 --- a/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.fir.ir.txt @@ -1,7 +1,4 @@ FILE fqName: fileName:/exclExclOnPlatformType.kt - FUN name:use visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:kotlin.Any - BLOCK_BODY FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun use (a: kotlin.Any): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -16,3 +13,6 @@ FILE fqName: fileName:/exclExclOnPlatformType.kt : @[FlexibleNullability] kotlin.String arg0: CALL 'public open fun getProperty (p0: @[FlexibleNullability] kotlin.String?): @[FlexibleNullability] kotlin.String? declared in java.lang.System' type=@[FlexibleNullability] kotlin.String? origin=null p0: CONST String type=kotlin.String value="abc" + FUN name:use visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.fir.kt.txt b/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.fir.kt.txt index 953814ac05f..9a53b777bf7 100644 --- a/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.fir.kt.txt @@ -1,8 +1,8 @@ -fun use(a: Any) { -} - fun test() { use(a = CHECK_NOT_NULL(arg0 = WeakReference<@FlexibleNullability String?>(p0 = "").get())) use(a = CHECK_NOT_NULL<@FlexibleNullability String>(arg0 = getProperty(p0 = "abc"))) } +fun use(a: Any) { +} + diff --git a/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.ir.txt b/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.ir.txt index f53769bb82b..73b8d666bcf 100644 --- a/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.ir.txt +++ b/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.ir.txt @@ -1,7 +1,4 @@ FILE fqName: fileName:/exclExclOnPlatformType.kt - FUN name:use visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:kotlin.Any - BLOCK_BODY FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun use (a: kotlin.Any): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -16,3 +13,6 @@ FILE fqName: fileName:/exclExclOnPlatformType.kt : kotlin.String arg0: CALL 'public open fun getProperty (p0: @[FlexibleNullability] kotlin.String?): @[FlexibleNullability] kotlin.String? declared in java.lang.System' type=@[FlexibleNullability] kotlin.String? origin=null p0: CONST String type=kotlin.String value="abc" + FUN name:use visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.kt.txt b/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.kt.txt index 5764056ce36..abe4f4dbdbc 100644 --- a/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.kt.txt +++ b/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.kt.txt @@ -1,7 +1,8 @@ -fun use(a: Any) { -} - fun test() { use(a = CHECK_NOT_NULL(arg0 = WeakReference<@FlexibleNullability String?>(p0 = "").get())) use(a = CHECK_NOT_NULL(arg0 = getProperty(p0 = "abc"))) } + +fun use(a: Any) { +} + diff --git a/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.fir.ir.txt b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.fir.ir.txt index 29c1da32de1..0106a7e5a2d 100644 --- a/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.fir.ir.txt @@ -1,23 +1,19 @@ FILE fqName: fileName:/exhaustiveWhenElseBranch.kt CLASS ENUM_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Enum<.A>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + ENUM_ENTRY name:V1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .A' CONSTRUCTOR visibility:private <> () returnType:.A [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' : .A INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Enum<.A>]' - ENUM_ENTRY name:V1 - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .A' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.A> - SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.A VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.A> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.A> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>, other:.A) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -36,6 +32,10 @@ FILE fqName: fileName:/exhaustiveWhenElseBranch.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.A> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -54,66 +54,17 @@ FILE fqName: fileName:/exhaustiveWhenElseBranch.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - FUN name:testVariableAssignment_throws visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - VAR name:x type:kotlin.Int [val] - BLOCK type=kotlin.Unit origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] - GET_VAR 'a: .A declared in .testVariableAssignment_throws' type=.A origin=null - WHEN type=kotlin.Unit origin=WHEN - 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: .A declared in .testVariableAssignment_throws' type=.A origin=null - arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A - then: SET_VAR 'val x: kotlin.Int declared in .testVariableAssignment_throws' type=kotlin.Unit origin=EQ - CONST Int type=kotlin.Int value=11 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null - FUN name:testStatement_empty visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.A [val] - GET_VAR 'a: .A declared in .testStatement_empty' type=.A origin=null - WHEN type=kotlin.Int origin=WHEN - 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: .A declared in .testStatement_empty' type=.A origin=null - arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A - then: CONST Int type=kotlin.Int value=1 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null - FUN name:testParenthesized_throwsJvm visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.A [val] - GET_VAR 'a: .A declared in .testParenthesized_throwsJvm' type=.A origin=null - WHEN type=kotlin.Int origin=WHEN - 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: .A declared in .testParenthesized_throwsJvm' type=.A origin=null - arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A - then: CONST Int type=kotlin.Int value=1 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null FUN name:testAnnotated_throwsJvm visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.A [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] GET_VAR 'a: .A declared in .testAnnotated_throwsJvm' type=.A origin=null WHEN type=kotlin.Int origin=WHEN 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: .A declared in .testAnnotated_throwsJvm' type=.A origin=null + arg0: GET_VAR 'val tmp_0: .A declared in .testAnnotated_throwsJvm' type=.A origin=null arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A then: CONST Int type=kotlin.Int value=1 BRANCH @@ -124,36 +75,36 @@ FILE fqName: fileName:/exhaustiveWhenElseBranch.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testExpression_throws (a: .A): kotlin.Int declared in ' BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.A [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.A [val] GET_VAR 'a: .A declared in .testExpression_throws' type=.A origin=null WHEN type=kotlin.Int origin=WHEN 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_4: .A declared in .testExpression_throws' type=.A origin=null + arg0: GET_VAR 'val tmp_1: .A declared in .testExpression_throws' type=.A origin=null arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A then: CONST Int type=kotlin.Int value=1 BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null - FUN name:testIfTheElseStatement_empty visibility:public modality:FINAL <> (a:.A, flag:kotlin.Boolean) returnType:kotlin.Unit + FUN name:testIfTheElseAnnotated_throwsJvm visibility:public modality:FINAL <> (a:.A, flag:kotlin.Boolean) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A VALUE_PARAMETER name:flag index:1 type:kotlin.Boolean BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit WHEN type=kotlin.Int origin=IF BRANCH - if: GET_VAR 'flag: kotlin.Boolean declared in .testIfTheElseStatement_empty' type=kotlin.Boolean origin=null + if: GET_VAR 'flag: kotlin.Boolean declared in .testIfTheElseAnnotated_throwsJvm' type=kotlin.Boolean origin=null then: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: BLOCK type=kotlin.Int origin=null BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:.A [val] - GET_VAR 'a: .A declared in .testIfTheElseStatement_empty' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.A [val] + GET_VAR 'a: .A declared in .testIfTheElseAnnotated_throwsJvm' type=.A origin=null WHEN type=kotlin.Int origin=WHEN 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_5: .A declared in .testIfTheElseStatement_empty' type=.A origin=null + arg0: GET_VAR 'val tmp_2: .A declared in .testIfTheElseAnnotated_throwsJvm' type=.A origin=null arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A then: CONST Int type=kotlin.Int value=1 BRANCH @@ -172,36 +123,36 @@ FILE fqName: fileName:/exhaustiveWhenElseBranch.kt if: CONST Boolean type=kotlin.Boolean value=true then: BLOCK type=kotlin.Int origin=null BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.A [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.A [val] GET_VAR 'a: .A declared in .testIfTheElseParenthesized_throwsJvm' type=.A origin=null WHEN type=kotlin.Int origin=WHEN 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_6: .A declared in .testIfTheElseParenthesized_throwsJvm' type=.A origin=null + arg0: GET_VAR 'val tmp_3: .A declared in .testIfTheElseParenthesized_throwsJvm' type=.A origin=null arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A then: CONST Int type=kotlin.Int value=1 BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null - FUN name:testIfTheElseAnnotated_throwsJvm visibility:public modality:FINAL <> (a:.A, flag:kotlin.Boolean) returnType:kotlin.Unit + FUN name:testIfTheElseStatement_empty visibility:public modality:FINAL <> (a:.A, flag:kotlin.Boolean) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A VALUE_PARAMETER name:flag index:1 type:kotlin.Boolean BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit WHEN type=kotlin.Int origin=IF BRANCH - if: GET_VAR 'flag: kotlin.Boolean declared in .testIfTheElseAnnotated_throwsJvm' type=kotlin.Boolean origin=null + if: GET_VAR 'flag: kotlin.Boolean declared in .testIfTheElseStatement_empty' type=kotlin.Boolean origin=null then: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: BLOCK type=kotlin.Int origin=null BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:.A [val] - GET_VAR 'a: .A declared in .testIfTheElseAnnotated_throwsJvm' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.A [val] + GET_VAR 'a: .A declared in .testIfTheElseStatement_empty' type=.A origin=null WHEN type=kotlin.Int origin=WHEN 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_7: .A declared in .testIfTheElseAnnotated_throwsJvm' type=.A origin=null + arg0: GET_VAR 'val tmp_4: .A declared in .testIfTheElseStatement_empty' type=.A origin=null arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A then: CONST Int type=kotlin.Int value=1 BRANCH @@ -217,14 +168,63 @@ FILE fqName: fileName:/exhaustiveWhenElseBranch.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .testLambdaResultExpression_throws' BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:.A [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:.A [val] GET_VAR 'a: .A declared in .testLambdaResultExpression_throws' type=.A origin=null WHEN type=kotlin.Int origin=WHEN 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_8: .A declared in .testLambdaResultExpression_throws.' type=.A origin=null + arg0: GET_VAR 'val tmp_5: .A declared in .testLambdaResultExpression_throws.' type=.A origin=null arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A then: CONST Int type=kotlin.Int value=1 BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null + FUN name:testParenthesized_throwsJvm visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.A [val] + GET_VAR 'a: .A declared in .testParenthesized_throwsJvm' type=.A origin=null + WHEN type=kotlin.Int origin=WHEN + 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_6: .A declared in .testParenthesized_throwsJvm' type=.A origin=null + arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A + then: CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null + FUN name:testStatement_empty visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:.A [val] + GET_VAR 'a: .A declared in .testStatement_empty' type=.A origin=null + WHEN type=kotlin.Int origin=WHEN + 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_7: .A declared in .testStatement_empty' type=.A origin=null + arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A + then: CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null + FUN name:testVariableAssignment_throws visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + VAR name:x type:kotlin.Int [val] + BLOCK type=kotlin.Unit origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:.A [val] + GET_VAR 'a: .A declared in .testVariableAssignment_throws' type=.A origin=null + WHEN type=kotlin.Unit origin=WHEN + 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_8: .A declared in .testVariableAssignment_throws' type=.A origin=null + arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A + then: SET_VAR 'val x: kotlin.Int declared in .testVariableAssignment_throws' type=kotlin.Unit origin=EQ + CONST Int type=kotlin.Int value=11 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null diff --git a/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.fir.kt.txt b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.fir.kt.txt index 2c8a0efe76e..a448d51305d 100644 --- a/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.fir.kt.txt @@ -1,57 +1,26 @@ enum class A : Enum { + V1 = A() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - V1 = A() + fun valueOf(value: String): A /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): A /* Synthetic body for ENUM_VALUEOF */ - val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } -fun testVariableAssignment_throws(a: A) { - val x: Int +fun testAnnotated_throwsJvm(a: A) { { // BLOCK val tmp_0: A = a when { - EQEQ(arg0 = tmp_0, arg1 = A.V1) -> x = 11 - else -> noWhenBranchMatchedException() - } - } -} - -fun testStatement_empty(a: A) { - { // BLOCK - val tmp_1: A = a - when { - EQEQ(arg0 = tmp_1, arg1 = A.V1) -> 1 - else -> noWhenBranchMatchedException() - } - } /*~> Unit */ -} - -fun testParenthesized_throwsJvm(a: A) { - { // BLOCK - val tmp_2: A = a - when { - EQEQ(arg0 = tmp_2, arg1 = A.V1) -> 1 - else -> noWhenBranchMatchedException() - } - } /*~> Unit */ -} - -fun testAnnotated_throwsJvm(a: A) { - { // BLOCK - val tmp_3: A = a - when { - EQEQ(arg0 = tmp_3, arg1 = A.V1) -> 1 + EQEQ(arg0 = tmp_0, arg1 = A.V1) -> 1 else -> noWhenBranchMatchedException() } } /*~> Unit */ @@ -59,22 +28,22 @@ fun testAnnotated_throwsJvm(a: A) { fun testExpression_throws(a: A): Int { return { // BLOCK - val tmp_4: A = a + val tmp_1: A = a when { - EQEQ(arg0 = tmp_4, arg1 = A.V1) -> 1 + EQEQ(arg0 = tmp_1, arg1 = A.V1) -> 1 else -> noWhenBranchMatchedException() } } } -fun testIfTheElseStatement_empty(a: A, flag: Boolean) { +fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean) { when { flag -> 0 else -> { // BLOCK { // BLOCK - val tmp_5: A = a + val tmp_2: A = a when { - EQEQ(arg0 = tmp_5, arg1 = A.V1) -> 1 + EQEQ(arg0 = tmp_2, arg1 = A.V1) -> 1 else -> noWhenBranchMatchedException() } } @@ -87,9 +56,9 @@ fun testIfTheElseParenthesized_throwsJvm(a: A, flag: Boolean) { flag -> 0 else -> { // BLOCK { // BLOCK - val tmp_6: A = a + val tmp_3: A = a when { - EQEQ(arg0 = tmp_6, arg1 = A.V1) -> 1 + EQEQ(arg0 = tmp_3, arg1 = A.V1) -> 1 else -> noWhenBranchMatchedException() } } @@ -97,14 +66,14 @@ fun testIfTheElseParenthesized_throwsJvm(a: A, flag: Boolean) { } /*~> Unit */ } -fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean) { +fun testIfTheElseStatement_empty(a: A, flag: Boolean) { when { flag -> 0 else -> { // BLOCK { // BLOCK - val tmp_7: A = a + val tmp_4: A = a when { - EQEQ(arg0 = tmp_7, arg1 = A.V1) -> 1 + EQEQ(arg0 = tmp_4, arg1 = A.V1) -> 1 else -> noWhenBranchMatchedException() } } @@ -115,9 +84,9 @@ fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean) { fun testLambdaResultExpression_throws(a: A) { local fun (): Int { return { // BLOCK - val tmp_8: A = a + val tmp_5: A = a when { - EQEQ(arg0 = tmp_8, arg1 = A.V1) -> 1 + EQEQ(arg0 = tmp_5, arg1 = A.V1) -> 1 else -> noWhenBranchMatchedException() } } @@ -125,3 +94,34 @@ fun testLambdaResultExpression_throws(a: A) { .invoke() /*~> Unit */ } +fun testParenthesized_throwsJvm(a: A) { + { // BLOCK + val tmp_6: A = a + when { + EQEQ(arg0 = tmp_6, arg1 = A.V1) -> 1 + else -> noWhenBranchMatchedException() + } + } /*~> Unit */ +} + +fun testStatement_empty(a: A) { + { // BLOCK + val tmp_7: A = a + when { + EQEQ(arg0 = tmp_7, arg1 = A.V1) -> 1 + else -> noWhenBranchMatchedException() + } + } /*~> Unit */ +} + +fun testVariableAssignment_throws(a: A) { + val x: Int + { // BLOCK + val tmp_8: A = a + when { + EQEQ(arg0 = tmp_8, arg1 = A.V1) -> x = 11 + else -> noWhenBranchMatchedException() + } + } +} + diff --git a/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.ir.txt b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.ir.txt index 58487dbfa2b..4abd71f32d6 100644 --- a/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.ir.txt +++ b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.ir.txt @@ -1,32 +1,19 @@ FILE fqName: fileName:/exhaustiveWhenElseBranch.kt CLASS ENUM_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Enum<.A>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + ENUM_ENTRY name:V1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .A' CONSTRUCTOR visibility:private <> () returnType:.A [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' : .A INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Enum<.A>]' - ENUM_ENTRY name:V1 - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .A' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.A + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.A> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>, other:.A) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -45,68 +32,38 @@ FILE fqName: fileName:/exhaustiveWhenElseBranch.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.A> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.A - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.A> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN name:testVariableAssignment_throws visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - VAR name:x type:kotlin.Int [val] - BLOCK type=kotlin.Unit origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] - GET_VAR 'a: .A declared in .testVariableAssignment_throws' type=.A origin=null - WHEN type=kotlin.Unit origin=WHEN - 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: .A declared in .testVariableAssignment_throws' type=.A origin=null - arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A - then: SET_VAR 'val x: kotlin.Int declared in .testVariableAssignment_throws' type=kotlin.Unit origin=EQ - CONST Int type=kotlin.Int value=11 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null - FUN name:testStatement_empty visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - BLOCK type=kotlin.Unit origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.A [val] - GET_VAR 'a: .A declared in .testStatement_empty' type=.A origin=null - WHEN type=kotlin.Unit origin=WHEN - 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: .A declared in .testStatement_empty' type=.A origin=null - arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A - then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CONST Int type=kotlin.Int value=1 - FUN name:testParenthesized_throwsJvm visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - BLOCK type=kotlin.Unit origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.A [val] - GET_VAR 'a: .A declared in .testParenthesized_throwsJvm' type=.A origin=null - WHEN type=kotlin.Unit origin=WHEN - 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: .A declared in .testParenthesized_throwsJvm' type=.A origin=null - arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A - then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CONST Int type=kotlin.Int value=1 + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.A>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.A> FUN name:testAnnotated_throwsJvm visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY BLOCK type=kotlin.Unit origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.A [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] GET_VAR 'a: .A declared in .testAnnotated_throwsJvm' type=.A origin=null WHEN type=kotlin.Unit origin=WHEN 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: .A declared in .testAnnotated_throwsJvm' type=.A origin=null + arg0: GET_VAR 'val tmp_0: .A declared in .testAnnotated_throwsJvm' type=.A origin=null arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CONST Int type=kotlin.Int value=1 @@ -115,36 +72,36 @@ FILE fqName: fileName:/exhaustiveWhenElseBranch.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testExpression_throws (a: .A): kotlin.Int declared in ' BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.A [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.A [val] GET_VAR 'a: .A declared in .testExpression_throws' type=.A origin=null WHEN type=kotlin.Int origin=WHEN 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_4: .A declared in .testExpression_throws' type=.A origin=null + arg0: GET_VAR 'val tmp_1: .A declared in .testExpression_throws' type=.A origin=null arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A then: CONST Int type=kotlin.Int value=1 BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null - FUN name:testIfTheElseStatement_empty visibility:public modality:FINAL <> (a:.A, flag:kotlin.Boolean) returnType:kotlin.Unit + FUN name:testIfTheElseAnnotated_throwsJvm visibility:public modality:FINAL <> (a:.A, flag:kotlin.Boolean) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A VALUE_PARAMETER name:flag index:1 type:kotlin.Boolean BLOCK_BODY WHEN type=kotlin.Unit origin=IF BRANCH - if: GET_VAR 'flag: kotlin.Boolean declared in .testIfTheElseStatement_empty' type=kotlin.Boolean origin=null + if: GET_VAR 'flag: kotlin.Boolean declared in .testIfTheElseAnnotated_throwsJvm' type=kotlin.Boolean origin=null then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: BLOCK type=kotlin.Unit origin=null BLOCK type=kotlin.Unit origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:.A [val] - GET_VAR 'a: .A declared in .testIfTheElseStatement_empty' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.A [val] + GET_VAR 'a: .A declared in .testIfTheElseAnnotated_throwsJvm' type=.A origin=null WHEN type=kotlin.Unit origin=WHEN 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_5: .A declared in .testIfTheElseStatement_empty' type=.A origin=null + arg0: GET_VAR 'val tmp_2: .A declared in .testIfTheElseAnnotated_throwsJvm' type=.A origin=null arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CONST Int type=kotlin.Int value=1 @@ -161,34 +118,34 @@ FILE fqName: fileName:/exhaustiveWhenElseBranch.kt if: CONST Boolean type=kotlin.Boolean value=true then: BLOCK type=kotlin.Unit origin=null BLOCK type=kotlin.Unit origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.A [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.A [val] GET_VAR 'a: .A declared in .testIfTheElseParenthesized_throwsJvm' type=.A origin=null WHEN type=kotlin.Unit origin=WHEN 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_6: .A declared in .testIfTheElseParenthesized_throwsJvm' type=.A origin=null + arg0: GET_VAR 'val tmp_3: .A declared in .testIfTheElseParenthesized_throwsJvm' type=.A origin=null arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CONST Int type=kotlin.Int value=1 - FUN name:testIfTheElseAnnotated_throwsJvm visibility:public modality:FINAL <> (a:.A, flag:kotlin.Boolean) returnType:kotlin.Unit + FUN name:testIfTheElseStatement_empty visibility:public modality:FINAL <> (a:.A, flag:kotlin.Boolean) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A VALUE_PARAMETER name:flag index:1 type:kotlin.Boolean BLOCK_BODY WHEN type=kotlin.Unit origin=IF BRANCH - if: GET_VAR 'flag: kotlin.Boolean declared in .testIfTheElseAnnotated_throwsJvm' type=kotlin.Boolean origin=null + if: GET_VAR 'flag: kotlin.Boolean declared in .testIfTheElseStatement_empty' type=kotlin.Boolean origin=null then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: BLOCK type=kotlin.Unit origin=null BLOCK type=kotlin.Unit origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:.A [val] - GET_VAR 'a: .A declared in .testIfTheElseAnnotated_throwsJvm' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.A [val] + GET_VAR 'a: .A declared in .testIfTheElseStatement_empty' type=.A origin=null WHEN type=kotlin.Unit origin=WHEN 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_7: .A declared in .testIfTheElseAnnotated_throwsJvm' type=.A origin=null + arg0: GET_VAR 'val tmp_4: .A declared in .testIfTheElseStatement_empty' type=.A origin=null arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CONST Int type=kotlin.Int value=1 @@ -202,14 +159,57 @@ FILE fqName: fileName:/exhaustiveWhenElseBranch.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .testLambdaResultExpression_throws' BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:.A [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:.A [val] GET_VAR 'a: .A declared in .testLambdaResultExpression_throws' type=.A origin=null WHEN type=kotlin.Int origin=WHEN 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_8: .A declared in .testLambdaResultExpression_throws.' type=.A origin=null + arg0: GET_VAR 'val tmp_5: .A declared in .testLambdaResultExpression_throws.' type=.A origin=null arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A then: CONST Int type=kotlin.Int value=1 BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null + FUN name:testParenthesized_throwsJvm visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + BLOCK type=kotlin.Unit origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.A [val] + GET_VAR 'a: .A declared in .testParenthesized_throwsJvm' type=.A origin=null + WHEN type=kotlin.Unit origin=WHEN + 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_6: .A declared in .testParenthesized_throwsJvm' type=.A origin=null + arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A + then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CONST Int type=kotlin.Int value=1 + FUN name:testStatement_empty visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + BLOCK type=kotlin.Unit origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:.A [val] + GET_VAR 'a: .A declared in .testStatement_empty' type=.A origin=null + WHEN type=kotlin.Unit origin=WHEN + 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_7: .A declared in .testStatement_empty' type=.A origin=null + arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A + then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CONST Int type=kotlin.Int value=1 + FUN name:testVariableAssignment_throws visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + VAR name:x type:kotlin.Int [val] + BLOCK type=kotlin.Unit origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:.A [val] + GET_VAR 'a: .A declared in .testVariableAssignment_throws' type=.A origin=null + WHEN type=kotlin.Unit origin=WHEN + 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_8: .A declared in .testVariableAssignment_throws' type=.A origin=null + arg1: GET_ENUM 'ENUM_ENTRY name:V1' type=.A + then: SET_VAR 'val x: kotlin.Int declared in .testVariableAssignment_throws' type=kotlin.Unit origin=EQ + CONST Int type=kotlin.Int value=11 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun noWhenBranchMatchedException (): kotlin.Nothing declared in kotlin.internal.ir' type=kotlin.Nothing origin=null diff --git a/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt.txt b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt.txt index fb46e628bec..2d638730a8e 100644 --- a/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt.txt +++ b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt.txt @@ -1,77 +1,48 @@ enum class A : Enum { + V1 = A() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - V1 = A() + fun valueOf(value: String): A /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): A /* Synthetic body for ENUM_VALUEOF */ - val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } -fun testVariableAssignment_throws(a: A) { - val x: Int +fun testAnnotated_throwsJvm(a: A) { { // BLOCK val tmp_0: A = a when { - EQEQ(arg0 = tmp_0, arg1 = A.V1) -> x = 11 - else -> noWhenBranchMatchedException() - } - } -} - -fun testStatement_empty(a: A) { - { // BLOCK - val tmp_1: A = a - when { - EQEQ(arg0 = tmp_1, arg1 = A.V1) -> 1 /*~> Unit */ - } - } -} - -fun testParenthesized_throwsJvm(a: A) { - { // BLOCK - val tmp_2: A = a - when { - EQEQ(arg0 = tmp_2, arg1 = A.V1) -> 1 /*~> Unit */ - } - } -} - -fun testAnnotated_throwsJvm(a: A) { - { // BLOCK - val tmp_3: A = a - when { - EQEQ(arg0 = tmp_3, arg1 = A.V1) -> 1 /*~> Unit */ + EQEQ(arg0 = tmp_0, arg1 = A.V1) -> 1 /*~> Unit */ } } } fun testExpression_throws(a: A): Int { return { // BLOCK - val tmp_4: A = a + val tmp_1: A = a when { - EQEQ(arg0 = tmp_4, arg1 = A.V1) -> 1 + EQEQ(arg0 = tmp_1, arg1 = A.V1) -> 1 else -> noWhenBranchMatchedException() } } } -fun testIfTheElseStatement_empty(a: A, flag: Boolean) { +fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean) { when { flag -> 0 /*~> Unit */ else -> { // BLOCK { // BLOCK - val tmp_5: A = a + val tmp_2: A = a when { - EQEQ(arg0 = tmp_5, arg1 = A.V1) -> 1 /*~> Unit */ + EQEQ(arg0 = tmp_2, arg1 = A.V1) -> 1 /*~> Unit */ } } } @@ -83,23 +54,23 @@ fun testIfTheElseParenthesized_throwsJvm(a: A, flag: Boolean) { flag -> 0 /*~> Unit */ else -> { // BLOCK { // BLOCK - val tmp_6: A = a + val tmp_3: A = a when { - EQEQ(arg0 = tmp_6, arg1 = A.V1) -> 1 /*~> Unit */ + EQEQ(arg0 = tmp_3, arg1 = A.V1) -> 1 /*~> Unit */ } } } } } -fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean) { +fun testIfTheElseStatement_empty(a: A, flag: Boolean) { when { flag -> 0 /*~> Unit */ else -> { // BLOCK { // BLOCK - val tmp_7: A = a + val tmp_4: A = a when { - EQEQ(arg0 = tmp_7, arg1 = A.V1) -> 1 /*~> Unit */ + EQEQ(arg0 = tmp_4, arg1 = A.V1) -> 1 /*~> Unit */ } } } @@ -109,12 +80,42 @@ fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean) { fun testLambdaResultExpression_throws(a: A) { local fun (): Int { return { // BLOCK - val tmp_8: A = a + val tmp_5: A = a when { - EQEQ(arg0 = tmp_8, arg1 = A.V1) -> 1 + EQEQ(arg0 = tmp_5, arg1 = A.V1) -> 1 else -> noWhenBranchMatchedException() } } } .invoke() /*~> Unit */ } + +fun testParenthesized_throwsJvm(a: A) { + { // BLOCK + val tmp_6: A = a + when { + EQEQ(arg0 = tmp_6, arg1 = A.V1) -> 1 /*~> Unit */ + } + } +} + +fun testStatement_empty(a: A) { + { // BLOCK + val tmp_7: A = a + when { + EQEQ(arg0 = tmp_7, arg1 = A.V1) -> 1 /*~> Unit */ + } + } +} + +fun testVariableAssignment_throws(a: A) { + val x: Int + { // BLOCK + val tmp_8: A = a + when { + EQEQ(arg0 = tmp_8, arg1 = A.V1) -> x = 11 + else -> noWhenBranchMatchedException() + } + } +} + diff --git a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.ir.txt b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.ir.txt index 913f6586b5c..f341b57f294 100644 --- a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.ir.txt +++ b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.ir.txt @@ -1,4 +1,10 @@ FILE fqName: fileName:/extensionPropertyGetterCall.kt + FUN name:test5 visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.String + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.String declared in ' + CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=GET_PROPERTY + $receiver: GET_VAR ': kotlin.String declared in .test5' type=kotlin.String origin=null PROPERTY name:okext visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.String correspondingProperty: PROPERTY name:okext visibility:public modality:FINAL [val] @@ -6,9 +12,3 @@ FILE fqName: fileName:/extensionPropertyGetterCall.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' CONST String type=kotlin.String value="OK" - FUN name:test5 visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.String - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.String declared in ' - CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=GET_PROPERTY - $receiver: GET_VAR ': kotlin.String declared in .test5' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt.txt b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt.txt index bfc10654dd7..e2d7b84d7fb 100644 --- a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt.txt +++ b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt.txt @@ -1,8 +1,9 @@ +fun String.test5(): String { + return .() +} + val String.okext: String get(): String { return "OK" } -fun String.test5(): String { - return .() -} diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.ir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.ir.txt index 99bb78bf82c..3a8621bdd89 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.ir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.ir.txt @@ -7,6 +7,22 @@ FILE fqName: fileName:/floatingPointCompareTo.kt CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null $this: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Int declared in ' + CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + other: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + FUN name:test1fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float) returnType:kotlin.Int + $receiver: VALUE_PARAMETER name: type:kotlin.Float + VALUE_PARAMETER name:x index:0 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1fr (x: kotlin.Float): kotlin.Int declared in ' + CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null + $this: GET_VAR ': kotlin.Float declared in .test1fr' type=kotlin.Float origin=null + other: GET_VAR 'x: kotlin.Float declared in .test1fr' type=kotlin.Float origin=null FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -25,6 +41,42 @@ FILE fqName: fileName:/floatingPointCompareTo.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null + other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test2fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2fr (x: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test2fr' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null + $this: GET_VAR ': kotlin.Float declared in .test2fr' type=kotlin.Float origin=null + other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test2fr' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -51,32 +103,6 @@ FILE fqName: fileName:/floatingPointCompareTo.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Int - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Int declared in ' - CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null - other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null - arg1: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -103,28 +129,20 @@ FILE fqName: fileName:/floatingPointCompareTo.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + FUN name:test3fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + RETURN type=kotlin.Nothing from='public final fun test3fr (x: kotlin.Any): kotlin.Boolean declared in ' WHEN type=kotlin.Boolean origin=ANDAND BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: CALL 'public final fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null - $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + $this: GET_VAR ': kotlin.Float declared in .test3fr' type=kotlin.Float origin=null other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null arg1: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -155,46 +173,28 @@ FILE fqName: fileName:/floatingPointCompareTo.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float) returnType:kotlin.Int - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1fr (x: kotlin.Float): kotlin.Int declared in ' - CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_VAR ': kotlin.Float declared in .test1fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Float declared in .test1fr' type=kotlin.Float origin=null - FUN name:test2fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float + FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2fr (x: kotlin.Any): kotlin.Boolean declared in ' + RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' WHEN type=kotlin.Boolean origin=ANDAND BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .test2fr' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_VAR ': kotlin.Float declared in .test2fr' type=kotlin.Float origin=null - other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .test2fr' type=kotlin.Any origin=null - arg1: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test3fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3fr (x: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: CALL 'public final fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_VAR ': kotlin.Float declared in .test3fr' type=kotlin.Float origin=null + $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null arg1: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.kt.txt index dcac0bdffa2..2a45df97020 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.kt.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.kt.txt @@ -2,6 +2,14 @@ fun test1d(x: Double, y: Double): Int { return x.compareTo(other = y) } +fun test1f(x: Float, y: Float): Int { + return x.compareTo(other = y) +} + +fun Float.test1fr(x: Float): Int { + return .compareTo(other = x) +} + fun test2d(x: Double, y: Any): Boolean { return when { y is Double -> EQEQ(arg0 = x.compareTo(other = y /*as Double */), arg1 = 0) @@ -9,6 +17,20 @@ fun test2d(x: Double, y: Any): Boolean { } } +fun test2f(x: Float, y: Any): Boolean { + return when { + y is Float -> EQEQ(arg0 = x.compareTo(other = y /*as Float */), arg1 = 0) + else -> false + } +} + +fun Float.test2fr(x: Any): Boolean { + return when { + x is Float -> EQEQ(arg0 = .compareTo(other = x /*as Float */), arg1 = 0) + else -> false + } +} + fun test3d(x: Any, y: Any): Boolean { return when { when { @@ -19,17 +41,6 @@ fun test3d(x: Any, y: Any): Boolean { } } -fun test1f(x: Float, y: Float): Int { - return x.compareTo(other = y) -} - -fun test2f(x: Float, y: Any): Boolean { - return when { - y is Float -> EQEQ(arg0 = x.compareTo(other = y /*as Float */), arg1 = 0) - else -> false - } -} - fun test3f(x: Any, y: Any): Boolean { return when { when { @@ -40,12 +51,9 @@ fun test3f(x: Any, y: Any): Boolean { } } -fun testFD(x: Any, y: Any): Boolean { +fun Float.test3fr(x: Any): Boolean { return when { - when { - x is Float -> y is Double - else -> false - } -> EQEQ(arg0 = x /*as Float */.compareTo(other = y /*as Double */), arg1 = 0) + x is Double -> EQEQ(arg0 = .compareTo(other = x /*as Double */), arg1 = 0) else -> false } } @@ -60,20 +68,13 @@ fun testDF(x: Any, y: Any): Boolean { } } -fun Float.test1fr(x: Float): Int { - return .compareTo(other = x) -} - -fun Float.test2fr(x: Any): Boolean { +fun testFD(x: Any, y: Any): Boolean { return when { - x is Float -> EQEQ(arg0 = .compareTo(other = x /*as Float */), arg1 = 0) + when { + x is Float -> y is Double + else -> false + } -> EQEQ(arg0 = x /*as Float */.compareTo(other = y /*as Double */), arg1 = 0) else -> false } } -fun Float.test3fr(x: Any): Boolean { - return when { - x is Double -> EQEQ(arg0 = .compareTo(other = x /*as Double */), arg1 = 0) - else -> false - } -} diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.ir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.ir.txt index 996dfb6443f..833704b26d9 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.ir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.ir.txt @@ -7,6 +7,14 @@ FILE fqName: fileName:/floatingPointEqeq.kt CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null arg1: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Double? @@ -15,6 +23,14 @@ FILE fqName: fileName:/floatingPointEqeq.kt CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'x: kotlin.Double declared in .test2d' type=kotlin.Double origin=null arg1: GET_VAR 'y: kotlin.Double? declared in .test2d' type=kotlin.Double? origin=null + FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' + CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -23,6 +39,14 @@ FILE fqName: fileName:/floatingPointEqeq.kt 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 'x: kotlin.Double declared in .test3d' type=kotlin.Double origin=null arg1: GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + 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 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Number @@ -31,6 +55,14 @@ FILE fqName: fileName:/floatingPointEqeq.kt 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 'x: kotlin.Double declared in .test4d' type=kotlin.Double origin=null arg1: GET_VAR 'y: kotlin.Number declared in .test4d' type=kotlin.Number origin=null + FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' + 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 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -47,6 +79,22 @@ FILE fqName: fileName:/floatingPointEqeq.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + then: CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null + arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false FUN name:test6d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -71,54 +119,6 @@ FILE fqName: fileName:/floatingPointEqeq.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' - CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null - FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - 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 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null - FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Number - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' - 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 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null - FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null - then: CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null - arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false FUN name:test6f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -143,31 +143,6 @@ FILE fqName: fileName:/floatingPointEqeq.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null - $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -193,3 +168,28 @@ FILE fqName: fileName:/floatingPointEqeq.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null + $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.kt.txt index bf8d04a8997..7e89bea0287 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.kt.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.kt.txt @@ -2,18 +2,34 @@ fun test1d(x: Double, y: Double): Boolean { return ieee754equals(arg0 = x, arg1 = y) } +fun test1f(x: Float, y: Float): Boolean { + return ieee754equals(arg0 = x, arg1 = y) +} + fun test2d(x: Double, y: Double?): Boolean { return ieee754equals(arg0 = x, arg1 = y) } +fun test2f(x: Float, y: Float?): Boolean { + return ieee754equals(arg0 = x, arg1 = y) +} + fun test3d(x: Double, y: Any): Boolean { return EQEQ(arg0 = x, arg1 = y) } +fun test3f(x: Float, y: Any): Boolean { + return EQEQ(arg0 = x, arg1 = y) +} + fun test4d(x: Double, y: Number): Boolean { return EQEQ(arg0 = x, arg1 = y) } +fun test4f(x: Float, y: Number): Boolean { + return EQEQ(arg0 = x, arg1 = y) +} + fun test5d(x: Double, y: Any): Boolean { return when { y is Double -> ieee754equals(arg0 = x, arg1 = y /*as Double */) @@ -21,6 +37,13 @@ fun test5d(x: Double, y: Any): Boolean { } } +fun test5f(x: Float, y: Any): Boolean { + return when { + y is Float -> ieee754equals(arg0 = x, arg1 = y /*as Float */) + else -> false + } +} + fun test6d(x: Any, y: Any): Boolean { return when { when { @@ -31,29 +54,6 @@ fun test6d(x: Any, y: Any): Boolean { } } -fun test1f(x: Float, y: Float): Boolean { - return ieee754equals(arg0 = x, arg1 = y) -} - -fun test2f(x: Float, y: Float?): Boolean { - return ieee754equals(arg0 = x, arg1 = y) -} - -fun test3f(x: Float, y: Any): Boolean { - return EQEQ(arg0 = x, arg1 = y) -} - -fun test4f(x: Float, y: Number): Boolean { - return EQEQ(arg0 = x, arg1 = y) -} - -fun test5f(x: Float, y: Any): Boolean { - return when { - y is Float -> ieee754equals(arg0 = x, arg1 = y /*as Float */) - else -> false - } -} - fun test6f(x: Any, y: Any): Boolean { return when { when { @@ -64,6 +64,16 @@ fun test6f(x: Any, y: Any): Boolean { } } +fun testDF(x: Any, y: Any): Boolean { + return when { + when { + x is Double -> y is Float + else -> false + } -> ieee754equals(arg0 = x /*as Double */, arg1 = y /*as Float */.toDouble()) + else -> false + } +} + fun testFD(x: Any, y: Any): Boolean { return when { when { @@ -74,12 +84,3 @@ fun testFD(x: Any, y: Any): Boolean { } } -fun testDF(x: Any, y: Any): Boolean { - return when { - when { - x is Double -> y is Float - else -> false - } -> ieee754equals(arg0 = x /*as Double */, arg1 = y /*as Float */.toDouble()) - else -> false - } -} diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.ir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.ir.txt index e5b9513e680..147a6598826 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.ir.txt @@ -7,6 +7,22 @@ FILE fqName: fileName:/floatingPointEquals.kt CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null $this: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + other: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + FUN name:test1fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float + VALUE_PARAMETER name:x index:0 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1fr (x: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR ': kotlin.Float declared in .test1fr' type=kotlin.Float origin=null + other: GET_VAR 'x: kotlin.Float declared in .test1fr' type=kotlin.Float origin=null FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Double? @@ -15,6 +31,22 @@ FILE fqName: fileName:/floatingPointEquals.kt CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null $this: GET_VAR 'x: kotlin.Double declared in .test2d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Double? declared in .test2d' type=kotlin.Double? origin=null + FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null + other: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null + FUN name:test2fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float?) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float + VALUE_PARAMETER name:x index:0 type:kotlin.Float? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2fr (x: kotlin.Float?): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR ': kotlin.Float declared in .test2fr' type=kotlin.Float origin=null + other: GET_VAR 'x: kotlin.Float? declared in .test2fr' type=kotlin.Float? origin=null FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -23,6 +55,22 @@ FILE fqName: fileName:/floatingPointEquals.kt CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null $this: GET_VAR 'x: kotlin.Double declared in .test3d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null + other: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null + FUN name:test3fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3fr (x: kotlin.Any): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR ': kotlin.Float declared in .test3fr' type=kotlin.Float origin=null + other: GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Number @@ -31,6 +79,22 @@ FILE fqName: fileName:/floatingPointEquals.kt CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null $this: GET_VAR 'x: kotlin.Double declared in .test4d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Number declared in .test4d' type=kotlin.Number origin=null + FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null + other: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null + FUN name:test4fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Number) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float + VALUE_PARAMETER name:x index:0 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4fr (x: kotlin.Number): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR ': kotlin.Float declared in .test4fr' type=kotlin.Float origin=null + other: GET_VAR 'x: kotlin.Number declared in .test4fr' type=kotlin.Number origin=null FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -47,6 +111,38 @@ FILE fqName: fileName:/floatingPointEquals.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null + other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test5fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5fr (x: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null + then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR ': kotlin.Float declared in .test5fr' type=kotlin.Float origin=null + other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false FUN name:test6d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -71,54 +167,6 @@ FILE fqName: fileName:/floatingPointEquals.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null - FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null - FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Number - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null - FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null - then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null - other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false FUN name:test6f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -143,27 +191,19 @@ FILE fqName: fileName:/floatingPointEquals.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + FUN name:test6fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + RETURN type=kotlin.Nothing from='public final fun test6fr (x: kotlin.Any): kotlin.Boolean declared in ' WHEN type=kotlin.Boolean origin=ANDAND BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + $this: GET_VAR ': kotlin.Float declared in .test6fr' type=kotlin.Float origin=null other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -191,67 +231,27 @@ FILE fqName: fileName:/floatingPointEquals.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1fr (x: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR ': kotlin.Float declared in .test1fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Float declared in .test1fr' type=kotlin.Float origin=null - FUN name:test2fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float?) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Float? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2fr (x: kotlin.Float?): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR ': kotlin.Float declared in .test2fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Float? declared in .test2fr' type=kotlin.Float? origin=null - FUN name:test3fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float + FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3fr (x: kotlin.Any): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR ': kotlin.Float declared in .test3fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null - FUN name:test4fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Number) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Number - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4fr (x: kotlin.Number): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR ': kotlin.Float declared in .test4fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Number declared in .test4fr' type=kotlin.Number origin=null - FUN name:test5fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5fr (x: kotlin.Any): kotlin.Boolean declared in ' + RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' WHEN type=kotlin.Boolean origin=ANDAND BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR ': kotlin.Float declared in .test5fr' type=kotlin.Float origin=null - other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test6fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test6fr (x: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null - then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR ': kotlin.Float declared in .test6fr' type=kotlin.Float origin=null + $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.kt.txt index a8045172c87..4b84afe0061 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.kt.txt @@ -2,18 +2,50 @@ fun test1d(x: Double, y: Double): Boolean { return x.equals(other = y) } +fun test1f(x: Float, y: Float): Boolean { + return x.equals(other = y) +} + +fun Float.test1fr(x: Float): Boolean { + return .equals(other = x) +} + fun test2d(x: Double, y: Double?): Boolean { return x.equals(other = y) } +fun test2f(x: Float, y: Float?): Boolean { + return x.equals(other = y) +} + +fun Float.test2fr(x: Float?): Boolean { + return .equals(other = x) +} + fun test3d(x: Double, y: Any): Boolean { return x.equals(other = y) } +fun test3f(x: Float, y: Any): Boolean { + return x.equals(other = y) +} + +fun Float.test3fr(x: Any): Boolean { + return .equals(other = x) +} + fun test4d(x: Double, y: Number): Boolean { return x.equals(other = y) } +fun test4f(x: Float, y: Number): Boolean { + return x.equals(other = y) +} + +fun Float.test4fr(x: Number): Boolean { + return .equals(other = x) +} + fun test5d(x: Double, y: Any): Boolean { return when { y is Double -> x.equals(other = y /*as Double */) @@ -21,6 +53,20 @@ fun test5d(x: Double, y: Any): Boolean { } } +fun test5f(x: Float, y: Any): Boolean { + return when { + y is Float -> x.equals(other = y /*as Float */) + else -> false + } +} + +fun Float.test5fr(x: Any): Boolean { + return when { + x is Float -> .equals(other = x /*as Float */) + else -> false + } +} + fun test6d(x: Any, y: Any): Boolean { return when { when { @@ -31,29 +77,6 @@ fun test6d(x: Any, y: Any): Boolean { } } -fun test1f(x: Float, y: Float): Boolean { - return x.equals(other = y) -} - -fun test2f(x: Float, y: Float?): Boolean { - return x.equals(other = y) -} - -fun test3f(x: Float, y: Any): Boolean { - return x.equals(other = y) -} - -fun test4f(x: Float, y: Number): Boolean { - return x.equals(other = y) -} - -fun test5f(x: Float, y: Any): Boolean { - return when { - y is Float -> x.equals(other = y /*as Float */) - else -> false - } -} - fun test6f(x: Any, y: Any): Boolean { return when { when { @@ -64,12 +87,9 @@ fun test6f(x: Any, y: Any): Boolean { } } -fun testFD(x: Any, y: Any): Boolean { +fun Float.test6fr(x: Any): Boolean { return when { - when { - x is Float -> y is Double - else -> false - } -> x /*as Float */.equals(other = y /*as Double */) + x is Double -> .equals(other = x /*as Double */) else -> false } } @@ -84,32 +104,12 @@ fun testDF(x: Any, y: Any): Boolean { } } -fun Float.test1fr(x: Float): Boolean { - return .equals(other = x) -} - -fun Float.test2fr(x: Float?): Boolean { - return .equals(other = x) -} - -fun Float.test3fr(x: Any): Boolean { - return .equals(other = x) -} - -fun Float.test4fr(x: Number): Boolean { - return .equals(other = x) -} - -fun Float.test5fr(x: Any): Boolean { +fun testFD(x: Any, y: Any): Boolean { return when { - x is Float -> .equals(other = x /*as Float */) - else -> false - } -} - -fun Float.test6fr(x: Any): Boolean { - return when { - x is Double -> .equals(other = x /*as Double */) + when { + x is Float -> y is Double + else -> false + } -> x /*as Float */.equals(other = y /*as Double */) else -> false } } diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.ir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.ir.txt index 0927b7e58a4..6e8e682de24 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.ir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.ir.txt @@ -7,6 +7,22 @@ FILE fqName: fileName:/floatingPointEquals.kt CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null $this: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + other: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + FUN name:test1fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float + VALUE_PARAMETER name:x index:0 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1fr (x: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR ': kotlin.Float declared in .test1fr' type=kotlin.Float origin=null + other: GET_VAR 'x: kotlin.Float declared in .test1fr' type=kotlin.Float origin=null FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Double? @@ -15,6 +31,22 @@ FILE fqName: fileName:/floatingPointEquals.kt CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null $this: GET_VAR 'x: kotlin.Double declared in .test2d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Double? declared in .test2d' type=kotlin.Double? origin=null + FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null + other: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null + FUN name:test2fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float?) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float + VALUE_PARAMETER name:x index:0 type:kotlin.Float? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2fr (x: kotlin.Float?): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR ': kotlin.Float declared in .test2fr' type=kotlin.Float origin=null + other: GET_VAR 'x: kotlin.Float? declared in .test2fr' type=kotlin.Float? origin=null FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -23,6 +55,22 @@ FILE fqName: fileName:/floatingPointEquals.kt CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null $this: GET_VAR 'x: kotlin.Double declared in .test3d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null + other: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null + FUN name:test3fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3fr (x: kotlin.Any): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR ': kotlin.Float declared in .test3fr' type=kotlin.Float origin=null + other: GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Number @@ -31,6 +79,22 @@ FILE fqName: fileName:/floatingPointEquals.kt CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null $this: GET_VAR 'x: kotlin.Double declared in .test4d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Number declared in .test4d' type=kotlin.Number origin=null + FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null + other: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null + FUN name:test4fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Number) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float + VALUE_PARAMETER name:x index:0 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4fr (x: kotlin.Number): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR ': kotlin.Float declared in .test4fr' type=kotlin.Float origin=null + other: GET_VAR 'x: kotlin.Number declared in .test4fr' type=kotlin.Number origin=null FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -46,6 +110,36 @@ FILE fqName: fileName:/floatingPointEquals.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null + other: GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test5fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5fr (x: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null + then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR ': kotlin.Float declared in .test5fr' type=kotlin.Float origin=null + other: GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false FUN name:test6d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -68,53 +162,6 @@ FILE fqName: fileName:/floatingPointEquals.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null - FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null - FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Number - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null - FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null - then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false FUN name:test6f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -137,25 +184,18 @@ FILE fqName: fileName:/floatingPointEquals.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + FUN name:test6fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:kotlin.Float VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + RETURN type=kotlin.Nothing from='public final fun test6fr (x: kotlin.Any): kotlin.Boolean declared in ' WHEN type=kotlin.Boolean origin=ANDAND BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - other: GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null + then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null + $this: GET_VAR ': kotlin.Float declared in .test6fr' type=kotlin.Float origin=null + other: GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -181,65 +221,25 @@ FILE fqName: fileName:/floatingPointEquals.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1fr (x: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR ': kotlin.Float declared in .test1fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Float declared in .test1fr' type=kotlin.Float origin=null - FUN name:test2fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float?) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Float? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2fr (x: kotlin.Float?): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR ': kotlin.Float declared in .test2fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Float? declared in .test2fr' type=kotlin.Float? origin=null - FUN name:test3fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float + FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3fr (x: kotlin.Any): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR ': kotlin.Float declared in .test3fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null - FUN name:test4fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Number) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Number - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4fr (x: kotlin.Number): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR ': kotlin.Float declared in .test4fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Number declared in .test4fr' type=kotlin.Number origin=null - FUN name:test5fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5fr (x: kotlin.Any): kotlin.Boolean declared in ' + RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' WHEN type=kotlin.Boolean origin=ANDAND BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null - then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR ': kotlin.Float declared in .test5fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test6fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test6fr (x: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null - then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Float' type=kotlin.Boolean origin=null - $this: GET_VAR ': kotlin.Float declared in .test6fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + other: GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.kt.txt index 0899ef2bd51..17a1348034d 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.kt.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.kt.txt @@ -2,18 +2,50 @@ fun test1d(x: Double, y: Double): Boolean { return x.equals(other = y) } +fun test1f(x: Float, y: Float): Boolean { + return x.equals(other = y) +} + +fun Float.test1fr(x: Float): Boolean { + return .equals(other = x) +} + fun test2d(x: Double, y: Double?): Boolean { return x.equals(other = y) } +fun test2f(x: Float, y: Float?): Boolean { + return x.equals(other = y) +} + +fun Float.test2fr(x: Float?): Boolean { + return .equals(other = x) +} + fun test3d(x: Double, y: Any): Boolean { return x.equals(other = y) } +fun test3f(x: Float, y: Any): Boolean { + return x.equals(other = y) +} + +fun Float.test3fr(x: Any): Boolean { + return .equals(other = x) +} + fun test4d(x: Double, y: Number): Boolean { return x.equals(other = y) } +fun test4f(x: Float, y: Number): Boolean { + return x.equals(other = y) +} + +fun Float.test4fr(x: Number): Boolean { + return .equals(other = x) +} + fun test5d(x: Double, y: Any): Boolean { return when { y is Double -> x.equals(other = y) @@ -21,6 +53,20 @@ fun test5d(x: Double, y: Any): Boolean { } } +fun test5f(x: Float, y: Any): Boolean { + return when { + y is Float -> x.equals(other = y) + else -> false + } +} + +fun Float.test5fr(x: Any): Boolean { + return when { + x is Float -> .equals(other = x) + else -> false + } +} + fun test6d(x: Any, y: Any): Boolean { return when { when { @@ -31,29 +77,6 @@ fun test6d(x: Any, y: Any): Boolean { } } -fun test1f(x: Float, y: Float): Boolean { - return x.equals(other = y) -} - -fun test2f(x: Float, y: Float?): Boolean { - return x.equals(other = y) -} - -fun test3f(x: Float, y: Any): Boolean { - return x.equals(other = y) -} - -fun test4f(x: Float, y: Number): Boolean { - return x.equals(other = y) -} - -fun test5f(x: Float, y: Any): Boolean { - return when { - y is Float -> x.equals(other = y) - else -> false - } -} - fun test6f(x: Any, y: Any): Boolean { return when { when { @@ -64,6 +87,23 @@ fun test6f(x: Any, y: Any): Boolean { } } +fun Float.test6fr(x: Any): Boolean { + return when { + x is Double -> .equals(other = x) + else -> false + } +} + +fun testDF(x: Any, y: Any): Boolean { + return when { + when { + x is Double -> y is Float + else -> false + } -> x.equals(other = y) + else -> false + } +} + fun testFD(x: Any, y: Any): Boolean { return when { when { @@ -74,42 +114,3 @@ fun testFD(x: Any, y: Any): Boolean { } } -fun testDF(x: Any, y: Any): Boolean { - return when { - when { - x is Double -> y is Float - else -> false - } -> x.equals(other = y) - else -> false - } -} - -fun Float.test1fr(x: Float): Boolean { - return .equals(other = x) -} - -fun Float.test2fr(x: Float?): Boolean { - return .equals(other = x) -} - -fun Float.test3fr(x: Any): Boolean { - return .equals(other = x) -} - -fun Float.test4fr(x: Number): Boolean { - return .equals(other = x) -} - -fun Float.test5fr(x: Any): Boolean { - return when { - x is Float -> .equals(other = x) - else -> false - } -} - -fun Float.test6fr(x: Any): Boolean { - return when { - x is Double -> .equals(other = x) - else -> false - } -} diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.ir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.ir.txt index 9f577923263..dac5f0d966f 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.ir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.ir.txt @@ -8,6 +8,15 @@ FILE fqName: fileName:/floatingPointExcleq.kt $this: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ arg0: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null arg1: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Double? @@ -17,6 +26,15 @@ FILE fqName: fileName:/floatingPointExcleq.kt $this: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ arg0: GET_VAR 'x: kotlin.Double declared in .test2d' type=kotlin.Double origin=null arg1: GET_VAR 'y: kotlin.Double? declared in .test2d' type=kotlin.Double? origin=null + FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -26,6 +44,15 @@ FILE fqName: fileName:/floatingPointExcleq.kt $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_VAR 'x: kotlin.Double declared in .test3d' type=kotlin.Double origin=null arg1: GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean 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_VAR 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Number @@ -35,6 +62,15 @@ FILE fqName: fileName:/floatingPointExcleq.kt $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_VAR 'x: kotlin.Double declared in .test4d' type=kotlin.Double origin=null arg1: GET_VAR 'y: kotlin.Number declared in .test4d' type=kotlin.Number origin=null + FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean 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_VAR 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -52,6 +88,23 @@ FILE fqName: fileName:/floatingPointExcleq.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null + arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false FUN name:test6d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -77,59 +130,6 @@ FILE fqName: fileName:/floatingPointExcleq.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null - FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean 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_VAR 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null - FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Number - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean 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_VAR 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null - FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null - then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null - arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false FUN name:test6f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -155,32 +155,6 @@ FILE fqName: fileName:/floatingPointExcleq.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null - $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -207,3 +181,29 @@ FILE fqName: fileName:/floatingPointExcleq.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null + $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.kt.txt index 7d0f0beb31b..78649794951 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.kt.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.kt.txt @@ -2,18 +2,34 @@ fun test1d(x: Double, y: Double): Boolean { return ieee754equals(arg0 = x, arg1 = y).not() } +fun test1f(x: Float, y: Float): Boolean { + return ieee754equals(arg0 = x, arg1 = y).not() +} + fun test2d(x: Double, y: Double?): Boolean { return ieee754equals(arg0 = x, arg1 = y).not() } +fun test2f(x: Float, y: Float?): Boolean { + return ieee754equals(arg0 = x, arg1 = y).not() +} + fun test3d(x: Double, y: Any): Boolean { return EQEQ(arg0 = x, arg1 = y).not() } +fun test3f(x: Float, y: Any): Boolean { + return EQEQ(arg0 = x, arg1 = y).not() +} + fun test4d(x: Double, y: Number): Boolean { return EQEQ(arg0 = x, arg1 = y).not() } +fun test4f(x: Float, y: Number): Boolean { + return EQEQ(arg0 = x, arg1 = y).not() +} + fun test5d(x: Double, y: Any): Boolean { return when { y is Double -> ieee754equals(arg0 = x, arg1 = y /*as Double */).not() @@ -21,6 +37,13 @@ fun test5d(x: Double, y: Any): Boolean { } } +fun test5f(x: Float, y: Any): Boolean { + return when { + y is Float -> ieee754equals(arg0 = x, arg1 = y /*as Float */).not() + else -> false + } +} + fun test6d(x: Any, y: Any): Boolean { return when { when { @@ -31,29 +54,6 @@ fun test6d(x: Any, y: Any): Boolean { } } -fun test1f(x: Float, y: Float): Boolean { - return ieee754equals(arg0 = x, arg1 = y).not() -} - -fun test2f(x: Float, y: Float?): Boolean { - return ieee754equals(arg0 = x, arg1 = y).not() -} - -fun test3f(x: Float, y: Any): Boolean { - return EQEQ(arg0 = x, arg1 = y).not() -} - -fun test4f(x: Float, y: Number): Boolean { - return EQEQ(arg0 = x, arg1 = y).not() -} - -fun test5f(x: Float, y: Any): Boolean { - return when { - y is Float -> ieee754equals(arg0 = x, arg1 = y /*as Float */).not() - else -> false - } -} - fun test6f(x: Any, y: Any): Boolean { return when { when { @@ -64,6 +64,16 @@ fun test6f(x: Any, y: Any): Boolean { } } +fun testDF(x: Any, y: Any): Boolean { + return when { + when { + x is Double -> y is Float + else -> false + } -> ieee754equals(arg0 = x /*as Double */, arg1 = y /*as Float */.toDouble()).not() + else -> false + } +} + fun testFD(x: Any, y: Any): Boolean { return when { when { @@ -74,12 +84,3 @@ fun testFD(x: Any, y: Any): Boolean { } } -fun testDF(x: Any, y: Any): Boolean { - return when { - when { - x is Double -> y is Float - else -> false - } -> ieee754equals(arg0 = x /*as Double */, arg1 = y /*as Float */.toDouble()).not() - else -> false - } -} diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.ir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.ir.txt index a1757c7559b..3924c3a1154 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.ir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.ir.txt @@ -7,6 +7,14 @@ FILE fqName: fileName:/floatingPointLess.kt CALL 'public final fun less (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT arg0: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null arg1: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun less (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -23,6 +31,22 @@ FILE fqName: fileName:/floatingPointLess.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null + then: CALL 'public final fun less (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null + arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -47,30 +71,6 @@ FILE fqName: fileName:/floatingPointLess.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public final fun less (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null - then: CALL 'public final fun less (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null - arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -95,31 +95,6 @@ FILE fqName: fileName:/floatingPointLess.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun less (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null - $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Any VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -145,3 +120,28 @@ FILE fqName: fileName:/floatingPointLess.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun less (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null + $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.kt.txt index e5f90615d37..c69a940dfc8 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.kt.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.kt.txt @@ -2,6 +2,10 @@ fun test1d(x: Double, y: Double): Boolean { return less(arg0 = x, arg1 = y) } +fun test1f(x: Float, y: Float): Boolean { + return less(arg0 = x, arg1 = y) +} + fun test2d(x: Double, y: Any): Boolean { return when { y is Double -> less(arg0 = x, arg1 = y /*as Double */) @@ -9,6 +13,13 @@ fun test2d(x: Double, y: Any): Boolean { } } +fun test2f(x: Float, y: Any): Boolean { + return when { + y is Float -> less(arg0 = x, arg1 = y /*as Float */) + else -> false + } +} + fun test3d(x: Any, y: Any): Boolean { return when { when { @@ -19,17 +30,6 @@ fun test3d(x: Any, y: Any): Boolean { } } -fun test1f(x: Float, y: Float): Boolean { - return less(arg0 = x, arg1 = y) -} - -fun test2f(x: Float, y: Any): Boolean { - return when { - y is Float -> less(arg0 = x, arg1 = y /*as Float */) - else -> false - } -} - fun test3f(x: Any, y: Any): Boolean { return when { when { @@ -40,6 +40,16 @@ fun test3f(x: Any, y: Any): Boolean { } } +fun testDF(x: Any, y: Any): Boolean { + return when { + when { + x is Double -> y is Float + else -> false + } -> less(arg0 = x /*as Double */, arg1 = y /*as Float */.toDouble()) + else -> false + } +} + fun testFD(x: Any, y: Any): Boolean { return when { when { @@ -50,12 +60,3 @@ fun testFD(x: Any, y: Any): Boolean { } } -fun testDF(x: Any, y: Any): Boolean { - return when { - when { - x is Double -> y is Float - else -> false - } -> less(arg0 = x /*as Double */, arg1 = y /*as Float */.toDouble()) - else -> false - } -} diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.ir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.ir.txt index 86b3b363357..07da29917a5 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.ir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.ir.txt @@ -1,4 +1,42 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt + CLASS CLASS name:F modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.F.F> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Float] reified:false + CONSTRUCTOR visibility:public <> () returnType:.F.F> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:F modality:FINAL visibility:public 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 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:testCapturedType visibility:public modality:FINAL <> ($this:.F.F>, x:T of .F, y:kotlin.Any) returnType:kotlin.Boolean + $this: VALUE_PARAMETER name: type:.F.F> + VALUE_PARAMETER name:x index:0 type:T of .F + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testCapturedType (x: T of .F, y: kotlin.Any): kotlin.Boolean declared in .F' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .F.testCapturedType' type=kotlin.Any origin=null + then: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null + $this: GET_VAR 'x: T of .F declared in .F.testCapturedType' type=T of .F origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .F.testCapturedType' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false FUN name:test0 visibility:public modality:FINAL (x:kotlin.Any, y:T of .test0) returnType:kotlin.Boolean TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:x index:0 type:kotlin.Any @@ -121,41 +159,3 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - CLASS CLASS name:F modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.F.F> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Float] reified:false - CONSTRUCTOR visibility:public <> () returnType:.F.F> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:F modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:testCapturedType visibility:public modality:FINAL <> ($this:.F.F>, x:T of .F, y:kotlin.Any) returnType:kotlin.Boolean - $this: VALUE_PARAMETER name: type:.F.F> - VALUE_PARAMETER name:x index:0 type:T of .F - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testCapturedType (x: T of .F, y: kotlin.Any): kotlin.Boolean declared in .F' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .F.testCapturedType' type=kotlin.Any origin=null - then: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null - $this: GET_VAR 'x: T of .F declared in .F.testCapturedType' type=T of .F origin=null - arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .F.testCapturedType' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - 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: 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 diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.kt.txt index 35f3b17f98e..c05e9863fe4 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.kt.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.kt.txt @@ -1,3 +1,19 @@ +class F { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun testCapturedType(x: T, y: Any): Boolean { + return when { + y is Double -> ieee754equals(arg0 = x.toDouble(), arg1 = y /*as Double */) + else -> false + } + } + +} + fun test0(x: Any, y: T): Boolean { return when { x is Int -> EQEQ(arg0 = x, arg1 = y) @@ -47,18 +63,3 @@ fun test6(x: Any, y: T): Boolean { } } -class F { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun testCapturedType(x: T, y: Any): Boolean { - return when { - y is Double -> ieee754equals(arg0 = x.toDouble(), arg1 = y /*as Double */) - else -> false - } - } - -} diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.ir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.ir.txt index f6f285cd903..c42c4b5b31f 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.ir.txt @@ -1,4 +1,9 @@ FILE fqName: fileName:/whenByFloatingPoint.kt + FUN name:foo visibility:public modality:FINAL <> (x:kotlin.Double) returnType:kotlin.Double + VALUE_PARAMETER name:x index:0 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (x: kotlin.Double): kotlin.Double declared in ' + GET_VAR 'x: kotlin.Double declared in .foo' type=kotlin.Double origin=null FUN name:testSimple visibility:public modality:FINAL <> (x:kotlin.Double) returnType:kotlin.Int VALUE_PARAMETER name:x index:0 type:kotlin.Double BLOCK_BODY @@ -15,29 +20,6 @@ FILE fqName: fileName:/whenByFloatingPoint.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Int type=kotlin.Int value=1 - FUN name:testSmartCastInWhenSubject visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Int - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - WHEN type=kotlin.Unit origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null - then: RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=-1 - RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' - BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Double [val] - TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null - WHEN type=kotlin.Int origin=WHEN - BRANCH - if: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_1: kotlin.Double declared in .testSmartCastInWhenSubject' type=kotlin.Double origin=null - arg1: CONST Double type=kotlin.Double value=0.0 - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Int type=kotlin.Int value=1 FUN name:testSmartCastInWhenCondition visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Int VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -50,12 +32,12 @@ FILE fqName: fileName:/whenByFloatingPoint.kt CONST Int type=kotlin.Int value=-1 RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenCondition (x: kotlin.Double, y: kotlin.Any): kotlin.Int declared in ' BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Double [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Double [val] GET_VAR 'x: kotlin.Double declared in .testSmartCastInWhenCondition' type=kotlin.Double origin=null WHEN type=kotlin.Int origin=WHEN BRANCH if: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_2: kotlin.Double declared in .testSmartCastInWhenCondition' type=kotlin.Double origin=null + arg0: GET_VAR 'val tmp_1: kotlin.Double declared in .testSmartCastInWhenCondition' type=kotlin.Double origin=null arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double GET_VAR 'y: kotlin.Any declared in .testSmartCastInWhenCondition' type=kotlin.Any origin=null then: CONST Int type=kotlin.Int value=0 @@ -67,17 +49,40 @@ FILE fqName: fileName:/whenByFloatingPoint.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenConditionInBranch (x: kotlin.Any): kotlin.Int declared in ' BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Any [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Any [val] GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null WHEN type=kotlin.Int origin=WHEN BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'val tmp_3: kotlin.Any declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null + GET_VAR 'val tmp_2: kotlin.Any declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null then: CONST Int type=kotlin.Int value=-1 BRANCH if: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'val tmp_3: kotlin.Any declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null + GET_VAR 'val tmp_2: kotlin.Any declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null + arg1: CONST Double type=kotlin.Double value=0.0 + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Int type=kotlin.Int value=1 + FUN name:testSmartCastInWhenSubject visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=-1 + RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Double [val] + TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_3: kotlin.Double declared in .testSmartCastInWhenSubject' type=kotlin.Double origin=null arg1: CONST Double type=kotlin.Double value=0.0 then: CONST Int type=kotlin.Int value=0 BRANCH @@ -115,11 +120,6 @@ FILE fqName: fileName:/whenByFloatingPoint.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Int type=kotlin.Int value=1 - FUN name:foo visibility:public modality:FINAL <> (x:kotlin.Double) returnType:kotlin.Double - VALUE_PARAMETER name:x index:0 type:kotlin.Double - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (x: kotlin.Double): kotlin.Double declared in ' - GET_VAR 'x: kotlin.Double declared in .foo' type=kotlin.Double origin=null FUN name:testWithPrematureExitInConditionSubexpression visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Int VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.kt.txt index c78d312ca50..47367d03211 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.kt.txt @@ -1,3 +1,7 @@ +fun foo(x: Double): Double { + return x +} + fun testSimple(x: Double): Int { return { // BLOCK val tmp_0: Double = x @@ -8,27 +12,14 @@ fun testSimple(x: Double): Int { } } -fun testSmartCastInWhenSubject(x: Any): Int { - when { - x !is Double -> return -1 - } - return { // BLOCK - val tmp_1: Double = x /*as Double */ - when { - ieee754equals(arg0 = tmp_1, arg1 = 0.0) -> 0 - else -> 1 - } - } -} - fun testSmartCastInWhenCondition(x: Double, y: Any): Int { when { y !is Double -> return -1 } return { // BLOCK - val tmp_2: Double = x + val tmp_1: Double = x when { - ieee754equals(arg0 = tmp_2, arg1 = y /*as Double */) -> 0 + ieee754equals(arg0 = tmp_1, arg1 = y /*as Double */) -> 0 else -> 1 } } @@ -36,10 +27,23 @@ fun testSmartCastInWhenCondition(x: Double, y: Any): Int { fun testSmartCastInWhenConditionInBranch(x: Any): Int { return { // BLOCK - val tmp_3: Any = x + val tmp_2: Any = x when { - tmp_3 !is Double -> -1 - ieee754equals(arg0 = tmp_3 /*as Double */, arg1 = 0.0) -> 0 + tmp_2 !is Double -> -1 + ieee754equals(arg0 = tmp_2 /*as Double */, arg1 = 0.0) -> 0 + else -> 1 + } + } +} + +fun testSmartCastInWhenSubject(x: Any): Int { + when { + x !is Double -> return -1 + } + return { // BLOCK + val tmp_3: Double = x /*as Double */ + when { + ieee754equals(arg0 = tmp_3, arg1 = 0.0) -> 0 else -> 1 } } @@ -61,10 +65,6 @@ fun testSmartCastToDifferentTypes(x: Any, y: Any): Int { } } -fun foo(x: Double): Double { - return x -} - fun testWithPrematureExitInConditionSubexpression(x: Any): Int { return { // BLOCK val tmp_5: Any = x diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.ir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.ir.txt index f33b5b52952..97f3848d74e 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.ir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.ir.txt @@ -1,4 +1,9 @@ FILE fqName: fileName:/whenByFloatingPoint.kt + FUN name:foo visibility:public modality:FINAL <> (x:kotlin.Double) returnType:kotlin.Double + VALUE_PARAMETER name:x index:0 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (x: kotlin.Double): kotlin.Double declared in ' + GET_VAR 'x: kotlin.Double declared in .foo' type=kotlin.Double origin=null FUN name:testSimple visibility:public modality:FINAL <> (x:kotlin.Double) returnType:kotlin.Int VALUE_PARAMETER name:x index:0 type:kotlin.Double BLOCK_BODY @@ -15,29 +20,6 @@ FILE fqName: fileName:/whenByFloatingPoint.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Int type=kotlin.Int value=1 - FUN name:testSmartCastInWhenSubject visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Int - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - WHEN type=kotlin.Unit origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null - then: RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=-1 - RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' - BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any [val] - GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null - WHEN type=kotlin.Int origin=WHEN - BRANCH - if: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'val tmp_1: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null - arg1: CONST Double type=kotlin.Double value=0.0 - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Int type=kotlin.Int value=1 FUN name:testSmartCastInWhenCondition visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Int VALUE_PARAMETER name:x index:0 type:kotlin.Double VALUE_PARAMETER name:y index:1 type:kotlin.Any @@ -50,12 +32,12 @@ FILE fqName: fileName:/whenByFloatingPoint.kt CONST Int type=kotlin.Int value=-1 RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenCondition (x: kotlin.Double, y: kotlin.Any): kotlin.Int declared in ' BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Double [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Double [val] GET_VAR 'x: kotlin.Double declared in .testSmartCastInWhenCondition' type=kotlin.Double origin=null WHEN type=kotlin.Int origin=WHEN BRANCH if: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_2: kotlin.Double declared in .testSmartCastInWhenCondition' type=kotlin.Double origin=null + arg0: GET_VAR 'val tmp_1: kotlin.Double declared in .testSmartCastInWhenCondition' type=kotlin.Double origin=null arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double GET_VAR 'y: kotlin.Any declared in .testSmartCastInWhenCondition' type=kotlin.Any origin=null then: CONST Int type=kotlin.Int value=0 @@ -67,18 +49,41 @@ FILE fqName: fileName:/whenByFloatingPoint.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenConditionInBranch (x: kotlin.Any): kotlin.Int declared in ' BLOCK type=kotlin.Int origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Any [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Any [val] GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null WHEN type=kotlin.Int origin=WHEN BRANCH if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCL $this: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'val tmp_3: kotlin.Any declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null + GET_VAR 'val tmp_2: kotlin.Any declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null then: CONST Int type=kotlin.Int value=-1 BRANCH if: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'val tmp_3: kotlin.Any declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null + GET_VAR 'val tmp_2: kotlin.Any declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null + arg1: CONST Double type=kotlin.Double value=0.0 + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Int type=kotlin.Int value=1 + FUN name:testSmartCastInWhenSubject visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=-1 + RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Any [val] + GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'val tmp_3: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null arg1: CONST Double type=kotlin.Double value=0.0 then: CONST Int type=kotlin.Int value=0 BRANCH @@ -116,11 +121,6 @@ FILE fqName: fileName:/whenByFloatingPoint.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Int type=kotlin.Int value=1 - FUN name:foo visibility:public modality:FINAL <> (x:kotlin.Double) returnType:kotlin.Double - VALUE_PARAMETER name:x index:0 type:kotlin.Double - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (x: kotlin.Double): kotlin.Double declared in ' - GET_VAR 'x: kotlin.Double declared in .foo' type=kotlin.Double origin=null FUN name:testWithPrematureExitInConditionSubexpression visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Int VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.kt.txt index 0d6193bab54..d5f0d7606a8 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.kt.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.kt.txt @@ -1,3 +1,7 @@ +fun foo(x: Double): Double { + return x +} + fun testSimple(x: Double): Int { return { // BLOCK val tmp_0: Double = x @@ -8,37 +12,37 @@ fun testSimple(x: Double): Int { } } -fun testSmartCastInWhenSubject(x: Any): Int { - when { - x !is Double -> return -1 - } - return { // BLOCK - val tmp_1: Any = x - when { - ieee754equals(arg0 = tmp_1 /*as Double */, arg1 = 0.0) -> 0 - else -> 1 - } - } -} - fun testSmartCastInWhenCondition(x: Double, y: Any): Int { when { y !is Double -> return -1 } return { // BLOCK - val tmp_2: Double = x + val tmp_1: Double = x when { - ieee754equals(arg0 = tmp_2, arg1 = y /*as Double */) -> 0 + ieee754equals(arg0 = tmp_1, arg1 = y /*as Double */) -> 0 else -> 1 } } } fun testSmartCastInWhenConditionInBranch(x: Any): Int { + return { // BLOCK + val tmp_2: Any = x + when { + tmp_2 is Double.not() -> -1 + ieee754equals(arg0 = tmp_2 /*as Double */, arg1 = 0.0) -> 0 + else -> 1 + } + } +} + +fun testSmartCastInWhenSubject(x: Any): Int { + when { + x !is Double -> return -1 + } return { // BLOCK val tmp_3: Any = x when { - tmp_3 is Double.not() -> -1 ieee754equals(arg0 = tmp_3 /*as Double */, arg1 = 0.0) -> 0 else -> 1 } @@ -61,10 +65,6 @@ fun testSmartCastToDifferentTypes(x: Any, y: Any): Int { } } -fun foo(x: Double): Double { - return x -} - fun testWithPrematureExitInConditionSubexpression(x: Any): Int { return { // BLOCK val tmp_5: Any = x @@ -77,3 +77,4 @@ fun testWithPrematureExitInConditionSubexpression(x: Any): Int { } } } + diff --git a/compiler/testData/ir/irText/expressions/for.ir.txt b/compiler/testData/ir/irText/expressions/for.ir.txt index 317288ca2c4..9a7a19252f5 100644 --- a/compiler/testData/ir/irText/expressions/for.ir.txt +++ b/compiler/testData/ir/irText/expressions/for.ir.txt @@ -1,60 +1,60 @@ FILE fqName: fileName:/for.kt - FUN name:testEmpty visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit - VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List - BLOCK_BODY - BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.Iterator [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR - $this: GET_VAR 'ss: kotlin.collections.List declared in .testEmpty' type=kotlin.collections.List origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator declared in .testEmpty' type=kotlin.collections.Iterator origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator declared in .testEmpty' type=kotlin.collections.Iterator origin=null - FUN name:testIterable visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit - VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List - BLOCK_BODY - BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.Iterator [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR - $this: GET_VAR 'ss: kotlin.collections.List declared in .testIterable' type=kotlin.collections.List origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator declared in .testIterable' type=kotlin.collections.Iterator origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator declared in .testIterable' type=kotlin.collections.Iterator origin=null - BLOCK type=kotlin.Unit origin=null - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: GET_VAR 'val s: kotlin.String declared in .testIterable' type=kotlin.String origin=null FUN name:testDestructuring visibility:public modality:FINAL <> (pp:kotlin.collections.List>) returnType:kotlin.Unit VALUE_PARAMETER name:pp index:0 type:kotlin.collections.List> BLOCK_BODY BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator> [val] + VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.Iterator> [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=FOR_LOOP_ITERATOR $this: GET_VAR 'pp: kotlin.collections.List> declared in .testDestructuring' type=kotlin.collections.List> origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator> declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator> declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Pair [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Pair [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=kotlin.Pair origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator> declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator> declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null VAR name:i type:kotlin.Int [val] CALL 'public final fun component1 (): A of kotlin.Pair declared in kotlin.Pair' type=kotlin.Int origin=COMPONENT_N(index=1) - $this: GET_VAR 'val tmp_3: kotlin.Pair declared in .testDestructuring' type=kotlin.Pair origin=null + $this: GET_VAR 'val tmp_1: kotlin.Pair declared in .testDestructuring' type=kotlin.Pair origin=null VAR name:s type:kotlin.String [val] CALL 'public final fun component2 (): B of kotlin.Pair declared in kotlin.Pair' type=kotlin.String origin=COMPONENT_N(index=2) - $this: GET_VAR 'val tmp_3: kotlin.Pair declared in .testDestructuring' type=kotlin.Pair origin=null + $this: GET_VAR 'val tmp_1: kotlin.Pair declared in .testDestructuring' type=kotlin.Pair origin=null BLOCK type=kotlin.Unit origin=null CALL 'public final fun println (message: kotlin.Int): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null message: GET_VAR 'val i: kotlin.Int declared in .testDestructuring' type=kotlin.Int origin=null CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null message: GET_VAR 'val s: kotlin.String declared in .testDestructuring' type=kotlin.String origin=null + FUN name:testEmpty visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit + VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'ss: kotlin.collections.List declared in .testEmpty' type=kotlin.collections.List origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator declared in .testEmpty' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator declared in .testEmpty' type=kotlin.collections.Iterator origin=null + FUN name:testIterable visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit + VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.Iterator [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'ss: kotlin.collections.List declared in .testIterable' type=kotlin.collections.List origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator declared in .testIterable' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator declared in .testIterable' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Unit origin=null + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: GET_VAR 'val s: kotlin.String declared in .testIterable' type=kotlin.String origin=null FUN name:testRange visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY BLOCK type=kotlin.Unit origin=FOR_LOOP diff --git a/compiler/testData/ir/irText/expressions/for.kt.txt b/compiler/testData/ir/irText/expressions/for.kt.txt index 69918029e0e..3e04e4b312d 100644 --- a/compiler/testData/ir/irText/expressions/for.kt.txt +++ b/compiler/testData/ir/irText/expressions/for.kt.txt @@ -1,33 +1,33 @@ -fun testEmpty(ss: List) { +fun testDestructuring(pp: List>) { { // BLOCK - val tmp_0: Iterator = ss.iterator() + val tmp_0: Iterator> = pp.iterator() while (tmp_0.hasNext()) { // BLOCK - val s: String = tmp_0.next() - } - } -} - -fun testIterable(ss: List) { - { // BLOCK - val tmp_1: Iterator = ss.iterator() - while (tmp_1.hasNext()) { // BLOCK - val s: String = tmp_1.next() + val tmp_1: Pair = tmp_0.next() + val i: Int = tmp_1.component1() + val s: String = tmp_1.component2() { // BLOCK + println(message = i) println(message = s) } } } } -fun testDestructuring(pp: List>) { +fun testEmpty(ss: List) { { // BLOCK - val tmp_2: Iterator> = pp.iterator() + val tmp_2: Iterator = ss.iterator() while (tmp_2.hasNext()) { // BLOCK - val tmp_3: Pair = tmp_2.next() - val i: Int = tmp_3.component1() - val s: String = tmp_3.component2() + val s: String = tmp_2.next() + } + } +} + +fun testIterable(ss: List) { + { // BLOCK + val tmp_3: Iterator = ss.iterator() + while (tmp_3.hasNext()) { // BLOCK + val s: String = tmp_3.next() { // BLOCK - println(message = i) println(message = s) } } @@ -42,3 +42,4 @@ fun testRange() { } } } + diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.ir.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.ir.txt index c25f4d49659..fc726bc6e4f 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.ir.txt @@ -1,30 +1,6 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt - CLASS OBJECT name:FiveTimes modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FiveTimes - CONSTRUCTOR visibility:private <> () returnType:.FiveTimes [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:FiveTimes modality:FINAL visibility:public 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 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 CLASS CLASS name:IntCell modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IntCell - CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.IntCell [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IntCell modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private EXPRESSION_BODY @@ -44,6 +20,11 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .IntCell declared in .IntCell.' type=.IntCell origin=null value: GET_VAR ': kotlin.Int declared in .IntCell.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.IntCell [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IntCell modality:FINAL visibility:public 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 declared in kotlin.Any @@ -59,13 +40,19 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:IReceiver modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IReceiver - FUN name:iterator visibility:public modality:OPEN <> ($this:.IReceiver, $receiver:.FiveTimes) returnType:.IntCell [operator] - $this: VALUE_PARAMETER name: type:.IReceiver - $receiver: VALUE_PARAMETER name: type:.FiveTimes - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun iterator (): .IntCell declared in .IReceiver' - CONSTRUCTOR_CALL 'public constructor (value: kotlin.Int) declared in .IntCell' type=.IntCell origin=null - value: CONST Int type=kotlin.Int value=5 + 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: 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:hasNext visibility:public modality:OPEN <> ($this:.IReceiver, $receiver:.IntCell) returnType:kotlin.Boolean [operator] $this: VALUE_PARAMETER name: type:.IReceiver $receiver: VALUE_PARAMETER name: type:.IntCell @@ -75,6 +62,13 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt arg0: CALL 'public final fun (): kotlin.Int declared in .IntCell' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .IntCell declared in .IReceiver.hasNext' type=.IntCell origin=null arg1: CONST Int type=kotlin.Int value=0 + FUN name:iterator visibility:public modality:OPEN <> ($this:.IReceiver, $receiver:.FiveTimes) returnType:.IntCell [operator] + $this: VALUE_PARAMETER name: type:.IReceiver + $receiver: VALUE_PARAMETER name: type:.FiveTimes + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun iterator (): .IntCell declared in .IReceiver' + CONSTRUCTOR_CALL 'public constructor (value: kotlin.Int) declared in .IntCell' type=.IntCell origin=null + value: CONST Int type=kotlin.Int value=5 FUN name:next visibility:public modality:OPEN <> ($this:.IReceiver, $receiver:.IntCell) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.IReceiver $receiver: VALUE_PARAMETER name: type:.IntCell @@ -89,6 +83,12 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR $this: GET_VAR 'val tmp_0: kotlin.Int declared in .IReceiver.next' type=kotlin.Int origin=null GET_VAR 'val tmp_0: kotlin.Int declared in .IReceiver.next' type=kotlin.Int origin=null + CLASS OBJECT name:FiveTimes modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FiveTimes + CONSTRUCTOR visibility:private <> () returnType:.FiveTimes [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:FiveTimes modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.kt.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.kt.txt index b2a30ce3ea6..e3773521ed9 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.kt.txt @@ -1,35 +1,26 @@ -object FiveTimes { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - class IntCell { + var value: Int + field = value + get + set + constructor(value: Int) /* primary */ { super/*Any*/() /* () */ } - var value: Int - field = value - get - set - } interface IReceiver { - operator fun FiveTimes.iterator(): IntCell { - return IntCell(value = 5) - } - operator fun IntCell.hasNext(): Boolean { return greater(arg0 = .(), arg1 = 0) } + operator fun FiveTimes.iterator(): IntCell { + return IntCell(value = 5) + } + operator fun IntCell.next(): Int { return { // BLOCK val tmp_0: Int = .() @@ -40,6 +31,15 @@ interface IReceiver { } +object FiveTimes { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + fun IReceiver.test() { { // BLOCK val tmp_1: IntCell = (, FiveTimes).iterator() diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.ir.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.ir.txt index 8d0849a54e7..e8958c9ee7b 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.ir.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.ir.txt @@ -1,30 +1,6 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt - CLASS OBJECT name:FiveTimes modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FiveTimes - CONSTRUCTOR visibility:private <> () returnType:.FiveTimes [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:FiveTimes modality:FINAL visibility:public 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 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 CLASS CLASS name:IntCell modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IntCell - CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.IntCell [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IntCell modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private EXPRESSION_BODY @@ -44,6 +20,11 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .IntCell declared in .IntCell.' type=.IntCell origin=null value: GET_VAR ': kotlin.Int declared in .IntCell.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.IntCell [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IntCell modality:FINAL visibility:public 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 declared in kotlin.Any @@ -59,13 +40,19 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:IReceiver modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IReceiver - FUN name:iterator visibility:public modality:OPEN <> ($this:.IReceiver, $receiver:.FiveTimes) returnType:.IntCell [operator] - $this: VALUE_PARAMETER name: type:.IReceiver - $receiver: VALUE_PARAMETER name: type:.FiveTimes - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun iterator (): .IntCell declared in .IReceiver' - CONSTRUCTOR_CALL 'public constructor (value: kotlin.Int) declared in .IntCell' type=.IntCell origin=null - value: CONST Int type=kotlin.Int value=5 + 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: 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:hasNext visibility:public modality:OPEN <> ($this:.IReceiver, $receiver:.IntCell) returnType:kotlin.Boolean [operator] $this: VALUE_PARAMETER name: type:.IReceiver $receiver: VALUE_PARAMETER name: type:.IntCell @@ -75,6 +62,13 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt arg0: CALL 'public final fun (): kotlin.Int declared in .IntCell' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .IntCell declared in .IReceiver.hasNext' type=.IntCell origin=null arg1: CONST Int type=kotlin.Int value=0 + FUN name:iterator visibility:public modality:OPEN <> ($this:.IReceiver, $receiver:.FiveTimes) returnType:.IntCell [operator] + $this: VALUE_PARAMETER name: type:.IReceiver + $receiver: VALUE_PARAMETER name: type:.FiveTimes + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun iterator (): .IntCell declared in .IReceiver' + CONSTRUCTOR_CALL 'public constructor (value: kotlin.Int) declared in .IntCell' type=.IntCell origin=null + value: CONST Int type=kotlin.Int value=5 FUN name:next visibility:public modality:OPEN <> ($this:.IReceiver, $receiver:.IntCell) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.IReceiver $receiver: VALUE_PARAMETER name: type:.IntCell @@ -92,6 +86,12 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR $this: GET_VAR 'val tmp_1: kotlin.Int declared in .IReceiver.next' type=kotlin.Int origin=null GET_VAR 'val tmp_1: kotlin.Int declared in .IReceiver.next' type=kotlin.Int origin=null + CLASS OBJECT name:FiveTimes modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FiveTimes + CONSTRUCTOR visibility:private <> () returnType:.FiveTimes [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:FiveTimes modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.kt.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.kt.txt index b48dae73df2..d1793e39097 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.kt.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.kt.txt @@ -1,35 +1,26 @@ -object FiveTimes { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - class IntCell { + var value: Int + field = value + get + set + constructor(value: Int) /* primary */ { super/*Any*/() /* () */ } - var value: Int - field = value - get - set - } interface IReceiver { - operator fun FiveTimes.iterator(): IntCell { - return IntCell(value = 5) - } - operator fun IntCell.hasNext(): Boolean { return greater(arg0 = .(), arg1 = 0) } + operator fun FiveTimes.iterator(): IntCell { + return IntCell(value = 5) + } + operator fun IntCell.next(): Int { return { // BLOCK val tmp_0: IntCell = @@ -43,6 +34,15 @@ interface IReceiver { } +object FiveTimes { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + fun IReceiver.test() { { // BLOCK val tmp_2: IntCell = (, FiveTimes).iterator() @@ -54,3 +54,4 @@ fun IReceiver.test() { } } } + diff --git a/compiler/testData/ir/irText/expressions/funImportedFromObject.ir.txt b/compiler/testData/ir/irText/expressions/funImportedFromObject.ir.txt index 007fc55a08c..6d4f583d0cb 100644 --- a/compiler/testData/ir/irText/expressions/funImportedFromObject.ir.txt +++ b/compiler/testData/ir/irText/expressions/funImportedFromObject.ir.txt @@ -5,12 +5,6 @@ FILE fqName:test fileName:/funImportedFromObject.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL ($this:test.Host) returnType:kotlin.String [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true - $this: VALUE_PARAMETER name: type:test.Host - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in test.Host' - CONST String type=kotlin.String value="OK" 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 @@ -24,6 +18,12 @@ FILE fqName:test fileName:/funImportedFromObject.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL ($this:test.Host) returnType:kotlin.String [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true + $this: VALUE_PARAMETER name: type:test.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in test.Host' + CONST String type=kotlin.String value="OK" FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test (): kotlin.String declared in test' diff --git a/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.ir.txt index ca81c779fd6..c15ed050550 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.ir.txt @@ -1,8 +1,6 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt CLASS INTERFACE name:IRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IRunnable - FUN name:run visibility:public modality:ABSTRACT <> ($this:.IRunnable) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IRunnable 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 @@ -16,6 +14,8 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:run visibility:public modality:ABSTRACT <> ($this:.IRunnable) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IRunnable FUN name:foo1 visibility:public modality:FINAL <> (r:.IRunnable, s:kotlin.Array) returnType:kotlin.Unit VALUE_PARAMETER name:r index:0 type:.IRunnable VALUE_PARAMETER name:s index:1 type:kotlin.Array varargElementType:kotlin.String [vararg] diff --git a/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.ir.txt index 6819e46adc4..1e06c87f7c6 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.ir.txt @@ -1,8 +1,6 @@ FILE fqName: fileName:/basicFunInterfaceConversion.kt CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo - FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.Foo) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Foo 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 @@ -16,6 +14,8 @@ FILE fqName: fileName:/basicFunInterfaceConversion.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.Foo) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Foo FUN name:foo visibility:public modality:FINAL <> (f:.Foo) returnType:kotlin.String VALUE_PARAMETER name:f index:0 type:.Foo BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/funInterface/castFromAny.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/castFromAny.ir.txt index f1f33b6e79b..3c4df9a40ac 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/castFromAny.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/castFromAny.ir.txt @@ -1,8 +1,6 @@ FILE fqName: fileName:/castFromAny.kt CLASS INTERFACE name:KRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KRunnable - FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.KRunnable) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.KRunnable 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 @@ -16,6 +14,8 @@ FILE fqName: fileName:/castFromAny.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.KRunnable) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.KRunnable FUN name:test visibility:public modality:FINAL <> (a:kotlin.Any?) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any? BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/funInterface/functionSupertype.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/functionSupertype.ir.txt index b4b9f1c46c9..4bbb6d3b4a9 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/functionSupertype.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/functionSupertype.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/functionSupertype.kt CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Function0] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo - FUN FAKE_OVERRIDE name:invoke visibility:public modality:ABSTRACT <> ($this:kotlin.Function0) returnType:kotlin.Int [fake_override,operator] - overridden: - public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0 - $this: VALUE_PARAMETER name: type:kotlin.Function0 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.Function0 @@ -14,6 +10,10 @@ FILE fqName: fileName:/functionSupertype.kt overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Function0 $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:invoke visibility:public modality:ABSTRACT <> ($this:kotlin.Function0) returnType:kotlin.Int [fake_override,operator] + overridden: + public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0 + $this: VALUE_PARAMETER name: type:kotlin.Function0 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.Function0 diff --git a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.ir.txt index 3a2e4ee7da3..e44446eed57 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.ir.txt @@ -1,60 +1,4 @@ FILE fqName: fileName:/partialSam.kt - CLASS INTERFACE name:Fn modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fn.Fn, R of .Fn> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:R index:1 variance: superTypes:[kotlin.Any?] reified:false - FUN name:run visibility:public modality:ABSTRACT <> ($this:.Fn.Fn, R of .Fn>, s:kotlin.String, i:kotlin.Int, t:T of .Fn) returnType:R of .Fn - $this: VALUE_PARAMETER name: type:.Fn.Fn, R of .Fn> - VALUE_PARAMETER name:s index:0 type:kotlin.String - VALUE_PARAMETER name:i index:1 type:kotlin.Int - VALUE_PARAMETER name:t index:2 type:T of .Fn - 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: 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 - CLASS CLASS name:J modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.J - CONSTRUCTOR visibility:public <> () returnType:.J [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:J modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:runConversion visibility:public modality:FINAL <> ($this:.J, f1:.Fn, f2:.Fn) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.J - VALUE_PARAMETER name:f1 index:0 type:.Fn - VALUE_PARAMETER name:f2 index:1 type:.Fn - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun runConversion (f1: .Fn, f2: .Fn): kotlin.Int declared in .J' - CALL 'public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn' type=kotlin.Int origin=null - $this: GET_VAR 'f1: .Fn declared in .J.runConversion' type=.Fn origin=null - s: CONST String type=kotlin.String value="Bar" - i: CONST Int type=kotlin.Int value=1 - t: CALL 'public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn' type=kotlin.String origin=null - $this: GET_VAR 'f2: .Fn declared in .J.runConversion' type=.Fn origin=null - s: CONST String type=kotlin.String value="Foo" - i: CONST Int type=kotlin.Int value=42 - t: CONST Int type=kotlin.Int value=239 - 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: 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 PROPERTY name:fsi visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:fsi type:.Fn visibility:private [final,static] EXPRESSION_BODY @@ -65,16 +9,6 @@ FILE fqName: fileName:/partialSam.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Fn]' - FUN name:run visibility:public modality:OPEN <> ($this:.fsi., s:kotlin.String, i:kotlin.Int, t:kotlin.String) returnType:kotlin.Int - overridden: - public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn - $this: VALUE_PARAMETER name: type:.fsi. - VALUE_PARAMETER name:s index:0 type:kotlin.String - VALUE_PARAMETER name:i index:1 type:kotlin.Int - VALUE_PARAMETER name:t index:2 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.String): kotlin.Int declared in .fsi.' - CONST Int type=kotlin.Int value=1 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 .Fn @@ -88,6 +22,16 @@ FILE fqName: fileName:/partialSam.kt overridden: public open fun toString (): kotlin.String declared in .Fn $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:run visibility:public modality:OPEN <> ($this:.fsi., s:kotlin.String, i:kotlin.Int, t:kotlin.String) returnType:kotlin.Int + overridden: + public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn + $this: VALUE_PARAMETER name: type:.fsi. + VALUE_PARAMETER name:s index:0 type:kotlin.String + VALUE_PARAMETER name:i index:1 type:kotlin.Int + VALUE_PARAMETER name:t index:2 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.String): kotlin.Int declared in .fsi.' + CONST Int type=kotlin.Int value=1 CONSTRUCTOR_CALL 'public constructor () declared in .fsi.' type=.fsi. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Fn correspondingProperty: PROPERTY name:fsi visibility:public modality:FINAL [val] @@ -104,16 +48,6 @@ FILE fqName: fileName:/partialSam.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Fn]' - FUN name:run visibility:public modality:OPEN <> ($this:.fis., s:kotlin.String, i:kotlin.Int, t:kotlin.Int) returnType:kotlin.String - overridden: - public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn - $this: VALUE_PARAMETER name: type:.fis. - VALUE_PARAMETER name:s index:0 type:kotlin.String - VALUE_PARAMETER name:i index:1 type:kotlin.Int - VALUE_PARAMETER name:t index:2 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.Int): kotlin.String declared in .fis.' - CONST String type=kotlin.String value="" 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 .Fn @@ -127,12 +61,78 @@ FILE fqName: fileName:/partialSam.kt overridden: public open fun toString (): kotlin.String declared in .Fn $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:run visibility:public modality:OPEN <> ($this:.fis., s:kotlin.String, i:kotlin.Int, t:kotlin.Int) returnType:kotlin.String + overridden: + public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn + $this: VALUE_PARAMETER name: type:.fis. + VALUE_PARAMETER name:s index:0 type:kotlin.String + VALUE_PARAMETER name:i index:1 type:kotlin.Int + VALUE_PARAMETER name:t index:2 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.Int): kotlin.String declared in .fis.' + CONST String type=kotlin.String value="" CONSTRUCTOR_CALL 'public constructor () declared in .fis.' type=.fis. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Fn correspondingProperty: PROPERTY name:fis visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): .Fn declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fis type:.Fn visibility:private [final,static]' type=.Fn origin=null + CLASS CLASS name:J modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.J + CONSTRUCTOR visibility:public <> () returnType:.J [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:J modality:FINAL visibility:public 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 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:runConversion visibility:public modality:FINAL <> ($this:.J, f1:.Fn, f2:.Fn) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.J + VALUE_PARAMETER name:f1 index:0 type:.Fn + VALUE_PARAMETER name:f2 index:1 type:.Fn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun runConversion (f1: .Fn, f2: .Fn): kotlin.Int declared in .J' + CALL 'public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn' type=kotlin.Int origin=null + $this: GET_VAR 'f1: .Fn declared in .J.runConversion' type=.Fn origin=null + s: CONST String type=kotlin.String value="Bar" + i: CONST Int type=kotlin.Int value=1 + t: CALL 'public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn' type=kotlin.String origin=null + $this: GET_VAR 'f2: .Fn declared in .J.runConversion' type=.Fn origin=null + s: CONST String type=kotlin.String value="Foo" + i: CONST Int type=kotlin.Int value=42 + t: CONST Int type=kotlin.Int value=239 + CLASS INTERFACE name:Fn modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fn.Fn, R of .Fn> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:R index:1 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:run visibility:public modality:ABSTRACT <> ($this:.Fn.Fn, R of .Fn>, s:kotlin.String, i:kotlin.Int, t:T of .Fn) returnType:R of .Fn + $this: VALUE_PARAMETER name: type:.Fn.Fn, R of .Fn> + VALUE_PARAMETER name:s index:0 type:kotlin.String + VALUE_PARAMETER name:i index:1 type:kotlin.Int + VALUE_PARAMETER name:t index:2 type:T of .Fn FUN name:test visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit VALUE_PARAMETER name:j index:0 type:.J BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.kt.txt index e0dfeedb75b..1a276064645 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.kt.txt @@ -1,21 +1,3 @@ -fun interface Fn { - abstract fun run(s: String, i: Int, t: T): R - -} - -class J { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun runConversion(f1: Fn, f2: Fn): Int { - return f1.run(s = "Bar", i = 1, t = f2.run(s = "Foo", i = 42, t = 239)) - } - -} - val fsi: Fn field = { // BLOCK local class : Fn { @@ -54,6 +36,24 @@ val fis: Fn } get +class J { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun runConversion(f1: Fn, f2: Fn): Int { + return f1.run(s = "Bar", i = 1, t = f2.run(s = "Foo", i = 42, t = 239)) + } + +} + +fun interface Fn { + abstract fun run(s: String, i: Int, t: T): R + +} + fun test(j: J) { j.runConversion(f1 = (), f2 = local fun (s: String, i: Int, ti: Int): String { return "" @@ -64,3 +64,4 @@ fun test(j: J) { } /*-> Fn */, f2 = ()) /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/expressions/funInterface/partialSam.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.ir.txt index df37a5523b6..a736fe617ce 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/partialSam.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.ir.txt @@ -1,60 +1,4 @@ FILE fqName: fileName:/partialSam.kt - CLASS INTERFACE name:Fn modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fn.Fn, R of .Fn> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:R index:1 variance: superTypes:[kotlin.Any?] reified:false - FUN name:run visibility:public modality:ABSTRACT <> ($this:.Fn.Fn, R of .Fn>, s:kotlin.String, i:kotlin.Int, t:T of .Fn) returnType:R of .Fn - $this: VALUE_PARAMETER name: type:.Fn.Fn, R of .Fn> - VALUE_PARAMETER name:s index:0 type:kotlin.String - VALUE_PARAMETER name:i index:1 type:kotlin.Int - VALUE_PARAMETER name:t index:2 type:T of .Fn - 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: 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 - CLASS CLASS name:J modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.J - CONSTRUCTOR visibility:public <> () returnType:.J [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:J modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:runConversion visibility:public modality:FINAL <> ($this:.J, f1:.Fn, f2:.Fn) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.J - VALUE_PARAMETER name:f1 index:0 type:.Fn - VALUE_PARAMETER name:f2 index:1 type:.Fn - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun runConversion (f1: .Fn, f2: .Fn): kotlin.Int declared in .J' - CALL 'public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn' type=kotlin.Int origin=null - $this: GET_VAR 'f1: .Fn declared in .J.runConversion' type=.Fn origin=null - s: CONST String type=kotlin.String value="Bar" - i: CONST Int type=kotlin.Int value=1 - t: CALL 'public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn' type=kotlin.String origin=null - $this: GET_VAR 'f2: .Fn declared in .J.runConversion' type=.Fn origin=null - s: CONST String type=kotlin.String value="Foo" - i: CONST Int type=kotlin.Int value=42 - t: CONST Int type=kotlin.Int value=239 - 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: 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 PROPERTY name:fsi visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:fsi type:.Fn visibility:private [final,static] EXPRESSION_BODY @@ -65,16 +9,6 @@ FILE fqName: fileName:/partialSam.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Fn]' - FUN name:run visibility:public modality:OPEN <> ($this:.fsi., s:kotlin.String, i:kotlin.Int, t:kotlin.String) returnType:kotlin.Int - overridden: - public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn - $this: VALUE_PARAMETER name: type:.fsi. - VALUE_PARAMETER name:s index:0 type:kotlin.String - VALUE_PARAMETER name:i index:1 type:kotlin.Int - VALUE_PARAMETER name:t index:2 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.String): kotlin.Int declared in .fsi.' - CONST Int type=kotlin.Int value=1 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 .Fn @@ -88,6 +22,16 @@ FILE fqName: fileName:/partialSam.kt overridden: public open fun toString (): kotlin.String declared in .Fn $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:run visibility:public modality:OPEN <> ($this:.fsi., s:kotlin.String, i:kotlin.Int, t:kotlin.String) returnType:kotlin.Int + overridden: + public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn + $this: VALUE_PARAMETER name: type:.fsi. + VALUE_PARAMETER name:s index:0 type:kotlin.String + VALUE_PARAMETER name:i index:1 type:kotlin.Int + VALUE_PARAMETER name:t index:2 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.String): kotlin.Int declared in .fsi.' + CONST Int type=kotlin.Int value=1 CONSTRUCTOR_CALL 'public constructor () declared in .fsi.' type=.fsi. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Fn correspondingProperty: PROPERTY name:fsi visibility:public modality:FINAL [val] @@ -104,16 +48,6 @@ FILE fqName: fileName:/partialSam.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Fn]' - FUN name:run visibility:public modality:OPEN <> ($this:.fis., s:kotlin.String, i:kotlin.Int, t:kotlin.Int) returnType:kotlin.String - overridden: - public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn - $this: VALUE_PARAMETER name: type:.fis. - VALUE_PARAMETER name:s index:0 type:kotlin.String - VALUE_PARAMETER name:i index:1 type:kotlin.Int - VALUE_PARAMETER name:t index:2 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.Int): kotlin.String declared in .fis.' - CONST String type=kotlin.String value="" 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 .Fn @@ -127,12 +61,78 @@ FILE fqName: fileName:/partialSam.kt overridden: public open fun toString (): kotlin.String declared in .Fn $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:run visibility:public modality:OPEN <> ($this:.fis., s:kotlin.String, i:kotlin.Int, t:kotlin.Int) returnType:kotlin.String + overridden: + public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn + $this: VALUE_PARAMETER name: type:.fis. + VALUE_PARAMETER name:s index:0 type:kotlin.String + VALUE_PARAMETER name:i index:1 type:kotlin.Int + VALUE_PARAMETER name:t index:2 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.Int): kotlin.String declared in .fis.' + CONST String type=kotlin.String value="" CONSTRUCTOR_CALL 'public constructor () declared in .fis.' type=.fis. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Fn correspondingProperty: PROPERTY name:fis visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): .Fn declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fis type:.Fn visibility:private [final,static]' type=.Fn origin=null + CLASS CLASS name:J modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.J + CONSTRUCTOR visibility:public <> () returnType:.J [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:J modality:FINAL visibility:public 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 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:runConversion visibility:public modality:FINAL <> ($this:.J, f1:.Fn, f2:.Fn) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.J + VALUE_PARAMETER name:f1 index:0 type:.Fn + VALUE_PARAMETER name:f2 index:1 type:.Fn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun runConversion (f1: .Fn, f2: .Fn): kotlin.Int declared in .J' + CALL 'public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn' type=kotlin.Int origin=null + $this: GET_VAR 'f1: .Fn declared in .J.runConversion' type=.Fn origin=null + s: CONST String type=kotlin.String value="Bar" + i: CONST Int type=kotlin.Int value=1 + t: CALL 'public abstract fun run (s: kotlin.String, i: kotlin.Int, t: T of .Fn): R of .Fn declared in .Fn' type=kotlin.String origin=null + $this: GET_VAR 'f2: .Fn declared in .J.runConversion' type=.Fn origin=null + s: CONST String type=kotlin.String value="Foo" + i: CONST Int type=kotlin.Int value=42 + t: CONST Int type=kotlin.Int value=239 + CLASS INTERFACE name:Fn modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fn.Fn, R of .Fn> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:R index:1 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:run visibility:public modality:ABSTRACT <> ($this:.Fn.Fn, R of .Fn>, s:kotlin.String, i:kotlin.Int, t:T of .Fn) returnType:R of .Fn + $this: VALUE_PARAMETER name: type:.Fn.Fn, R of .Fn> + VALUE_PARAMETER name:s index:0 type:kotlin.String + VALUE_PARAMETER name:i index:1 type:kotlin.Int + VALUE_PARAMETER name:t index:2 type:T of .Fn FUN name:test visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit VALUE_PARAMETER name:j index:0 type:.J BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt.txt index e0dfeedb75b..1a276064645 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt.txt @@ -1,21 +1,3 @@ -fun interface Fn { - abstract fun run(s: String, i: Int, t: T): R - -} - -class J { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun runConversion(f1: Fn, f2: Fn): Int { - return f1.run(s = "Bar", i = 1, t = f2.run(s = "Foo", i = 42, t = 239)) - } - -} - val fsi: Fn field = { // BLOCK local class : Fn { @@ -54,6 +36,24 @@ val fis: Fn } get +class J { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun runConversion(f1: Fn, f2: Fn): Int { + return f1.run(s = "Bar", i = 1, t = f2.run(s = "Foo", i = 42, t = 239)) + } + +} + +fun interface Fn { + abstract fun run(s: String, i: Int, t: T): R + +} + fun test(j: J) { j.runConversion(f1 = (), f2 = local fun (s: String, i: Int, ti: Int): String { return "" @@ -64,3 +64,4 @@ fun test(j: J) { } /*-> Fn */, f2 = ()) /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.ir.txt index c4eddb14bf7..acebccd25a0 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.ir.txt @@ -1,9 +1,6 @@ FILE fqName: fileName:/samConversionInVarargs.kt CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFoo - VALUE_PARAMETER name:i index:0 type:kotlin.Int 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 @@ -17,9 +14,23 @@ FILE fqName: fileName:/samConversionInVarargs.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:useVararg visibility:public modality:FINAL <> (foos:kotlin.Array.IFoo>) returnType:kotlin.Unit - VALUE_PARAMETER name:foos index:0 type:kotlin.Array.IFoo> varargElementType:.IFoo [vararg] + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFoo + VALUE_PARAMETER name:i index:0 type:kotlin.Int + FUN name:testAdaptedCR visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY + CALL 'public final fun useVararg (vararg foos: .IFoo): kotlin.Unit declared in ' type=kotlin.Unit origin=null + foos: VARARG type=kotlin.Array.IFoo> varargElementType=.IFoo + BLOCK type=.IFoo origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:withVarargOfInt visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null + xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + GET_VAR 'p0: kotlin.Int declared in .testAdaptedCR.withVarargOfInt' type=kotlin.Int origin=null + TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo + FUNCTION_REFERENCE 'local final fun withVarargOfInt (p0: kotlin.Int): kotlin.Unit declared in .testAdaptedCR' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in FUN name:testLambda visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useVararg (vararg foos: .IFoo): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -56,22 +67,11 @@ FILE fqName: fileName:/samConversionInVarargs.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Unit declared in .testSeveralLambdas' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUN name:useVararg visibility:public modality:FINAL <> (foos:kotlin.Array.IFoo>) returnType:kotlin.Unit + VALUE_PARAMETER name:foos index:0 type:kotlin.Array.IFoo> varargElementType:.IFoo [vararg] + BLOCK_BODY FUN name:withVarargOfInt visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.String VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in ' CONST String type=kotlin.String value="" - FUN name:testAdaptedCR visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun useVararg (vararg foos: .IFoo): kotlin.Unit declared in ' type=kotlin.Unit origin=null - foos: VARARG type=kotlin.Array.IFoo> varargElementType=.IFoo - BLOCK type=.IFoo origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:withVarargOfInt visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null - xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - GET_VAR 'p0: kotlin.Int declared in .testAdaptedCR.withVarargOfInt' type=kotlin.Int origin=null - TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - FUNCTION_REFERENCE 'local final fun withVarargOfInt (p0: kotlin.Int): kotlin.Unit declared in .testAdaptedCR' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.kt.txt index 455accad276..6e32c05f929 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.kt.txt @@ -3,7 +3,14 @@ fun interface IFoo { } -fun useVararg(vararg foos: IFoo) { +fun testAdaptedCR() { + useVararg(foos = [{ // BLOCK + local fun withVarargOfInt(p0: Int) { + withVarargOfInt(xs = [p0]) /*~> Unit */ + } + + ::withVarargOfInt /*-> IFoo */ + }]) } fun testLambda() { @@ -26,17 +33,10 @@ fun testSeveralLambdas() { /*-> IFoo */]) } +fun useVararg(vararg foos: IFoo) { +} + fun withVarargOfInt(vararg xs: Int): String { return "" } -fun testAdaptedCR() { - useVararg(foos = [{ // BLOCK - local fun withVarargOfInt(p0: Int) { - withVarargOfInt(xs = [p0]) /*~> Unit */ - } - - ::withVarargOfInt /*-> IFoo */ - }]) -} - diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.ir.txt index ea8de7b7d77..ff6b27a3ce2 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.ir.txt @@ -1,9 +1,6 @@ FILE fqName: fileName:/samConversionInVarargs.kt CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFoo - VALUE_PARAMETER name:i index:0 type:kotlin.Int 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 @@ -17,9 +14,23 @@ FILE fqName: fileName:/samConversionInVarargs.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:useVararg visibility:public modality:FINAL <> (foos:kotlin.Array.IFoo>) returnType:kotlin.Unit - VALUE_PARAMETER name:foos index:0 type:kotlin.Array.IFoo> varargElementType:.IFoo [vararg] + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo, i:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFoo + VALUE_PARAMETER name:i index:0 type:kotlin.Int + FUN name:testAdaptedCR visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY + CALL 'public final fun useVararg (vararg foos: .IFoo): kotlin.Unit declared in ' type=kotlin.Unit origin=null + foos: VARARG type=kotlin.Array.IFoo> varargElementType=.IFoo + BLOCK type=.IFoo origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:withVarargOfInt visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null + xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + GET_VAR 'p0: kotlin.Int declared in .testAdaptedCR.withVarargOfInt' type=kotlin.Int origin=null + TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo + FUNCTION_REFERENCE 'local final fun withVarargOfInt (p0: kotlin.Int): kotlin.Unit declared in .testAdaptedCR' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in FUN name:testLambda visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useVararg (vararg foos: .IFoo): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -56,22 +67,11 @@ FILE fqName: fileName:/samConversionInVarargs.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Unit declared in .testSeveralLambdas' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUN name:useVararg visibility:public modality:FINAL <> (foos:kotlin.Array.IFoo>) returnType:kotlin.Unit + VALUE_PARAMETER name:foos index:0 type:kotlin.Array.IFoo> varargElementType:.IFoo [vararg] + BLOCK_BODY FUN name:withVarargOfInt visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.String VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in ' CONST String type=kotlin.String value="" - FUN name:testAdaptedCR visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun useVararg (vararg foos: .IFoo): kotlin.Unit declared in ' type=kotlin.Unit origin=null - foos: VARARG type=kotlin.Array.IFoo> varargElementType=.IFoo - BLOCK type=.IFoo origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:withVarargOfInt visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null - xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - GET_VAR 'p0: kotlin.Int declared in .testAdaptedCR.withVarargOfInt' type=kotlin.Int origin=null - TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - FUNCTION_REFERENCE 'local final fun withVarargOfInt (p0: kotlin.Int): kotlin.Unit declared in .testAdaptedCR' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt.txt index 81fc4867582..6e32c05f929 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt.txt @@ -3,7 +3,14 @@ fun interface IFoo { } -fun useVararg(vararg foos: IFoo) { +fun testAdaptedCR() { + useVararg(foos = [{ // BLOCK + local fun withVarargOfInt(p0: Int) { + withVarargOfInt(xs = [p0]) /*~> Unit */ + } + + ::withVarargOfInt /*-> IFoo */ + }]) } fun testLambda() { @@ -26,16 +33,10 @@ fun testSeveralLambdas() { /*-> IFoo */]) } +fun useVararg(vararg foos: IFoo) { +} + fun withVarargOfInt(vararg xs: Int): String { return "" } -fun testAdaptedCR() { - useVararg(foos = [{ // BLOCK - local fun withVarargOfInt(p0: Int) { - withVarargOfInt(xs = [p0]) /*~> Unit */ - } - - ::withVarargOfInt /*-> IFoo */ - }]) -} diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.ir.txt index 659a769ba5b..b4dc963423d 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.ir.txt @@ -1,8 +1,6 @@ FILE fqName: fileName:/samConversionInVarargsMixed.kt CLASS INTERFACE name:MyRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyRunnable - FUN name:run visibility:public modality:ABSTRACT <> ($this:.MyRunnable) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.MyRunnable 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 @@ -16,6 +14,11 @@ FILE fqName: fileName:/samConversionInVarargsMixed.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:run visibility:public modality:ABSTRACT <> ($this:.MyRunnable) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.MyRunnable + FUN name:foo visibility:public modality:FINAL <> (rs:kotlin.Array.MyRunnable>) returnType:kotlin.Unit + VALUE_PARAMETER name:rs index:0 type:kotlin.Array.MyRunnable> varargElementType:.MyRunnable [vararg] + BLOCK_BODY FUN name:test visibility:public modality:FINAL <> (a:kotlin.Any, r:.MyRunnable) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any VALUE_PARAMETER name:r index:1 type:.MyRunnable @@ -36,6 +39,3 @@ FILE fqName: fileName:/samConversionInVarargsMixed.kt GET_VAR 'r: .MyRunnable declared in .test' type=.MyRunnable origin=null TYPE_OP type=.MyRunnable origin=IMPLICIT_CAST typeOperand=.MyRunnable GET_VAR 'a: kotlin.Any declared in .test' type=kotlin.Any origin=null - FUN name:foo visibility:public modality:FINAL <> (rs:kotlin.Array.MyRunnable>) returnType:kotlin.Unit - VALUE_PARAMETER name:rs index:0 type:kotlin.Array.MyRunnable> varargElementType:.MyRunnable [vararg] - BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.kt.txt index d3d79d4c5ef..86a1f46afb4 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.kt.txt @@ -3,6 +3,9 @@ fun interface MyRunnable { } +fun foo(vararg rs: MyRunnable) { +} + fun test(a: Any, r: MyRunnable) { when { a is MyRunnable -> { // BLOCK @@ -14,5 +17,3 @@ fun test(a: Any, r: MyRunnable) { } } -fun foo(vararg rs: MyRunnable) { -} diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.ir.txt index 6c9f8626a12..858957bf061 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.ir.txt @@ -1,8 +1,6 @@ FILE fqName: fileName:/samConversionOnCallableReference.kt CLASS INTERFACE name:KRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KRunnable - FUN name:run visibility:public modality:ABSTRACT <> ($this:.KRunnable) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.KRunnable 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 @@ -16,6 +14,8 @@ FILE fqName: fileName:/samConversionOnCallableReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:run visibility:public modality:ABSTRACT <> ($this:.KRunnable) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.KRunnable FUN name:foo0 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY FUN name:foo1 visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int @@ -23,24 +23,11 @@ FILE fqName: fileName:/samConversionOnCallableReference.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' CONST Int type=kotlin.Int value=1 - FUN name:use visibility:public modality:FINAL <> (r:.KRunnable) returnType:kotlin.Unit - VALUE_PARAMETER name:r index:0 type:.KRunnable - BLOCK_BODY FUN name:testSamConstructor visibility:public modality:FINAL <> () returnType:.KRunnable BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testSamConstructor (): .KRunnable declared in ' TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable FUNCTION_REFERENCE 'public final fun foo0 (): kotlin.Unit declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= - FUN name:testSamCosntructorOnAdapted visibility:public modality:FINAL <> () returnType:.KRunnable - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testSamCosntructorOnAdapted (): .KRunnable declared in ' - TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable - BLOCK type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo1 visibility:local modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun foo1 (): kotlin.Unit declared in .testSamCosntructorOnAdapted' type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in FUN name:testSamConversion visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun use (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -56,3 +43,16 @@ FILE fqName: fileName:/samConversionOnCallableReference.kt CALL 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable FUNCTION_REFERENCE 'local final fun foo1 (): kotlin.Unit declared in .testSamConversionOnAdapted' type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in + FUN name:testSamCosntructorOnAdapted visibility:public modality:FINAL <> () returnType:.KRunnable + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testSamCosntructorOnAdapted (): .KRunnable declared in ' + TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + BLOCK type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo1 visibility:local modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun foo1 (): kotlin.Unit declared in .testSamCosntructorOnAdapted' type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in + FUN name:use visibility:public modality:FINAL <> (r:.KRunnable) returnType:kotlin.Unit + VALUE_PARAMETER name:r index:0 type:.KRunnable + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt.txt index 9d3478ecc6c..261b0397cfd 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt.txt @@ -10,23 +10,10 @@ fun foo1(vararg xs: Int): Int { return 1 } -fun use(r: KRunnable) { -} - fun testSamConstructor(): KRunnable { return ::foo0 /*-> KRunnable */ } -fun testSamCosntructorOnAdapted(): KRunnable { - return { // BLOCK - local fun foo1() { - foo1() /*~> Unit */ - } - - ::foo1 - } /*-> KRunnable */ -} - fun testSamConversion() { use(r = ::foo0 /*-> KRunnable */) } @@ -40,3 +27,17 @@ fun testSamConversionOnAdapted() { ::foo1 /*-> KRunnable */ }) } + +fun testSamCosntructorOnAdapted(): KRunnable { + return { // BLOCK + local fun foo1() { + foo1() /*~> Unit */ + } + + ::foo1 + } /*-> KRunnable */ +} + +fun use(r: KRunnable) { +} + diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.ir.txt index 3c9aa904cc2..78b049f6492 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.ir.txt @@ -1,8 +1,23 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt CLASS INTERFACE name:KRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KRunnable + 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: 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:run visibility:public modality:ABSTRACT <> ($this:.KRunnable) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.KRunnable + CLASS INTERFACE name:Unrelated modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Unrelated 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 @@ -46,6 +61,26 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null + FUN name:test10 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.Unrelated + GET_VAR 'a: kotlin.Any declared in .test10' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Function0 + TYPE_OP type=.Unrelated origin=IMPLICIT_CAST typeOperand=.Unrelated + GET_VAR 'a: kotlin.Any declared in .test10' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: BLOCK type=kotlin.Unit origin=null + CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any declared in .test10' type=kotlin.Any origin=null FUN name:test2 visibility:public modality:FINAL <> (a:.KRunnable) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.KRunnable BLOCK_BODY @@ -145,21 +180,6 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable GET_VAR 'a: T of .test7b declared in .test7b' type=T of .test7b origin=null - CLASS INTERFACE name:Unrelated modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Unrelated - 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: 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:test7c visibility:public modality:FINAL (a:T of .test7c) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[.Unrelated; kotlin.Function0] reified:false VALUE_PARAMETER name:a index:0 type:T of .test7c @@ -180,23 +200,3 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable FUNCTION_REFERENCE 'public final fun test9 (): kotlin.Unit declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= - FUN name:test10 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:kotlin.Any - BLOCK_BODY - WHEN type=kotlin.Unit origin=IF - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.Unrelated - GET_VAR 'a: kotlin.Any declared in .test10' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Function0 - TYPE_OP type=.Unrelated origin=IMPLICIT_CAST typeOperand=.Unrelated - GET_VAR 'a: kotlin.Any declared in .test10' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: BLOCK type=kotlin.Unit origin=null - CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null - r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable - TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 - GET_VAR 'a: kotlin.Any declared in .test10' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.kt.txt index 38ce376d9d8..f4d71e73f26 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.kt.txt @@ -3,6 +3,9 @@ fun interface KRunnable { } +interface Unrelated { +} + fun id(x: T): T { return x } @@ -25,6 +28,17 @@ fun test1(a: Function0) { } } +fun test10(a: Any) { + when { + when { + a is Unrelated -> a /*as Unrelated */ is Function0 + else -> false + } -> { // BLOCK + run1(r = a /*as Function0 */ /*-> KRunnable */) + } + } +} + fun test2(a: KRunnable) { a as Function0 /*~> Unit */ run1(r = a) @@ -78,13 +92,10 @@ fun > test7a(a: T) { run1(r = a /*as Function0 */ /*-> KRunnable */) } -fun test7b(a: T) where T : Function1, T : Function0 { +fun test7b(a: T) where T : Function0, T : Function1 { run1(r = a /*-> KRunnable */) } -interface Unrelated { -} - fun test7c(a: T) where T : Unrelated, T : Function0 { run1(r = a /*-> KRunnable */) } @@ -97,14 +108,3 @@ fun test9() { run1(r = ::test9 /*-> KRunnable */) } -fun test10(a: Any) { - when { - when { - a is Unrelated -> a /*as Unrelated */ is Function0 - else -> false - } -> { // BLOCK - run1(r = a /*as Function0 */ /*-> KRunnable */) - } - } -} - diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.ir.txt index b49994cf50e..60eb1938fb9 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.ir.txt @@ -1,8 +1,23 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt CLASS INTERFACE name:KRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KRunnable + 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: 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:run visibility:public modality:ABSTRACT <> ($this:.KRunnable) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.KRunnable + CLASS INTERFACE name:Unrelated modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Unrelated 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 @@ -46,6 +61,25 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null + FUN name:test10 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.Unrelated + GET_VAR 'a: kotlin.Any declared in .test10' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any declared in .test10' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: BLOCK type=kotlin.Unit origin=null + CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any declared in .test10' type=kotlin.Any origin=null FUN name:test2 visibility:public modality:FINAL <> (a:.KRunnable) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.KRunnable BLOCK_BODY @@ -144,21 +178,6 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable GET_VAR 'a: T of .test7b declared in .test7b' type=T of .test7b origin=null - CLASS INTERFACE name:Unrelated modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Unrelated - 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: 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:test7c visibility:public modality:FINAL (a:T of .test7c) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[.Unrelated; kotlin.Function0] reified:false VALUE_PARAMETER name:a index:0 type:T of .test7c @@ -179,22 +198,3 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable FUNCTION_REFERENCE 'public final fun test9 (): kotlin.Unit declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= - FUN name:test10 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:kotlin.Any - BLOCK_BODY - WHEN type=kotlin.Unit origin=IF - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.Unrelated - GET_VAR 'a: kotlin.Any declared in .test10' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Function0 - GET_VAR 'a: kotlin.Any declared in .test10' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: BLOCK type=kotlin.Unit origin=null - CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null - r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable - TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 - GET_VAR 'a: kotlin.Any declared in .test10' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt.txt index a60696ee3ed..db52932e9f1 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt.txt @@ -3,6 +3,9 @@ fun interface KRunnable { } +interface Unrelated { +} + fun id(x: T): T { return x } @@ -25,6 +28,17 @@ fun test1(a: Function0) { } } +fun test10(a: Any) { + when { + when { + a is Unrelated -> a is Function0 + else -> false + } -> { // BLOCK + run1(r = a /*as Function0 */ /*-> KRunnable */) + } + } +} + fun test2(a: KRunnable) { a as Function0 /*~> Unit */ run1(r = a) @@ -78,13 +92,10 @@ fun > test7a(a: T) { run1(r = a /*as Function0 */ /*-> KRunnable */) } -fun test7b(a: T) where T : Function1, T : Function0 { +fun test7b(a: T) where T : Function0, T : Function1 { run1(r = a /*-> KRunnable */) } -interface Unrelated { -} - fun test7c(a: T) where T : Unrelated, T : Function0 { run1(r = a /*-> KRunnable */) } @@ -97,13 +108,3 @@ fun test9() { run1(r = ::test9 /*-> KRunnable */) } -fun test10(a: Any) { - when { - when { - a is Unrelated -> a is Function0 - else -> false - } -> { // BLOCK - run1(r = a /*as Function0 */ /*-> KRunnable */) - } - } -} diff --git a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.ir.txt b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.ir.txt index 5fe6fcf6698..3fa6a71ebeb 100644 --- a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.ir.txt @@ -1,47 +1,7 @@ FILE fqName: fileName:/funInterfaceConstructorReference.kt - CLASS INTERFACE name:KRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KRunnable - FUN name:run visibility:public modality:ABSTRACT <> ($this:.KRunnable) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.KRunnable - 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: 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 - TYPEALIAS name:KR visibility:public expandedType:.KRunnable - CLASS INTERFACE name:KSupplier modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KSupplier.KSupplier> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:get visibility:public modality:ABSTRACT <> ($this:.KSupplier.KSupplier>) returnType:T of .KSupplier - $this: VALUE_PARAMETER name: type:.KSupplier.KSupplier> - 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: 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 - TYPEALIAS name:KSS visibility:public expandedType:.KSupplier CLASS INTERFACE name:KConsumer modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KConsumer.KConsumer> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:accept visibility:public modality:ABSTRACT <> ($this:.KConsumer.KConsumer>, x:T of .KConsumer) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.KConsumer.KConsumer> - VALUE_PARAMETER name:x index:0 type:T of .KConsumer 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 @@ -55,7 +15,44 @@ FILE fqName: fileName:/funInterfaceConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - TYPEALIAS name:KCS visibility:public expandedType:.KConsumer + FUN name:accept visibility:public modality:ABSTRACT <> ($this:.KConsumer.KConsumer>, x:T of .KConsumer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.KConsumer.KConsumer> + VALUE_PARAMETER name:x index:0 type:T of .KConsumer + CLASS INTERFACE name:KRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KRunnable + 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: 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:run visibility:public modality:ABSTRACT <> ($this:.KRunnable) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.KRunnable + CLASS INTERFACE name:KSupplier modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KSupplier.KSupplier> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:get visibility:public modality:ABSTRACT <> ($this:.KSupplier.KSupplier>) returnType:T of .KSupplier + $this: VALUE_PARAMETER name: type:.KSupplier.KSupplier> FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction1, .KRunnable> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.reflect.KFunction1, .KRunnable> declared in ' @@ -160,3 +157,6 @@ FILE fqName: fileName:/funInterfaceConstructorReference.kt : kotlin.Function1 arg0: GET_VAR 'function: kotlin.Function1 declared in .test3b.KConsumer' type=kotlin.Function1 origin=null FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1): .KConsumer declared in .test3b' type=kotlin.reflect.KFunction1, .KConsumer> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= + TYPEALIAS name:KCS visibility:public expandedType:.KConsumer + TYPEALIAS name:KR visibility:public expandedType:.KRunnable + TYPEALIAS name:KSS visibility:public expandedType:.KSupplier diff --git a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.kt.txt b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.kt.txt index 6f9c39f4d05..d4bd52558c2 100644 --- a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.kt.txt @@ -1,21 +1,18 @@ -fun interface KRunnable { - abstract fun run() - -} - -typealias KR = KRunnable -fun interface KSupplier { - abstract fun get(): T - -} - -typealias KSS = KSupplier fun interface KConsumer { abstract fun accept(x: T) } -typealias KCS = KConsumer +fun interface KRunnable { + abstract fun run() + +} + +fun interface KSupplier { + abstract fun get(): T + +} + fun test1(): KFunction1, KRunnable> { return { // BLOCK local fun KRunnable(function: Function0): KRunnable { @@ -95,3 +92,7 @@ fun test3b(): KFunction> { ::KConsumer } } + +typealias KCS = KConsumer +typealias KR = KRunnable +typealias KSS = KSupplier diff --git a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.ir.txt b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.ir.txt index 94a542a7ca0..cdcaad1fa8c 100644 --- a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.ir.txt @@ -1,47 +1,7 @@ FILE fqName: fileName:/funInterfaceConstructorReference.kt - CLASS INTERFACE name:KRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KRunnable - FUN name:run visibility:public modality:ABSTRACT <> ($this:.KRunnable) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.KRunnable - 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: 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 - TYPEALIAS name:KR visibility:public expandedType:.KRunnable - CLASS INTERFACE name:KSupplier modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KSupplier.KSupplier> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:get visibility:public modality:ABSTRACT <> ($this:.KSupplier.KSupplier>) returnType:T of .KSupplier - $this: VALUE_PARAMETER name: type:.KSupplier.KSupplier> - 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: 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 - TYPEALIAS name:KSS visibility:public expandedType:.KSupplier CLASS INTERFACE name:KConsumer modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KConsumer.KConsumer> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:accept visibility:public modality:ABSTRACT <> ($this:.KConsumer.KConsumer>, x:T of .KConsumer) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.KConsumer.KConsumer> - VALUE_PARAMETER name:x index:0 type:T of .KConsumer 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 @@ -55,7 +15,44 @@ FILE fqName: fileName:/funInterfaceConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - TYPEALIAS name:KCS visibility:public expandedType:.KConsumer + FUN name:accept visibility:public modality:ABSTRACT <> ($this:.KConsumer.KConsumer>, x:T of .KConsumer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.KConsumer.KConsumer> + VALUE_PARAMETER name:x index:0 type:T of .KConsumer + CLASS INTERFACE name:KRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KRunnable + 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: 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:run visibility:public modality:ABSTRACT <> ($this:.KRunnable) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.KRunnable + CLASS INTERFACE name:KSupplier modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KSupplier.KSupplier> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:get visibility:public modality:ABSTRACT <> ($this:.KSupplier.KSupplier>) returnType:T of .KSupplier + $this: VALUE_PARAMETER name: type:.KSupplier.KSupplier> FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction1<@[ParameterName(name = "function")] kotlin.Function0, .KRunnable> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.reflect.KFunction1<@[ParameterName(name = "function")] kotlin.Function0, .KRunnable> declared in ' @@ -160,3 +157,6 @@ FILE fqName: fileName:/funInterfaceConstructorReference.kt : kotlin.Function1<@[ParameterName(name = "x")] kotlin.String, kotlin.Unit> arg0: GET_VAR 'function: kotlin.Function1<@[ParameterName(name = "x")] kotlin.String, kotlin.Unit> declared in .test3b.KConsumer' type=kotlin.Function1<@[ParameterName(name = "x")] kotlin.String, kotlin.Unit> origin=null FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = "x")] kotlin.String, kotlin.Unit>): .KConsumer declared in .test3b' type=kotlin.reflect.KFunction1<@[ParameterName(name = "function")] kotlin.Function1<@[ParameterName(name = "x")] kotlin.String, kotlin.Unit>, .KConsumer> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= + TYPEALIAS name:KCS visibility:public expandedType:.KConsumer + TYPEALIAS name:KR visibility:public expandedType:.KRunnable + TYPEALIAS name:KSS visibility:public expandedType:.KSupplier diff --git a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.kt.txt b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.kt.txt index d6f57efb122..45ea708688c 100644 --- a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.kt.txt @@ -1,21 +1,18 @@ -fun interface KRunnable { - abstract fun run() - -} - -typealias KR = KRunnable -fun interface KSupplier { - abstract fun get(): T - -} - -typealias KSS = KSupplier fun interface KConsumer { abstract fun accept(x: T) } -typealias KCS = KConsumer +fun interface KRunnable { + abstract fun run() + +} + +fun interface KSupplier { + abstract fun get(): T + +} + fun test1(): KFunction1<@ParameterName(name = "function") Function0, KRunnable> { return { // BLOCK local fun KRunnable(function: Function0): KRunnable { @@ -95,3 +92,7 @@ fun test3b(): KFunction> { ::KConsumer } } + +typealias KCS = KConsumer +typealias KR = KRunnable +typealias KSS = KSupplier diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.ir.txt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.ir.txt index a0f82355476..e3296d8f483 100644 --- a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.ir.txt +++ b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.ir.txt @@ -1,12 +1,36 @@ FILE fqName: fileName:/genericConstructorCallWithTypeArguments.kt - FUN name:testSimple visibility:public modality:FINAL <> () returnType:.Box - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testSimple (): .Box declared in ' - CONSTRUCTOR_CALL 'public constructor (value: T of .Box) declared in .Box' type=.Box origin=null - : kotlin.Long - value: CALL 'public final fun times (other: kotlin.Int): kotlin.Long declared in kotlin.Long' type=kotlin.Long origin=MUL - $this: CONST Long type=kotlin.Long value=2 - other: CONST Int type=kotlin.Int value=3 + CLASS CLASS name:Box modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box.Box> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:T of .Box visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: T of .Box declared in .Box.' type=T of .Box origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Box.Box>) returnType:T of .Box + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Box.Box> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Box declared in .Box' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Box visibility:private [final]' type=T of .Box origin=null + receiver: GET_VAR ': .Box.Box> declared in .Box.' type=.Box.Box> origin=null + CONSTRUCTOR visibility:public <> (value:T of .Box) returnType:.Box.Box> [primary] + VALUE_PARAMETER name:value index:0 type:T of .Box + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box modality:FINAL visibility:public 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 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:testArray visibility:public modality:FINAL (n:kotlin.Int, block:kotlin.Function0.testArray>) returnType:kotlin.Array.testArray> [inline] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true VALUE_PARAMETER name:n index:0 type:kotlin.Int @@ -23,35 +47,11 @@ FILE fqName: fileName:/genericConstructorCallWithTypeArguments.kt RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): T of .testArray declared in .testArray' CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .testArray origin=INVOKE $this: GET_VAR 'block: kotlin.Function0.testArray> declared in .testArray' type=kotlin.Function0.testArray> origin=VARIABLE_AS_FUNCTION - CLASS CLASS name:Box modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box.Box> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .Box) returnType:.Box.Box> [primary] - VALUE_PARAMETER name:value index:0 type:T of .Box - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:T of .Box visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: T of .Box declared in .Box.' type=T of .Box origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Box.Box>) returnType:T of .Box - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Box.Box> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .Box declared in .Box' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Box visibility:private [final]' type=T of .Box origin=null - receiver: GET_VAR ': .Box.Box> declared in .Box.' type=.Box.Box> 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: 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:testSimple visibility:public modality:FINAL <> () returnType:.Box + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testSimple (): .Box declared in ' + CONSTRUCTOR_CALL 'public constructor (value: T of .Box) declared in .Box' type=.Box origin=null + : kotlin.Long + value: CALL 'public final fun times (other: kotlin.Int): kotlin.Long declared in kotlin.Long' type=kotlin.Long origin=MUL + $this: CONST Long type=kotlin.Long value=2 + other: CONST Int type=kotlin.Int value=3 diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt.txt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt.txt index b20114935fa..1984c64d7b3 100644 --- a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt.txt +++ b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt.txt @@ -1,5 +1,14 @@ -fun testSimple(): Box { - return Box(value = 2L.times(other = 3)) +class Box { + val value: T + field = value + get + + constructor(value: T) /* primary */ { + super/*Any*/() + /* () */ + + } + } inline fun testArray(n: Int, crossinline block: Function0): Array { @@ -9,15 +18,7 @@ inline fun testArray(n: Int, crossinline block: Function0) ) } -class Box { - constructor(value: T) /* primary */ { - super/*Any*/() - /* () */ - - } - - val value: T - field = value - get - +fun testSimple(): Box { + return Box(value = 2L.times(other = 3)) } + diff --git a/compiler/testData/ir/irText/expressions/genericPropertyCall.ir.txt b/compiler/testData/ir/irText/expressions/genericPropertyCall.ir.txt index 4c4a4602f7b..8a90675cc77 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyCall.ir.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyCall.ir.txt @@ -1,12 +1,4 @@ FILE fqName: fileName:/genericPropertyCall.kt - PROPERTY name:id visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:T of . - correspondingProperty: PROPERTY name:id visibility:public modality:FINAL [val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:T of . - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of . declared in ' - GET_VAR ': T of . declared in .' type=T of . origin=null PROPERTY name:test visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.String visibility:private [final,static] EXPRESSION_BODY @@ -18,3 +10,11 @@ FILE fqName: fileName:/genericPropertyCall.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null + PROPERTY name:id visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:T of . + correspondingProperty: PROPERTY name:id visibility:public modality:FINAL [val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:T of . + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of . declared in ' + GET_VAR ': T of . declared in .' type=T of . origin=null diff --git a/compiler/testData/ir/irText/expressions/genericPropertyCall.kt.txt b/compiler/testData/ir/irText/expressions/genericPropertyCall.kt.txt index 37051856b73..fbcd7033860 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyCall.kt.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyCall.kt.txt @@ -1,8 +1,9 @@ +val test: String + field = "abc".() + get + val T.id: T get(): T { return } -val test: String - field = "abc".() - get diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.ir.txt b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.ir.txt index e6399e7af3e..673f0a789b3 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.ir.txt @@ -1,18 +1,117 @@ FILE fqName: fileName:/genericPropertyRef.kt + PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) declared in .DVal' type=.DVal origin=null + kmember: PROPERTY_REFERENCE 'public final text: kotlin.String?' field=null getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, kotlin.String?> origin=null + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Value.> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=null + t: GET_VAR ': .Value.> declared in .' type=.Value.> origin=null + p: PROPERTY_REFERENCE 'public final additionalText: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty1<.Value.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE + <1>: T of . + PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) declared in .DVal' type=.DVal origin=null + kmember: PROPERTY_REFERENCE 'public final value: T of .Value' field=null getter='public final fun (): T of .Value declared in .Value' setter='public final fun (: T of .Value): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, T of .> origin=null + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Value.> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=null + t: GET_VAR ': .Value.> declared in .' type=.Value.> origin=null + p: PROPERTY_REFERENCE 'public final additionalValue: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty1<.Value.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE + <1>: T of . + PROPERTY name:recivier visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static] + EXPRESSION_BODY + CONST String type=kotlin.String value="fail" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? + correspondingProperty: PROPERTY name:recivier visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static]' type=kotlin.Any? origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any?) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:recivier visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Any? + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Any? declared in .' type=kotlin.Any? origin=null + PROPERTY name:value2 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static] + EXPRESSION_BODY + CONST String type=kotlin.String value="fail2" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? + correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static]' type=kotlin.Any? origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any?) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Any? + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Any? declared in .' type=kotlin.Any? origin=null + PROPERTY name:barRef visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:barRef type:kotlin.reflect.KMutableProperty1 visibility:private [final,static] + EXPRESSION_BODY + PROPERTY_REFERENCE 'public final bar: T of .' field=null getter='public final fun (): T of . declared in ' setter='public final fun (value: T of .): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1 origin=null + <1>: kotlin.String? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty1 + correspondingProperty: PROPERTY name:barRef visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KMutableProperty1 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:barRef type:kotlin.reflect.KMutableProperty1 visibility:private [final,static]' type=kotlin.reflect.KMutableProperty1 origin=null + CLASS CLASS name:DVal modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DVal + PROPERTY name:kmember visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:kmember type:kotlin.Any visibility:private [final] + EXPRESSION_BODY + GET_VAR 'kmember: kotlin.Any declared in .DVal.' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DVal) returnType:kotlin.Any + correspondingProperty: PROPERTY name:kmember visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.DVal + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .DVal' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:kmember type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + receiver: GET_VAR ': .DVal declared in .DVal.' type=.DVal origin=null + CONSTRUCTOR visibility:public <> (kmember:kotlin.Any) returnType:.DVal [primary] + VALUE_PARAMETER name:kmember index:0 type:kotlin.Any + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DVal modality:FINAL visibility:public 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 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:getValue visibility:public modality:FINAL <> ($this:.DVal, t:kotlin.Any?, p:kotlin.Any) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.DVal + VALUE_PARAMETER name:t index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' + CONST Int type=kotlin.Int value=42 CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Value.Value> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .Value, text:kotlin.String?) returnType:.Value.Value> [primary] - VALUE_PARAMETER name:value index:0 type:T of .Value - EXPRESSION_BODY - TYPE_OP type=T of .Value origin=CAST typeOperand=T of .Value - CONST Null type=kotlin.Nothing? value=null - VALUE_PARAMETER name:text index:1 type:kotlin.String? - EXPRESSION_BODY - CONST Null type=kotlin.Nothing? value=null - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:value type:T of .Value visibility:private EXPRESSION_BODY @@ -51,76 +150,17 @@ FILE fqName: fileName:/genericPropertyRef.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:text type:kotlin.String? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Value.Value> declared in .Value.' type=.Value.Value> origin=null value: GET_VAR ': kotlin.String? declared in .Value.' type=kotlin.String? 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: 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 - PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final text: kotlin.String?' field=null getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, kotlin.String?> origin=null - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Value.> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=null - t: GET_VAR ': .Value.> declared in .' type=.Value.> origin=null - p: PROPERTY_REFERENCE 'public final additionalText: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty1<.Value.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE - <1>: T of . - PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final value: T of .Value' field=null getter='public final fun (): T of .Value declared in .Value' setter='public final fun (: T of .Value): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, T of .> origin=null - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Value.> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=null - t: GET_VAR ': .Value.> declared in .' type=.Value.> origin=null - p: PROPERTY_REFERENCE 'public final additionalValue: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty1<.Value.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE - <1>: T of . - CLASS CLASS name:DVal modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DVal - CONSTRUCTOR visibility:public <> (kmember:kotlin.Any) returnType:.DVal [primary] - VALUE_PARAMETER name:kmember index:0 type:kotlin.Any + CONSTRUCTOR visibility:public <> (value:T of .Value, text:kotlin.String?) returnType:.Value.Value> [primary] + VALUE_PARAMETER name:value index:0 type:T of .Value + EXPRESSION_BODY + TYPE_OP type=T of .Value origin=CAST typeOperand=T of .Value + CONST Null type=kotlin.Nothing? value=null + VALUE_PARAMETER name:text index:1 type:kotlin.String? + EXPRESSION_BODY + CONST Null type=kotlin.Nothing? value=null BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DVal modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:kmember visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:kmember type:kotlin.Any visibility:private [final] - EXPRESSION_BODY - GET_VAR 'kmember: kotlin.Any declared in .DVal.' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DVal) returnType:kotlin.Any - correspondingProperty: PROPERTY name:kmember visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.DVal - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .DVal' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:kmember type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null - receiver: GET_VAR ': .DVal declared in .DVal.' type=.DVal origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:.DVal, t:kotlin.Any?, p:kotlin.Any) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.DVal - VALUE_PARAMETER name:t index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' - CONST Int type=kotlin.Int value=42 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Value modality:FINAL visibility:public 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 declared in kotlin.Any @@ -134,36 +174,6 @@ FILE fqName: fileName:/genericPropertyRef.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:recivier visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static] - EXPRESSION_BODY - CONST String type=kotlin.String value="fail" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? - correspondingProperty: PROPERTY name:recivier visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static]' type=kotlin.Any? origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any?) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:recivier visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Any? - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Any? declared in .' type=kotlin.Any? origin=null - PROPERTY name:value2 visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static] - EXPRESSION_BODY - CONST String type=kotlin.String value="fail2" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? - correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static]' type=kotlin.Any? origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any?) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Any? - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Any? declared in .' type=kotlin.Any? origin=null PROPERTY name:bar visibility:public modality:FINAL [var] FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:T of . correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [var] @@ -182,13 +192,3 @@ FILE fqName: fileName:/genericPropertyRef.kt : GET_VAR ': T of . declared in .' type=T of . origin=null CALL 'public final fun (: kotlin.Any?): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : GET_VAR 'value: T of . declared in .' type=T of . origin=null - PROPERTY name:barRef visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:barRef type:kotlin.reflect.KMutableProperty1 visibility:private [final,static] - EXPRESSION_BODY - PROPERTY_REFERENCE 'public final bar: T of .' field=null getter='public final fun (): T of . declared in ' setter='public final fun (value: T of .): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1 origin=null - <1>: kotlin.String? - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty1 - correspondingProperty: PROPERTY name:barRef visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KMutableProperty1 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:barRef type:kotlin.reflect.KMutableProperty1 visibility:private [final,static]' type=kotlin.reflect.KMutableProperty1 origin=null diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.kt.txt b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.kt.txt index f41ebab2a94..ef82a60aed1 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.kt.txt @@ -1,22 +1,3 @@ -class Value { - constructor(value: T = null as T, text: String? = null) /* primary */ { - super/*Any*/() - /* () */ - - } - - var value: T - field = value - get - set - - var text: String? - field = text - get - set - -} - val Value.additionalText: Int /* by */ field = DVal(kmember = Value::text) get(): Int { @@ -29,23 +10,6 @@ val Value.additionalValue: Int /* by */ return #additionalValue$delegate.getValue(t = , p = ::additionalValue/*()*/) } -class DVal { - constructor(kmember: Any) /* primary */ { - super/*Any*/() - /* () */ - - } - - val kmember: Any - field = kmember - get - - operator fun getValue(t: Any?, p: Any): Int { - return 42 - } - -} - var recivier: Any? field = "fail" get @@ -56,6 +20,46 @@ var value2: Any? get set +val barRef: KMutableProperty1 + field = ::bar/*()*/ + get + +class DVal { + val kmember: Any + field = kmember + get + + constructor(kmember: Any) /* primary */ { + super/*Any*/() + /* () */ + + } + + operator fun getValue(t: Any?, p: Any): Int { + return 42 + } + +} + +class Value { + var value: T + field = value + get + set + + var text: String? + field = text + get + set + + constructor(value: T = null as T, text: String? = null) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + var T.bar: T get(): T { return @@ -65,6 +69,3 @@ var T.bar: T ( = value) } -val barRef: KMutableProperty1 - field = ::bar/*()*/ - get diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.ir.txt b/compiler/testData/ir/irText/expressions/genericPropertyRef.ir.txt index 08224fe3e34..81eeaccff31 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.ir.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.ir.txt @@ -1,18 +1,117 @@ FILE fqName: fileName:/genericPropertyRef.kt + PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) declared in .DVal' type=.DVal origin=null + kmember: PROPERTY_REFERENCE 'public final text: kotlin.String?' field=null getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value, kotlin.String?> origin=null + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Value.> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=null + t: GET_VAR ': .Value.> declared in .' type=.Value.> origin=null + p: PROPERTY_REFERENCE 'public final additionalText: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty1<.Value.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE + <1>: T of . + PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) declared in .DVal' type=.DVal origin=null + kmember: PROPERTY_REFERENCE 'public final value: T of .Value' field=null getter='public final fun (): T of .Value declared in .Value' setter='public final fun (: T of .Value): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value, kotlin.Any?> origin=null + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Value.> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=null + t: GET_VAR ': .Value.> declared in .' type=.Value.> origin=null + p: PROPERTY_REFERENCE 'public final additionalValue: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty1<.Value.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE + <1>: T of . + PROPERTY name:recivier visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static] + EXPRESSION_BODY + CONST String type=kotlin.String value="fail" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? + correspondingProperty: PROPERTY name:recivier visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static]' type=kotlin.Any? origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any?) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:recivier visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Any? + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Any? declared in .' type=kotlin.Any? origin=null + PROPERTY name:value2 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static] + EXPRESSION_BODY + CONST String type=kotlin.String value="fail2" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? + correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static]' type=kotlin.Any? origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any?) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Any? + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Any? declared in .' type=kotlin.Any? origin=null + PROPERTY name:barRef visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:barRef type:kotlin.reflect.KMutableProperty1 visibility:private [final,static] + EXPRESSION_BODY + PROPERTY_REFERENCE 'public final bar: T of .' field=null getter='public final fun (): T of . declared in ' setter='public final fun (value: T of .): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1 origin=null + <1>: kotlin.String? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty1 + correspondingProperty: PROPERTY name:barRef visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KMutableProperty1 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:barRef type:kotlin.reflect.KMutableProperty1 visibility:private [final,static]' type=kotlin.reflect.KMutableProperty1 origin=null + CLASS CLASS name:DVal modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DVal + PROPERTY name:kmember visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:kmember type:kotlin.Any visibility:private [final] + EXPRESSION_BODY + GET_VAR 'kmember: kotlin.Any declared in .DVal.' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DVal) returnType:kotlin.Any + correspondingProperty: PROPERTY name:kmember visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.DVal + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .DVal' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:kmember type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + receiver: GET_VAR ': .DVal declared in .DVal.' type=.DVal origin=null + CONSTRUCTOR visibility:public <> (kmember:kotlin.Any) returnType:.DVal [primary] + VALUE_PARAMETER name:kmember index:0 type:kotlin.Any + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DVal modality:FINAL visibility:public 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 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:getValue visibility:public modality:FINAL <> ($this:.DVal, t:kotlin.Any?, p:kotlin.Any) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.DVal + VALUE_PARAMETER name:t index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' + CONST Int type=kotlin.Int value=42 CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Value.Value> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .Value, text:kotlin.String?) returnType:.Value.Value> [primary] - VALUE_PARAMETER name:value index:0 type:T of .Value - EXPRESSION_BODY - TYPE_OP type=T of .Value origin=CAST typeOperand=T of .Value - CONST Null type=kotlin.Nothing? value=null - VALUE_PARAMETER name:text index:1 type:kotlin.String? - EXPRESSION_BODY - CONST Null type=kotlin.Nothing? value=null - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:value type:T of .Value visibility:private EXPRESSION_BODY @@ -51,76 +150,17 @@ FILE fqName: fileName:/genericPropertyRef.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:text type:kotlin.String? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Value.Value> declared in .Value.' type=.Value.Value> origin=null value: GET_VAR ': kotlin.String? declared in .Value.' type=kotlin.String? 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: 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 - PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final text: kotlin.String?' field=null getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value, kotlin.String?> origin=null - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Value.> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=null - t: GET_VAR ': .Value.> declared in .' type=.Value.> origin=null - p: PROPERTY_REFERENCE 'public final additionalText: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty1<.Value.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE - <1>: T of . - PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final value: T of .Value' field=null getter='public final fun (): T of .Value declared in .Value' setter='public final fun (: T of .Value): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value, kotlin.Any?> origin=null - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Value.> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=null - t: GET_VAR ': .Value.> declared in .' type=.Value.> origin=null - p: PROPERTY_REFERENCE 'public final additionalValue: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty1<.Value.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE - <1>: T of . - CLASS CLASS name:DVal modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DVal - CONSTRUCTOR visibility:public <> (kmember:kotlin.Any) returnType:.DVal [primary] - VALUE_PARAMETER name:kmember index:0 type:kotlin.Any + CONSTRUCTOR visibility:public <> (value:T of .Value, text:kotlin.String?) returnType:.Value.Value> [primary] + VALUE_PARAMETER name:value index:0 type:T of .Value + EXPRESSION_BODY + TYPE_OP type=T of .Value origin=CAST typeOperand=T of .Value + CONST Null type=kotlin.Nothing? value=null + VALUE_PARAMETER name:text index:1 type:kotlin.String? + EXPRESSION_BODY + CONST Null type=kotlin.Nothing? value=null BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DVal modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:kmember visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:kmember type:kotlin.Any visibility:private [final] - EXPRESSION_BODY - GET_VAR 'kmember: kotlin.Any declared in .DVal.' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DVal) returnType:kotlin.Any - correspondingProperty: PROPERTY name:kmember visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.DVal - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .DVal' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:kmember type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null - receiver: GET_VAR ': .DVal declared in .DVal.' type=.DVal origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:.DVal, t:kotlin.Any?, p:kotlin.Any) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.DVal - VALUE_PARAMETER name:t index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' - CONST Int type=kotlin.Int value=42 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Value modality:FINAL visibility:public 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 declared in kotlin.Any @@ -134,36 +174,6 @@ FILE fqName: fileName:/genericPropertyRef.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:recivier visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static] - EXPRESSION_BODY - CONST String type=kotlin.String value="fail" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? - correspondingProperty: PROPERTY name:recivier visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static]' type=kotlin.Any? origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any?) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:recivier visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Any? - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Any? declared in .' type=kotlin.Any? origin=null - PROPERTY name:value2 visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static] - EXPRESSION_BODY - CONST String type=kotlin.String value="fail2" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? - correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static]' type=kotlin.Any? origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any?) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Any? - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Any? declared in .' type=kotlin.Any? origin=null PROPERTY name:bar visibility:public modality:FINAL [var] FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:T of . correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [var] @@ -182,13 +192,3 @@ FILE fqName: fileName:/genericPropertyRef.kt : GET_VAR ': T of . declared in .' type=T of . origin=null CALL 'public final fun (: kotlin.Any?): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : GET_VAR 'value: T of . declared in .' type=T of . origin=null - PROPERTY name:barRef visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:barRef type:kotlin.reflect.KMutableProperty1 visibility:private [final,static] - EXPRESSION_BODY - PROPERTY_REFERENCE 'public final bar: T of .' field=null getter='public final fun (): T of . declared in ' setter='public final fun (value: T of .): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1 origin=null - <1>: kotlin.String? - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty1 - correspondingProperty: PROPERTY name:barRef visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KMutableProperty1 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:barRef type:kotlin.reflect.KMutableProperty1 visibility:private [final,static]' type=kotlin.reflect.KMutableProperty1 origin=null diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.kt.txt b/compiler/testData/ir/irText/expressions/genericPropertyRef.kt.txt index f41ebab2a94..ef82a60aed1 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.kt.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.kt.txt @@ -1,22 +1,3 @@ -class Value { - constructor(value: T = null as T, text: String? = null) /* primary */ { - super/*Any*/() - /* () */ - - } - - var value: T - field = value - get - set - - var text: String? - field = text - get - set - -} - val Value.additionalText: Int /* by */ field = DVal(kmember = Value::text) get(): Int { @@ -29,23 +10,6 @@ val Value.additionalValue: Int /* by */ return #additionalValue$delegate.getValue(t = , p = ::additionalValue/*()*/) } -class DVal { - constructor(kmember: Any) /* primary */ { - super/*Any*/() - /* () */ - - } - - val kmember: Any - field = kmember - get - - operator fun getValue(t: Any?, p: Any): Int { - return 42 - } - -} - var recivier: Any? field = "fail" get @@ -56,6 +20,46 @@ var value2: Any? get set +val barRef: KMutableProperty1 + field = ::bar/*()*/ + get + +class DVal { + val kmember: Any + field = kmember + get + + constructor(kmember: Any) /* primary */ { + super/*Any*/() + /* () */ + + } + + operator fun getValue(t: Any?, p: Any): Int { + return 42 + } + +} + +class Value { + var value: T + field = value + get + set + + var text: String? + field = text + get + set + + constructor(value: T = null as T, text: String? = null) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + var T.bar: T get(): T { return @@ -65,6 +69,3 @@ var T.bar: T ( = value) } -val barRef: KMutableProperty1 - field = ::bar/*()*/ - get diff --git a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.ir.txt b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.ir.txt index 28cb466a511..0c76ceb3802 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.ir.txt @@ -1,18 +1,39 @@ FILE fqName: fileName:/implicitCastToTypeParameter.kt - FUN name:test1 visibility:public modality:FINAL ($receiver:kotlin.Any) returnType:T of .test1? [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true - $receiver: VALUE_PARAMETER name: type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1 (): T of .test1? declared in ' - WHEN type=T of .test1? origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of .test1 - GET_VAR ': kotlin.Any declared in .test1' type=kotlin.Any origin=null - then: TYPE_OP type=T of .test1 origin=IMPLICIT_CAST typeOperand=T of .test1 - GET_VAR ': kotlin.Any declared in .test1' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Null type=kotlin.Nothing? value=null + CLASS CLASS name:Bar modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Bar.Bar> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.Bar.Bar> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Bar modality:FINAL visibility:public 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 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:test visibility:public modality:FINAL <> ($this:.Bar.Bar>, arg:kotlin.Any) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Bar.Bar> + VALUE_PARAMETER name:arg index:0 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=T of .Bar origin=CAST typeOperand=T of .Bar + GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null + CALL 'public final fun useT (t: T of .Bar): kotlin.Unit declared in .Bar' type=kotlin.Unit origin=null + $this: GET_VAR ': .Bar.Bar> declared in .Bar.test' type=.Bar.Bar> origin=null + t: TYPE_OP type={T of .Bar & Any} origin=IMPLICIT_CAST typeOperand={T of .Bar & Any} + GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null + FUN name:useT visibility:public modality:FINAL <> ($this:.Bar.Bar>, t:T of .Bar) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Bar.Bar> + VALUE_PARAMETER name:t index:0 type:T of .Bar + BLOCK_BODY CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo.Foo> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -29,6 +50,20 @@ FILE fqName: fileName:/implicitCastToTypeParameter.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL ($receiver:kotlin.Any) returnType:T of .test1? [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true + $receiver: VALUE_PARAMETER name: type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): T of .test1? declared in ' + WHEN type=T of .test1? origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of .test1 + GET_VAR ': kotlin.Any declared in .test1' type=kotlin.Any origin=null + then: TYPE_OP type=T of .test1 origin=IMPLICIT_CAST typeOperand=T of .test1 + GET_VAR ': kotlin.Any declared in .test1' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Null type=kotlin.Nothing? value=null PROPERTY name:asT visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL ($receiver:.Foo.>) returnType:T of .? [inline] correspondingProperty: PROPERTY name:asT visibility:public modality:FINAL [val] @@ -44,38 +79,3 @@ FILE fqName: fileName:/implicitCastToTypeParameter.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Null type=kotlin.Nothing? value=null - CLASS CLASS name:Bar modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Bar.Bar> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Bar.Bar> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Bar modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:test visibility:public modality:FINAL <> ($this:.Bar.Bar>, arg:kotlin.Any) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Bar.Bar> - VALUE_PARAMETER name:arg index:0 type:kotlin.Any - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=T of .Bar origin=CAST typeOperand=T of .Bar - GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null - CALL 'public final fun useT (t: T of .Bar): kotlin.Unit declared in .Bar' type=kotlin.Unit origin=null - $this: GET_VAR ': .Bar.Bar> declared in .Bar.test' type=.Bar.Bar> origin=null - t: TYPE_OP type={T of .Bar & Any} origin=IMPLICIT_CAST typeOperand={T of .Bar & Any} - GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null - FUN name:useT visibility:public modality:FINAL <> ($this:.Bar.Bar>, t:T of .Bar) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Bar.Bar> - VALUE_PARAMETER name:t index:0 type:T of .Bar - BLOCK_BODY - 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: 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 diff --git a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.kt.txt b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.kt.txt index 6a69da27a94..908457348a9 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.kt.txt @@ -1,21 +1,3 @@ -inline fun Any.test1(): T? { - return when { - is T -> /*as T */ - else -> null - } -} - -interface Foo { -} - -val Foo.asT: T? - inline get(): T? { - return when { - is T -> - else -> null - } - } - class Bar { constructor() /* primary */ { super/*Any*/() @@ -33,3 +15,21 @@ class Bar { } +interface Foo { +} + +inline fun Any.test1(): T? { + return when { + is T -> /*as T */ + else -> null + } +} + +val Foo.asT: T? + inline get(): T? { + return when { + is T -> + else -> null + } + } + diff --git a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.ir.txt b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.ir.txt index 15f9699fa1e..e861c2014e9 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.ir.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.ir.txt @@ -1,18 +1,39 @@ FILE fqName: fileName:/implicitCastToTypeParameter.kt - FUN name:test1 visibility:public modality:FINAL ($receiver:kotlin.Any) returnType:T of .test1? [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true - $receiver: VALUE_PARAMETER name: type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1 (): T of .test1? declared in ' - WHEN type=T of .test1? origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of .test1 - GET_VAR ': kotlin.Any declared in .test1' type=kotlin.Any origin=null - then: TYPE_OP type=T of .test1 origin=IMPLICIT_CAST typeOperand=T of .test1 - GET_VAR ': kotlin.Any declared in .test1' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Null type=kotlin.Nothing? value=null + CLASS CLASS name:Bar modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Bar.Bar> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.Bar.Bar> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Bar modality:FINAL visibility:public 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 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:test visibility:public modality:FINAL <> ($this:.Bar.Bar>, arg:kotlin.Any) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Bar.Bar> + VALUE_PARAMETER name:arg index:0 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=T of .Bar origin=CAST typeOperand=T of .Bar + GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null + CALL 'public final fun useT (t: T of .Bar): kotlin.Unit declared in .Bar' type=kotlin.Unit origin=null + $this: GET_VAR ': .Bar.Bar> declared in .Bar.test' type=.Bar.Bar> origin=null + t: TYPE_OP type=T of .Bar origin=IMPLICIT_CAST typeOperand=T of .Bar + GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null + FUN name:useT visibility:public modality:FINAL <> ($this:.Bar.Bar>, t:T of .Bar) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Bar.Bar> + VALUE_PARAMETER name:t index:0 type:T of .Bar + BLOCK_BODY CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo.Foo> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -29,6 +50,20 @@ FILE fqName: fileName:/implicitCastToTypeParameter.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL ($receiver:kotlin.Any) returnType:T of .test1? [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true + $receiver: VALUE_PARAMETER name: type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): T of .test1? declared in ' + WHEN type=T of .test1? origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of .test1 + GET_VAR ': kotlin.Any declared in .test1' type=kotlin.Any origin=null + then: TYPE_OP type=T of .test1 origin=IMPLICIT_CAST typeOperand=T of .test1 + GET_VAR ': kotlin.Any declared in .test1' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Null type=kotlin.Nothing? value=null PROPERTY name:asT visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL ($receiver:.Foo.>) returnType:T of .? [inline] correspondingProperty: PROPERTY name:asT visibility:public modality:FINAL [val] @@ -45,38 +80,3 @@ FILE fqName: fileName:/implicitCastToTypeParameter.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Null type=kotlin.Nothing? value=null - CLASS CLASS name:Bar modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Bar.Bar> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Bar.Bar> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Bar modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:test visibility:public modality:FINAL <> ($this:.Bar.Bar>, arg:kotlin.Any) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Bar.Bar> - VALUE_PARAMETER name:arg index:0 type:kotlin.Any - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=T of .Bar origin=CAST typeOperand=T of .Bar - GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null - CALL 'public final fun useT (t: T of .Bar): kotlin.Unit declared in .Bar' type=kotlin.Unit origin=null - $this: GET_VAR ': .Bar.Bar> declared in .Bar.test' type=.Bar.Bar> origin=null - t: TYPE_OP type=T of .Bar origin=IMPLICIT_CAST typeOperand=T of .Bar - GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null - FUN name:useT visibility:public modality:FINAL <> ($this:.Bar.Bar>, t:T of .Bar) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Bar.Bar> - VALUE_PARAMETER name:t index:0 type:T of .Bar - BLOCK_BODY - 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: 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 diff --git a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt.txt b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt.txt index 845cfadcb16..3fec95a9126 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt.txt @@ -1,21 +1,3 @@ -inline fun Any.test1(): T? { - return when { - is T -> /*as T */ - else -> null - } -} - -interface Foo { -} - -val Foo.asT: T? - inline get(): T? { - return when { - is T -> /*as T */ - else -> null - } - } - class Bar { constructor() /* primary */ { super/*Any*/() @@ -32,3 +14,22 @@ class Bar { } } + +interface Foo { +} + +inline fun Any.test1(): T? { + return when { + is T -> /*as T */ + else -> null + } +} + +val Foo.asT: T? + inline get(): T? { + return when { + is T -> /*as T */ + else -> null + } + } + diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.ir.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.ir.txt index a135ad1cf19..e96fbeeccdc 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.ir.txt @@ -29,10 +29,6 @@ FILE fqName: fileName:/incrementDecrement.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:arr type:kotlin.IntArray visibility:private [final,static]' type=kotlin.IntArray origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:p visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private EXPRESSION_BODY @@ -52,17 +48,10 @@ FILE fqName: fileName:/incrementDecrement.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null - FUN name:get visibility:public modality:FINAL <> ($this:.C, i:kotlin.Int) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): kotlin.Int declared in .C' - GET_VAR 'i: kotlin.Int declared in .C.get' type=kotlin.Int origin=null - FUN name:set visibility:public modality:FINAL <> ($this:.C, i:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:i index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:kotlin.Int + CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -76,12 +65,19 @@ FILE fqName: fileName:/incrementDecrement.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:get visibility:public modality:FINAL <> ($this:.C, i:kotlin.Int) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): kotlin.Int declared in .C' + GET_VAR 'i: kotlin.Int declared in .C.get' type=kotlin.Int origin=null + FUN name:set visibility:public modality:FINAL <> ($this:.C, i:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Int + BLOCK_BODY CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.O - CONSTRUCTOR visibility:private <> () returnType:.O [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:p visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private EXPRESSION_BODY @@ -101,17 +97,10 @@ FILE fqName: fileName:/incrementDecrement.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .O declared in .O.' type=.O origin=null value: GET_VAR ': kotlin.Int declared in .O.' type=kotlin.Int origin=null - FUN name:get visibility:public modality:FINAL <> ($this:.O, i:kotlin.Int) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.O - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): kotlin.Int declared in .O' - GET_VAR 'i: kotlin.Int declared in .O.get' type=kotlin.Int origin=null - FUN name:set visibility:public modality:FINAL <> ($this:.O, i:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.O - VALUE_PARAMETER name:i index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:kotlin.Int + CONSTRUCTOR visibility:private <> () returnType:.O [primary] BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:O modality:FINAL visibility:public 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 declared in kotlin.Any @@ -125,302 +114,237 @@ FILE fqName: fileName:/incrementDecrement.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testVarPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:x type:kotlin.Int [var] - CONST Int type=kotlin.Int value=0 - VAR name:x1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_INCR - SET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Unit origin=PREFIX_INCR - CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_INCR - GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_INCR - VAR name:x2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_DECR - SET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Unit origin=PREFIX_DECR - CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_DECR - GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_DECR - FUN name:testVarPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:x type:kotlin.Int [var] - CONST Int type=kotlin.Int value=0 - VAR name:x1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] - GET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=POSTFIX_INCR - SET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Unit origin=POSTFIX_INCR - CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_0: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_0: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null - VAR name:x2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] - GET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=POSTFIX_DECR - SET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Unit origin=POSTFIX_DECR - CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_1: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_1: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null - FUN name:testPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:p1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_INCR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PREFIX_INCR - : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PREFIX_INCR - CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PREFIX_INCR - VAR name:p2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_DECR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PREFIX_DECR - : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PREFIX_DECR - CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PREFIX_DECR - FUN name:testPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:p1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_INCR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_INCR - : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_2: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_2: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null - VAR name:p2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_DECR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_DECR - : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_3: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_3: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null - FUN name:testArrayPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:a1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.IntArray [val] - CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=PREFIX_INCR - $this: GET_VAR 'val tmp_4: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_5: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null - value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_4: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_5: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null - CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_4: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_5: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null - VAR name:a2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.IntArray [val] - CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=PREFIX_DECR - $this: GET_VAR 'val tmp_6: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_7: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null - value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_6: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_7: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null - CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_6: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_7: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null + FUN name:get visibility:public modality:FINAL <> ($this:.O, i:kotlin.Int) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.O + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): kotlin.Int declared in .O' + GET_VAR 'i: kotlin.Int declared in .O.get' type=kotlin.Int origin=null + FUN name:set visibility:public modality:FINAL <> ($this:.O, i:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.O + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Int + BLOCK_BODY FUN name:testArrayPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a1 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val] + CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_1: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_1: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_2: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_2: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.IntArray [val] + CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_3: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_4: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_3: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_4: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_5: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_5: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + FUN name:testArrayPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.IntArray [val] + CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'val tmp_6: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_7: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_6: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_7: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_6: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_7: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.IntArray [val] CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.Int [val] - CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_8: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_9: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_8: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_9: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_10: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_10: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - VAR name:a2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.IntArray [val] - CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_12 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_13 type:kotlin.Int [val] - CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_11: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_12: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_11: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_12: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_13: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_13: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - FUN name:testClassPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:p1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_14 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_INCR - $this: GET_VAR 'val tmp_14: .C declared in .testClassPropPrefix' type=.C origin=null - : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_14: .C declared in .testClassPropPrefix' type=.C origin=null - CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_14: .C declared in .testClassPropPrefix' type=.C origin=null - VAR name:p2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_15 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_DECR - $this: GET_VAR 'val tmp_15: .C declared in .testClassPropPrefix' type=.C origin=null - : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_15: .C declared in .testClassPropPrefix' type=.C origin=null - CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_15: .C declared in .testClassPropPrefix' type=.C origin=null - FUN name:testClassPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:p1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_16 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_17 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_16: .C declared in .testClassPropPostfix' type=.C origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_16: .C declared in .testClassPropPostfix' type=.C origin=null - : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_17: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_17: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null - VAR name:p2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_18 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_19 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_18: .C declared in .testClassPropPostfix' type=.C origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_18: .C declared in .testClassPropPostfix' type=.C origin=null - : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_19: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_19: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null - FUN name:testClassOperatorPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:a1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_20 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_21 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_INCR - $this: GET_VAR 'val tmp_20: .C declared in .testClassOperatorPrefix' type=.C origin=null - i: GET_VAR 'val tmp_21: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null - value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_20: .C declared in .testClassOperatorPrefix' type=.C origin=null - i: GET_VAR 'val tmp_21: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null - CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_20: .C declared in .testClassOperatorPrefix' type=.C origin=null - i: GET_VAR 'val tmp_21: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null - VAR name:a2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_22 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_23 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_DECR - $this: GET_VAR 'val tmp_22: .C declared in .testClassOperatorPrefix' type=.C origin=null - i: GET_VAR 'val tmp_23: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'val tmp_8: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_9: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_22: .C declared in .testClassOperatorPrefix' type=.C origin=null - i: GET_VAR 'val tmp_23: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null - CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_22: .C declared in .testClassOperatorPrefix' type=.C origin=null - i: GET_VAR 'val tmp_23: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_8: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_9: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_8: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_9: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null FUN name:testClassOperatorPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a1 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_24 type:.C [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:.C [val] CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_25 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_26 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_12 type:kotlin.Int [val] CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_24: .C declared in .testClassOperatorPostfix' type=.C origin=null - i: GET_VAR 'val tmp_25: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_10: .C declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_11: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_24: .C declared in .testClassOperatorPostfix' type=.C origin=null - i: GET_VAR 'val tmp_25: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_10: .C declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_11: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_26: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_26: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_12: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_12: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null VAR name:a2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_27 type:.C [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_13 type:.C [val] CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_28 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_14 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_29 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_15 type:kotlin.Int [val] CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_27: .C declared in .testClassOperatorPostfix' type=.C origin=null - i: GET_VAR 'val tmp_28: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_13: .C declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_14: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_27: .C declared in .testClassOperatorPostfix' type=.C origin=null - i: GET_VAR 'val tmp_28: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_13: .C declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_14: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_29: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_29: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null - FUN name:testObjectPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + $this: GET_VAR 'val tmp_15: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_15: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + FUN name:testClassOperatorPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - VAR name:p1 type:kotlin.Int [val] + VAR name:a1 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=PREFIX_INCR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_INCR - $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR - $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR - $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - VAR name:p2 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_16 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_17 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'val tmp_16: .C declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_17: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_16: .C declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_17: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_16: .C declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_17: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=PREFIX_DECR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_DECR - $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR - $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR - $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - FUN name:testObjectPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + VAR IR_TEMPORARY_VARIABLE name:tmp_18 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_19 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'val tmp_18: .C declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_19: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_18: .C declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_19: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_18: .C declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_19: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + FUN name:testClassPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:p1 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_30 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_20 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_21 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_20: .C declared in .testClassPropPostfix' type=.C origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_20: .C declared in .testClassPropPostfix' type=.C origin=null : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_30: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_30: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_21: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_21: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null VAR name:p2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_31 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_DECR - $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_22 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_23 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_22: .C declared in .testClassPropPostfix' type=.C origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_22: .C declared in .testClassPropPostfix' type=.C origin=null : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_31: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_31: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_23: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_23: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null + FUN name:testClassPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_24 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'val tmp_24: .C declared in .testClassPropPrefix' type=.C origin=null + : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_24: .C declared in .testClassPropPrefix' type=.C origin=null + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_24: .C declared in .testClassPropPrefix' type=.C origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_25 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'val tmp_25: .C declared in .testClassPropPrefix' type=.C origin=null + : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_25: .C declared in .testClassPropPrefix' type=.C origin=null + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_25: .C declared in .testClassPropPrefix' type=.C origin=null + FUN name:testObjectOperatorPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_26 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_27 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_28 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_26: .O declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_27: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_26: .O declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_27: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_28: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_28: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_29 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_30 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_31 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_29: .O declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_30: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_29: .O declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_30: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_31: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_31: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null FUN name:testObjectOperatorPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a1 type:kotlin.Int [val] @@ -455,37 +379,113 @@ FILE fqName: fileName:/incrementDecrement.kt CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR $this: GET_VAR 'val tmp_34: .O declared in .testObjectOperatorPrefix' type=.O origin=null i: GET_VAR 'val tmp_35: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null - FUN name:testObjectOperatorPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:testObjectPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - VAR name:a1 type:kotlin.Int [val] + VAR name:p1 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_36 type:.O [val] - GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - VAR IR_TEMPORARY_VARIABLE name:tmp_37 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_38 type:kotlin.Int [val] - CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_36: .O declared in .testObjectOperatorPostfix' type=.O origin=null - i: GET_VAR 'val tmp_37: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_36: .O declared in .testObjectOperatorPostfix' type=.O origin=null - i: GET_VAR 'val tmp_37: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_38: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_38: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - VAR name:a2 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_36 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_36: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_36: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null + VAR name:p2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_39 type:.O [val] - GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_37 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_37: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_37: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null + FUN name:testObjectPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + FUN name:testPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_38 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_INCR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_INCR + : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_38: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_38: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_39 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_DECR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_DECR + : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_39: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_39: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null + FUN name:testPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PREFIX_INCR + : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PREFIX_INCR + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PREFIX_INCR + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PREFIX_DECR + : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PREFIX_DECR + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PREFIX_DECR + FUN name:testVarPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR name:x1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE name:tmp_40 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 + GET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=POSTFIX_INCR + SET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Unit origin=POSTFIX_INCR + CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_40: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_40: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null + VAR name:x2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR VAR IR_TEMPORARY_VARIABLE name:tmp_41 type:kotlin.Int [val] - CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_39: .O declared in .testObjectOperatorPostfix' type=.O origin=null - i: GET_VAR 'val tmp_40: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_39: .O declared in .testObjectOperatorPostfix' type=.O origin=null - i: GET_VAR 'val tmp_40: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_41: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_41: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=POSTFIX_DECR + SET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Unit origin=POSTFIX_DECR + CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_41: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_41: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null + FUN name:testVarPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR name:x1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + SET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Unit origin=PREFIX_INCR + CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_INCR + GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_INCR + VAR name:x2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + SET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Unit origin=PREFIX_DECR + CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_DECR + GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_DECR diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.kt.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.kt.txt index 5c92611b282..b0f59e184b3 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.kt.txt @@ -8,17 +8,17 @@ val arr: IntArray get class C { + var p: Int + field = 0 + get + set + constructor() /* primary */ { super/*Any*/() /* () */ } - var p: Int - field = 0 - get - set - operator fun get(i: Int): Int { return i } @@ -29,17 +29,17 @@ class C { } object O { + var p: Int + field = 0 + get + set + private constructor() /* primary */ { super/*Any*/() /* () */ } - var p: Int - field = 0 - get - set - operator fun get(i: Int): Int { return i } @@ -49,168 +49,111 @@ object O { } -fun testVarPrefix() { - var x: Int = 0 - val x1: Int = { // BLOCK - x = x.inc() - x - } - val x2: Int = { // BLOCK - x = x.dec() - x - } -} - -fun testVarPostfix() { - var x: Int = 0 - val x1: Int = { // BLOCK - val tmp_0: Int = x - x = tmp_0.inc() - tmp_0 - } - val x2: Int = { // BLOCK - val tmp_1: Int = x - x = tmp_1.dec() - tmp_1 - } -} - -fun testPropPrefix() { - val p1: Int = { // BLOCK - ( = ().inc()) - () - } - val p2: Int = { // BLOCK - ( = ().dec()) - () - } -} - -fun testPropPostfix() { - val p1: Int = { // BLOCK - val tmp_2: Int = () - ( = tmp_2.inc()) +fun testArrayPostfix() { + val a1: Int = { // BLOCK + val tmp_0: IntArray = () + val tmp_1: Int = 0 + val tmp_2: Int = tmp_0.get(index = tmp_1) + tmp_0.set(index = tmp_1, value = tmp_2.inc()) tmp_2 } - val p2: Int = { // BLOCK - val tmp_3: Int = () - ( = tmp_3.dec()) - tmp_3 + val a2: Int = { // BLOCK + val tmp_3: IntArray = () + val tmp_4: Int = 0 + val tmp_5: Int = tmp_3.get(index = tmp_4) + tmp_3.set(index = tmp_4, value = tmp_5.dec()) + tmp_5 } } fun testArrayPrefix() { val a1: Int = { // BLOCK - val tmp_4: IntArray = () - val tmp_5: Int = 0 - tmp_4.set(index = tmp_5, value = tmp_4.get(index = tmp_5).inc()) - tmp_4.get(index = tmp_5) - } - val a2: Int = { // BLOCK val tmp_6: IntArray = () val tmp_7: Int = 0 - tmp_6.set(index = tmp_7, value = tmp_6.get(index = tmp_7).dec()) + tmp_6.set(index = tmp_7, value = tmp_6.get(index = tmp_7).inc()) tmp_6.get(index = tmp_7) } -} - -fun testArrayPostfix() { - val a1: Int = { // BLOCK + val a2: Int = { // BLOCK val tmp_8: IntArray = () val tmp_9: Int = 0 - val tmp_10: Int = tmp_8.get(index = tmp_9) - tmp_8.set(index = tmp_9, value = tmp_10.inc()) - tmp_10 - } - val a2: Int = { // BLOCK - val tmp_11: IntArray = () - val tmp_12: Int = 0 - val tmp_13: Int = tmp_11.get(index = tmp_12) - tmp_11.set(index = tmp_12, value = tmp_13.dec()) - tmp_13 - } -} - -fun testClassPropPrefix() { - val p1: Int = { // BLOCK - val tmp_14: C = C() - tmp_14.( = tmp_14.().inc()) - tmp_14.() - } - val p2: Int = { // BLOCK - val tmp_15: C = C() - tmp_15.( = tmp_15.().dec()) - tmp_15.() - } -} - -fun testClassPropPostfix() { - val p1: Int = { // BLOCK - val tmp_16: C = C() - val tmp_17: Int = tmp_16.() - tmp_16.( = tmp_17.inc()) - tmp_17 - } - val p2: Int = { // BLOCK - val tmp_18: C = C() - val tmp_19: Int = tmp_18.() - tmp_18.( = tmp_19.dec()) - tmp_19 - } -} - -fun testClassOperatorPrefix() { - val a1: Int = { // BLOCK - val tmp_20: C = C() - val tmp_21: Int = 0 - tmp_20.set(i = tmp_21, value = tmp_20.get(i = tmp_21).inc()) - tmp_20.get(i = tmp_21) - } - val a2: Int = { // BLOCK - val tmp_22: C = C() - val tmp_23: Int = 0 - tmp_22.set(i = tmp_23, value = tmp_22.get(i = tmp_23).dec()) - tmp_22.get(i = tmp_23) + tmp_8.set(index = tmp_9, value = tmp_8.get(index = tmp_9).dec()) + tmp_8.get(index = tmp_9) } } fun testClassOperatorPostfix() { val a1: Int = { // BLOCK - val tmp_24: C = C() - val tmp_25: Int = 0 - val tmp_26: Int = tmp_24.get(i = tmp_25) - tmp_24.set(i = tmp_25, value = tmp_26.inc()) - tmp_26 + val tmp_10: C = C() + val tmp_11: Int = 0 + val tmp_12: Int = tmp_10.get(i = tmp_11) + tmp_10.set(i = tmp_11, value = tmp_12.inc()) + tmp_12 } val a2: Int = { // BLOCK - val tmp_27: C = C() - val tmp_28: Int = 0 - val tmp_29: Int = tmp_27.get(i = tmp_28) - tmp_27.set(i = tmp_28, value = tmp_29.dec()) - tmp_29 + val tmp_13: C = C() + val tmp_14: Int = 0 + val tmp_15: Int = tmp_13.get(i = tmp_14) + tmp_13.set(i = tmp_14, value = tmp_15.dec()) + tmp_15 } } -fun testObjectPropPrefix() { - val p1: Int = { // BLOCK - O.( = O.().inc()) - O.() +fun testClassOperatorPrefix() { + val a1: Int = { // BLOCK + val tmp_16: C = C() + val tmp_17: Int = 0 + tmp_16.set(i = tmp_17, value = tmp_16.get(i = tmp_17).inc()) + tmp_16.get(i = tmp_17) } - val p2: Int = { // BLOCK - O.( = O.().dec()) - O.() + val a2: Int = { // BLOCK + val tmp_18: C = C() + val tmp_19: Int = 0 + tmp_18.set(i = tmp_19, value = tmp_18.get(i = tmp_19).dec()) + tmp_18.get(i = tmp_19) } } -fun testObjectPropPostfix() { +fun testClassPropPostfix() { val p1: Int = { // BLOCK - val tmp_30: Int = O.() - O.( = tmp_30.inc()) - tmp_30 + val tmp_20: C = C() + val tmp_21: Int = tmp_20.() + tmp_20.( = tmp_21.inc()) + tmp_21 } val p2: Int = { // BLOCK - val tmp_31: Int = O.() - O.( = tmp_31.dec()) + val tmp_22: C = C() + val tmp_23: Int = tmp_22.() + tmp_22.( = tmp_23.dec()) + tmp_23 + } +} + +fun testClassPropPrefix() { + val p1: Int = { // BLOCK + val tmp_24: C = C() + tmp_24.( = tmp_24.().inc()) + tmp_24.() + } + val p2: Int = { // BLOCK + val tmp_25: C = C() + tmp_25.( = tmp_25.().dec()) + tmp_25.() + } +} + +fun testObjectOperatorPostfix() { + val a1: Int = { // BLOCK + val tmp_26: O = O + val tmp_27: Int = 0 + val tmp_28: Int = tmp_26.get(i = tmp_27) + tmp_26.set(i = tmp_27, value = tmp_28.inc()) + tmp_28 + } + val a2: Int = { // BLOCK + val tmp_29: O = O + val tmp_30: Int = 0 + val tmp_31: Int = tmp_29.get(i = tmp_30) + tmp_29.set(i = tmp_30, value = tmp_31.dec()) tmp_31 } } @@ -230,19 +173,77 @@ fun testObjectOperatorPrefix() { } } -fun testObjectOperatorPostfix() { - val a1: Int = { // BLOCK - val tmp_36: O = O - val tmp_37: Int = 0 - val tmp_38: Int = tmp_36.get(i = tmp_37) - tmp_36.set(i = tmp_37, value = tmp_38.inc()) +fun testObjectPropPostfix() { + val p1: Int = { // BLOCK + val tmp_36: Int = O.() + O.( = tmp_36.inc()) + tmp_36 + } + val p2: Int = { // BLOCK + val tmp_37: Int = O.() + O.( = tmp_37.dec()) + tmp_37 + } +} + +fun testObjectPropPrefix() { + val p1: Int = { // BLOCK + O.( = O.().inc()) + O.() + } + val p2: Int = { // BLOCK + O.( = O.().dec()) + O.() + } +} + +fun testPropPostfix() { + val p1: Int = { // BLOCK + val tmp_38: Int = () + ( = tmp_38.inc()) tmp_38 } - val a2: Int = { // BLOCK - val tmp_39: O = O - val tmp_40: Int = 0 - val tmp_41: Int = tmp_39.get(i = tmp_40) - tmp_39.set(i = tmp_40, value = tmp_41.dec()) + val p2: Int = { // BLOCK + val tmp_39: Int = () + ( = tmp_39.dec()) + tmp_39 + } +} + +fun testPropPrefix() { + val p1: Int = { // BLOCK + ( = ().inc()) + () + } + val p2: Int = { // BLOCK + ( = ().dec()) + () + } +} + +fun testVarPostfix() { + var x: Int = 0 + val x1: Int = { // BLOCK + val tmp_40: Int = x + x = tmp_40.inc() + tmp_40 + } + val x2: Int = { // BLOCK + val tmp_41: Int = x + x = tmp_41.dec() tmp_41 } } + +fun testVarPrefix() { + var x: Int = 0 + val x1: Int = { // BLOCK + x = x.inc() + x + } + val x2: Int = { // BLOCK + x = x.dec() + x + } +} + diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.ir.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.ir.txt index 50c6136d107..9d7f4155fe1 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.ir.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.ir.txt @@ -29,10 +29,6 @@ FILE fqName: fileName:/incrementDecrement.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:arr type:kotlin.IntArray visibility:private [final,static]' type=kotlin.IntArray origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:p visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private EXPRESSION_BODY @@ -52,17 +48,10 @@ FILE fqName: fileName:/incrementDecrement.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null - FUN name:get visibility:public modality:FINAL <> ($this:.C, i:kotlin.Int) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): kotlin.Int declared in .C' - GET_VAR 'i: kotlin.Int declared in .C.get' type=kotlin.Int origin=null - FUN name:set visibility:public modality:FINAL <> ($this:.C, i:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:i index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:kotlin.Int + CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -76,12 +65,19 @@ FILE fqName: fileName:/incrementDecrement.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:get visibility:public modality:FINAL <> ($this:.C, i:kotlin.Int) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): kotlin.Int declared in .C' + GET_VAR 'i: kotlin.Int declared in .C.get' type=kotlin.Int origin=null + FUN name:set visibility:public modality:FINAL <> ($this:.C, i:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Int + BLOCK_BODY CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.O - CONSTRUCTOR visibility:private <> () returnType:.O [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:p visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private EXPRESSION_BODY @@ -101,17 +97,10 @@ FILE fqName: fileName:/incrementDecrement.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .O declared in .O.' type=.O origin=null value: GET_VAR ': kotlin.Int declared in .O.' type=kotlin.Int origin=null - FUN name:get visibility:public modality:FINAL <> ($this:.O, i:kotlin.Int) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.O - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): kotlin.Int declared in .O' - GET_VAR 'i: kotlin.Int declared in .O.get' type=kotlin.Int origin=null - FUN name:set visibility:public modality:FINAL <> ($this:.O, i:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.O - VALUE_PARAMETER name:i index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:kotlin.Int + CONSTRUCTOR visibility:private <> () returnType:.O [primary] BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:O modality:FINAL visibility:public 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 declared in kotlin.Any @@ -125,42 +114,349 @@ FILE fqName: fileName:/incrementDecrement.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testVarPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:get visibility:public modality:FINAL <> ($this:.O, i:kotlin.Int) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.O + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): kotlin.Int declared in .O' + GET_VAR 'i: kotlin.Int declared in .O.get' type=kotlin.Int origin=null + FUN name:set visibility:public modality:FINAL <> ($this:.O, i:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.O + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Int + BLOCK_BODY + FUN name:testArrayPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - VAR name:x type:kotlin.Int [var] - CONST Int type=kotlin.Int value=0 - VAR name:x1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_INCR - SET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Unit origin=PREFIX_INCR - CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_INCR - GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_INCR - VAR name:x2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_DECR - SET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Unit origin=PREFIX_DECR - CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_DECR - GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_DECR - FUN name:testVarPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:x type:kotlin.Int [var] - CONST Int type=kotlin.Int value=0 - VAR name:x1 type:kotlin.Int [val] + VAR name:a1 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] - GET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=POSTFIX_INCR - SET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Unit origin=POSTFIX_INCR - CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_0: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_0: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null - VAR name:x2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val] + CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] - GET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=POSTFIX_DECR - SET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Unit origin=POSTFIX_DECR - CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_1: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_1: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_1: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_0: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_1: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_2: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_2: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.IntArray [val] + CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_3: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_4: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_3: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_4: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_5: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_5: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null + FUN name:testArrayPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.IntArray [val] + CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'val tmp_6: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_7: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_6: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_7: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_6: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_7: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.IntArray [val] + CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'val tmp_8: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_9: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_8: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_9: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_8: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_9: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null + FUN name:testClassOperatorPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_12 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_10: .C declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_11: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_10: .C declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_11: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_12: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_12: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_13 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_14 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_15 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_13: .C declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_14: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_13: .C declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_14: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_15: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_15: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + FUN name:testClassOperatorPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_16 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_17 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'val tmp_16: .C declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_17: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_16: .C declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_17: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_16: .C declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_17: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_18 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_19 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'val tmp_18: .C declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_19: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_18: .C declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_19: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_18: .C declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_19: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + FUN name:testClassPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_20 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_21 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_20: .C declared in .testClassPropPostfix' type=.C origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_20: .C declared in .testClassPropPostfix' type=.C origin=null + : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_21: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_21: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_22 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_23 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_22: .C declared in .testClassPropPostfix' type=.C origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_22: .C declared in .testClassPropPostfix' type=.C origin=null + : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_23: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_23: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null + FUN name:testClassPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_24 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + BLOCK type=kotlin.Int origin=PREFIX_INCR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'val tmp_24: .C declared in .testClassPropPrefix' type=.C origin=null + : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_24: .C declared in .testClassPropPrefix' type=.C origin=null + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_24: .C declared in .testClassPropPrefix' type=.C origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_25 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + BLOCK type=kotlin.Int origin=PREFIX_DECR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'val tmp_25: .C declared in .testClassPropPrefix' type=.C origin=null + : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_25: .C declared in .testClassPropPrefix' type=.C origin=null + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_25: .C declared in .testClassPropPrefix' type=.C origin=null + FUN name:testObjectOperatorPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_26 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_27 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_28 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_26: .O declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_27: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_26: .O declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_27: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_28: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_28: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_29 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_30 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_31 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_29: .O declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_30: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_29: .O declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_30: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_31: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_31: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + FUN name:testObjectOperatorPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_32 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_33 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'val tmp_32: .O declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_33: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_32: .O declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_33: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_32: .O declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_33: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_34 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_35 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'val tmp_34: .O declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_35: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_34: .O declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_35: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_34: .O declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_35: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + FUN name:testObjectPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_36 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_37 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_36: .O declared in .testObjectPropPostfix' type=.O origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_36: .O declared in .testObjectPropPostfix' type=.O origin=null + : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_37: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_37: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_38 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_39 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_38: .O declared in .testObjectPropPostfix' type=.O origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_38: .O declared in .testObjectPropPostfix' type=.O origin=null + : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_39: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_39: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null + FUN name:testObjectPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_40 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + BLOCK type=kotlin.Int origin=PREFIX_INCR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'val tmp_40: .O declared in .testObjectPropPrefix' type=.O origin=null + : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_40: .O declared in .testObjectPropPrefix' type=.O origin=null + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_40: .O declared in .testObjectPropPrefix' type=.O origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_41 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + BLOCK type=kotlin.Int origin=PREFIX_DECR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'val tmp_41: .O declared in .testObjectPropPrefix' type=.O origin=null + : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_41: .O declared in .testObjectPropPrefix' type=.O origin=null + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_41: .O declared in .testObjectPropPrefix' type=.O origin=null + FUN name:testPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_42 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_INCR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_INCR + : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_42: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_42: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_43 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_DECR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_DECR + : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_43: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_43: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null FUN name:testPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:p1 type:kotlin.Int [val] @@ -177,335 +473,39 @@ FILE fqName: fileName:/incrementDecrement.kt : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PREFIX_DECR CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PREFIX_DECR - FUN name:testPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name:testVarPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - VAR name:p1 type:kotlin.Int [val] + VAR name:x type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR name:x1 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=POSTFIX_INCR - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_INCR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_INCR - : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_2: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_2: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null - VAR name:p2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_DECR - BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_DECR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_DECR - : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_3: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_3: kotlin.Int declared in .testPropPostfix' type=kotlin.Int origin=null - FUN name:testArrayPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:a1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.IntArray [val] - CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=PREFIX_INCR - $this: GET_VAR 'val tmp_4: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_5: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null - value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_4: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_5: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null - CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_4: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_5: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null - VAR name:a2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.IntArray [val] - CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=PREFIX_DECR - $this: GET_VAR 'val tmp_6: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_7: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null - value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_6: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_7: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null - CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_6: kotlin.IntArray declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_7: kotlin.Int declared in .testArrayPrefix' type=kotlin.Int origin=null - FUN name:testArrayPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:a1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.IntArray [val] - CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.Int [val] - CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_8: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_9: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_8: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_9: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_10: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_10: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - VAR name:a2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.IntArray [val] - CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_12 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_13 type:kotlin.Int [val] - CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_11: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_12: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_11: kotlin.IntArray declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_12: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_13: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_13: kotlin.Int declared in .testArrayPostfix' type=kotlin.Int origin=null - FUN name:testClassPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:p1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_14 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - BLOCK type=kotlin.Int origin=PREFIX_INCR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_INCR - $this: GET_VAR 'val tmp_14: .C declared in .testClassPropPrefix' type=.C origin=null - : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_14: .C declared in .testClassPropPrefix' type=.C origin=null - CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_14: .C declared in .testClassPropPrefix' type=.C origin=null - VAR name:p2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_15 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - BLOCK type=kotlin.Int origin=PREFIX_DECR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_DECR - $this: GET_VAR 'val tmp_15: .C declared in .testClassPropPrefix' type=.C origin=null - : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_15: .C declared in .testClassPropPrefix' type=.C origin=null - CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_15: .C declared in .testClassPropPrefix' type=.C origin=null - FUN name:testClassPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:p1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_16 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_17 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_16: .C declared in .testClassPropPostfix' type=.C origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_16: .C declared in .testClassPropPostfix' type=.C origin=null - : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_17: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_17: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null - VAR name:p2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_18 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_19 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_18: .C declared in .testClassPropPostfix' type=.C origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_18: .C declared in .testClassPropPostfix' type=.C origin=null - : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_19: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_19: kotlin.Int declared in .testClassPropPostfix' type=kotlin.Int origin=null - FUN name:testClassOperatorPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:a1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_20 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_21 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_INCR - $this: GET_VAR 'val tmp_20: .C declared in .testClassOperatorPrefix' type=.C origin=null - i: GET_VAR 'val tmp_21: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null - value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_20: .C declared in .testClassOperatorPrefix' type=.C origin=null - i: GET_VAR 'val tmp_21: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null - CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_20: .C declared in .testClassOperatorPrefix' type=.C origin=null - i: GET_VAR 'val tmp_21: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null - VAR name:a2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_22 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_23 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_DECR - $this: GET_VAR 'val tmp_22: .C declared in .testClassOperatorPrefix' type=.C origin=null - i: GET_VAR 'val tmp_23: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null - value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_22: .C declared in .testClassOperatorPrefix' type=.C origin=null - i: GET_VAR 'val tmp_23: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null - CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_22: .C declared in .testClassOperatorPrefix' type=.C origin=null - i: GET_VAR 'val tmp_23: kotlin.Int declared in .testClassOperatorPrefix' type=kotlin.Int origin=null - FUN name:testClassOperatorPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:a1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_24 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_25 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_26 type:kotlin.Int [val] - CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_24: .C declared in .testClassOperatorPostfix' type=.C origin=null - i: GET_VAR 'val tmp_25: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null - CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_24: .C declared in .testClassOperatorPostfix' type=.C origin=null - i: GET_VAR 'val tmp_25: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null - value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_26: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_26: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null - VAR name:a2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_27 type:.C [val] - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_28 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_29 type:kotlin.Int [val] - CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_27: .C declared in .testClassOperatorPostfix' type=.C origin=null - i: GET_VAR 'val tmp_28: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null - CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_27: .C declared in .testClassOperatorPostfix' type=.C origin=null - i: GET_VAR 'val tmp_28: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null - value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_29: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_29: kotlin.Int declared in .testClassOperatorPostfix' type=kotlin.Int origin=null - FUN name:testObjectPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:p1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_30 type:.O [val] - GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - BLOCK type=kotlin.Int origin=PREFIX_INCR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_INCR - $this: GET_VAR 'val tmp_30: .O declared in .testObjectPropPrefix' type=.O origin=null - : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_30: .O declared in .testObjectPropPrefix' type=.O origin=null - CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_30: .O declared in .testObjectPropPrefix' type=.O origin=null - VAR name:p2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_31 type:.O [val] - GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - BLOCK type=kotlin.Int origin=PREFIX_DECR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_DECR - $this: GET_VAR 'val tmp_31: .O declared in .testObjectPropPrefix' type=.O origin=null - : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_31: .O declared in .testObjectPropPrefix' type=.O origin=null - CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_31: .O declared in .testObjectPropPrefix' type=.O origin=null - FUN name:testObjectPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:p1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_32 type:.O [val] - GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_33 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_32: .O declared in .testObjectPropPostfix' type=.O origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_32: .O declared in .testObjectPropPostfix' type=.O origin=null - : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_33: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_33: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null - VAR name:p2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_34 type:.O [val] - GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_35 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_34: .O declared in .testObjectPropPostfix' type=.O origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_34: .O declared in .testObjectPropPostfix' type=.O origin=null - : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_35: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_35: kotlin.Int declared in .testObjectPropPostfix' type=kotlin.Int origin=null - FUN name:testObjectOperatorPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:a1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_36 type:.O [val] - GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - VAR IR_TEMPORARY_VARIABLE name:tmp_37 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_INCR - $this: GET_VAR 'val tmp_36: .O declared in .testObjectOperatorPrefix' type=.O origin=null - i: GET_VAR 'val tmp_37: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null - value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR - $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_36: .O declared in .testObjectOperatorPrefix' type=.O origin=null - i: GET_VAR 'val tmp_37: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null - CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_36: .O declared in .testObjectOperatorPrefix' type=.O origin=null - i: GET_VAR 'val tmp_37: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null - VAR name:a2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_38 type:.O [val] - GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - VAR IR_TEMPORARY_VARIABLE name:tmp_39 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_DECR - $this: GET_VAR 'val tmp_38: .O declared in .testObjectOperatorPrefix' type=.O origin=null - i: GET_VAR 'val tmp_39: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null - value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_38: .O declared in .testObjectOperatorPrefix' type=.O origin=null - i: GET_VAR 'val tmp_39: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null - CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_38: .O declared in .testObjectOperatorPrefix' type=.O origin=null - i: GET_VAR 'val tmp_39: kotlin.Int declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null - FUN name:testObjectOperatorPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:a1 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_40 type:.O [val] - GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O - VAR IR_TEMPORARY_VARIABLE name:tmp_41 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_42 type:kotlin.Int [val] - CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_40: .O declared in .testObjectOperatorPostfix' type=.O origin=null - i: GET_VAR 'val tmp_41: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_40: .O declared in .testObjectOperatorPostfix' type=.O origin=null - i: GET_VAR 'val tmp_41: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_42: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_42: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - VAR name:a2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_43 type:.O [val] - GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O VAR IR_TEMPORARY_VARIABLE name:tmp_44 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 + GET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=POSTFIX_INCR + SET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Unit origin=POSTFIX_INCR + CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_44: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_44: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null + VAR name:x2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR VAR IR_TEMPORARY_VARIABLE name:tmp_45 type:kotlin.Int [val] - CALL 'public final fun get (i: kotlin.Int): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_43: .O declared in .testObjectOperatorPostfix' type=.O origin=null - i: GET_VAR 'val tmp_44: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_43: .O declared in .testObjectOperatorPostfix' type=.O origin=null - i: GET_VAR 'val tmp_44: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_45: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_45: kotlin.Int declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=POSTFIX_DECR + SET_VAR 'var x: kotlin.Int declared in .testVarPostfix' type=kotlin.Unit origin=POSTFIX_DECR + CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_45: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_45: kotlin.Int declared in .testVarPostfix' type=kotlin.Int origin=null + FUN name:testVarPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR name:x1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + SET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Unit origin=PREFIX_INCR + CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_INCR + GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_INCR + VAR name:x2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + SET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Unit origin=PREFIX_DECR + CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_DECR + GET_VAR 'var x: kotlin.Int declared in .testVarPrefix' type=kotlin.Int origin=PREFIX_DECR diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.kt.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.kt.txt index 6816f0c791e..a395ec2056a 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.kt.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.kt.txt @@ -8,17 +8,17 @@ val arr: IntArray get class C { + var p: Int + field = 0 + get + set + constructor() /* primary */ { super/*Any*/() /* () */ } - var p: Int - field = 0 - get - set - operator fun get(i: Int): Int { return i } @@ -29,17 +29,17 @@ class C { } object O { + var p: Int + field = 0 + get + set + private constructor() /* primary */ { super/*Any*/() /* () */ } - var p: Int - field = 0 - get - set - operator fun get(i: Int): Int { return i } @@ -49,29 +49,188 @@ object O { } -fun testVarPrefix() { - var x: Int = 0 - val x1: Int = { // BLOCK - x = x.inc() - x +fun testArrayPostfix() { + val a1: Int = { // BLOCK + val tmp_0: IntArray = () + val tmp_1: Int = 0 + val tmp_2: Int = tmp_0.get(index = tmp_1) + tmp_0.set(index = tmp_1, value = tmp_2.inc()) + tmp_2 } - val x2: Int = { // BLOCK - x = x.dec() - x + val a2: Int = { // BLOCK + val tmp_3: IntArray = () + val tmp_4: Int = 0 + val tmp_5: Int = tmp_3.get(index = tmp_4) + tmp_3.set(index = tmp_4, value = tmp_5.dec()) + tmp_5 } } -fun testVarPostfix() { - var x: Int = 0 - val x1: Int = { // BLOCK - val tmp_0: Int = x - x = tmp_0.inc() - tmp_0 +fun testArrayPrefix() { + val a1: Int = { // BLOCK + val tmp_6: IntArray = () + val tmp_7: Int = 0 + tmp_6.set(index = tmp_7, value = tmp_6.get(index = tmp_7).inc()) + tmp_6.get(index = tmp_7) } - val x2: Int = { // BLOCK - val tmp_1: Int = x - x = tmp_1.dec() - tmp_1 + val a2: Int = { // BLOCK + val tmp_8: IntArray = () + val tmp_9: Int = 0 + tmp_8.set(index = tmp_9, value = tmp_8.get(index = tmp_9).dec()) + tmp_8.get(index = tmp_9) + } +} + +fun testClassOperatorPostfix() { + val a1: Int = { // BLOCK + val tmp_10: C = C() + val tmp_11: Int = 0 + val tmp_12: Int = tmp_10.get(i = tmp_11) + tmp_10.set(i = tmp_11, value = tmp_12.inc()) + tmp_12 + } + val a2: Int = { // BLOCK + val tmp_13: C = C() + val tmp_14: Int = 0 + val tmp_15: Int = tmp_13.get(i = tmp_14) + tmp_13.set(i = tmp_14, value = tmp_15.dec()) + tmp_15 + } +} + +fun testClassOperatorPrefix() { + val a1: Int = { // BLOCK + val tmp_16: C = C() + val tmp_17: Int = 0 + tmp_16.set(i = tmp_17, value = tmp_16.get(i = tmp_17).inc()) + tmp_16.get(i = tmp_17) + } + val a2: Int = { // BLOCK + val tmp_18: C = C() + val tmp_19: Int = 0 + tmp_18.set(i = tmp_19, value = tmp_18.get(i = tmp_19).dec()) + tmp_18.get(i = tmp_19) + } +} + +fun testClassPropPostfix() { + val p1: Int = { // BLOCK + val tmp_20: C = C() + { // BLOCK + val tmp_21: Int = tmp_20.() + tmp_20.( = tmp_21.inc()) + tmp_21 + } + } + val p2: Int = { // BLOCK + val tmp_22: C = C() + { // BLOCK + val tmp_23: Int = tmp_22.() + tmp_22.( = tmp_23.dec()) + tmp_23 + } + } +} + +fun testClassPropPrefix() { + val p1: Int = { // BLOCK + val tmp_24: C = C() + { // BLOCK + tmp_24.( = tmp_24.().inc()) + tmp_24.() + } + } + val p2: Int = { // BLOCK + val tmp_25: C = C() + { // BLOCK + tmp_25.( = tmp_25.().dec()) + tmp_25.() + } + } +} + +fun testObjectOperatorPostfix() { + val a1: Int = { // BLOCK + val tmp_26: O = O + val tmp_27: Int = 0 + val tmp_28: Int = tmp_26.get(i = tmp_27) + tmp_26.set(i = tmp_27, value = tmp_28.inc()) + tmp_28 + } + val a2: Int = { // BLOCK + val tmp_29: O = O + val tmp_30: Int = 0 + val tmp_31: Int = tmp_29.get(i = tmp_30) + tmp_29.set(i = tmp_30, value = tmp_31.dec()) + tmp_31 + } +} + +fun testObjectOperatorPrefix() { + val a1: Int = { // BLOCK + val tmp_32: O = O + val tmp_33: Int = 0 + tmp_32.set(i = tmp_33, value = tmp_32.get(i = tmp_33).inc()) + tmp_32.get(i = tmp_33) + } + val a2: Int = { // BLOCK + val tmp_34: O = O + val tmp_35: Int = 0 + tmp_34.set(i = tmp_35, value = tmp_34.get(i = tmp_35).dec()) + tmp_34.get(i = tmp_35) + } +} + +fun testObjectPropPostfix() { + val p1: Int = { // BLOCK + val tmp_36: O = O + { // BLOCK + val tmp_37: Int = tmp_36.() + tmp_36.( = tmp_37.inc()) + tmp_37 + } + } + val p2: Int = { // BLOCK + val tmp_38: O = O + { // BLOCK + val tmp_39: Int = tmp_38.() + tmp_38.( = tmp_39.dec()) + tmp_39 + } + } +} + +fun testObjectPropPrefix() { + val p1: Int = { // BLOCK + val tmp_40: O = O + { // BLOCK + tmp_40.( = tmp_40.().inc()) + tmp_40.() + } + } + val p2: Int = { // BLOCK + val tmp_41: O = O + { // BLOCK + tmp_41.( = tmp_41.().dec()) + tmp_41.() + } + } +} + +fun testPropPostfix() { + val p1: Int = { // BLOCK + { // BLOCK + val tmp_42: Int = () + ( = tmp_42.inc()) + tmp_42 + } + } + val p2: Int = { // BLOCK + { // BLOCK + val tmp_43: Int = () + ( = tmp_43.dec()) + tmp_43 + } } } @@ -90,187 +249,29 @@ fun testPropPrefix() { } } -fun testPropPostfix() { - val p1: Int = { // BLOCK - { // BLOCK - val tmp_2: Int = () - ( = tmp_2.inc()) - tmp_2 - } +fun testVarPostfix() { + var x: Int = 0 + val x1: Int = { // BLOCK + val tmp_44: Int = x + x = tmp_44.inc() + tmp_44 } - val p2: Int = { // BLOCK - { // BLOCK - val tmp_3: Int = () - ( = tmp_3.dec()) - tmp_3 - } - } -} - -fun testArrayPrefix() { - val a1: Int = { // BLOCK - val tmp_4: IntArray = () - val tmp_5: Int = 0 - tmp_4.set(index = tmp_5, value = tmp_4.get(index = tmp_5).inc()) - tmp_4.get(index = tmp_5) - } - val a2: Int = { // BLOCK - val tmp_6: IntArray = () - val tmp_7: Int = 0 - tmp_6.set(index = tmp_7, value = tmp_6.get(index = tmp_7).dec()) - tmp_6.get(index = tmp_7) - } -} - -fun testArrayPostfix() { - val a1: Int = { // BLOCK - val tmp_8: IntArray = () - val tmp_9: Int = 0 - val tmp_10: Int = tmp_8.get(index = tmp_9) - tmp_8.set(index = tmp_9, value = tmp_10.inc()) - tmp_10 - } - val a2: Int = { // BLOCK - val tmp_11: IntArray = () - val tmp_12: Int = 0 - val tmp_13: Int = tmp_11.get(index = tmp_12) - tmp_11.set(index = tmp_12, value = tmp_13.dec()) - tmp_13 - } -} - -fun testClassPropPrefix() { - val p1: Int = { // BLOCK - val tmp_14: C = C() - { // BLOCK - tmp_14.( = tmp_14.().inc()) - tmp_14.() - } - } - val p2: Int = { // BLOCK - val tmp_15: C = C() - { // BLOCK - tmp_15.( = tmp_15.().dec()) - tmp_15.() - } - } -} - -fun testClassPropPostfix() { - val p1: Int = { // BLOCK - val tmp_16: C = C() - { // BLOCK - val tmp_17: Int = tmp_16.() - tmp_16.( = tmp_17.inc()) - tmp_17 - } - } - val p2: Int = { // BLOCK - val tmp_18: C = C() - { // BLOCK - val tmp_19: Int = tmp_18.() - tmp_18.( = tmp_19.dec()) - tmp_19 - } - } -} - -fun testClassOperatorPrefix() { - val a1: Int = { // BLOCK - val tmp_20: C = C() - val tmp_21: Int = 0 - tmp_20.set(i = tmp_21, value = tmp_20.get(i = tmp_21).inc()) - tmp_20.get(i = tmp_21) - } - val a2: Int = { // BLOCK - val tmp_22: C = C() - val tmp_23: Int = 0 - tmp_22.set(i = tmp_23, value = tmp_22.get(i = tmp_23).dec()) - tmp_22.get(i = tmp_23) - } -} - -fun testClassOperatorPostfix() { - val a1: Int = { // BLOCK - val tmp_24: C = C() - val tmp_25: Int = 0 - val tmp_26: Int = tmp_24.get(i = tmp_25) - tmp_24.set(i = tmp_25, value = tmp_26.inc()) - tmp_26 - } - val a2: Int = { // BLOCK - val tmp_27: C = C() - val tmp_28: Int = 0 - val tmp_29: Int = tmp_27.get(i = tmp_28) - tmp_27.set(i = tmp_28, value = tmp_29.dec()) - tmp_29 - } -} - -fun testObjectPropPrefix() { - val p1: Int = { // BLOCK - val tmp_30: O = O - { // BLOCK - tmp_30.( = tmp_30.().inc()) - tmp_30.() - } - } - val p2: Int = { // BLOCK - val tmp_31: O = O - { // BLOCK - tmp_31.( = tmp_31.().dec()) - tmp_31.() - } - } -} - -fun testObjectPropPostfix() { - val p1: Int = { // BLOCK - val tmp_32: O = O - { // BLOCK - val tmp_33: Int = tmp_32.() - tmp_32.( = tmp_33.inc()) - tmp_33 - } - } - val p2: Int = { // BLOCK - val tmp_34: O = O - { // BLOCK - val tmp_35: Int = tmp_34.() - tmp_34.( = tmp_35.dec()) - tmp_35 - } - } -} - -fun testObjectOperatorPrefix() { - val a1: Int = { // BLOCK - val tmp_36: O = O - val tmp_37: Int = 0 - tmp_36.set(i = tmp_37, value = tmp_36.get(i = tmp_37).inc()) - tmp_36.get(i = tmp_37) - } - val a2: Int = { // BLOCK - val tmp_38: O = O - val tmp_39: Int = 0 - tmp_38.set(i = tmp_39, value = tmp_38.get(i = tmp_39).dec()) - tmp_38.get(i = tmp_39) - } -} - -fun testObjectOperatorPostfix() { - val a1: Int = { // BLOCK - val tmp_40: O = O - val tmp_41: Int = 0 - val tmp_42: Int = tmp_40.get(i = tmp_41) - tmp_40.set(i = tmp_41, value = tmp_42.inc()) - tmp_42 - } - val a2: Int = { // BLOCK - val tmp_43: O = O - val tmp_44: Int = 0 - val tmp_45: Int = tmp_43.get(i = tmp_44) - tmp_43.set(i = tmp_44, value = tmp_45.dec()) + val x2: Int = { // BLOCK + val tmp_45: Int = x + x = tmp_45.dec() tmp_45 } } + +fun testVarPrefix() { + var x: Int = 0 + val x1: Int = { // BLOCK + x = x.inc() + x + } + val x2: Int = { // BLOCK + x = x.dec() + x + } +} + diff --git a/compiler/testData/ir/irText/expressions/inlinedBreakContinue.ir.txt b/compiler/testData/ir/irText/expressions/inlinedBreakContinue.ir.txt index 8ab672b9cf5..e7b03c61233 100644 --- a/compiler/testData/ir/irText/expressions/inlinedBreakContinue.ir.txt +++ b/compiler/testData/ir/irText/expressions/inlinedBreakContinue.ir.txt @@ -1,9 +1,4 @@ FILE fqName: fileName:/inlinedBreakContinue.kt - FUN name:foo visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit [inline] - VALUE_PARAMETER name:block index:0 type:kotlin.Function0 - BLOCK_BODY - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE - $this: GET_VAR 'block: kotlin.Function0 declared in .foo' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:bar visibility:public modality:FINAL <> (block1:kotlin.Function0, block2:kotlin.Function0) returnType:kotlin.Unit [inline] VALUE_PARAMETER name:block1 index:0 type:kotlin.Function0 VALUE_PARAMETER name:block2 index:1 type:kotlin.Function0 [noinline] @@ -12,6 +7,11 @@ FILE fqName: fileName:/inlinedBreakContinue.kt $this: GET_VAR 'block1: kotlin.Function0 declared in .bar' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'block2: kotlin.Function0 declared in .bar' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + FUN name:foo visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit [inline] + VALUE_PARAMETER name:block index:0 type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE + $this: GET_VAR 'block: kotlin.Function0 declared in .foo' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY WHILE label=null origin=WHILE_LOOP diff --git a/compiler/testData/ir/irText/expressions/inlinedBreakContinue.kt.txt b/compiler/testData/ir/irText/expressions/inlinedBreakContinue.kt.txt index 6357dc39b8e..9f810514878 100644 --- a/compiler/testData/ir/irText/expressions/inlinedBreakContinue.kt.txt +++ b/compiler/testData/ir/irText/expressions/inlinedBreakContinue.kt.txt @@ -1,12 +1,12 @@ -inline fun foo(block: Function0) { - block.invoke() -} - inline fun bar(block1: Function0, noinline block2: Function0) { block1.invoke() block2.invoke() } +inline fun foo(block: Function0) { + block.invoke() +} + fun test1() { while (true) { // BLOCK foo(block = local fun () { @@ -58,3 +58,4 @@ fun test2() { ) } } + diff --git a/compiler/testData/ir/irText/expressions/interfaceThisRef.ir.txt b/compiler/testData/ir/irText/expressions/interfaceThisRef.ir.txt index 2284b7311ab..b428a98133b 100644 --- a/compiler/testData/ir/irText/expressions/interfaceThisRef.ir.txt +++ b/compiler/testData/ir/irText/expressions/interfaceThisRef.ir.txt @@ -1,13 +1,6 @@ FILE fqName: fileName:/interfaceThisRef.kt CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFoo - FUN name:bar visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFoo - BLOCK_BODY - CALL 'public abstract fun foo (): kotlin.Unit declared in .IFoo' type=kotlin.Unit origin=null - $this: GET_VAR ': .IFoo declared in .IFoo.bar' type=.IFoo 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 @@ -21,3 +14,10 @@ FILE fqName: fileName:/interfaceThisRef.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFoo + BLOCK_BODY + CALL 'public abstract fun foo (): kotlin.Unit declared in .IFoo' type=kotlin.Unit origin=null + $this: GET_VAR ': .IFoo declared in .IFoo.bar' type=.IFoo origin=null + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFoo diff --git a/compiler/testData/ir/irText/expressions/interfaceThisRef.kt.txt b/compiler/testData/ir/irText/expressions/interfaceThisRef.kt.txt index 7ae049ccf92..6574c6aa113 100644 --- a/compiler/testData/ir/irText/expressions/interfaceThisRef.kt.txt +++ b/compiler/testData/ir/irText/expressions/interfaceThisRef.kt.txt @@ -1,8 +1,9 @@ interface IFoo { - abstract fun foo() - fun bar() { .foo() } + abstract fun foo() + } + diff --git a/compiler/testData/ir/irText/expressions/intersectedSmartcastForExtensionReceiverWithSameConstructor.ir.txt b/compiler/testData/ir/irText/expressions/intersectedSmartcastForExtensionReceiverWithSameConstructor.ir.txt index fb504e9a8a5..de8741d9d08 100644 --- a/compiler/testData/ir/irText/expressions/intersectedSmartcastForExtensionReceiverWithSameConstructor.ir.txt +++ b/compiler/testData/ir/irText/expressions/intersectedSmartcastForExtensionReceiverWithSameConstructor.ir.txt @@ -19,6 +19,10 @@ FILE fqName: fileName:/intersectedSmartcastForExtensionReceiverWithSameCon overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:parameterizedExt visibility:public modality:FINAL ($receiver:.Bar.parameterizedExt>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Bar.parameterizedExt> + BLOCK_BODY FUN name:specificExt visibility:public modality:FINAL <> ($receiver:.Bar) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.Bar BLOCK_BODY @@ -48,10 +52,6 @@ FILE fqName: fileName:/intersectedSmartcastForExtensionReceiverWithSameCon CALL 'public final fun specificExt (): kotlin.Unit declared in ' type=kotlin.Unit origin=null $receiver: TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar GET_VAR 'x: kotlin.Any declared in .test_1_2' type=kotlin.Any origin=null - FUN name:parameterizedExt visibility:public modality:FINAL ($receiver:.Bar.parameterizedExt>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Bar.parameterizedExt> - BLOCK_BODY FUN name:test_2_1 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/intersectedSmartcastForExtensionReceiverWithSameConstructor.kt.txt b/compiler/testData/ir/irText/expressions/intersectedSmartcastForExtensionReceiverWithSameConstructor.kt.txt index 4adee5590f6..1ee25d831b9 100644 --- a/compiler/testData/ir/irText/expressions/intersectedSmartcastForExtensionReceiverWithSameConstructor.kt.txt +++ b/compiler/testData/ir/irText/expressions/intersectedSmartcastForExtensionReceiverWithSameConstructor.kt.txt @@ -7,6 +7,9 @@ class Bar { } +fun Bar.parameterizedExt() { +} + fun Bar.specificExt() { } @@ -22,9 +25,6 @@ fun test_1_2(x: Any) { x /*as Bar */.specificExt() } -fun Bar.parameterizedExt() { -} - fun test_2_1(x: Any) { x as Bar /*~> Unit */ x /*as Bar */ as Bar /*~> Unit */ @@ -38,3 +38,4 @@ fun test_2_2(x: Any) { x /*as Bar */.parameterizedExt() x /*as Bar */.parameterizedExt() } + diff --git a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.fir.ir.txt b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.fir.ir.txt index a1ba8e08466..747fa77a14d 100644 --- a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.fir.ir.txt @@ -1,19 +1,4 @@ FILE fqName: fileName:/jvmFieldWithIntersectionTypes.kt - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - 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: 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 CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.JFieldOwner; .IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived1 CONSTRUCTOR visibility:public <> () returnType:.Derived1 [primary] @@ -58,25 +43,6 @@ FILE fqName: fileName:/jvmFieldWithIntersectionTypes.kt public open fun toString (): kotlin.String declared in .JFieldOwner public open fun toString (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Mid modality:OPEN visibility:public superTypes:[.JFieldOwner] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Mid - CONSTRUCTOR visibility:public <> () returnType:.Mid [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JFieldOwner' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Mid modality:OPEN visibility:public superTypes:[.JFieldOwner]' - 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 .JFieldOwner - $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 .JFieldOwner - $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 .JFieldOwner - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:DerivedThroughMid1 modality:FINAL visibility:public superTypes:[.Mid; .IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DerivedThroughMid1 CONSTRUCTOR visibility:public <> () returnType:.DerivedThroughMid1 [primary] @@ -121,6 +87,40 @@ FILE fqName: fileName:/jvmFieldWithIntersectionTypes.kt public open fun toString (): kotlin.String declared in .Mid public open fun toString (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Mid modality:OPEN visibility:public superTypes:[.JFieldOwner] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Mid + CONSTRUCTOR visibility:public <> () returnType:.Mid [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JFieldOwner' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Mid modality:OPEN visibility:public superTypes:[.JFieldOwner]' + 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 .JFieldOwner + $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 .JFieldOwner + $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 .JFieldOwner + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + 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: 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:test visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.Unit VALUE_PARAMETER name:b index:0 type:kotlin.Boolean BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.fir.kt.txt b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.fir.kt.txt index 56a079ed1f7..8340255ccf5 100644 --- a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.fir.kt.txt @@ -1,6 +1,3 @@ -interface IFoo { -} - class Derived1 : JFieldOwner, IFoo { constructor() /* primary */ { super/*JFieldOwner*/() @@ -19,15 +16,6 @@ class Derived2 : JFieldOwner, IFoo { } -open class Mid : JFieldOwner { - constructor() /* primary */ { - super/*JFieldOwner*/() - /* () */ - - } - -} - class DerivedThroughMid1 : Mid, IFoo { constructor() /* primary */ { super/*Mid*/() @@ -46,6 +34,18 @@ class DerivedThroughMid2 : Mid, IFoo { } +open class Mid : JFieldOwner { + constructor() /* primary */ { + super/*JFieldOwner*/() + /* () */ + + } + +} + +interface IFoo { +} + fun test(b: Boolean) { val d1: Derived1 = Derived1() val d2: Derived2 = Derived2() diff --git a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.ir.txt b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.ir.txt index 6fec7736ee7..b8f185dc98e 100644 --- a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.ir.txt +++ b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.ir.txt @@ -1,19 +1,4 @@ FILE fqName: fileName:/jvmFieldWithIntersectionTypes.kt - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - 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: 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 CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.JFieldOwner; .IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived1 CONSTRUCTOR visibility:public <> () returnType:.Derived1 [primary] @@ -64,28 +49,6 @@ FILE fqName: fileName:/jvmFieldWithIntersectionTypes.kt PROPERTY FAKE_OVERRIDE name:f visibility:public modality:FINAL [fake_override,var] overridden: public final f: kotlin.Int - CLASS CLASS name:Mid modality:OPEN visibility:public superTypes:[.JFieldOwner] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Mid - CONSTRUCTOR visibility:public <> () returnType:.Mid [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JFieldOwner' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Mid modality:OPEN visibility:public superTypes:[.JFieldOwner]' - 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 .JFieldOwner - $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 .JFieldOwner - $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 .JFieldOwner - $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY FAKE_OVERRIDE name:f visibility:public modality:FINAL [fake_override,var] - overridden: - public final f: kotlin.Int CLASS CLASS name:DerivedThroughMid1 modality:FINAL visibility:public superTypes:[.Mid; .IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DerivedThroughMid1 CONSTRUCTOR visibility:public <> () returnType:.DerivedThroughMid1 [primary] @@ -136,6 +99,43 @@ FILE fqName: fileName:/jvmFieldWithIntersectionTypes.kt PROPERTY FAKE_OVERRIDE name:f visibility:public modality:FINAL [fake_override,var] overridden: public final f + CLASS CLASS name:Mid modality:OPEN visibility:public superTypes:[.JFieldOwner] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Mid + CONSTRUCTOR visibility:public <> () returnType:.Mid [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JFieldOwner' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Mid modality:OPEN visibility:public superTypes:[.JFieldOwner]' + 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 .JFieldOwner + $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 .JFieldOwner + $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 .JFieldOwner + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:f visibility:public modality:FINAL [fake_override,var] + overridden: + public final f: kotlin.Int + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + 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: 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:test visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.Unit VALUE_PARAMETER name:b index:0 type:kotlin.Boolean BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt.txt b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt.txt index 5f5ad0b7736..07e2ead9a7f 100644 --- a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt.txt +++ b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt.txt @@ -1,6 +1,3 @@ -interface IFoo { -} - class Derived1 : JFieldOwner, IFoo { constructor() /* primary */ { super/*JFieldOwner*/() @@ -19,15 +16,6 @@ class Derived2 : JFieldOwner, IFoo { } -open class Mid : JFieldOwner { - constructor() /* primary */ { - super/*JFieldOwner*/() - /* () */ - - } - -} - class DerivedThroughMid1 : Mid, IFoo { constructor() /* primary */ { super/*Mid*/() @@ -46,6 +34,18 @@ class DerivedThroughMid2 : Mid, IFoo { } +open class Mid : JFieldOwner { + constructor() /* primary */ { + super/*JFieldOwner*/() + /* () */ + + } + +} + +interface IFoo { +} + fun test(b: Boolean) { val d1: Derived1 = Derived1() val d2: Derived2 = Derived2() diff --git a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.ir.txt b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.ir.txt index cf6443599b0..3586b6b1d53 100644 --- a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.ir.txt @@ -1,28 +1,15 @@ FILE fqName: fileName:/Derived.kt CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ receiver: GET_VAR ': .Derived declared in .Derived' type=.Derived origin=null value: CONST Int type=kotlin.Int value=0 - FUN name:getValue visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.Derived + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (): kotlin.Int declared in .Derived' - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.Int visibility:public' type=kotlin.Int origin=null - receiver: GET_VAR ': .Derived declared in .Derived.getValue' type=.Derived origin=null - FUN name:setValue visibility:public modality:FINAL <> ($this:.Derived, value:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Derived - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ - receiver: GET_VAR ': .Derived declared in .Derived.setValue' type=.Derived origin=null - value: GET_VAR 'value: kotlin.Int declared in .Derived.setValue' type=kotlin.Int origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base]' 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 .Base @@ -36,3 +23,16 @@ FILE fqName: fileName:/Derived.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.Derived + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (): kotlin.Int declared in .Derived' + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.Int visibility:public' type=kotlin.Int origin=null + receiver: GET_VAR ': .Derived declared in .Derived.getValue' type=.Derived origin=null + FUN name:setValue visibility:public modality:FINAL <> ($this:.Derived, value:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Derived + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ + receiver: GET_VAR ': .Derived declared in .Derived.setValue' type=.Derived origin=null + value: GET_VAR 'value: kotlin.Int declared in .Derived.setValue' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.kt.txt b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.kt.txt index b8d23df3e1f..196d3ed34be 100644 --- a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.kt.txt @@ -1,14 +1,14 @@ class Derived : Base { + init { + .#value = 0 + } + constructor() /* primary */ { super/*Base*/() /* () */ } - init { - .#value = 0 - } - fun getValue(): Int { return .#value } diff --git a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.ir.txt b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.ir.txt index 04903968105..76a5e1140f0 100644 --- a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.ir.txt +++ b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.ir.txt @@ -1,28 +1,15 @@ FILE fqName: fileName:/Derived.kt CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ receiver: GET_VAR ': .Derived declared in .Derived' type=.Derived origin=null value: CONST Int type=kotlin.Int value=0 - FUN name:getValue visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.Derived + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (): kotlin.Int declared in .Derived' - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.Int visibility:public' type=kotlin.Int origin=null - receiver: GET_VAR ': .Derived declared in .Derived.getValue' type=.Derived origin=null - FUN name:setValue visibility:public modality:FINAL <> ($this:.Derived, value:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Derived - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ - receiver: GET_VAR ': .Derived declared in .Derived.setValue' type=.Derived origin=null - value: GET_VAR 'value: kotlin.Int declared in .Derived.setValue' type=kotlin.Int origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base]' 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 .Base @@ -36,6 +23,19 @@ FILE fqName: fileName:/Derived.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.Derived + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (): kotlin.Int declared in .Derived' + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.Int visibility:public' type=kotlin.Int origin=null + receiver: GET_VAR ': .Derived declared in .Derived.getValue' type=.Derived origin=null + FUN name:setValue visibility:public modality:FINAL <> ($this:.Derived, value:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Derived + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ + receiver: GET_VAR ': .Derived declared in .Derived.setValue' type=.Derived origin=null + value: GET_VAR 'value: kotlin.Int declared in .Derived.setValue' type=kotlin.Int origin=null PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,var] overridden: public final value: kotlin.Int diff --git a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.kt.txt b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.kt.txt index 0a51e83f756..ce4b8a1c6c7 100644 --- a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.kt.txt +++ b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.kt.txt @@ -1,14 +1,14 @@ class Derived : Base { + init { + (super).#value = 0 + } + constructor() /* primary */ { super/*Base*/() /* () */ } - init { - (super).#value = 0 - } - fun getValue(): Int { return (super).#value } diff --git a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.ir.txt b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.ir.txt index c660abb2514..e5b1fd6a609 100644 --- a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.ir.txt @@ -1,31 +1,6 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt - FUN name:testFun visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null - p0: CONST String type=kotlin.String value="testFun" - PROPERTY name:testProp visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Any - correspondingProperty: PROPERTY name:testProp visibility:public modality:FINAL [var] - BLOCK_BODY - CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null - p0: CONST String type=kotlin.String value="testProp/get" - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in ' - CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> (value:kotlin.Any) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:testProp visibility:public modality:FINAL [var] - VALUE_PARAMETER name:value index:0 type:kotlin.Any - BLOCK_BODY - CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null - p0: CONST String type=kotlin.String value="testProp/set" CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClass - CONSTRUCTOR visibility:public <> () returnType:.TestClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:test visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -49,6 +24,10 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null p0: CONST String type=kotlin.String value="TestClass/init" + CONSTRUCTOR visibility:public <> () returnType:.TestClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClass modality:FINAL visibility:public 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 declared in kotlin.Any @@ -62,3 +41,24 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testFun visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null + p0: CONST String type=kotlin.String value="testFun" + PROPERTY name:testProp visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Any + correspondingProperty: PROPERTY name:testProp visibility:public modality:FINAL [var] + BLOCK_BODY + CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null + p0: CONST String type=kotlin.String value="testProp/get" + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in ' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> (value:kotlin.Any) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testProp visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:kotlin.Any + BLOCK_BODY + CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null + p0: CONST String type=kotlin.String value="testProp/set" diff --git a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.kt.txt b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.kt.txt index 30bafebac69..7a9d96de21b 100644 --- a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.kt.txt @@ -1,23 +1,4 @@ -fun testFun() { - #out.println(p0 = "testFun") -} - -var testProp: Any - get(): Any { - #out.println(p0 = "testProp/get") - return 42 - } - set(value: Any) { - #out.println(p0 = "testProp/set") - } - class TestClass { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val test: Int field = when { else -> { // BLOCK @@ -31,4 +12,24 @@ class TestClass { #out.println(p0 = "TestClass/init") } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + +fun testFun() { + #out.println(p0 = "testFun") +} + +var testProp: Any + get(): Any { + #out.println(p0 = "testProp/get") + return 42 + } + set(value: Any) { + #out.println(p0 = "testProp/set") + } + diff --git a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.ir.txt b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.ir.txt index ecdb3c5bf16..bf9e1975dfc 100644 --- a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.ir.txt +++ b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.ir.txt @@ -1,34 +1,6 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt - FUN name:testFun visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null - $this: TYPE_OP type=java.io.PrintStream origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null - p0: CONST String type=kotlin.String value="testFun" - PROPERTY name:testProp visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Any - correspondingProperty: PROPERTY name:testProp visibility:public modality:FINAL [var] - BLOCK_BODY - CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null - $this: TYPE_OP type=java.io.PrintStream origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null - p0: CONST String type=kotlin.String value="testProp/get" - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in ' - CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> (value:kotlin.Any) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:testProp visibility:public modality:FINAL [var] - VALUE_PARAMETER name:value index:0 type:kotlin.Any - BLOCK_BODY - CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null - $this: TYPE_OP type=java.io.PrintStream origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null - p0: CONST String type=kotlin.String value="testProp/set" CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClass - CONSTRUCTOR visibility:public <> () returnType:.TestClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:test visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -54,6 +26,10 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt $this: TYPE_OP type=java.io.PrintStream origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null p0: CONST String type=kotlin.String value="TestClass/init" + CONSTRUCTOR visibility:public <> () returnType:.TestClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClass modality:FINAL visibility:public 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 declared in kotlin.Any @@ -67,3 +43,27 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testFun visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: TYPE_OP type=java.io.PrintStream origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null + p0: CONST String type=kotlin.String value="testFun" + PROPERTY name:testProp visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Any + correspondingProperty: PROPERTY name:testProp visibility:public modality:FINAL [var] + BLOCK_BODY + CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: TYPE_OP type=java.io.PrintStream origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null + p0: CONST String type=kotlin.String value="testProp/get" + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in ' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> (value:kotlin.Any) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testProp visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:kotlin.Any + BLOCK_BODY + CALL 'public open fun println (p0: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: TYPE_OP type=java.io.PrintStream origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:@[FlexibleNullability] java.io.PrintStream? visibility:public [final,static]' type=@[FlexibleNullability] java.io.PrintStream? origin=null + p0: CONST String type=kotlin.String value="testProp/set" diff --git a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.kt.txt b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.kt.txt index fb473f7154e..1ee8a2b9a05 100644 --- a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.kt.txt +++ b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.kt.txt @@ -1,23 +1,4 @@ -fun testFun() { - super.#out /*!! PrintStream */.println(p0 = "testFun") -} - -var testProp: Any - get(): Any { - super.#out /*!! PrintStream */.println(p0 = "testProp/get") - return 42 - } - set(value: Any) { - super.#out /*!! PrintStream */.println(p0 = "testProp/set") - } - class TestClass { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val test: Int field = when { else -> { // BLOCK @@ -31,5 +12,24 @@ class TestClass { super.#out /*!! PrintStream */.println(p0 = "TestClass/init") } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } +fun testFun() { + super.#out /*!! PrintStream */.println(p0 = "testFun") +} + +var testProp: Any + get(): Any { + super.#out /*!! PrintStream */.println(p0 = "testProp/get") + return 42 + } + set(value: Any) { + super.#out /*!! PrintStream */.println(p0 = "testProp/set") + } + diff --git a/compiler/testData/ir/irText/expressions/kt16904.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt16904.fir.ir.txt index 398bf685f95..e2c2cd75699 100644 --- a/compiler/testData/ir/irText/expressions/kt16904.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt16904.fir.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/kt16904.kt CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:.B visibility:private [final] EXPRESSION_BODY @@ -35,6 +31,10 @@ FILE fqName: fileName:/kt16904.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null value: GET_VAR ': kotlin.Int declared in .A.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public 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 declared in kotlin.Any @@ -54,10 +54,6 @@ FILE fqName: fileName:/kt16904.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:plusAssign visibility:public modality:FINAL <> ($this:.B, x:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY 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 @@ -71,6 +67,10 @@ FILE fqName: fileName:/kt16904.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:plusAssign visibility:public modality:FINAL <> ($this:.B, x:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 CONSTRUCTOR visibility:public <> () returnType:.Test1 @@ -87,6 +87,19 @@ FILE fqName: fileName:/kt16904.kt $this: CALL 'public final fun (): kotlin.Int declared in .Test1' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Test1 declared in .Test1' type=.Test1 origin=null other: CONST Int type=kotlin.Int value=42 + 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 .A + $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 .A + $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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] overridden: public final x: .B @@ -109,30 +122,17 @@ FILE fqName: fileName:/kt16904.kt public final fun (: kotlin.Int): kotlin.Unit declared in .A $this: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name: index:0 type:kotlin.Int - 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 .A - $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 .A - $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 .A - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.J] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:public <> () returnType:.Test2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .J' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.J]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:field type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ receiver: GET_VAR ': .Test2 declared in .Test2' type=.Test2 origin=null value: CONST Int type=kotlin.Int value=42 + CONSTRUCTOR visibility:public <> () returnType:.Test2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .J' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.J]' 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 .J diff --git a/compiler/testData/ir/irText/expressions/kt16904.fir.kt.txt b/compiler/testData/ir/irText/expressions/kt16904.fir.kt.txt index 8505dcfe34f..17d1631f91a 100644 --- a/compiler/testData/ir/irText/expressions/kt16904.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt16904.fir.kt.txt @@ -1,10 +1,4 @@ abstract class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val x: B field = B() get @@ -14,6 +8,12 @@ abstract class A { get set + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } class B { @@ -40,14 +40,15 @@ class Test1 : A { } class Test2 : J { + init { + .#field = 42 + } + constructor() /* primary */ { super/*J*/() /* () */ } - init { - .#field = 42 - } - } + diff --git a/compiler/testData/ir/irText/expressions/kt16904.ir.txt b/compiler/testData/ir/irText/expressions/kt16904.ir.txt index 4ac306d6129..2b46b85b6ed 100644 --- a/compiler/testData/ir/irText/expressions/kt16904.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt16904.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/kt16904.kt CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:.B visibility:private [final] EXPRESSION_BODY @@ -35,6 +31,10 @@ FILE fqName: fileName:/kt16904.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null value: GET_VAR ': kotlin.Int declared in .A.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public 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 declared in kotlin.Any @@ -54,10 +54,6 @@ FILE fqName: fileName:/kt16904.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:plusAssign visibility:public modality:FINAL <> ($this:.B, x:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY 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 @@ -71,6 +67,10 @@ FILE fqName: fileName:/kt16904.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:plusAssign visibility:public modality:FINAL <> ($this:.B, x:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 CONSTRUCTOR visibility:public <> () returnType:.Test1 @@ -93,6 +93,19 @@ FILE fqName: fileName:/kt16904.kt $this: CALL 'public final fun (): kotlin.Int declared in .Test1' type=kotlin.Int origin=PLUSEQ $this: GET_VAR 'val tmp_1: .Test1 declared in .Test1.' type=.Test1 origin=null other: CONST Int type=kotlin.Int value=42 + 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 .A + $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 .A + $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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] overridden: public final x: .B @@ -115,30 +128,17 @@ FILE fqName: fileName:/kt16904.kt public final fun (: kotlin.Int): kotlin.Unit declared in .A $this: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name: index:0 type:kotlin.Int - 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 .A - $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 .A - $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 .A - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.J] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 - CONSTRUCTOR visibility:public <> () returnType:.Test2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .J' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.J]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:field type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ receiver: GET_VAR ': .Test2 declared in .Test2' type=.Test2 origin=null value: CONST Int type=kotlin.Int value=42 + CONSTRUCTOR visibility:public <> () returnType:.Test2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .J' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.J]' 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 .J diff --git a/compiler/testData/ir/irText/expressions/kt16904.kt.txt b/compiler/testData/ir/irText/expressions/kt16904.kt.txt index 7006a58cc45..12d2ad79297 100644 --- a/compiler/testData/ir/irText/expressions/kt16904.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt16904.kt.txt @@ -1,10 +1,4 @@ abstract class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val x: B field = B() get @@ -14,6 +8,12 @@ abstract class A { get set + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } class B { @@ -46,15 +46,15 @@ class Test1 : A { } class Test2 : J { + init { + (super).#field = 42 + } + constructor() /* primary */ { super/*J*/() /* () */ } - init { - (super).#field = 42 - } - } diff --git a/compiler/testData/ir/irText/expressions/kt16905.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt16905.fir.ir.txt index ec175a09f12..ccea0b93071 100644 --- a/compiler/testData/ir/irText/expressions/kt16905.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt16905.fir.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/kt16905.kt CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner CONSTRUCTOR visibility:public <> ($this:.Outer) returnType:.Outer.Inner [primary] @@ -67,6 +63,10 @@ FILE fqName: fileName:/kt16905.kt overridden: public open fun toString (): kotlin.String declared in .Outer.Inner $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any @@ -80,9 +80,9 @@ FILE fqName: fileName:/kt16905.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - TYPEALIAS name:OI visibility:public expandedType:.Outer.Inner FUN name:test visibility:public modality:FINAL <> () returnType:.Outer.Inner BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test (): .Outer.Inner declared in ' CONSTRUCTOR_CALL 'public constructor () declared in .Outer.Inner' type=.Outer.Inner origin=null $outer: CONSTRUCTOR_CALL 'public constructor () declared in .Outer' type=.Outer origin=null + TYPEALIAS name:OI visibility:public expandedType:.Outer.Inner diff --git a/compiler/testData/ir/irText/expressions/kt16905.fir.kt.txt b/compiler/testData/ir/irText/expressions/kt16905.fir.kt.txt index 5f5268b994e..33d3f1114c8 100644 --- a/compiler/testData/ir/irText/expressions/kt16905.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt16905.fir.kt.txt @@ -1,10 +1,4 @@ class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - open inner class Inner { constructor() /* primary */ { super/*Any*/() @@ -32,9 +26,16 @@ class Outer { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } -typealias OI = Inner fun test(): Inner { return Outer().Inner() } + +typealias OI = Inner diff --git a/compiler/testData/ir/irText/expressions/kt16905.ir.txt b/compiler/testData/ir/irText/expressions/kt16905.ir.txt index 2fba848a032..5363766505f 100644 --- a/compiler/testData/ir/irText/expressions/kt16905.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt16905.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/kt16905.kt CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner CONSTRUCTOR visibility:public <> ($this:.Outer) returnType:.Outer.Inner [primary] @@ -67,6 +63,10 @@ FILE fqName: fileName:/kt16905.kt overridden: public open fun toString (): kotlin.String declared in .Outer.Inner $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any @@ -80,9 +80,9 @@ FILE fqName: fileName:/kt16905.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - TYPEALIAS name:OI visibility:public expandedType:.Outer.Inner FUN name:test visibility:public modality:FINAL <> () returnType:.Outer.Inner BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test (): .Outer.Inner declared in ' CONSTRUCTOR_CALL 'public constructor () declared in .Outer.Inner' type=.Outer.Inner origin=null $outer: CONSTRUCTOR_CALL 'public constructor () declared in .Outer' type=.Outer origin=null + TYPEALIAS name:OI visibility:public expandedType:.Outer.Inner diff --git a/compiler/testData/ir/irText/expressions/kt16905.kt.txt b/compiler/testData/ir/irText/expressions/kt16905.kt.txt index 5f5268b994e..33d3f1114c8 100644 --- a/compiler/testData/ir/irText/expressions/kt16905.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt16905.kt.txt @@ -1,10 +1,4 @@ class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - open inner class Inner { constructor() /* primary */ { super/*Any*/() @@ -32,9 +26,16 @@ class Outer { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } -typealias OI = Inner fun test(): Inner { return Outer().Inner() } + +typealias OI = Inner diff --git a/compiler/testData/ir/irText/expressions/kt23030.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt23030.fir.ir.txt index bc6d45dd8a1..28fad1892f7 100644 --- a/compiler/testData/ir/irText/expressions/kt23030.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt23030.fir.ir.txt @@ -1,74 +1,23 @@ FILE fqName: fileName:/kt23030.kt - FUN name:compareTo visibility:public modality:FINAL <> ($receiver:kotlin.Int, c:kotlin.Char) returnType:kotlin.Int [operator] - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:c index:0 type:kotlin.Char - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=0 - FUN name:testOverloadedCompareToCall visibility:public modality:FINAL <> (x:kotlin.Int, y:kotlin.Char) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Char - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testOverloadedCompareToCall (x: kotlin.Int, y: kotlin.Char): kotlin.Boolean declared in ' - CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: CALL 'public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' type=kotlin.Int origin=null - $receiver: GET_VAR 'x: kotlin.Int declared in .testOverloadedCompareToCall' type=kotlin.Int origin=null - c: GET_VAR 'y: kotlin.Char declared in .testOverloadedCompareToCall' type=kotlin.Char origin=null - arg1: CONST Int type=kotlin.Int value=0 - FUN name:testOverloadedCompareToCallWithSmartCast visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testOverloadedCompareToCallWithSmartCast (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int - GET_VAR 'x: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Char - GET_VAR 'y: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: CALL 'public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' type=kotlin.Int origin=null - $receiver: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int - GET_VAR 'x: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null - c: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char - GET_VAR 'y: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null - arg1: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testEqualsWithSmartCast visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testEqualsWithSmartCast (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int - GET_VAR 'x: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Char - GET_VAR 'y: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: 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 'x: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 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:compareTo visibility:public modality:FINAL <> ($this:.C, $receiver:kotlin.Int, c:kotlin.Char) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.C $receiver: VALUE_PARAMETER name: type:kotlin.Int @@ -116,16 +65,67 @@ FILE fqName: fileName:/kt23030.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - 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: 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:compareTo visibility:public modality:FINAL <> ($receiver:kotlin.Int, c:kotlin.Char) returnType:kotlin.Int [operator] + $receiver: VALUE_PARAMETER name: type:kotlin.Int + VALUE_PARAMETER name:c index:0 type:kotlin.Char + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=0 + FUN name:testEqualsWithSmartCast visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testEqualsWithSmartCast (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Char + GET_VAR 'y: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: 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 'x: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testOverloadedCompareToCall visibility:public modality:FINAL <> (x:kotlin.Int, y:kotlin.Char) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Char + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testOverloadedCompareToCall (x: kotlin.Int, y: kotlin.Char): kotlin.Boolean declared in ' + CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: CALL 'public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' type=kotlin.Int origin=null + $receiver: GET_VAR 'x: kotlin.Int declared in .testOverloadedCompareToCall' type=kotlin.Int origin=null + c: GET_VAR 'y: kotlin.Char declared in .testOverloadedCompareToCall' type=kotlin.Char origin=null + arg1: CONST Int type=kotlin.Int value=0 + FUN name:testOverloadedCompareToCallWithSmartCast visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testOverloadedCompareToCallWithSmartCast (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Char + GET_VAR 'y: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: CALL 'public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' type=kotlin.Int origin=null + $receiver: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null + c: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char + GET_VAR 'y: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/kt23030.fir.kt.txt b/compiler/testData/ir/irText/expressions/kt23030.fir.kt.txt index 29bf0a1e8db..e71f4760488 100644 --- a/compiler/testData/ir/irText/expressions/kt23030.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt23030.fir.kt.txt @@ -1,31 +1,3 @@ -operator fun Int.compareTo(c: Char): Int { - return 0 -} - -fun testOverloadedCompareToCall(x: Int, y: Char): Boolean { - return less(arg0 = x.compareTo(c = y), arg1 = 0) -} - -fun testOverloadedCompareToCallWithSmartCast(x: Any, y: Any): Boolean { - return when { - when { - x is Int -> y is Char - else -> false - } -> less(arg0 = x /*as Int */.compareTo(c = y /*as Char */), arg1 = 0) - else -> false - } -} - -fun testEqualsWithSmartCast(x: Any, y: Any): Boolean { - return when { - when { - x is Int -> y is Char - else -> false - } -> EQEQ(arg0 = x, arg1 = y) - else -> false - } -} - class C { constructor() /* primary */ { super/*Any*/() @@ -53,3 +25,31 @@ class C { } +operator fun Int.compareTo(c: Char): Int { + return 0 +} + +fun testEqualsWithSmartCast(x: Any, y: Any): Boolean { + return when { + when { + x is Int -> y is Char + else -> false + } -> EQEQ(arg0 = x, arg1 = y) + else -> false + } +} + +fun testOverloadedCompareToCall(x: Int, y: Char): Boolean { + return less(arg0 = x.compareTo(c = y), arg1 = 0) +} + +fun testOverloadedCompareToCallWithSmartCast(x: Any, y: Any): Boolean { + return when { + when { + x is Int -> y is Char + else -> false + } -> less(arg0 = x /*as Int */.compareTo(c = y /*as Char */), arg1 = 0) + else -> false + } +} + diff --git a/compiler/testData/ir/irText/expressions/kt23030.ir.txt b/compiler/testData/ir/irText/expressions/kt23030.ir.txt index ee2cb0c5d81..ed34eb870f4 100644 --- a/compiler/testData/ir/irText/expressions/kt23030.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt23030.ir.txt @@ -1,74 +1,23 @@ FILE fqName: fileName:/kt23030.kt - FUN name:compareTo visibility:public modality:FINAL <> ($receiver:kotlin.Int, c:kotlin.Char) returnType:kotlin.Int [operator] - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:c index:0 type:kotlin.Char - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=0 - FUN name:testOverloadedCompareToCall visibility:public modality:FINAL <> (x:kotlin.Int, y:kotlin.Char) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Char - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testOverloadedCompareToCall (x: kotlin.Int, y: kotlin.Char): kotlin.Boolean declared in ' - CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: CALL 'public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' type=kotlin.Int origin=LT - $receiver: GET_VAR 'x: kotlin.Int declared in .testOverloadedCompareToCall' type=kotlin.Int origin=null - c: GET_VAR 'y: kotlin.Char declared in .testOverloadedCompareToCall' type=kotlin.Char origin=null - arg1: CONST Int type=kotlin.Int value=0 - FUN name:testOverloadedCompareToCallWithSmartCast visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testOverloadedCompareToCallWithSmartCast (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int - GET_VAR 'x: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Char - GET_VAR 'y: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: CALL 'public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' type=kotlin.Int origin=LT - $receiver: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int - GET_VAR 'x: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null - c: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char - GET_VAR 'y: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null - arg1: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testEqualsWithSmartCast visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testEqualsWithSmartCast (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int - GET_VAR 'x: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Char - GET_VAR 'y: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: 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 'x: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 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:compareTo visibility:public modality:FINAL <> ($this:.C, $receiver:kotlin.Int, c:kotlin.Char) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.C $receiver: VALUE_PARAMETER name: type:kotlin.Int @@ -116,16 +65,67 @@ FILE fqName: fileName:/kt23030.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - 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: 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:compareTo visibility:public modality:FINAL <> ($receiver:kotlin.Int, c:kotlin.Char) returnType:kotlin.Int [operator] + $receiver: VALUE_PARAMETER name: type:kotlin.Int + VALUE_PARAMETER name:c index:0 type:kotlin.Char + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=0 + FUN name:testEqualsWithSmartCast visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testEqualsWithSmartCast (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Char + GET_VAR 'y: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: 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 'x: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testOverloadedCompareToCall visibility:public modality:FINAL <> (x:kotlin.Int, y:kotlin.Char) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Char + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testOverloadedCompareToCall (x: kotlin.Int, y: kotlin.Char): kotlin.Boolean declared in ' + CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: CALL 'public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' type=kotlin.Int origin=LT + $receiver: GET_VAR 'x: kotlin.Int declared in .testOverloadedCompareToCall' type=kotlin.Int origin=null + c: GET_VAR 'y: kotlin.Char declared in .testOverloadedCompareToCall' type=kotlin.Char origin=null + arg1: CONST Int type=kotlin.Int value=0 + FUN name:testOverloadedCompareToCallWithSmartCast visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testOverloadedCompareToCallWithSmartCast (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Char + GET_VAR 'y: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: CALL 'public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' type=kotlin.Int origin=LT + $receiver: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null + c: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char + GET_VAR 'y: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/kt23030.kt.txt b/compiler/testData/ir/irText/expressions/kt23030.kt.txt index 83fd65dbfc2..e71f4760488 100644 --- a/compiler/testData/ir/irText/expressions/kt23030.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt23030.kt.txt @@ -1,31 +1,3 @@ -operator fun Int.compareTo(c: Char): Int { - return 0 -} - -fun testOverloadedCompareToCall(x: Int, y: Char): Boolean { - return less(arg0 = x.compareTo(c = y), arg1 = 0) -} - -fun testOverloadedCompareToCallWithSmartCast(x: Any, y: Any): Boolean { - return when { - when { - x is Int -> y is Char - else -> false - } -> less(arg0 = x /*as Int */.compareTo(c = y /*as Char */), arg1 = 0) - else -> false - } -} - -fun testEqualsWithSmartCast(x: Any, y: Any): Boolean { - return when { - when { - x is Int -> y is Char - else -> false - } -> EQEQ(arg0 = x, arg1 = y) - else -> false - } -} - class C { constructor() /* primary */ { super/*Any*/() @@ -52,3 +24,32 @@ class C { } } + +operator fun Int.compareTo(c: Char): Int { + return 0 +} + +fun testEqualsWithSmartCast(x: Any, y: Any): Boolean { + return when { + when { + x is Int -> y is Char + else -> false + } -> EQEQ(arg0 = x, arg1 = y) + else -> false + } +} + +fun testOverloadedCompareToCall(x: Int, y: Char): Boolean { + return less(arg0 = x.compareTo(c = y), arg1 = 0) +} + +fun testOverloadedCompareToCallWithSmartCast(x: Any, y: Any): Boolean { + return when { + when { + x is Int -> y is Char + else -> false + } -> less(arg0 = x /*as Int */.compareTo(c = y /*as Char */), arg1 = 0) + else -> false + } +} + diff --git a/compiler/testData/ir/irText/expressions/kt24804.ir.txt b/compiler/testData/ir/irText/expressions/kt24804.ir.txt index 6eda24a82fc..a9d9b747bd1 100644 --- a/compiler/testData/ir/irText/expressions/kt24804.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt24804.ir.txt @@ -1,4 +1,10 @@ FILE fqName: fileName:/kt24804.kt + 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 ' + CALL 'public final fun run (x: kotlin.Boolean, y: kotlin.Boolean): kotlin.String declared in ' type=kotlin.String origin=null + x: CONST Boolean type=kotlin.Boolean value=true + y: CONST Boolean type=kotlin.Boolean value=true FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Boolean [inline] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Boolean declared in ' @@ -34,9 +40,3 @@ FILE fqName: fileName:/kt24804.kt condition: CALL 'public final fun foo (): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null RETURN type=kotlin.Nothing from='public final fun run (x: kotlin.Boolean, y: kotlin.Boolean): kotlin.String declared in ' CONST String type=kotlin.String value="OK" - 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 ' - CALL 'public final fun run (x: kotlin.Boolean, y: kotlin.Boolean): kotlin.String declared in ' type=kotlin.String origin=null - x: CONST Boolean type=kotlin.Boolean value=true - y: CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/expressions/kt24804.kt.txt b/compiler/testData/ir/irText/expressions/kt24804.kt.txt index cd16ba573e2..6345c5184ce 100644 --- a/compiler/testData/ir/irText/expressions/kt24804.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt24804.kt.txt @@ -1,3 +1,7 @@ +fun box(): String { + return run(x = true, y = true) +} + inline fun foo(): Boolean { return false } @@ -21,6 +25,3 @@ fun run(x: Boolean, y: Boolean): String { return "OK" } -fun box(): String { - return run(x = true, y = true) -} diff --git a/compiler/testData/ir/irText/expressions/kt28006.ir.txt b/compiler/testData/ir/irText/expressions/kt28006.ir.txt index 9cd4e297103..607c08bf410 100644 --- a/compiler/testData/ir/irText/expressions/kt28006.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt28006.ir.txt @@ -17,6 +17,28 @@ FILE fqName: fileName:/kt28006.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null + FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.Int): kotlin.String declared in ' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="\uD83E\uDD17" + GET_VAR 'x: kotlin.Int declared in .test1' type=kotlin.Int origin=null + FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.Int): kotlin.String declared in ' + STRING_CONCATENATION type=kotlin.String + GET_VAR 'x: kotlin.Int declared in .test2' type=kotlin.Int origin=null + CONST String type=kotlin.String value="\uD83E\uDD17" + FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Int): kotlin.String declared in ' + STRING_CONCATENATION type=kotlin.String + GET_VAR 'x: kotlin.Int declared in .test3' type=kotlin.Int origin=null + CONST String type=kotlin.String value="\uD83E\uDD17" + GET_VAR 'x: kotlin.Int declared in .test3' type=kotlin.Int origin=null PROPERTY name:testConst1 visibility:public modality:FINAL [const,val] FIELD PROPERTY_BACKING_FIELD name:testConst1 type:kotlin.String visibility:public [final,static] EXPRESSION_BODY @@ -53,25 +75,3 @@ FILE fqName: fileName:/kt28006.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testConst4 type:kotlin.String visibility:public [final,static]' type=kotlin.String origin=null - FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.String - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.Int): kotlin.String declared in ' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="\uD83E\uDD17" - GET_VAR 'x: kotlin.Int declared in .test1' type=kotlin.Int origin=null - FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.String - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.Int): kotlin.String declared in ' - STRING_CONCATENATION type=kotlin.String - GET_VAR 'x: kotlin.Int declared in .test2' type=kotlin.Int origin=null - CONST String type=kotlin.String value="\uD83E\uDD17" - FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.String - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Int): kotlin.String declared in ' - STRING_CONCATENATION type=kotlin.String - GET_VAR 'x: kotlin.Int declared in .test3' type=kotlin.Int origin=null - CONST String type=kotlin.String value="\uD83E\uDD17" - GET_VAR 'x: kotlin.Int declared in .test3' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/kt28006.kt.txt b/compiler/testData/ir/irText/expressions/kt28006.kt.txt index 4e1ac66f6cc..427554722e7 100644 --- a/compiler/testData/ir/irText/expressions/kt28006.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt28006.kt.txt @@ -6,6 +6,18 @@ val test2: String field = "\uD83E\uDD17\uD83E\uDD17" get +fun test1(x: Int): String { + return "\uD83E\uDD17" + x +} + +fun test2(x: Int): String { + return x + "\uD83E\uDD17" +} + +fun test3(x: Int): String { + return x + "\uD83E\uDD17" + x +} + const val testConst1: String field = "\uD83E\uDD17" get @@ -22,14 +34,3 @@ const val testConst4: String field = "\uD83E\uDD17\uD83E\uDD17\uD83E\uDD17\uD83E\uDD17" get -fun test1(x: Int): String { - return "\uD83E\uDD17" + x -} - -fun test2(x: Int): String { - return x + "\uD83E\uDD17" -} - -fun test3(x: Int): String { - return x + "\uD83E\uDD17" + x -} diff --git a/compiler/testData/ir/irText/expressions/kt28456.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt28456.fir.ir.txt index 49f5f472fa6..07777c37633 100644 --- a/compiler/testData/ir/irText/expressions/kt28456.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456.fir.ir.txt @@ -30,6 +30,51 @@ FILE fqName: fileName:/kt28456.kt VALUE_PARAMETER name:j index:1 type:kotlin.Int VALUE_PARAMETER name:v index:2 type:kotlin.Int BLOCK_BODY + FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] + GET_VAR 'a: .A declared in .testCompoundAssignment' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=1 + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=2 + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + $receiver: GET_VAR 'val tmp_0: .A declared in .testCompoundAssignment' type=.A origin=null + i: GET_VAR 'val tmp_1: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null + j: GET_VAR 'val tmp_2: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null + v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun get (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + $receiver: GET_VAR 'val tmp_0: .A declared in .testCompoundAssignment' type=.A origin=null + xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + GET_VAR 'val tmp_1: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null + GET_VAR 'val tmp_2: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=10 + FUN name:testPostfixIncrement visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Int + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: .A): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.A [val] + GET_VAR 'a: .A declared in .testPostfixIncrement' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=1 + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=2 + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] + CALL 'public final fun get (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_3: .A declared in .testPostfixIncrement' type=.A origin=null + xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + GET_VAR 'val tmp_4: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + GET_VAR 'val tmp_5: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_3: .A declared in .testPostfixIncrement' type=.A origin=null + i: GET_VAR 'val tmp_4: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + j: GET_VAR 'val tmp_5: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + v: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_6: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + GET_VAR 'val tmp_6: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY @@ -38,48 +83,3 @@ FILE fqName: fileName:/kt28456.kt i: CONST Int type=kotlin.Int value=1 j: CONST Int type=kotlin.Int value=2 v: CONST Int type=kotlin.Int value=0 - FUN name:testPostfixIncrement visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Int - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: .A): kotlin.Int declared in ' - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] - GET_VAR 'a: .A declared in .testPostfixIncrement' type=.A origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=1 - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=2 - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] - CALL 'public final fun get (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_0: .A declared in .testPostfixIncrement' type=.A origin=null - xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - GET_VAR 'val tmp_1: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - GET_VAR 'val tmp_2: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_0: .A declared in .testPostfixIncrement' type=.A origin=null - i: GET_VAR 'val tmp_1: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - j: GET_VAR 'val tmp_2: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - v: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_3: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - GET_VAR 'val tmp_3: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.A [val] - GET_VAR 'a: .A declared in .testCompoundAssignment' type=.A origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=1 - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=2 - CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - $receiver: GET_VAR 'val tmp_4: .A declared in .testCompoundAssignment' type=.A origin=null - i: GET_VAR 'val tmp_5: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null - j: GET_VAR 'val tmp_6: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null - v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun get (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - $receiver: GET_VAR 'val tmp_4: .A declared in .testCompoundAssignment' type=.A origin=null - xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - GET_VAR 'val tmp_5: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null - GET_VAR 'val tmp_6: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=10 diff --git a/compiler/testData/ir/irText/expressions/kt28456.fir.kt.txt b/compiler/testData/ir/irText/expressions/kt28456.fir.kt.txt index a7b91dde441..9dbf4d57b0f 100644 --- a/compiler/testData/ir/irText/expressions/kt28456.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt28456.fir.kt.txt @@ -14,26 +14,27 @@ operator fun A.get(vararg xs: Int): Int { operator fun A.set(i: Int, j: Int, v: Int) { } -fun testSimpleAssignment(a: A) { - a.set(i = 1, j = 2, v = 0) +fun testCompoundAssignment(a: A) { + { // BLOCK + val tmp_0: A = a + val tmp_1: Int = 1 + val tmp_2: Int = 2 + tmp_0.set(i = tmp_1, j = tmp_2, v = tmp_0.get(xs = [tmp_1, tmp_2]).plus(other = 10)) + } } fun testPostfixIncrement(a: A): Int { return { // BLOCK - val tmp_0: A = a - val tmp_1: Int = 1 - val tmp_2: Int = 2 - val tmp_3: Int = tmp_0.get(xs = [tmp_1, tmp_2]) - tmp_0.set(i = tmp_1, j = tmp_2, v = tmp_3.inc()) - tmp_3 + val tmp_3: A = a + val tmp_4: Int = 1 + val tmp_5: Int = 2 + val tmp_6: Int = tmp_3.get(xs = [tmp_4, tmp_5]) + tmp_3.set(i = tmp_4, j = tmp_5, v = tmp_6.inc()) + tmp_6 } } -fun testCompoundAssignment(a: A) { - { // BLOCK - val tmp_4: A = a - val tmp_5: Int = 1 - val tmp_6: Int = 2 - tmp_4.set(i = tmp_5, j = tmp_6, v = tmp_4.get(xs = [tmp_5, tmp_6]).plus(other = 10)) - } +fun testSimpleAssignment(a: A) { + a.set(i = 1, j = 2, v = 0) } + diff --git a/compiler/testData/ir/irText/expressions/kt28456.ir.txt b/compiler/testData/ir/irText/expressions/kt28456.ir.txt index 250c2333d6f..618c3a9218d 100644 --- a/compiler/testData/ir/irText/expressions/kt28456.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456.ir.txt @@ -30,6 +30,51 @@ FILE fqName: fileName:/kt28456.kt VALUE_PARAMETER name:j index:1 type:kotlin.Int VALUE_PARAMETER name:v index:2 type:kotlin.Int BLOCK_BODY + FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] + GET_VAR 'a: .A declared in .testCompoundAssignment' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=1 + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=2 + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + $receiver: GET_VAR 'val tmp_0: .A declared in .testCompoundAssignment' type=.A origin=null + i: GET_VAR 'val tmp_1: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null + j: GET_VAR 'val tmp_2: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null + v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun get (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + $receiver: GET_VAR 'val tmp_0: .A declared in .testCompoundAssignment' type=.A origin=null + xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + GET_VAR 'val tmp_1: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null + GET_VAR 'val tmp_2: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=10 + FUN name:testPostfixIncrement visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Int + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: .A): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.A [val] + GET_VAR 'a: .A declared in .testPostfixIncrement' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=1 + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=2 + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] + CALL 'public final fun get (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_3: .A declared in .testPostfixIncrement' type=.A origin=null + xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + GET_VAR 'val tmp_4: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + GET_VAR 'val tmp_5: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_3: .A declared in .testPostfixIncrement' type=.A origin=null + i: GET_VAR 'val tmp_4: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + j: GET_VAR 'val tmp_5: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + v: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_6: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + GET_VAR 'val tmp_6: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY @@ -38,48 +83,3 @@ FILE fqName: fileName:/kt28456.kt i: CONST Int type=kotlin.Int value=1 j: CONST Int type=kotlin.Int value=2 v: CONST Int type=kotlin.Int value=0 - FUN name:testPostfixIncrement visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Int - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: .A): kotlin.Int declared in ' - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] - GET_VAR 'a: .A declared in .testPostfixIncrement' type=.A origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=1 - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=2 - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] - CALL 'public final fun get (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_0: .A declared in .testPostfixIncrement' type=.A origin=null - xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - GET_VAR 'val tmp_1: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - GET_VAR 'val tmp_2: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_0: .A declared in .testPostfixIncrement' type=.A origin=null - i: GET_VAR 'val tmp_1: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - j: GET_VAR 'val tmp_2: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - v: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_3: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - GET_VAR 'val tmp_3: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.A [val] - GET_VAR 'a: .A declared in .testCompoundAssignment' type=.A origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=1 - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=2 - CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - $receiver: GET_VAR 'val tmp_4: .A declared in .testCompoundAssignment' type=.A origin=null - i: GET_VAR 'val tmp_5: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null - j: GET_VAR 'val tmp_6: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null - v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun get (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - $receiver: GET_VAR 'val tmp_4: .A declared in .testCompoundAssignment' type=.A origin=null - xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - GET_VAR 'val tmp_5: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null - GET_VAR 'val tmp_6: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=10 diff --git a/compiler/testData/ir/irText/expressions/kt28456.kt.txt b/compiler/testData/ir/irText/expressions/kt28456.kt.txt index a7b91dde441..9dbf4d57b0f 100644 --- a/compiler/testData/ir/irText/expressions/kt28456.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt28456.kt.txt @@ -14,26 +14,27 @@ operator fun A.get(vararg xs: Int): Int { operator fun A.set(i: Int, j: Int, v: Int) { } -fun testSimpleAssignment(a: A) { - a.set(i = 1, j = 2, v = 0) +fun testCompoundAssignment(a: A) { + { // BLOCK + val tmp_0: A = a + val tmp_1: Int = 1 + val tmp_2: Int = 2 + tmp_0.set(i = tmp_1, j = tmp_2, v = tmp_0.get(xs = [tmp_1, tmp_2]).plus(other = 10)) + } } fun testPostfixIncrement(a: A): Int { return { // BLOCK - val tmp_0: A = a - val tmp_1: Int = 1 - val tmp_2: Int = 2 - val tmp_3: Int = tmp_0.get(xs = [tmp_1, tmp_2]) - tmp_0.set(i = tmp_1, j = tmp_2, v = tmp_3.inc()) - tmp_3 + val tmp_3: A = a + val tmp_4: Int = 1 + val tmp_5: Int = 2 + val tmp_6: Int = tmp_3.get(xs = [tmp_4, tmp_5]) + tmp_3.set(i = tmp_4, j = tmp_5, v = tmp_6.inc()) + tmp_6 } } -fun testCompoundAssignment(a: A) { - { // BLOCK - val tmp_4: A = a - val tmp_5: Int = 1 - val tmp_6: Int = 2 - tmp_4.set(i = tmp_5, j = tmp_6, v = tmp_4.get(xs = [tmp_5, tmp_6]).plus(other = 10)) - } +fun testSimpleAssignment(a: A) { + a.set(i = 1, j = 2, v = 0) } + diff --git a/compiler/testData/ir/irText/expressions/kt28456b.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt28456b.fir.ir.txt index 89fcf435352..607cd160fed 100644 --- a/compiler/testData/ir/irText/expressions/kt28456b.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456b.fir.ir.txt @@ -44,6 +44,41 @@ FILE fqName: fileName:/kt28456b.kt CONST Int type=kotlin.Int value=42 VALUE_PARAMETER name:v index:2 type:kotlin.Int BLOCK_BODY + FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] + GET_VAR 'a: .A declared in .testCompoundAssignment' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=1 + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + $receiver: GET_VAR 'val tmp_0: .A declared in .testCompoundAssignment' type=.A origin=null + i: GET_VAR 'val tmp_1: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null + v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + $receiver: GET_VAR 'val tmp_0: .A declared in .testCompoundAssignment' type=.A origin=null + i: GET_VAR 'val tmp_1: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=10 + FUN name:testPostfixIncrement visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Int + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: .A): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.A [val] + GET_VAR 'a: .A declared in .testPostfixIncrement' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=1 + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_2: .A declared in .testPostfixIncrement' type=.A origin=null + i: GET_VAR 'val tmp_3: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_2: .A declared in .testPostfixIncrement' type=.A origin=null + i: GET_VAR 'val tmp_3: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + v: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_4: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + GET_VAR 'val tmp_4: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY @@ -51,38 +86,3 @@ FILE fqName: fileName:/kt28456b.kt $receiver: GET_VAR 'a: .A declared in .testSimpleAssignment' type=.A origin=null i: CONST Int type=kotlin.Int value=1 v: CONST Int type=kotlin.Int value=0 - FUN name:testPostfixIncrement visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Int - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: .A): kotlin.Int declared in ' - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] - GET_VAR 'a: .A declared in .testPostfixIncrement' type=.A origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=1 - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] - CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_0: .A declared in .testPostfixIncrement' type=.A origin=null - i: GET_VAR 'val tmp_1: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_0: .A declared in .testPostfixIncrement' type=.A origin=null - i: GET_VAR 'val tmp_1: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - v: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_2: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - GET_VAR 'val tmp_2: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.A [val] - GET_VAR 'a: .A declared in .testCompoundAssignment' type=.A origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=1 - CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - $receiver: GET_VAR 'val tmp_3: .A declared in .testCompoundAssignment' type=.A origin=null - i: GET_VAR 'val tmp_4: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null - v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - $receiver: GET_VAR 'val tmp_3: .A declared in .testCompoundAssignment' type=.A origin=null - i: GET_VAR 'val tmp_4: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=10 diff --git a/compiler/testData/ir/irText/expressions/kt28456b.fir.kt.txt b/compiler/testData/ir/irText/expressions/kt28456b.fir.kt.txt index e865e5669da..936208c0247 100644 --- a/compiler/testData/ir/irText/expressions/kt28456b.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt28456b.fir.kt.txt @@ -14,24 +14,25 @@ operator fun A.get(i: Int, a: Int = 1, b: Int = 2, c: Int = 3, d: Int = 4): Int operator fun A.set(i: Int, j: Int = 42, v: Int) { } -fun testSimpleAssignment(a: A) { - a.set(i = 1, v = 0) +fun testCompoundAssignment(a: A) { + { // BLOCK + val tmp_0: A = a + val tmp_1: Int = 1 + tmp_0.set(i = tmp_1, v = tmp_0.get(i = tmp_1).plus(other = 10)) + } } fun testPostfixIncrement(a: A): Int { return { // BLOCK - val tmp_0: A = a - val tmp_1: Int = 1 - val tmp_2: Int = tmp_0.get(i = tmp_1) - tmp_0.set(i = tmp_1, v = tmp_2.inc()) - tmp_2 + val tmp_2: A = a + val tmp_3: Int = 1 + val tmp_4: Int = tmp_2.get(i = tmp_3) + tmp_2.set(i = tmp_3, v = tmp_4.inc()) + tmp_4 } } -fun testCompoundAssignment(a: A) { - { // BLOCK - val tmp_3: A = a - val tmp_4: Int = 1 - tmp_3.set(i = tmp_4, v = tmp_3.get(i = tmp_4).plus(other = 10)) - } +fun testSimpleAssignment(a: A) { + a.set(i = 1, v = 0) } + diff --git a/compiler/testData/ir/irText/expressions/kt28456b.ir.txt b/compiler/testData/ir/irText/expressions/kt28456b.ir.txt index 047a00ac94d..80682069897 100644 --- a/compiler/testData/ir/irText/expressions/kt28456b.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456b.ir.txt @@ -44,6 +44,41 @@ FILE fqName: fileName:/kt28456b.kt CONST Int type=kotlin.Int value=42 VALUE_PARAMETER name:v index:2 type:kotlin.Int BLOCK_BODY + FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] + GET_VAR 'a: .A declared in .testCompoundAssignment' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=1 + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ + $receiver: GET_VAR 'val tmp_0: .A declared in .testCompoundAssignment' type=.A origin=null + i: GET_VAR 'val tmp_1: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null + v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ + $receiver: GET_VAR 'val tmp_0: .A declared in .testCompoundAssignment' type=.A origin=null + i: GET_VAR 'val tmp_1: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=10 + FUN name:testPostfixIncrement visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Int + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: .A): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.A [val] + GET_VAR 'a: .A declared in .testPostfixIncrement' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=1 + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_2: .A declared in .testPostfixIncrement' type=.A origin=null + i: GET_VAR 'val tmp_3: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_2: .A declared in .testPostfixIncrement' type=.A origin=null + i: GET_VAR 'val tmp_3: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + v: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_4: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null + GET_VAR 'val tmp_4: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY @@ -51,38 +86,3 @@ FILE fqName: fileName:/kt28456b.kt $receiver: GET_VAR 'a: .A declared in .testSimpleAssignment' type=.A origin=null i: CONST Int type=kotlin.Int value=1 v: CONST Int type=kotlin.Int value=0 - FUN name:testPostfixIncrement visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Int - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: .A): kotlin.Int declared in ' - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] - GET_VAR 'a: .A declared in .testPostfixIncrement' type=.A origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=1 - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] - CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_0: .A declared in .testPostfixIncrement' type=.A origin=null - i: GET_VAR 'val tmp_1: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_0: .A declared in .testPostfixIncrement' type=.A origin=null - i: GET_VAR 'val tmp_1: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - v: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_2: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - GET_VAR 'val tmp_2: kotlin.Int declared in .testPostfixIncrement' type=kotlin.Int origin=null - FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:.A - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.A [val] - GET_VAR 'a: .A declared in .testCompoundAssignment' type=.A origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=1 - CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ - $receiver: GET_VAR 'val tmp_3: .A declared in .testCompoundAssignment' type=.A origin=null - i: GET_VAR 'val tmp_4: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null - v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ - $this: CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - $receiver: GET_VAR 'val tmp_3: .A declared in .testCompoundAssignment' type=.A origin=null - i: GET_VAR 'val tmp_4: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=10 diff --git a/compiler/testData/ir/irText/expressions/kt28456b.kt.txt b/compiler/testData/ir/irText/expressions/kt28456b.kt.txt index e865e5669da..936208c0247 100644 --- a/compiler/testData/ir/irText/expressions/kt28456b.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt28456b.kt.txt @@ -14,24 +14,25 @@ operator fun A.get(i: Int, a: Int = 1, b: Int = 2, c: Int = 3, d: Int = 4): Int operator fun A.set(i: Int, j: Int = 42, v: Int) { } -fun testSimpleAssignment(a: A) { - a.set(i = 1, v = 0) +fun testCompoundAssignment(a: A) { + { // BLOCK + val tmp_0: A = a + val tmp_1: Int = 1 + tmp_0.set(i = tmp_1, v = tmp_0.get(i = tmp_1).plus(other = 10)) + } } fun testPostfixIncrement(a: A): Int { return { // BLOCK - val tmp_0: A = a - val tmp_1: Int = 1 - val tmp_2: Int = tmp_0.get(i = tmp_1) - tmp_0.set(i = tmp_1, v = tmp_2.inc()) - tmp_2 + val tmp_2: A = a + val tmp_3: Int = 1 + val tmp_4: Int = tmp_2.get(i = tmp_3) + tmp_2.set(i = tmp_3, v = tmp_4.inc()) + tmp_4 } } -fun testCompoundAssignment(a: A) { - { // BLOCK - val tmp_3: A = a - val tmp_4: Int = 1 - tmp_3.set(i = tmp_4, v = tmp_3.get(i = tmp_4).plus(other = 10)) - } +fun testSimpleAssignment(a: A) { + a.set(i = 1, v = 0) } + diff --git a/compiler/testData/ir/irText/expressions/kt30020.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt30020.fir.ir.txt index 14bc2310c39..8394edee277 100644 --- a/compiler/testData/ir/irText/expressions/kt30020.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt30020.fir.ir.txt @@ -1,12 +1,167 @@ FILE fqName: fileName:/kt30020.kt + CLASS CLASS name:AML modality:ABSTRACT visibility:public superTypes:[kotlin.collections.MutableList] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AML + CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AML.Inner + CONSTRUCTOR visibility:public <> ($this:.AML) returnType:.AML.Inner [primary] + $outer: VALUE_PARAMETER name: type:.AML + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] 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 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:testOuterThis visibility:public modality:FINAL <> ($this:.AML.Inner) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.AML.Inner + BLOCK_BODY + CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ + : kotlin.Int + $receiver: GET_VAR ': .AML declared in .AML' type=.AML origin=null + element: CONST Int type=kotlin.Int value=300 + CONSTRUCTOR visibility:public <> () returnType:.AML [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AML modality:ABSTRACT visibility:public superTypes:[kotlin.collections.MutableList]' + FUN FAKE_OVERRIDE name:add visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, element:kotlin.Int) returnType:kotlin.Boolean [fake_override] + overridden: + public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:element index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:add visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int, element:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun add (index: kotlin.Int, element: E of kotlin.collections.MutableList): kotlin.Unit declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:element index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:addAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public abstract fun addAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection + FUN FAKE_OVERRIDE name:addAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public abstract fun addAll (index: kotlin.Int, elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:elements index:1 type:kotlin.collections.Collection + FUN FAKE_OVERRIDE name:clear visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun clear (): kotlin.Unit declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + FUN FAKE_OVERRIDE name:contains visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, element:kotlin.Int) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public abstract fun contains (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.List + VALUE_PARAMETER name:element index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public abstract fun containsAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.List + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection + 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.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:get visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, index:kotlin.Int) returnType:kotlin.Int [fake_override,operator] + overridden: + public abstract fun get (index: kotlin.Int): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.List + VALUE_PARAMETER name:index index:0 type:kotlin.Int + 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.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, element:kotlin.Int) returnType:kotlin.Int [fake_override] + overridden: + public abstract fun indexOf (element: E of kotlin.collections.MutableList): kotlin.Int declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.List + VALUE_PARAMETER name:element index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List) returnType:kotlin.Boolean [fake_override] + overridden: + public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.List + FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableCollection) returnType:kotlin.collections.MutableIterator [fake_override,operator] + overridden: + public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableCollection + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, element:kotlin.Int) returnType:kotlin.Int [fake_override] + overridden: + public abstract fun lastIndexOf (element: E of kotlin.collections.MutableList): kotlin.Int declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.List + VALUE_PARAMETER name:element index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList) returnType:kotlin.collections.MutableListIterator [fake_override] + overridden: + public abstract fun listIterator (): kotlin.collections.MutableListIterator declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int) returnType:kotlin.collections.MutableListIterator [fake_override] + overridden: + public abstract fun listIterator (index: kotlin.Int): kotlin.collections.MutableListIterator declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:remove visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, element:kotlin.Int) returnType:kotlin.Boolean [fake_override] + overridden: + public abstract fun remove (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:element index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public abstract fun removeAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int) returnType:kotlin.Int [fake_override] + overridden: + public abstract fun removeAt (index: kotlin.Int): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public abstract fun retainAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection + FUN FAKE_OVERRIDE name:set visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int, element:kotlin.Int) returnType:kotlin.Int [fake_override,operator] + overridden: + public abstract fun set (index: kotlin.Int, element: E of kotlin.collections.MutableList): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:element index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:subList visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:kotlin.collections.MutableList [fake_override] + overridden: + public abstract fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.MutableList declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int + VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int + 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.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testExplicitThis visibility:public modality:FINAL <> ($this:.AML) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.AML + BLOCK_BODY + CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ + : kotlin.Int + $receiver: GET_VAR ': .AML declared in .AML.testExplicitThis' type=.AML origin=null + element: CONST Int type=kotlin.Int value=200 + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.Int declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.List CLASS INTERFACE name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X - PROPERTY name:xs visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.collections.MutableList - correspondingProperty: PROPERTY name:xs visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.X - FUN name:f visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:.X 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 @@ -20,6 +175,12 @@ FILE fqName: fileName:/kt30020.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:.X + PROPERTY name:xs visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.collections.MutableList + correspondingProperty: PROPERTY name:xs visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.X FUN name:test visibility:public modality:FINAL <> (x:.X, nx:.X?) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:.X VALUE_PARAMETER name:nx index:1 type:.X? @@ -89,164 +250,3 @@ FILE fqName: fileName:/kt30020.kt : kotlin.Int $receiver: GET_VAR ': kotlin.collections.MutableList declared in .testExtensionReceiver' type=kotlin.collections.MutableList origin=null element: CONST Int type=kotlin.Int value=100 - CLASS CLASS name:AML modality:ABSTRACT visibility:public superTypes:[kotlin.collections.MutableList] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AML - CONSTRUCTOR visibility:public <> () returnType:.AML [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AML modality:ABSTRACT visibility:public superTypes:[kotlin.collections.MutableList]' - FUN name:testExplicitThis visibility:public modality:FINAL <> ($this:.AML) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.AML - BLOCK_BODY - CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ - : kotlin.Int - $receiver: GET_VAR ': .AML declared in .AML.testExplicitThis' type=.AML origin=null - element: CONST Int type=kotlin.Int value=200 - CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AML.Inner - CONSTRUCTOR visibility:public <> ($this:.AML) returnType:.AML.Inner [primary] - $outer: VALUE_PARAMETER name: type:.AML - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - FUN name:testOuterThis visibility:public modality:FINAL <> ($this:.AML.Inner) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.AML.Inner - BLOCK_BODY - CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ - : kotlin.Int - $receiver: GET_VAR ': .AML declared in .AML' type=.AML origin=null - element: CONST Int type=kotlin.Int value=300 - 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: 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 FAKE_OVERRIDE name:add visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, element:kotlin.Int) returnType:kotlin.Boolean [fake_override] - overridden: - public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - VALUE_PARAMETER name:element index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:add visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int, element:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun add (index: kotlin.Int, element: E of kotlin.collections.MutableList): kotlin.Unit declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:element index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:addAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] - overridden: - public abstract fun addAll (index: kotlin.Int, elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:elements index:1 type:kotlin.collections.Collection - FUN FAKE_OVERRIDE name:addAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] - overridden: - public abstract fun addAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection - FUN FAKE_OVERRIDE name:clear visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun clear (): kotlin.Unit declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList) returnType:kotlin.collections.MutableListIterator [fake_override] - overridden: - public abstract fun listIterator (): kotlin.collections.MutableListIterator declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int) returnType:kotlin.collections.MutableListIterator [fake_override] - overridden: - public abstract fun listIterator (index: kotlin.Int): kotlin.collections.MutableListIterator declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:remove visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, element:kotlin.Int) returnType:kotlin.Boolean [fake_override] - overridden: - public abstract fun remove (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - VALUE_PARAMETER name:element index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] - overridden: - public abstract fun removeAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection - FUN FAKE_OVERRIDE name:removeAt visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int) returnType:kotlin.Int [fake_override] - overridden: - public abstract fun removeAt (index: kotlin.Int): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:retainAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] - overridden: - public abstract fun retainAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection - FUN FAKE_OVERRIDE name:set visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int, element:kotlin.Int) returnType:kotlin.Int [fake_override,operator] - overridden: - public abstract fun set (index: kotlin.Int, element: E of kotlin.collections.MutableList): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:element index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:subList visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:kotlin.collections.MutableList [fake_override] - overridden: - public abstract fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.MutableList declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int - VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.Int declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.List - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List) returnType:kotlin.Boolean [fake_override] - overridden: - public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.List - FUN FAKE_OVERRIDE name:contains visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, element:kotlin.Int) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public abstract fun contains (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.List - VALUE_PARAMETER name:element index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableCollection) returnType:kotlin.collections.MutableIterator [fake_override,operator] - overridden: - public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableCollection - FUN FAKE_OVERRIDE name:containsAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] - overridden: - public abstract fun containsAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.List - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection - FUN FAKE_OVERRIDE name:get visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, index:kotlin.Int) returnType:kotlin.Int [fake_override,operator] - overridden: - public abstract fun get (index: kotlin.Int): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.List - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, element:kotlin.Int) returnType:kotlin.Int [fake_override] - overridden: - public abstract fun indexOf (element: E of kotlin.collections.MutableList): kotlin.Int declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.List - VALUE_PARAMETER name:element index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, element:kotlin.Int) returnType:kotlin.Int [fake_override] - overridden: - public abstract fun lastIndexOf (element: E of kotlin.collections.MutableList): kotlin.Int declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.List - VALUE_PARAMETER name:element index:0 type:kotlin.Int - 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.collections.MutableList - $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.collections.MutableList - $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.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt b/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt index 3d530641df2..705661b06f1 100644 --- a/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt @@ -1,9 +1,35 @@ +abstract class AML : MutableList { + inner class Inner { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun testOuterThis() { + .plusAssign(element = 300) + } + + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun testExplicitThis() { + .plusAssign(element = 200) + } + +} + interface X { + abstract fun f(): MutableList + abstract val xs: MutableList abstract get - abstract fun f(): MutableList - } fun test(x: X, nx: X?) { @@ -31,28 +57,3 @@ fun MutableList.testExtensionReceiver() { .plusAssign(element = 100) } -abstract class AML : MutableList { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun testExplicitThis() { - .plusAssign(element = 200) - } - - inner class Inner { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun testOuterThis() { - .plusAssign(element = 300) - } - - } - -} diff --git a/compiler/testData/ir/irText/expressions/kt30020.ir.txt b/compiler/testData/ir/irText/expressions/kt30020.ir.txt index 77f3435cf42..a5135c845cb 100644 --- a/compiler/testData/ir/irText/expressions/kt30020.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt30020.ir.txt @@ -1,110 +1,6 @@ FILE fqName: fileName:/kt30020.kt - CLASS INTERFACE name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X - PROPERTY name:xs visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.collections.MutableList - correspondingProperty: PROPERTY name:xs visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.X - FUN name:f visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:.X - 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: 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:test visibility:public modality:FINAL <> (x:.X, nx:.X?) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:.X - VALUE_PARAMETER name:nx index:1 type:.X? - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.X [val] - GET_VAR 'x: .X declared in .test' type=.X origin=null - CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ - : kotlin.Int - $receiver: CALL 'public abstract fun (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=PLUSEQ - $this: GET_VAR 'val tmp_0: .X declared in .test' type=.X origin=null - element: CONST Int type=kotlin.Int value=1 - CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ - : kotlin.Int - $receiver: CALL 'public abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null - $this: GET_VAR 'x: .X declared in .test' type=.X origin=null - element: CONST Int type=kotlin.Int value=2 - CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ - : kotlin.Int - $receiver: TYPE_OP type=kotlin.collections.MutableList origin=CAST typeOperand=kotlin.collections.MutableList - CALL 'public abstract fun (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=GET_PROPERTY - $this: GET_VAR 'x: .X declared in .test' type=.X origin=null - element: CONST Int type=kotlin.Int value=3 - CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ - : kotlin.Int - $receiver: TYPE_OP type=kotlin.collections.MutableList origin=CAST typeOperand=kotlin.collections.MutableList - CALL 'public abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null - $this: GET_VAR 'x: .X declared in .test' type=.X origin=null - element: CONST Int type=kotlin.Int value=4 - CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ - : kotlin.Int - $receiver: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.collections.MutableList origin=EXCLEXCL - : kotlin.collections.MutableList - arg0: BLOCK type=kotlin.collections.MutableList? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.X? [val] - GET_VAR 'nx: .X? declared in .test' type=.X? origin=null - WHEN type=kotlin.collections.MutableList? 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: .X? declared in .test' type=.X? 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 abstract fun (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=GET_PROPERTY - $this: GET_VAR 'val tmp_1: .X? declared in .test' type=.X? origin=null - element: CONST Int type=kotlin.Int value=5 - CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ - : kotlin.Int - $receiver: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.collections.MutableList origin=EXCLEXCL - : kotlin.collections.MutableList - arg0: BLOCK type=kotlin.collections.MutableList? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.X? [val] - GET_VAR 'nx: .X? declared in .test' type=.X? origin=null - WHEN type=kotlin.collections.MutableList? 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: .X? declared in .test' type=.X? 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 abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null - $this: GET_VAR 'val tmp_2: .X? declared in .test' type=.X? origin=null - element: CONST Int type=kotlin.Int value=6 - FUN name:testExtensionReceiver visibility:public modality:FINAL <> ($receiver:kotlin.collections.MutableList) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:kotlin.collections.MutableList - BLOCK_BODY - CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ - : kotlin.Int - $receiver: GET_VAR ': kotlin.collections.MutableList declared in .testExtensionReceiver' type=kotlin.collections.MutableList origin=PLUSEQ - element: CONST Int type=kotlin.Int value=100 CLASS CLASS name:AML modality:ABSTRACT visibility:public superTypes:[kotlin.collections.MutableList] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AML - CONSTRUCTOR visibility:public <> () returnType:.AML [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AML modality:ABSTRACT visibility:public superTypes:[kotlin.collections.MutableList]' - FUN name:testExplicitThis visibility:public modality:FINAL <> ($this:.AML) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.AML - BLOCK_BODY - CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ - : kotlin.Int - $receiver: GET_VAR ': .AML declared in .AML.testExplicitThis' type=.AML origin=PLUSEQ - element: CONST Int type=kotlin.Int value=200 CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AML.Inner CONSTRUCTOR visibility:public <> ($this:.AML) returnType:.AML.Inner [primary] @@ -112,13 +8,6 @@ FILE fqName: fileName:/kt30020.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - FUN name:testOuterThis visibility:public modality:FINAL <> ($this:.AML.Inner) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.AML.Inner - BLOCK_BODY - CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ - : kotlin.Int - $receiver: GET_VAR ': .AML declared in .AML' type=.AML origin=PLUSEQ - element: CONST Int type=kotlin.Int value=300 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 @@ -132,14 +21,17 @@ FILE fqName: fileName:/kt30020.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.Int declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.List + FUN name:testOuterThis visibility:public modality:FINAL <> ($this:.AML.Inner) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.AML.Inner + BLOCK_BODY + CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ + : kotlin.Int + $receiver: GET_VAR ': .AML declared in .AML' type=.AML origin=PLUSEQ + element: CONST Int type=kotlin.Int value=300 + CONSTRUCTOR visibility:public <> () returnType:.AML [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AML modality:ABSTRACT visibility:public superTypes:[kotlin.collections.MutableList]' FUN FAKE_OVERRIDE name:add visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, element:kotlin.Int) returnType:kotlin.Boolean [fake_override] overridden: public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList @@ -151,17 +43,17 @@ FILE fqName: fileName:/kt30020.kt $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList VALUE_PARAMETER name:index index:0 type:kotlin.Int VALUE_PARAMETER name:element index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:addAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public abstract fun addAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection FUN FAKE_OVERRIDE name:addAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] overridden: public abstract fun addAll (index: kotlin.Int, elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList VALUE_PARAMETER name:index index:0 type:kotlin.Int VALUE_PARAMETER name:elements index:1 type:kotlin.collections.Collection - FUN FAKE_OVERRIDE name:addAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] - overridden: - public abstract fun addAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection FUN FAKE_OVERRIDE name:clear visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList) returnType:kotlin.Unit [fake_override] overridden: public abstract fun clear (): kotlin.Unit declared in kotlin.collections.MutableList @@ -253,3 +145,111 @@ FILE fqName: fileName:/kt30020.kt overridden: public open fun toString (): kotlin.String declared in kotlin.collections.MutableList $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testExplicitThis visibility:public modality:FINAL <> ($this:.AML) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.AML + BLOCK_BODY + CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ + : kotlin.Int + $receiver: GET_VAR ': .AML declared in .AML.testExplicitThis' type=.AML origin=PLUSEQ + element: CONST Int type=kotlin.Int value=200 + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.Int declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.List + CLASS INTERFACE name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X + 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: 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:f visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:.X + PROPERTY name:xs visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.collections.MutableList + correspondingProperty: PROPERTY name:xs visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.X + FUN name:test visibility:public modality:FINAL <> (x:.X, nx:.X?) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:.X + VALUE_PARAMETER name:nx index:1 type:.X? + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.X [val] + GET_VAR 'x: .X declared in .test' type=.X origin=null + CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ + : kotlin.Int + $receiver: CALL 'public abstract fun (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=PLUSEQ + $this: GET_VAR 'val tmp_0: .X declared in .test' type=.X origin=null + element: CONST Int type=kotlin.Int value=1 + CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ + : kotlin.Int + $receiver: CALL 'public abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null + $this: GET_VAR 'x: .X declared in .test' type=.X origin=null + element: CONST Int type=kotlin.Int value=2 + CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ + : kotlin.Int + $receiver: TYPE_OP type=kotlin.collections.MutableList origin=CAST typeOperand=kotlin.collections.MutableList + CALL 'public abstract fun (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=GET_PROPERTY + $this: GET_VAR 'x: .X declared in .test' type=.X origin=null + element: CONST Int type=kotlin.Int value=3 + CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ + : kotlin.Int + $receiver: TYPE_OP type=kotlin.collections.MutableList origin=CAST typeOperand=kotlin.collections.MutableList + CALL 'public abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null + $this: GET_VAR 'x: .X declared in .test' type=.X origin=null + element: CONST Int type=kotlin.Int value=4 + CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ + : kotlin.Int + $receiver: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.collections.MutableList origin=EXCLEXCL + : kotlin.collections.MutableList + arg0: BLOCK type=kotlin.collections.MutableList? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.X? [val] + GET_VAR 'nx: .X? declared in .test' type=.X? origin=null + WHEN type=kotlin.collections.MutableList? 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: .X? declared in .test' type=.X? 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 abstract fun (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=GET_PROPERTY + $this: GET_VAR 'val tmp_1: .X? declared in .test' type=.X? origin=null + element: CONST Int type=kotlin.Int value=5 + CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ + : kotlin.Int + $receiver: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.collections.MutableList origin=EXCLEXCL + : kotlin.collections.MutableList + arg0: BLOCK type=kotlin.collections.MutableList? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.X? [val] + GET_VAR 'nx: .X? declared in .test' type=.X? origin=null + WHEN type=kotlin.collections.MutableList? 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: .X? declared in .test' type=.X? 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 abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null + $this: GET_VAR 'val tmp_2: .X? declared in .test' type=.X? origin=null + element: CONST Int type=kotlin.Int value=6 + FUN name:testExtensionReceiver visibility:public modality:FINAL <> ($receiver:kotlin.collections.MutableList) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:kotlin.collections.MutableList + BLOCK_BODY + CALL 'public final fun plusAssign (element: T of kotlin.collections.plusAssign): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=PLUSEQ + : kotlin.Int + $receiver: GET_VAR ': kotlin.collections.MutableList declared in .testExtensionReceiver' type=kotlin.collections.MutableList origin=PLUSEQ + element: CONST Int type=kotlin.Int value=100 diff --git a/compiler/testData/ir/irText/expressions/kt30020.kt.txt b/compiler/testData/ir/irText/expressions/kt30020.kt.txt index 4cfa276ed19..6c005deb479 100644 --- a/compiler/testData/ir/irText/expressions/kt30020.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt30020.kt.txt @@ -1,9 +1,35 @@ +abstract class AML : MutableList { + inner class Inner { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun testOuterThis() { + .plusAssign(element = 300) + } + + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun testExplicitThis() { + .plusAssign(element = 200) + } + +} + interface X { + abstract fun f(): MutableList + abstract val xs: MutableList abstract get - abstract fun f(): MutableList - } fun test(x: X, nx: X?) { @@ -34,28 +60,3 @@ fun MutableList.testExtensionReceiver() { .plusAssign(element = 100) } -abstract class AML : MutableList { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun testExplicitThis() { - .plusAssign(element = 200) - } - - inner class Inner { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun testOuterThis() { - .plusAssign(element = 300) - } - - } - -} diff --git a/compiler/testData/ir/irText/expressions/kt35730.ir.txt b/compiler/testData/ir/irText/expressions/kt35730.ir.txt index f2910309c46..afdb55bfab9 100644 --- a/compiler/testData/ir/irText/expressions/kt35730.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt35730.ir.txt @@ -1,9 +1,6 @@ FILE fqName: fileName:/kt35730.kt CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base - FUN name:foo visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Base - BLOCK_BODY 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 @@ -17,21 +14,24 @@ FILE fqName: fileName:/kt35730.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Base + BLOCK_BODY CLASS OBJECT name:Derived modality:FINAL visibility:public superTypes:[.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived CONSTRUCTOR visibility:private <> () returnType:.Derived [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Derived modality:FINAL visibility:public superTypes:[.Base]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Unit [fake_override] - overridden: - public open fun foo (): kotlin.Unit declared in .Base - $this: VALUE_PARAMETER name: type:.Base 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 .Base $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (): kotlin.Unit declared in .Base + $this: VALUE_PARAMETER name: type:.Base 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 .Base diff --git a/compiler/testData/ir/irText/expressions/kt36956.ir.txt b/compiler/testData/ir/irText/expressions/kt36956.ir.txt index d71e9783c1f..fcb988110e0 100644 --- a/compiler/testData/ir/irText/expressions/kt36956.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt36956.ir.txt @@ -1,48 +1,4 @@ FILE fqName: fileName:/kt36956.kt - CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .A) returnType:.A.A> [primary] - VALUE_PARAMETER name:value index:0 type:T of .A - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:T of .A visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: T of .A declared in .A.' type=T of .A origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.A.A>) returnType:T of .A - correspondingProperty: PROPERTY name:value visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A.A> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): T of .A declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .A visibility:private [final]' type=T of .A origin=null - receiver: GET_VAR ': .A.A> declared in .A.' type=.A.A> origin=null - FUN name:get visibility:public modality:FINAL <> ($this:.A.A>, i:kotlin.Int) returnType:T of .A [operator] - $this: VALUE_PARAMETER name: type:.A.A> - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): T of .A declared in .A' - CALL 'private final fun (): T of .A declared in .A' type=T of .A origin=GET_PROPERTY - $this: GET_VAR ': .A.A> declared in .A.get' type=.A.A> origin=null - FUN name:set visibility:public modality:FINAL <> ($this:.A.A>, i:kotlin.Int, v:T of .A) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.A.A> - VALUE_PARAMETER name:i index:0 type:kotlin.Int - VALUE_PARAMETER name:v index:1 type:T of .A - BLOCK_BODY - 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: 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 PROPERTY name:aFloat visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:aFloat type:.A visibility:private [final,static] EXPRESSION_BODY @@ -77,3 +33,47 @@ FILE fqName: fileName:/kt36956.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Float declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aInt type:kotlin.Float visibility:private [final,static]' type=kotlin.Float origin=null + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:value visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:T of .A visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: T of .A declared in .A.' type=T of .A origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.A.A>) returnType:T of .A + correspondingProperty: PROPERTY name:value visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A.A> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): T of .A declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .A visibility:private [final]' type=T of .A origin=null + receiver: GET_VAR ': .A.A> declared in .A.' type=.A.A> origin=null + CONSTRUCTOR visibility:public <> (value:T of .A) returnType:.A.A> [primary] + VALUE_PARAMETER name:value index:0 type:T of .A + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 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:get visibility:public modality:FINAL <> ($this:.A.A>, i:kotlin.Int) returnType:T of .A [operator] + $this: VALUE_PARAMETER name: type:.A.A> + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): T of .A declared in .A' + CALL 'private final fun (): T of .A declared in .A' type=T of .A origin=GET_PROPERTY + $this: GET_VAR ': .A.A> declared in .A.get' type=.A.A> origin=null + FUN name:set visibility:public modality:FINAL <> ($this:.A.A>, i:kotlin.Int, v:T of .A) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.A.A> + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:v index:1 type:T of .A + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/kt36956.kt.txt b/compiler/testData/ir/irText/expressions/kt36956.kt.txt index 3e92394811d..18bfacc4265 100644 --- a/compiler/testData/ir/irText/expressions/kt36956.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt36956.kt.txt @@ -1,23 +1,3 @@ -class A { - constructor(value: T) /* primary */ { - super/*Any*/() - /* () */ - - } - - private val value: T - field = value - private get - - operator fun get(i: Int): T { - return .() - } - - operator fun set(i: Int, v: T) { - } - -} - val aFloat: A field = A(value = 0.0F) get @@ -31,3 +11,24 @@ val aInt: Float tmp_2 } get + +class A { + private val value: T + field = value + private get + + constructor(value: T) /* primary */ { + super/*Any*/() + /* () */ + + } + + operator fun get(i: Int): T { + return .() + } + + operator fun set(i: Int, v: T) { + } + +} + diff --git a/compiler/testData/ir/irText/expressions/kt37570.ir.txt b/compiler/testData/ir/irText/expressions/kt37570.ir.txt index cd391984a0b..740fa61ac47 100644 --- a/compiler/testData/ir/irText/expressions/kt37570.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt37570.ir.txt @@ -1,14 +1,6 @@ FILE fqName: fileName:/kt37570.kt - FUN name:a visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun a (): kotlin.String declared in ' - CONST String type=kotlin.String value="string" CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:b visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.String visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String @@ -31,6 +23,10 @@ FILE fqName: fileName:/kt37570.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .A declared in .A' type=.A origin=null value: GET_VAR '$this$apply: kotlin.String declared in .A.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -44,3 +40,7 @@ FILE fqName: fileName:/kt37570.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:a visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun a (): kotlin.String declared in ' + CONST String type=kotlin.String value="string" diff --git a/compiler/testData/ir/irText/expressions/kt37570.kt.txt b/compiler/testData/ir/irText/expressions/kt37570.kt.txt index 6818bc803a7..241f1c1f610 100644 --- a/compiler/testData/ir/irText/expressions/kt37570.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt37570.kt.txt @@ -1,14 +1,4 @@ -fun a(): String { - return "string" -} - class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val b: String get @@ -19,4 +9,15 @@ class A { ) /*~> Unit */ } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + +fun a(): String { + return "string" +} + diff --git a/compiler/testData/ir/irText/expressions/kt42321.ir.txt b/compiler/testData/ir/irText/expressions/kt42321.ir.txt index d221f68a2c5..7a8d5d94e7b 100644 --- a/compiler/testData/ir/irText/expressions/kt42321.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt42321.ir.txt @@ -6,9 +6,6 @@ FILE fqName: fileName:/kt42321.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:takeT visibility:public modality:ABSTRACT <> ($this:.C.C>, x:L of .C) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C.C> - VALUE_PARAMETER name:x index:0 type:L of .C 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 @@ -22,6 +19,41 @@ FILE fqName: fileName:/kt42321.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:takeT visibility:public modality:ABSTRACT <> ($this:.C.C>, x:L of .C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C.C> + VALUE_PARAMETER name:x index:0 type:L of .C + FUN name:testByteDotCall visibility:public modality:FINAL <> (c3:.C) returnType:kotlin.Unit + VALUE_PARAMETER name:c3 index:0 type:.C + BLOCK_BODY + CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c3: .C declared in .testByteDotCall' type=.C origin=null + x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 + other: CONST Int type=kotlin.Int value=2 + CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c3: .C declared in .testByteDotCall' type=.C origin=null + x: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 + bitCount: CONST Int type=kotlin.Int value=2 + CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c3: .C declared in .testByteDotCall' type=.C origin=null + x: CALL 'public final fun inv (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 + FUN name:testByteOperatorInfixCall visibility:public modality:FINAL <> (c6:.C) returnType:kotlin.Unit + VALUE_PARAMETER name:c6 index:0 type:.C + BLOCK_BODY + CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c6: .C declared in .testByteOperatorInfixCall' type=.C origin=null + x: CALL 'public open fun toByte (): kotlin.Byte declared in kotlin.Int' type=kotlin.Byte origin=null + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CONST Int type=kotlin.Int value=1 + other: CONST Int type=kotlin.Int value=2 + CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c6: .C declared in .testByteOperatorInfixCall' type=.C origin=null + x: CALL 'public open fun toByte (): kotlin.Byte declared in kotlin.Int' type=kotlin.Byte origin=null + $this: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 + bitCount: CONST Int type=kotlin.Int value=2 FUN name:testLongDotCall visibility:public modality:FINAL <> (c1:.C) returnType:kotlin.Unit VALUE_PARAMETER name:c1 index:0 type:.C BLOCK_BODY @@ -92,40 +124,6 @@ FILE fqName: fileName:/kt42321.kt $this: GET_VAR 'c1: .C declared in .testLongDotCall' type=.C origin=null x: CALL 'public final fun inv (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: CONST Int type=kotlin.Int value=1 - FUN name:testShortDotCall visibility:public modality:FINAL <> (c2:.C) returnType:kotlin.Unit - VALUE_PARAMETER name:c2 index:0 type:.C - BLOCK_BODY - CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null - $this: GET_VAR 'c2: .C declared in .testShortDotCall' type=.C origin=null - x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CONST Int type=kotlin.Int value=1 - other: CONST Int type=kotlin.Int value=2 - CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null - $this: GET_VAR 'c2: .C declared in .testShortDotCall' type=.C origin=null - x: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CONST Int type=kotlin.Int value=1 - bitCount: CONST Int type=kotlin.Int value=2 - CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null - $this: GET_VAR 'c2: .C declared in .testShortDotCall' type=.C origin=null - x: CALL 'public final fun inv (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CONST Int type=kotlin.Int value=1 - FUN name:testByteDotCall visibility:public modality:FINAL <> (c3:.C) returnType:kotlin.Unit - VALUE_PARAMETER name:c3 index:0 type:.C - BLOCK_BODY - CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null - $this: GET_VAR 'c3: .C declared in .testByteDotCall' type=.C origin=null - x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CONST Int type=kotlin.Int value=1 - other: CONST Int type=kotlin.Int value=2 - CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null - $this: GET_VAR 'c3: .C declared in .testByteDotCall' type=.C origin=null - x: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CONST Int type=kotlin.Int value=1 - bitCount: CONST Int type=kotlin.Int value=2 - CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null - $this: GET_VAR 'c3: .C declared in .testByteDotCall' type=.C origin=null - x: CALL 'public final fun inv (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CONST Int type=kotlin.Int value=1 FUN name:testLongOperatorInfixCall visibility:public modality:FINAL <> (c4:.C) returnType:kotlin.Unit VALUE_PARAMETER name:c4 index:0 type:.C BLOCK_BODY @@ -201,6 +199,23 @@ FILE fqName: fileName:/kt42321.kt $this: CALL 'public final fun xor (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: CONST Int type=kotlin.Int value=1 other: CONST Int type=kotlin.Int value=2 + FUN name:testShortDotCall visibility:public modality:FINAL <> (c2:.C) returnType:kotlin.Unit + VALUE_PARAMETER name:c2 index:0 type:.C + BLOCK_BODY + CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c2: .C declared in .testShortDotCall' type=.C origin=null + x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 + other: CONST Int type=kotlin.Int value=2 + CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c2: .C declared in .testShortDotCall' type=.C origin=null + x: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 + bitCount: CONST Int type=kotlin.Int value=2 + CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c2: .C declared in .testShortDotCall' type=.C origin=null + x: CALL 'public final fun inv (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 FUN name:testShortOperatorInfixCall visibility:public modality:FINAL <> (c5:.C) returnType:kotlin.Unit VALUE_PARAMETER name:c5 index:0 type:.C BLOCK_BODY @@ -216,18 +231,3 @@ FILE fqName: fileName:/kt42321.kt $this: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: CONST Int type=kotlin.Int value=1 bitCount: CONST Int type=kotlin.Int value=2 - FUN name:testByteOperatorInfixCall visibility:public modality:FINAL <> (c6:.C) returnType:kotlin.Unit - VALUE_PARAMETER name:c6 index:0 type:.C - BLOCK_BODY - CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null - $this: GET_VAR 'c6: .C declared in .testByteOperatorInfixCall' type=.C origin=null - x: CALL 'public open fun toByte (): kotlin.Byte declared in kotlin.Int' type=kotlin.Byte origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CONST Int type=kotlin.Int value=1 - other: CONST Int type=kotlin.Int value=2 - CALL 'public abstract fun takeT (x: L of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=null - $this: GET_VAR 'c6: .C declared in .testByteOperatorInfixCall' type=.C origin=null - x: CALL 'public open fun toByte (): kotlin.Byte declared in kotlin.Int' type=kotlin.Byte origin=null - $this: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CONST Int type=kotlin.Int value=1 - bitCount: CONST Int type=kotlin.Int value=2 diff --git a/compiler/testData/ir/irText/expressions/kt44993.ir.txt b/compiler/testData/ir/irText/expressions/kt44993.ir.txt index 126e58a0642..c4cbd47f829 100644 --- a/compiler/testData/ir/irText/expressions/kt44993.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt44993.ir.txt @@ -1,4 +1,38 @@ FILE fqName: fileName:/kt44993.kt + CLASS CLASS name:KotlinBox modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KotlinBox.KotlinBox> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:data visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:data type:T of .KotlinBox? visibility:public [final] + annotations: + JvmField + EXPRESSION_BODY + GET_VAR 'data: T of .KotlinBox? declared in .KotlinBox.' type=T of .KotlinBox? origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.KotlinBox.KotlinBox>) returnType:T of .KotlinBox? + correspondingProperty: PROPERTY name:data visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.KotlinBox.KotlinBox> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .KotlinBox? declared in .KotlinBox' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:data type:T of .KotlinBox? visibility:public [final]' type=T of .KotlinBox? origin=null + receiver: GET_VAR ': .KotlinBox.KotlinBox> declared in .KotlinBox.' type=.KotlinBox.KotlinBox> origin=null + CONSTRUCTOR visibility:public <> (data:T of .KotlinBox?) returnType:.KotlinBox.KotlinBox> [primary] + VALUE_PARAMETER name:data index:0 type:T of .KotlinBox? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KotlinBox modality:FINAL visibility:public 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 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:f visibility:public modality:FINAL <> (r:.KotlinBox<.JavaBox>) returnType:kotlin.String VALUE_PARAMETER name:r index:0 type:.KotlinBox<.JavaBox> BLOCK_BODY @@ -30,37 +64,3 @@ FILE fqName: fileName:/kt44993.kt if: CONST Boolean type=kotlin.Boolean value=true then: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:element type:@[FlexibleNullability] kotlin.String? visibility:public [final]' type=@[FlexibleNullability] kotlin.String? origin=null receiver: GET_VAR 'val tmp_0: .JavaBox? declared in .f' type=.JavaBox? origin=null - CLASS CLASS name:KotlinBox modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KotlinBox.KotlinBox> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (data:T of .KotlinBox?) returnType:.KotlinBox.KotlinBox> [primary] - VALUE_PARAMETER name:data index:0 type:T of .KotlinBox? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KotlinBox modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:data visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:data type:T of .KotlinBox? visibility:public [final] - annotations: - JvmField - EXPRESSION_BODY - GET_VAR 'data: T of .KotlinBox? declared in .KotlinBox.' type=T of .KotlinBox? origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.KotlinBox.KotlinBox>) returnType:T of .KotlinBox? - correspondingProperty: PROPERTY name:data visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.KotlinBox.KotlinBox> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .KotlinBox? declared in .KotlinBox' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:data type:T of .KotlinBox? visibility:public [final]' type=T of .KotlinBox? origin=null - receiver: GET_VAR ': .KotlinBox.KotlinBox> declared in .KotlinBox.' type=.KotlinBox.KotlinBox> 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: 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 diff --git a/compiler/testData/ir/irText/expressions/kt45022.ir.txt b/compiler/testData/ir/irText/expressions/kt45022.ir.txt index fe6400a5ea0..7f85676a01d 100644 --- a/compiler/testData/ir/irText/expressions/kt45022.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt45022.ir.txt @@ -1,25 +1,10 @@ FILE fqName: fileName:/kt45022.kt - TYPEALIAS name:AX visibility:public expandedType:.X - FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun plusAssign (any: kotlin.Any): kotlin.Unit declared in .X' type=kotlin.Unit origin=PLUSEQ - $this: GET_OBJECT 'CLASS OBJECT name:X modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X - any: CONST Int type=kotlin.Int value=1 - CALL 'public final fun plusAssign (any: kotlin.Any): kotlin.Unit declared in .X' type=kotlin.Unit origin=PLUSEQ - $this: GET_OBJECT 'CLASS OBJECT name:X modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X - any: CONST Int type=kotlin.Int value=1 CLASS OBJECT name:X modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X CONSTRUCTOR visibility:private <> () returnType:.X [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:plusAssign visibility:public modality:FINAL <> ($this:.X, any:kotlin.Any) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.X - VALUE_PARAMETER name:any index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun plusAssign (any: kotlin.Any): kotlin.Unit declared in .X' - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit 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 @@ -33,3 +18,18 @@ FILE fqName: fileName:/kt45022.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:plusAssign visibility:public modality:FINAL <> ($this:.X, any:kotlin.Any) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.X + VALUE_PARAMETER name:any index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun plusAssign (any: kotlin.Any): kotlin.Unit declared in .X' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun plusAssign (any: kotlin.Any): kotlin.Unit declared in .X' type=kotlin.Unit origin=PLUSEQ + $this: GET_OBJECT 'CLASS OBJECT name:X modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X + any: CONST Int type=kotlin.Int value=1 + CALL 'public final fun plusAssign (any: kotlin.Any): kotlin.Unit declared in .X' type=kotlin.Unit origin=PLUSEQ + $this: GET_OBJECT 'CLASS OBJECT name:X modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X + any: CONST Int type=kotlin.Int value=1 + TYPEALIAS name:AX visibility:public expandedType:.X diff --git a/compiler/testData/ir/irText/expressions/kt47082.ir.txt b/compiler/testData/ir/irText/expressions/kt47082.ir.txt index d9417289698..481c7dd484f 100644 --- a/compiler/testData/ir/irText/expressions/kt47082.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt47082.ir.txt @@ -1,27 +1,4 @@ FILE fqName: fileName:/kt47082.kt - FUN name:produce visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit>) returnType:E of .produce - TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun produce (block: @[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit>): E of .produce declared in ' - TYPE_OP type=E of .produce origin=CAST typeOperand=E of .produce - CONST Null type=kotlin.Nothing? value=null - CLASS INTERFACE name:Derived modality:ABSTRACT visibility:public superTypes:[.Base.Derived>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived.Derived> - TYPE_PARAMETER name:E index:0 variance:in superTypes:[kotlin.Any?] reified:false - 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 .Base - $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 .Base - $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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base.Base> TYPE_PARAMETER name:E index:0 variance:in superTypes:[kotlin.Any?] reified:false @@ -38,6 +15,22 @@ FILE fqName: fileName:/kt47082.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Derived modality:ABSTRACT visibility:public superTypes:[.Base.Derived>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived.Derived> + TYPE_PARAMETER name:E index:0 variance:in superTypes:[kotlin.Any?] reified:false + 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 .Base + $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 .Base + $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 .Base + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:Receiver modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Receiver.Receiver> TYPE_PARAMETER name:E index:0 variance:out superTypes:[kotlin.Any?] reified:false @@ -54,15 +47,10 @@ FILE fqName: fileName:/kt47082.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:toChannel visibility:public modality:FINAL ($receiver:.Receiver.toChannel>, destination:C of .toChannel) returnType:C of .toChannel - TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:C index:1 variance: superTypes:[.Base.toChannel>] reified:false - $receiver: VALUE_PARAMETER name: type:.Receiver.toChannel> - VALUE_PARAMETER name:destination index:0 type:C of .toChannel + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun toChannel (destination: C of .toChannel): C of .toChannel declared in ' - TYPE_OP type=C of .toChannel origin=CAST typeOperand=C of .toChannel - CONST Null type=kotlin.Nothing? value=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" FUN name:foo visibility:public modality:FINAL (r:.Receiver.foo>) returnType:R of .foo TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:r index:0 type:.Receiver.foo> @@ -80,7 +68,19 @@ FILE fqName: fileName:/kt47082.kt : .Derived.foo> $receiver: GET_VAR 'r: .Receiver.foo> declared in .foo' type=.Receiver.foo> origin=null destination: GET_VAR '$this$produce: .Derived.foo> declared in .foo.' type=.Derived.foo> origin=null - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + FUN name:produce visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit>) returnType:E of .produce + TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' - CONST String type=kotlin.String value="OK" + RETURN type=kotlin.Nothing from='public final fun produce (block: @[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit>): E of .produce declared in ' + TYPE_OP type=E of .produce origin=CAST typeOperand=E of .produce + CONST Null type=kotlin.Nothing? value=null + FUN name:toChannel visibility:public modality:FINAL ($receiver:.Receiver.toChannel>, destination:C of .toChannel) returnType:C of .toChannel + TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:C index:1 variance: superTypes:[.Base.toChannel>] reified:false + $receiver: VALUE_PARAMETER name: type:.Receiver.toChannel> + VALUE_PARAMETER name:destination index:0 type:C of .toChannel + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun toChannel (destination: C of .toChannel): C of .toChannel declared in ' + TYPE_OP type=C of .toChannel origin=CAST typeOperand=C of .toChannel + CONST Null type=kotlin.Nothing? value=null diff --git a/compiler/testData/ir/irText/expressions/kt47082.kt.txt b/compiler/testData/ir/irText/expressions/kt47082.kt.txt index e346fa5e0ef..0ddb49bf5f6 100644 --- a/compiler/testData/ir/irText/expressions/kt47082.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt47082.kt.txt @@ -1,18 +1,14 @@ -fun produce(block: @ExtensionFunctionType Function1, Unit>): E { - return null as E +interface Base { } interface Derived : Base { } -interface Base { -} - interface Receiver { } -fun > Receiver.toChannel(destination: C): C { - return null as C +fun box(): String { + return "OK" } fun foo(r: Receiver): R { @@ -22,6 +18,11 @@ fun foo(r: Receiver): R { ) } -fun box(): String { - return "OK" +fun produce(block: @ExtensionFunctionType Function1, Unit>): E { + return null as E } + +fun > Receiver.toChannel(destination: C): C { + return null as C +} + diff --git a/compiler/testData/ir/irText/expressions/kt47328.ir.txt b/compiler/testData/ir/irText/expressions/kt47328.ir.txt index 390abda2151..1ef1817f71c 100644 --- a/compiler/testData/ir/irText/expressions/kt47328.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt47328.ir.txt @@ -1,30 +1,6 @@ FILE fqName: fileName:/kt47328.kt - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - PROPERTY name:x visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Int - correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.A - 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: 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 CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.B [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A]' PROPERTY name:x visibility:public modality:OPEN [val] overridden: public abstract x: kotlin.Int @@ -42,6 +18,11 @@ FILE fqName: fileName:/kt47328.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .B' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .B declared in .B.' type=.B origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.B [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A]' 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 .A @@ -58,11 +39,6 @@ FILE fqName: fileName:/kt47328.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> TYPE_PARAMETER name:D index:0 variance: superTypes:[.A] reified:false - CONSTRUCTOR visibility:public <> (d:D of .C) returnType:.C.C> [primary] - VALUE_PARAMETER name:d index:0 type:D of .C - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:d visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:d type:D of .C visibility:public [final] annotations: @@ -76,6 +52,11 @@ FILE fqName: fileName:/kt47328.kt RETURN type=kotlin.Nothing from='public final fun (): D of .C declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:D of .C visibility:public [final]' type=D of .C origin=null receiver: GET_VAR ': .C.C> declared in .C.' type=.C.C> origin=null + CONSTRUCTOR visibility:public <> (d:D of .C) returnType:.C.C> [primary] + VALUE_PARAMETER name:d index:0 type:D of .C + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -91,11 +72,6 @@ FILE fqName: fileName:/kt47328.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.E - CONSTRUCTOR visibility:public <> (c:.C<.B>) returnType:.E [primary] - VALUE_PARAMETER name:c index:0 type:.C<.B> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:ax visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ax type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -109,6 +85,11 @@ FILE fqName: fileName:/kt47328.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .E' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ax type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .E declared in .E.' type=.E origin=null + CONSTRUCTOR visibility:public <> (c:.C<.B>) returnType:.E [primary] + VALUE_PARAMETER name:c index:0 type:.C<.B> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:E modality:FINAL visibility:public 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 declared in kotlin.Any @@ -122,3 +103,22 @@ FILE fqName: fileName:/kt47328.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + 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: 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 + PROPERTY name:x visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.A diff --git a/compiler/testData/ir/irText/expressions/kt48708.ir.txt b/compiler/testData/ir/irText/expressions/kt48708.ir.txt index efdc621cb8a..96a364dd68f 100644 --- a/compiler/testData/ir/irText/expressions/kt48708.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt48708.ir.txt @@ -1,4 +1,7 @@ FILE fqName: fileName:/kt48708.kt + FUN name:takeInt visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY FUN name:test visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.Unit VALUE_PARAMETER name:b index:0 type:kotlin.Boolean BLOCK_BODY @@ -16,6 +19,3 @@ FILE fqName: fileName:/kt48708.kt CONST Int type=kotlin.Int value=0 CALL 'public final fun takeInt (x: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null x: GET_VAR 'val x: kotlin.Int declared in .test' type=kotlin.Int origin=null - FUN name:takeInt visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/kt48708.kt.txt b/compiler/testData/ir/irText/expressions/kt48708.kt.txt index 0a05a243d5d..0cbcfa8d47f 100644 --- a/compiler/testData/ir/irText/expressions/kt48708.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt48708.kt.txt @@ -1,3 +1,6 @@ +fun takeInt(x: Int) { +} + fun test(b: Boolean) { val x: Int = when { b -> { // BLOCK @@ -11,5 +14,3 @@ fun test(b: Boolean) { takeInt(x = x) } -fun takeInt(x: Int) { -} diff --git a/compiler/testData/ir/irText/expressions/kt48806.ir.txt b/compiler/testData/ir/irText/expressions/kt48806.ir.txt index 24d52667edb..33db6286a42 100644 --- a/compiler/testData/ir/irText/expressions/kt48806.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt48806.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/kt48806.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:test_1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_1 type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -41,6 +37,10 @@ FILE fqName: fileName:/kt48806.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_2 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/kt48806.kt.txt b/compiler/testData/ir/irText/expressions/kt48806.kt.txt index 66625aad13f..72157781771 100644 --- a/compiler/testData/ir/irText/expressions/kt48806.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt48806.kt.txt @@ -1,10 +1,4 @@ class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val test_1: Int field = try { // BLOCK throw RuntimeException() @@ -25,4 +19,11 @@ class A { get + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/expressions/kt49203.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt49203.fir.ir.txt index 133d04c0416..46a74a26fa2 100644 --- a/compiler/testData/ir/irText/expressions/kt49203.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt49203.fir.ir.txt @@ -1,58 +1,6 @@ FILE fqName: fileName:/kt49203.kt - CLASS CLASS name:X modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X - CONSTRUCTOR visibility:public <> () returnType:.X [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:X modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private - EXPRESSION_BODY - CONST String type=kotlin.String value="" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X) returnType:kotlin.String - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.X - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .X' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private' type=kotlin.String origin=null - receiver: GET_VAR ': .X declared in .X.' type=.X origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X, :kotlin.String) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.X - VALUE_PARAMETER name: index:0 type:kotlin.String - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .X declared in .X.' type=.X origin=null - value: GET_VAR ': kotlin.String declared in .X.' type=kotlin.String origin=null - FUN name:plusAssign visibility:public modality:FINAL <> ($this:.X, data:kotlin.String) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.X - VALUE_PARAMETER name:data index:0 type:kotlin.String - BLOCK_BODY - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .X' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .X declared in .X.plusAssign' type=.X origin=null - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null - $this: CALL 'public final fun (): kotlin.String declared in .X' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .X declared in .X.plusAssign' type=.X origin=null - other: GET_VAR 'data: kotlin.String declared in .X.plusAssign' type=kotlin.String 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: 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 CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [lateinit,var] FIELD PROPERTY_BACKING_FIELD name:x type:.X visibility:private FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:.X @@ -89,6 +37,10 @@ FILE fqName: fileName:/kt49203.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:.X visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null value: GET_VAR ': .X declared in .A.' type=.X origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public 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 declared in kotlin.Any @@ -108,6 +60,19 @@ FILE fqName: fileName:/kt49203.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A]' + 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 .A + $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 .A + $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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [lateinit,fake_override,var] overridden: public final x: .X @@ -124,19 +89,54 @@ FILE fqName: fileName:/kt49203.kt overridden: public final fun (): .X declared in .A $this: VALUE_PARAMETER name: type:.A + CLASS CLASS name:X modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X + PROPERTY name:value visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.X + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .X' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private' type=kotlin.String origin=null + receiver: GET_VAR ': .X declared in .X.' type=.X origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X, :kotlin.String) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.X + VALUE_PARAMETER name: index:0 type:kotlin.String + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .X declared in .X.' type=.X origin=null + value: GET_VAR ': kotlin.String declared in .X.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> () returnType:.X [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:X modality:FINAL visibility:public 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 declared in .A + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .A + 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 .A + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:plusAssign visibility:public modality:FINAL <> ($this:.X, data:kotlin.String) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.X + VALUE_PARAMETER name:data index:0 type:kotlin.String + BLOCK_BODY + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .X' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .X declared in .X.plusAssign' type=.X origin=null + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun (): kotlin.String declared in .X' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .X declared in .X.plusAssign' type=.X origin=null + other: GET_VAR 'data: kotlin.String declared in .X.plusAssign' type=kotlin.String origin=null FUN name:test visibility:public modality:FINAL <> (b:.B) returnType:kotlin.Unit VALUE_PARAMETER name:b index:0 type:.B BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/kt49203.ir.txt b/compiler/testData/ir/irText/expressions/kt49203.ir.txt index ea52ffb08f7..4e16090eb92 100644 --- a/compiler/testData/ir/irText/expressions/kt49203.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt49203.ir.txt @@ -1,61 +1,6 @@ FILE fqName: fileName:/kt49203.kt - CLASS CLASS name:X modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X - CONSTRUCTOR visibility:public <> () returnType:.X [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:X modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private - EXPRESSION_BODY - CONST String type=kotlin.String value="" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X) returnType:kotlin.String - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.X - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .X' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private' type=kotlin.String origin=null - receiver: GET_VAR ': .X declared in .X.' type=.X origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X, :kotlin.String) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.X - VALUE_PARAMETER name: index:0 type:kotlin.String - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .X declared in .X.' type=.X origin=null - value: GET_VAR ': kotlin.String declared in .X.' type=kotlin.String origin=null - FUN name:plusAssign visibility:public modality:FINAL <> ($this:.X, data:kotlin.String) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.X - VALUE_PARAMETER name:data index:0 type:kotlin.String - BLOCK_BODY - BLOCK type=kotlin.Unit origin=PLUSEQ - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.X [val] - GET_VAR ': .X declared in .X.plusAssign' type=.X origin=null - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .X' type=kotlin.Unit origin=PLUSEQ - $this: GET_VAR 'val tmp_0: .X declared in .X.plusAssign' type=.X origin=null - : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ - $this: CALL 'public final fun (): kotlin.String declared in .X' type=kotlin.String origin=PLUSEQ - $this: GET_VAR 'val tmp_0: .X declared in .X.plusAssign' type=.X origin=null - other: GET_VAR 'data: kotlin.String declared in .X.plusAssign' type=kotlin.String 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: 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 CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [lateinit,var] FIELD PROPERTY_BACKING_FIELD name:x type:.X visibility:private FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:.X @@ -92,6 +37,10 @@ FILE fqName: fileName:/kt49203.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:.X visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null value: GET_VAR ': .X declared in .A.' type=.X origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public 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 declared in kotlin.Any @@ -111,6 +60,19 @@ FILE fqName: fileName:/kt49203.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A]' + 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 .A + $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 .A + $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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [lateinit,fake_override,var] overridden: public final x: .X @@ -127,19 +89,57 @@ FILE fqName: fileName:/kt49203.kt overridden: public final fun (): .X declared in .A $this: VALUE_PARAMETER name: type:.A + CLASS CLASS name:X modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X + PROPERTY name:value visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.X + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .X' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private' type=kotlin.String origin=null + receiver: GET_VAR ': .X declared in .X.' type=.X origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X, :kotlin.String) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.X + VALUE_PARAMETER name: index:0 type:kotlin.String + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .X declared in .X.' type=.X origin=null + value: GET_VAR ': kotlin.String declared in .X.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> () returnType:.X [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:X modality:FINAL visibility:public 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 declared in .A + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .A + 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 .A + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:plusAssign visibility:public modality:FINAL <> ($this:.X, data:kotlin.String) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.X + VALUE_PARAMETER name:data index:0 type:kotlin.String + BLOCK_BODY + BLOCK type=kotlin.Unit origin=PLUSEQ + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.X [val] + GET_VAR ': .X declared in .X.plusAssign' type=.X origin=null + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .X' type=kotlin.Unit origin=PLUSEQ + $this: GET_VAR 'val tmp_0: .X declared in .X.plusAssign' type=.X origin=null + : CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ + $this: CALL 'public final fun (): kotlin.String declared in .X' type=kotlin.String origin=PLUSEQ + $this: GET_VAR 'val tmp_0: .X declared in .X.plusAssign' type=.X origin=null + other: GET_VAR 'data: kotlin.String declared in .X.plusAssign' type=kotlin.String origin=null FUN name:test visibility:public modality:FINAL <> (b:.B) returnType:kotlin.Unit VALUE_PARAMETER name:b index:0 type:.B BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/kt51036.ir.txt b/compiler/testData/ir/irText/expressions/kt51036.ir.txt index 25559de4210..6c028175a09 100644 --- a/compiler/testData/ir/irText/expressions/kt51036.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt51036.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/kt51036.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.Companion CONSTRUCTOR visibility:private <> () returnType:.A.Companion [primary] @@ -24,25 +20,10 @@ FILE fqName: fileName:/kt51036.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:invoke visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.String) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.A - $receiver: VALUE_PARAMETER name: type:kotlin.String + CONSTRUCTOR visibility:public <> () returnType:.A [primary] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun invoke (): kotlin.Unit declared in .A' - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUN name:close visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun close (): kotlin.Unit declared in .A' - CALL 'public final fun invoke (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null - $this: GET_VAR ': .A declared in .A.close' type=.A origin=null - $receiver: CALL 'public final fun run (block: kotlin.Function0): R of kotlin.run declared in kotlin' type=kotlin.String origin=null - : kotlin.String - block: FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .A.close' - CONST String type=kotlin.String value="Abc" + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -56,3 +37,22 @@ FILE fqName: fileName:/kt51036.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:close visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun close (): kotlin.Unit declared in .A' + CALL 'public final fun invoke (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR ': .A declared in .A.close' type=.A origin=null + $receiver: CALL 'public final fun run (block: kotlin.Function0): R of kotlin.run declared in kotlin' type=kotlin.String origin=null + : kotlin.String + block: FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .A.close' + CONST String type=kotlin.String value="Abc" + FUN name:invoke visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.String) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.A + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun invoke (): kotlin.Unit declared in .A' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.ir.txt b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.ir.txt index 6722c414c04..a043e06eea0 100644 --- a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.ir.txt @@ -1,14 +1,14 @@ FILE fqName: fileName:/lambdaInCAO.kt - FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:kotlin.Any, lambda:kotlin.Function0) returnType:kotlin.Unit [operator] - $receiver: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:lambda index:0 type:kotlin.Function0 - BLOCK_BODY FUN name:get visibility:public modality:FINAL <> ($receiver:kotlin.Any, index:kotlin.Function0) returnType:kotlin.Int [operator] $receiver: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:index index:0 type:kotlin.Function0 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun get (index: kotlin.Function0): kotlin.Int declared in ' CONST Int type=kotlin.Int value=42 + FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:kotlin.Any, lambda:kotlin.Function0) returnType:kotlin.Unit [operator] + $receiver: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:lambda index:0 type:kotlin.Function0 + BLOCK_BODY FUN name:set visibility:public modality:FINAL <> ($receiver:kotlin.Any, index:kotlin.Function0, value:kotlin.Int) returnType:kotlin.Unit [operator] $receiver: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:index index:0 type:kotlin.Function0 diff --git a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.kt.txt b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.kt.txt index 9e90bc1a1fd..8ea285adc48 100644 --- a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.kt.txt @@ -1,10 +1,10 @@ -operator fun Any.plusAssign(lambda: Function0) { -} - operator fun Any.get(index: Function0): Int { return 42 } +operator fun Any.plusAssign(lambda: Function0) { +} + operator fun Any.set(index: Function0, value: Int) { } @@ -36,3 +36,4 @@ fun test3(a: Any) { tmp_2.set(index = tmp_3, value = tmp_4.inc()) tmp_4 /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/expressions/lambdaInCAO.ir.txt b/compiler/testData/ir/irText/expressions/lambdaInCAO.ir.txt index c3ba4cc5b22..40ce7ba2623 100644 --- a/compiler/testData/ir/irText/expressions/lambdaInCAO.ir.txt +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.ir.txt @@ -1,14 +1,14 @@ FILE fqName: fileName:/lambdaInCAO.kt - FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:kotlin.Any, lambda:kotlin.Function0) returnType:kotlin.Unit [operator] - $receiver: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:lambda index:0 type:kotlin.Function0 - BLOCK_BODY FUN name:get visibility:public modality:FINAL <> ($receiver:kotlin.Any, index:kotlin.Function0) returnType:kotlin.Int [operator] $receiver: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:index index:0 type:kotlin.Function0 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun get (index: kotlin.Function0): kotlin.Int declared in ' CONST Int type=kotlin.Int value=42 + FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:kotlin.Any, lambda:kotlin.Function0) returnType:kotlin.Unit [operator] + $receiver: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:lambda index:0 type:kotlin.Function0 + BLOCK_BODY FUN name:set visibility:public modality:FINAL <> ($receiver:kotlin.Any, index:kotlin.Function0, value:kotlin.Int) returnType:kotlin.Unit [operator] $receiver: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:index index:0 type:kotlin.Function0 diff --git a/compiler/testData/ir/irText/expressions/lambdaInCAO.kt.txt b/compiler/testData/ir/irText/expressions/lambdaInCAO.kt.txt index a255b0ebe90..a2a87793707 100644 --- a/compiler/testData/ir/irText/expressions/lambdaInCAO.kt.txt +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.kt.txt @@ -1,10 +1,10 @@ -operator fun Any.plusAssign(lambda: Function0) { -} - operator fun Any.get(index: Function0): Int { return 42 } +operator fun Any.plusAssign(lambda: Function0) { +} + operator fun Any.set(index: Function0, value: Int) { } @@ -38,3 +38,4 @@ fun test3(a: Any) { tmp_4 } /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/expressions/memberTypeArguments.ir.txt b/compiler/testData/ir/irText/expressions/memberTypeArguments.ir.txt index 5725bbb89c2..a3423d3dcce 100644 --- a/compiler/testData/ir/irText/expressions/memberTypeArguments.ir.txt +++ b/compiler/testData/ir/irText/expressions/memberTypeArguments.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/memberTypeArguments.kt CLASS CLASS name:GenericClass modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.GenericClass.GenericClass> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .GenericClass) returnType:.GenericClass.GenericClass> [primary] - VALUE_PARAMETER name:value index:0 type:T of .GenericClass - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GenericClass modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:T of .GenericClass visibility:private [final] EXPRESSION_BODY @@ -18,14 +13,11 @@ FILE fqName: fileName:/memberTypeArguments.kt RETURN type=kotlin.Nothing from='public final fun (): T of .GenericClass declared in .GenericClass' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .GenericClass visibility:private [final]' type=T of .GenericClass origin=null receiver: GET_VAR ': .GenericClass.GenericClass> declared in .GenericClass.' type=.GenericClass.GenericClass> origin=null - FUN name:withNewValue visibility:public modality:FINAL <> ($this:.GenericClass.GenericClass>, newValue:T of .GenericClass) returnType:.GenericClass.GenericClass> - $this: VALUE_PARAMETER name: type:.GenericClass.GenericClass> - VALUE_PARAMETER name:newValue index:0 type:T of .GenericClass + CONSTRUCTOR visibility:public <> (value:T of .GenericClass) returnType:.GenericClass.GenericClass> [primary] + VALUE_PARAMETER name:value index:0 type:T of .GenericClass BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withNewValue (newValue: T of .GenericClass): .GenericClass.GenericClass> declared in .GenericClass' - CONSTRUCTOR_CALL 'public constructor (value: T of .GenericClass) declared in .GenericClass' type=.GenericClass.GenericClass> origin=null - : T of .GenericClass - value: GET_VAR 'newValue: T of .GenericClass declared in .GenericClass.withNewValue' type=T of .GenericClass origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GenericClass modality:FINAL visibility:public 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 declared in kotlin.Any @@ -39,3 +31,11 @@ FILE fqName: fileName:/memberTypeArguments.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:withNewValue visibility:public modality:FINAL <> ($this:.GenericClass.GenericClass>, newValue:T of .GenericClass) returnType:.GenericClass.GenericClass> + $this: VALUE_PARAMETER name: type:.GenericClass.GenericClass> + VALUE_PARAMETER name:newValue index:0 type:T of .GenericClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun withNewValue (newValue: T of .GenericClass): .GenericClass.GenericClass> declared in .GenericClass' + CONSTRUCTOR_CALL 'public constructor (value: T of .GenericClass) declared in .GenericClass' type=.GenericClass.GenericClass> origin=null + : T of .GenericClass + value: GET_VAR 'newValue: T of .GenericClass declared in .GenericClass.withNewValue' type=T of .GenericClass origin=null diff --git a/compiler/testData/ir/irText/expressions/memberTypeArguments.kt.txt b/compiler/testData/ir/irText/expressions/memberTypeArguments.kt.txt index c918f56974a..bbebb480969 100644 --- a/compiler/testData/ir/irText/expressions/memberTypeArguments.kt.txt +++ b/compiler/testData/ir/irText/expressions/memberTypeArguments.kt.txt @@ -1,16 +1,17 @@ class GenericClass { + val value: T + field = value + get + constructor(value: T) /* primary */ { super/*Any*/() /* () */ } - val value: T - field = value - get - fun withNewValue(newValue: T): GenericClass { return GenericClass(value = newValue) } } + diff --git a/compiler/testData/ir/irText/expressions/membersImportedFromObject.ir.txt b/compiler/testData/ir/irText/expressions/membersImportedFromObject.ir.txt index f5cdb1b09f2..b444d65180b 100644 --- a/compiler/testData/ir/irText/expressions/membersImportedFromObject.ir.txt +++ b/compiler/testData/ir/irText/expressions/membersImportedFromObject.ir.txt @@ -1,53 +1,4 @@ FILE fqName: fileName:/membersImportedFromObject.kt - CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:private <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in .A' - CONST Int type=kotlin.Int value=1 - FUN name:fooExt visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.Int) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.A - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun fooExt (): kotlin.Int declared in .A' - CONST Int type=kotlin.Int value=2 - PROPERTY name:bar visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=42 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int - correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.' type=.A origin=null - PROPERTY name:barExt visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.Int) returnType:kotlin.Int - correspondingProperty: PROPERTY name:barExt visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' - CONST Int type=kotlin.Int value=43 - 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: 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 PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final,static] EXPRESSION_BODY @@ -90,3 +41,52 @@ FILE fqName: fileName:/membersImportedFromObject.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + PROPERTY name:bar visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public 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 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:foo visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in .A' + CONST Int type=kotlin.Int value=1 + FUN name:fooExt visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.Int) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + $receiver: VALUE_PARAMETER name: type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun fooExt (): kotlin.Int declared in .A' + CONST Int type=kotlin.Int value=2 + PROPERTY name:barExt visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.Int) returnType:kotlin.Int + correspondingProperty: PROPERTY name:barExt visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + $receiver: VALUE_PARAMETER name: type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + CONST Int type=kotlin.Int value=43 diff --git a/compiler/testData/ir/irText/expressions/membersImportedFromObject.kt.txt b/compiler/testData/ir/irText/expressions/membersImportedFromObject.kt.txt index de2ef786f9b..7f5d31c614b 100644 --- a/compiler/testData/ir/irText/expressions/membersImportedFromObject.kt.txt +++ b/compiler/testData/ir/irText/expressions/membersImportedFromObject.kt.txt @@ -1,29 +1,3 @@ -object A { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun foo(): Int { - return 1 - } - - fun Int.fooExt(): Int { - return 2 - } - - val bar: Int - field = 42 - get - - val Int.barExt: Int - get(): Int { - return 43 - } - -} - val test1: Int field = A.foo() get @@ -39,3 +13,30 @@ val test3: Int val test4: Int field = (A, 1).() get + +object A { + val bar: Int + field = 42 + get + + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun foo(): Int { + return 1 + } + + fun Int.fooExt(): Int { + return 2 + } + + val Int.barExt: Int + get(): Int { + return 43 + } + +} + diff --git a/compiler/testData/ir/irText/expressions/multipleSmartCasts.fir.ir.txt b/compiler/testData/ir/irText/expressions/multipleSmartCasts.fir.ir.txt index a72218d982d..1811a4c0af1 100644 --- a/compiler/testData/ir/irText/expressions/multipleSmartCasts.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/multipleSmartCasts.fir.ir.txt @@ -1,25 +1,23 @@ FILE fqName: fileName:/multipleSmartCasts.kt CLASS INTERFACE name:IC1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IC1 + 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: 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:component1 visibility:public modality:ABSTRACT <> ($this:.IC1) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.IC1 - 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: 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 CLASS INTERFACE name:IC2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IC2 - FUN name:component2 visibility:public modality:ABSTRACT <> ($this:.IC2) returnType:kotlin.String [operator] - $this: VALUE_PARAMETER name: type:.IC2 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 @@ -33,6 +31,8 @@ FILE fqName: fileName:/multipleSmartCasts.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:component2 visibility:public modality:ABSTRACT <> ($this:.IC2) returnType:kotlin.String [operator] + $this: VALUE_PARAMETER name: type:.IC2 FUN name:test visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/multipleSmartCasts.ir.txt b/compiler/testData/ir/irText/expressions/multipleSmartCasts.ir.txt index e508530efb7..be8390bd099 100644 --- a/compiler/testData/ir/irText/expressions/multipleSmartCasts.ir.txt +++ b/compiler/testData/ir/irText/expressions/multipleSmartCasts.ir.txt @@ -1,25 +1,23 @@ FILE fqName: fileName:/multipleSmartCasts.kt CLASS INTERFACE name:IC1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IC1 + 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: 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:component1 visibility:public modality:ABSTRACT <> ($this:.IC1) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.IC1 - 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: 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 CLASS INTERFACE name:IC2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IC2 - FUN name:component2 visibility:public modality:ABSTRACT <> ($this:.IC2) returnType:kotlin.String [operator] - $this: VALUE_PARAMETER name: type:.IC2 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 @@ -33,6 +31,8 @@ FILE fqName: fileName:/multipleSmartCasts.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:component2 visibility:public modality:ABSTRACT <> ($this:.IC2) returnType:kotlin.String [operator] + $this: VALUE_PARAMETER name: type:.IC2 FUN name:test visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/multipleThisReferences.ir.txt b/compiler/testData/ir/irText/expressions/multipleThisReferences.ir.txt index bd93e2c0965..fbfcf4b9ce2 100644 --- a/compiler/testData/ir/irText/expressions/multipleThisReferences.ir.txt +++ b/compiler/testData/ir/irText/expressions/multipleThisReferences.ir.txt @@ -1,42 +1,22 @@ FILE fqName: fileName:/multipleThisReferences.kt - CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.Int declared in .Host.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null + CONSTRUCTOR visibility:public <> (y:kotlin.Int) returnType:.Host [primary] + VALUE_PARAMETER name:y index:0 type:kotlin.Int BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner - CONSTRUCTOR visibility:public <> ($this:.Outer, x:kotlin.Int) returnType:.Outer.Inner [primary] - $outer: VALUE_PARAMETER name: type:.Outer - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.Int declared in .Outer.Inner.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Int - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Outer.Inner - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Outer.Inner' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Outer.Inner declared in .Outer.Inner.' type=.Outer.Inner 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: 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 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public 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 declared in kotlin.Any @@ -50,24 +30,6 @@ FILE fqName: fileName:/multipleThisReferences.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:public <> (y:kotlin.Int) returnType:.Host [primary] - VALUE_PARAMETER name:y index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:y visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - GET_VAR 'y: kotlin.Int declared in .Host.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Int - correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Host - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null FUN name:test visibility:public modality:FINAL <> ($this:.Host, $receiver:.Outer) returnType:.Outer.Inner $this: VALUE_PARAMETER name: type:.Host $receiver: VALUE_PARAMETER name: type:.Outer @@ -76,12 +38,6 @@ FILE fqName: fileName:/multipleThisReferences.kt BLOCK type=.Host.test. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.test. - CONSTRUCTOR visibility:public <> () returnType:.Host.test. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) declared in .Outer.Inner' - $this: GET_VAR ': .Outer declared in .Host.test' type=.Outer origin=null - x: CONST Int type=kotlin.Int value=42 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' PROPERTY name:xx visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -97,14 +53,12 @@ FILE fqName: fileName:/multipleThisReferences.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host.test.' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Host.test. declared in .Host.test..' type=.Host.test. origin=null - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:.Outer.Inner + CONSTRUCTOR visibility:public <> () returnType:.Host.test. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) declared in .Outer.Inner' + $this: GET_VAR ': .Outer declared in .Host.test' type=.Outer origin=null + x: CONST Int type=kotlin.Int value=42 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' 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 .Outer.Inner @@ -118,7 +72,53 @@ FILE fqName: fileName:/multipleThisReferences.kt overridden: public open fun toString (): kotlin.String declared in .Outer.Inner $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:.Outer.Inner CONSTRUCTOR_CALL 'public constructor () declared in .Host.test.' type=.Host.test. origin=OBJECT_LITERAL + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer + CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Outer.Inner.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Outer.Inner + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Outer.Inner' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Outer.Inner declared in .Outer.Inner.' type=.Outer.Inner origin=null + CONSTRUCTOR visibility:public <> ($this:.Outer, x:kotlin.Int) returnType:.Outer.Inner [primary] + $outer: VALUE_PARAMETER name: type:.Outer + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:OPEN visibility:public [inner] 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 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 + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/multipleThisReferences.kt.txt b/compiler/testData/ir/irText/expressions/multipleThisReferences.kt.txt index b25c07ff2ed..ea23dbcd744 100644 --- a/compiler/testData/ir/irText/expressions/multipleThisReferences.kt.txt +++ b/compiler/testData/ir/irText/expressions/multipleThisReferences.kt.txt @@ -1,49 +1,27 @@ -class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - open inner class Inner { - constructor(x: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: Int - field = x - get - - } - -} - class Host { + val y: Int + field = y + get + constructor(y: Int) /* primary */ { super/*Any*/() /* () */ } - val y: Int - field = y - get - fun Outer.test(): Inner { return { // BLOCK local class : Inner { + val xx: Int + field = .().plus(other = .()) + get + constructor() /* primary */ { .super/*Inner*/(x = 42) /* () */ } - val xx: Int - field = .().plus(other = .()) - get - } () @@ -51,3 +29,26 @@ class Host { } } + +class Outer { + open inner class Inner { + val x: Int + field = x + get + + constructor(x: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + diff --git a/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.fir.ir.txt b/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.fir.ir.txt index 16250775eaa..4634ec760dc 100644 --- a/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.fir.ir.txt @@ -1,32 +1,4 @@ FILE fqName: fileName:/nullCheckOnLambdaReturn.kt - FUN name:checkAny visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun checkAny (fn: kotlin.Function0): kotlin.Any declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAny' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION - FUN name:checkAnyN visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any? - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun checkAnyN (fn: kotlin.Function0): kotlin.Any? declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any? origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAnyN' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION - FUN name:id visibility:public modality:FINAL (x:T of .id) returnType:T of .id - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:x index:0 type:T of .id - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun id (x: T of .id): T of .id declared in ' - GET_VAR 'x: T of .id declared in .id' type=T of .id origin=null - FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Any declared in ' - CALL 'public final fun checkAny (fn: kotlin.Function0): kotlin.Any declared in ' type=kotlin.Any origin=null - fn: FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Any declared in .test1' - TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String - CALL 'public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null PROPERTY name:test2 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function0 visibility:private [final,static] EXPRESSION_BODY @@ -69,6 +41,34 @@ FILE fqName: fileName:/nullCheckOnLambdaReturn.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Function0 visibility:private [final,static]' type=kotlin.Function0 origin=null + FUN name:checkAny visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun checkAny (fn: kotlin.Function0): kotlin.Any declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAny' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + FUN name:checkAnyN visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any? + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun checkAnyN (fn: kotlin.Function0): kotlin.Any? declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any? origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAnyN' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + FUN name:id visibility:public modality:FINAL (x:T of .id) returnType:T of .id + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:x index:0 type:T of .id + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun id (x: T of .id): T of .id declared in ' + GET_VAR 'x: T of .id declared in .id' type=T of .id origin=null + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Any declared in ' + CALL 'public final fun checkAny (fn: kotlin.Function0): kotlin.Any declared in ' type=kotlin.Any origin=null + fn: FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Any declared in .test1' + TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String + CALL 'public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.Any? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.Any? declared in ' diff --git a/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.fir.kt.txt b/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.fir.kt.txt index 851a911a784..1b795d74916 100644 --- a/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.fir.kt.txt @@ -1,22 +1,3 @@ -fun checkAny(fn: Function0): Any { - return fn.invoke() -} - -fun checkAnyN(fn: Function0): Any? { - return fn.invoke() -} - -fun id(x: T): T { - return x -} - -fun test1(): Any { - return checkAny(fn = local fun (): Any { - return foo() /*!! String */ - } -) -} - val test2: Function0 field = local fun (): @FlexibleNullability String? { return foo() @@ -38,6 +19,25 @@ val test4: Function0 ) get +fun checkAny(fn: Function0): Any { + return fn.invoke() +} + +fun checkAnyN(fn: Function0): Any? { + return fn.invoke() +} + +fun id(x: T): T { + return x +} + +fun test1(): Any { + return checkAny(fn = local fun (): Any { + return foo() /*!! String */ + } +) +} + fun test5(): Any? { return checkAnyN(fn = local fun (): Any? { return foo() @@ -51,3 +51,4 @@ fun test6(): Any? { } ) } + diff --git a/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.ir.txt b/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.ir.txt index a4e565be28e..d27b4e0f225 100644 --- a/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.ir.txt +++ b/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.ir.txt @@ -1,32 +1,4 @@ FILE fqName: fileName:/nullCheckOnLambdaReturn.kt - FUN name:checkAny visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun checkAny (fn: kotlin.Function0): kotlin.Any declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAny' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION - FUN name:checkAnyN visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any? - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun checkAnyN (fn: kotlin.Function0): kotlin.Any? declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any? origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAnyN' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION - FUN name:id visibility:public modality:FINAL (x:T of .id) returnType:T of .id - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:x index:0 type:T of .id - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun id (x: T of .id): T of .id declared in ' - GET_VAR 'x: T of .id declared in .id' type=T of .id origin=null - FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Any declared in ' - CALL 'public final fun checkAny (fn: kotlin.Function0): kotlin.Any declared in ' type=kotlin.Any origin=null - fn: FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Any declared in .test1' - TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String - CALL 'public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null PROPERTY name:test2 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function0 visibility:private [final,static] EXPRESSION_BODY @@ -70,6 +42,34 @@ FILE fqName: fileName:/nullCheckOnLambdaReturn.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Function0 visibility:private [final,static]' type=kotlin.Function0 origin=null + FUN name:checkAny visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun checkAny (fn: kotlin.Function0): kotlin.Any declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAny' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + FUN name:checkAnyN visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any? + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun checkAnyN (fn: kotlin.Function0): kotlin.Any? declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any? origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAnyN' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + FUN name:id visibility:public modality:FINAL (x:T of .id) returnType:T of .id + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:x index:0 type:T of .id + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun id (x: T of .id): T of .id declared in ' + GET_VAR 'x: T of .id declared in .id' type=T of .id origin=null + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Any declared in ' + CALL 'public final fun checkAny (fn: kotlin.Function0): kotlin.Any declared in ' type=kotlin.Any origin=null + fn: FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Any declared in .test1' + TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String + CALL 'public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.Any? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.Any? declared in ' diff --git a/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.kt.txt b/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.kt.txt index 3a677e4311e..64486492124 100644 --- a/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.kt.txt +++ b/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.kt.txt @@ -1,22 +1,3 @@ -fun checkAny(fn: Function0): Any { - return fn.invoke() -} - -fun checkAnyN(fn: Function0): Any? { - return fn.invoke() -} - -fun id(x: T): T { - return x -} - -fun test1(): Any { - return checkAny(fn = local fun (): Any { - return foo() /*!! String */ - } -) -} - val test2: Function0 field = local fun (): @FlexibleNullability String? { return foo() /*!! String */ @@ -38,6 +19,25 @@ val test4: Function0 ) get +fun checkAny(fn: Function0): Any { + return fn.invoke() +} + +fun checkAnyN(fn: Function0): Any? { + return fn.invoke() +} + +fun id(x: T): T { + return x +} + +fun test1(): Any { + return checkAny(fn = local fun (): Any { + return foo() /*!! String */ + } +) +} + fun test5(): Any? { return checkAnyN(fn = local fun (): Any? { return foo() @@ -51,3 +51,4 @@ fun test6(): Any? { } ) } + diff --git a/compiler/testData/ir/irText/expressions/objectAsCallable.fir.ir.txt b/compiler/testData/ir/irText/expressions/objectAsCallable.fir.ir.txt index 71bff6d0850..b276606cb30 100644 --- a/compiler/testData/ir/irText/expressions/objectAsCallable.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/objectAsCallable.fir.ir.txt @@ -1,90 +1,4 @@ FILE fqName: fileName:/objectAsCallable.kt - CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:private <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public 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 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 - CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En - CONSTRUCTOR visibility:private <> () returnType:.En [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .En - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' - ENUM_ENTRY name:X - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.En> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:.En) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - VALUE_PARAMETER name:other index:0 type:.En - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - FUN name:invoke visibility:public modality:FINAL <> ($receiver:.A, i:kotlin.Int) returnType:kotlin.Int [operator] - $receiver: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun invoke (i: kotlin.Int): kotlin.Int declared in ' - GET_VAR 'i: kotlin.Int declared in .invoke' type=kotlin.Int origin=null - FUN name:invoke visibility:public modality:FINAL <> ($receiver:.En, i:kotlin.Int) returnType:kotlin.Int [operator] - $receiver: VALUE_PARAMETER name: type:.En - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun invoke (i: kotlin.Int): kotlin.Int declared in ' - GET_VAR 'i: kotlin.Int declared in .invoke' type=kotlin.Int origin=null PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final,static] EXPRESSION_BODY @@ -107,3 +21,89 @@ FILE fqName: fileName:/objectAsCallable.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null + CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En + ENUM_ENTRY name:X + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' + CONSTRUCTOR visibility:private <> () returnType:.En [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .En + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:.En) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + VALUE_PARAMETER name:other index:0 type:.En + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.En> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public 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 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:invoke visibility:public modality:FINAL <> ($receiver:.A, i:kotlin.Int) returnType:kotlin.Int [operator] + $receiver: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun invoke (i: kotlin.Int): kotlin.Int declared in ' + GET_VAR 'i: kotlin.Int declared in .invoke' type=kotlin.Int origin=null + FUN name:invoke visibility:public modality:FINAL <> ($receiver:.En, i:kotlin.Int) returnType:kotlin.Int [operator] + $receiver: VALUE_PARAMETER name: type:.En + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun invoke (i: kotlin.Int): kotlin.Int declared in ' + GET_VAR 'i: kotlin.Int declared in .invoke' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/objectAsCallable.fir.kt.txt b/compiler/testData/ir/irText/expressions/objectAsCallable.fir.kt.txt index 4a739c8fa16..1e64df3ef20 100644 --- a/compiler/testData/ir/irText/expressions/objectAsCallable.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/objectAsCallable.fir.kt.txt @@ -1,30 +1,38 @@ -object A { - private constructor() /* primary */ { - super/*Any*/() - /* () */ +val test1: Int + field = A.invoke(i = 42) + get - } - -} +val test2: Int + field = En.X.invoke(i = 42) + get enum class En : Enum { + X = En() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - X = En() + fun valueOf(value: String): En /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): En /* Synthetic body for ENUM_VALUEOF */ - val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } +object A { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + operator fun A.invoke(i: Int): Int { return i } @@ -33,10 +41,3 @@ operator fun En.invoke(i: Int): Int { return i } -val test1: Int - field = A.invoke(i = 42) - get - -val test2: Int - field = En.X.invoke(i = 42) - get diff --git a/compiler/testData/ir/irText/expressions/objectAsCallable.ir.txt b/compiler/testData/ir/irText/expressions/objectAsCallable.ir.txt index e053125a5c2..d7f44080c78 100644 --- a/compiler/testData/ir/irText/expressions/objectAsCallable.ir.txt +++ b/compiler/testData/ir/irText/expressions/objectAsCallable.ir.txt @@ -1,90 +1,4 @@ FILE fqName: fileName:/objectAsCallable.kt - CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:private <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public 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 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 - CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En - CONSTRUCTOR visibility:private <> () returnType:.En [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .En - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' - ENUM_ENTRY name:X - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:.En) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - VALUE_PARAMETER name:other index:0 type:.En - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.En> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN name:invoke visibility:public modality:FINAL <> ($receiver:.A, i:kotlin.Int) returnType:kotlin.Int [operator] - $receiver: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun invoke (i: kotlin.Int): kotlin.Int declared in ' - GET_VAR 'i: kotlin.Int declared in .invoke' type=kotlin.Int origin=null - FUN name:invoke visibility:public modality:FINAL <> ($receiver:.En, i:kotlin.Int) returnType:kotlin.Int [operator] - $receiver: VALUE_PARAMETER name: type:.En - VALUE_PARAMETER name:i index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun invoke (i: kotlin.Int): kotlin.Int declared in ' - GET_VAR 'i: kotlin.Int declared in .invoke' type=kotlin.Int origin=null PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final,static] EXPRESSION_BODY @@ -107,3 +21,89 @@ FILE fqName: fileName:/objectAsCallable.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null + CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En + ENUM_ENTRY name:X + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' + CONSTRUCTOR visibility:private <> () returnType:.En [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .En + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:.En) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + VALUE_PARAMETER name:other index:0 type:.En + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.En> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public 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 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:invoke visibility:public modality:FINAL <> ($receiver:.A, i:kotlin.Int) returnType:kotlin.Int [operator] + $receiver: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun invoke (i: kotlin.Int): kotlin.Int declared in ' + GET_VAR 'i: kotlin.Int declared in .invoke' type=kotlin.Int origin=null + FUN name:invoke visibility:public modality:FINAL <> ($receiver:.En, i:kotlin.Int) returnType:kotlin.Int [operator] + $receiver: VALUE_PARAMETER name: type:.En + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun invoke (i: kotlin.Int): kotlin.Int declared in ' + GET_VAR 'i: kotlin.Int declared in .invoke' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/objectAsCallable.kt.txt b/compiler/testData/ir/irText/expressions/objectAsCallable.kt.txt index 4a739c8fa16..1e64df3ef20 100644 --- a/compiler/testData/ir/irText/expressions/objectAsCallable.kt.txt +++ b/compiler/testData/ir/irText/expressions/objectAsCallable.kt.txt @@ -1,30 +1,38 @@ -object A { - private constructor() /* primary */ { - super/*Any*/() - /* () */ +val test1: Int + field = A.invoke(i = 42) + get - } - -} +val test2: Int + field = En.X.invoke(i = 42) + get enum class En : Enum { + X = En() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - X = En() + fun valueOf(value: String): En /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): En /* Synthetic body for ENUM_VALUEOF */ - val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } +object A { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + operator fun A.invoke(i: Int): Int { return i } @@ -33,10 +41,3 @@ operator fun En.invoke(i: Int): Int { return i } -val test1: Int - field = A.invoke(i = 42) - get - -val test2: Int - field = En.X.invoke(i = 42) - get diff --git a/compiler/testData/ir/irText/expressions/objectByNameInsideObject.ir.txt b/compiler/testData/ir/irText/expressions/objectByNameInsideObject.ir.txt index fd515f05051..a6a1fddce77 100644 --- a/compiler/testData/ir/irText/expressions/objectByNameInsideObject.ir.txt +++ b/compiler/testData/ir/irText/expressions/objectByNameInsideObject.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/objectByNameInsideObject.kt CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base - CONSTRUCTOR visibility:public <> (f1:kotlin.Function0) returnType:.Base [primary] - VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:f1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:f1 type:kotlin.Function0 visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/objectByNameInsideObject.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in .Base' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:f1 type:kotlin.Function0 visibility:private [final]' type=kotlin.Function0 origin=null receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null + CONSTRUCTOR visibility:public <> (f1:kotlin.Function0) returnType:.Base [primary] + VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public 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 declared in kotlin.Any @@ -41,6 +41,19 @@ FILE fqName: fileName:/objectByNameInsideObject.kt RETURN type=kotlin.Nothing from='local final fun (): kotlin.Any declared in .Thing.' GET_OBJECT 'CLASS OBJECT name:Thing modality:FINAL visibility:public superTypes:[.Base]' type=.Thing INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Thing modality:FINAL visibility:public superTypes:[.Base]' + 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 .Base + $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 .Base + $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 .Base + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:test1 visibility:public modality:FINAL <> ($this:.Thing) returnType:.Thing $this: VALUE_PARAMETER name: type:.Thing BLOCK_BODY @@ -59,16 +72,3 @@ FILE fqName: fileName:/objectByNameInsideObject.kt overridden: public final fun (): kotlin.Function0 declared in .Base $this: VALUE_PARAMETER name: type:.Base - 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 .Base - $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 .Base - $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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/objectByNameInsideObject.kt.txt b/compiler/testData/ir/irText/expressions/objectByNameInsideObject.kt.txt index 48a45ae537a..add76a92e09 100644 --- a/compiler/testData/ir/irText/expressions/objectByNameInsideObject.kt.txt +++ b/compiler/testData/ir/irText/expressions/objectByNameInsideObject.kt.txt @@ -1,14 +1,14 @@ open class Base { + val f1: Function0 + field = f1 + get + constructor(f1: Function0) /* primary */ { super/*Any*/() /* () */ } - val f1: Function0 - field = f1 - get - } object Thing : Base { @@ -30,3 +30,4 @@ object Thing : Base { } } + diff --git a/compiler/testData/ir/irText/expressions/objectReference.ir.txt b/compiler/testData/ir/irText/expressions/objectReference.ir.txt index cb201ea7cb0..376ecf0a204 100644 --- a/compiler/testData/ir/irText/expressions/objectReference.ir.txt +++ b/compiler/testData/ir/irText/expressions/objectReference.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/objectReference.kt CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z - CONSTRUCTOR visibility:private <> () returnType:.Z [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:counter visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private EXPRESSION_BODY @@ -24,83 +20,6 @@ FILE fqName: fileName:/objectReference.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Z declared in .Z.' type=.Z origin=null value: GET_VAR ': kotlin.Int declared in .Z.' type=kotlin.Int origin=null - FUN name:foo visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z - BLOCK_BODY - FUN name:bar visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .Z declared in .Z.bar' type=.Z origin=null - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null - $this: GET_VAR ': .Z declared in .Z.bar' type=.Z origin=null - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - CLASS CLASS name:Nested modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.Nested - CONSTRUCTOR visibility:public <> () returnType:.Z.Nested [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Nested modality:FINAL visibility:public superTypes:[kotlin.Any]' - ANONYMOUS_INITIALIZER isStatic=false - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - FUN name:test visibility:public modality:FINAL <> ($this:.Z.Nested) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z.Nested - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - 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: 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:aFun visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z - BLOCK_BODY - CALL 'public final fun withLambda (f: kotlin.Function0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - f: FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z PROPERTY name:aLambda visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0 visibility:private [final] EXPRESSION_BODY @@ -130,10 +49,6 @@ FILE fqName: fileName:/objectReference.kt BLOCK type=.Z.anObject. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.anObject. - CONSTRUCTOR visibility:public <> () returnType:.Z.anObject. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ @@ -146,19 +61,10 @@ FILE fqName: fileName:/objectReference.kt : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - FUN name:test visibility:public modality:FINAL <> ($this:.Z.anObject.) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z.anObject. + CONSTRUCTOR visibility:public <> () returnType:.Z.anObject. [primary] BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - : CONST Int type=kotlin.Int value=1 - CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local 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 declared in kotlin.Any @@ -172,6 +78,19 @@ FILE fqName: fileName:/objectReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> ($this:.Z.anObject.) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.anObject. + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z CONSTRUCTOR_CALL 'public constructor () declared in .Z.anObject.' type=.Z.anObject. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Any correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] @@ -180,6 +99,54 @@ FILE fqName: fileName:/objectReference.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .Z' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR ': .Z declared in .Z.' type=.Z origin=null + CLASS CLASS name:Nested modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.Nested + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + CONSTRUCTOR visibility:public <> () returnType:.Z.Nested [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Nested modality:FINAL visibility:public 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 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:test visibility:public modality:FINAL <> ($this:.Z.Nested) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.Nested + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + CONSTRUCTOR visibility:private <> () returnType:.Z [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Z modality:FINAL visibility:public 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 declared in kotlin.Any @@ -193,6 +160,39 @@ FILE fqName: fileName:/objectReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:aFun visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + CALL 'public final fun withLambda (f: kotlin.Function0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + f: FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + FUN name:bar visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .Z declared in .Z.bar' type=.Z origin=null + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + $this: GET_VAR ': .Z declared in .Z.bar' type=.Z origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + FUN name:foo visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY FUN name:test visibility:public modality:FINAL <> ($receiver:.Z) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.Z BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/objectReference.kt.txt b/compiler/testData/ir/irText/expressions/objectReference.kt.txt index 34456abcd4a..011ec38cb2e 100644 --- a/compiler/testData/ir/irText/expressions/objectReference.kt.txt +++ b/compiler/testData/ir/irText/expressions/objectReference.kt.txt @@ -1,58 +1,9 @@ object Z { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - var counter: Int field = 0 get set - fun foo() { - } - - fun bar() { - .( = 1) - .foo() - Z.( = 1) - Z.foo() - } - - class Nested { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - init { - Z.( = 1) - Z.foo() - Z.( = 1) - Z.foo() - } - - fun test() { - Z.( = 1) - Z.foo() - Z.( = 1) - Z.foo() - } - - } - - fun aFun() { - withLambda(f = local fun () { - Z.( = 1) - Z.foo() - Z.( = 1) - Z.foo() - } -) - } - val aLambda: Function0 field = local fun () { Z.( = 1) @@ -66,12 +17,6 @@ object Z { val anObject: Any field = { // BLOCK local class { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - init { Z.( = 1) Z.foo() @@ -79,6 +24,12 @@ object Z { Z.foo() } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + fun test() { Z.( = 1) Z.foo() @@ -92,6 +43,55 @@ object Z { } get + class Nested { + init { + Z.( = 1) + Z.foo() + Z.( = 1) + Z.foo() + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun test() { + Z.( = 1) + Z.foo() + Z.( = 1) + Z.foo() + } + + } + + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun aFun() { + withLambda(f = local fun () { + Z.( = 1) + Z.foo() + Z.( = 1) + Z.foo() + } +) + } + + fun bar() { + .( = 1) + .foo() + Z.( = 1) + Z.foo() + } + + fun foo() { + } + } fun Z.test() { diff --git a/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.ir.txt b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.ir.txt index e9d24e063cb..59b6e88686b 100644 --- a/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.ir.txt +++ b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/objectReferenceInClosureInSuperConstructorCall.kt CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base - CONSTRUCTOR visibility:public <> (lambda:kotlin.Function0) returnType:.Base [primary] - VALUE_PARAMETER name:lambda index:0 type:kotlin.Function0 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' PROPERTY name:lambda visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:lambda type:kotlin.Function0 visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/objectReferenceInClosureInSuperConstructorCall.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in .Base' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:lambda type:kotlin.Function0 visibility:private [final]' type=kotlin.Function0 origin=null receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null + CONSTRUCTOR visibility:public <> (lambda:kotlin.Function0) returnType:.Base [primary] + VALUE_PARAMETER name:lambda index:0 type:kotlin.Function0 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:ABSTRACT visibility:public 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 declared in kotlin.Any @@ -41,14 +41,6 @@ FILE fqName: fileName:/objectReferenceInClosureInSuperConstructorCall.kt RETURN type=kotlin.Nothing from='local final fun (): kotlin.Any declared in .Test.' GET_OBJECT 'CLASS OBJECT name:Test modality:FINAL visibility:public superTypes:[.Base]' type=.Test INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Test modality:FINAL visibility:public superTypes:[.Base]' - PROPERTY FAKE_OVERRIDE name:lambda visibility:public modality:FINAL [fake_override,val] - overridden: - public final lambda: kotlin.Function0 - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.Function0 [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:lambda visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Function0 declared in .Base - $this: VALUE_PARAMETER name: type:.Base 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 .Base @@ -62,3 +54,11 @@ FILE fqName: fileName:/objectReferenceInClosureInSuperConstructorCall.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:lambda visibility:public modality:FINAL [fake_override,val] + overridden: + public final lambda: kotlin.Function0 + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.Function0 [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:lambda visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Function0 declared in .Base + $this: VALUE_PARAMETER name: type:.Base diff --git a/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.kt.txt b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.kt.txt index b2e99c61e65..71198c315e3 100644 --- a/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.kt.txt +++ b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.kt.txt @@ -1,14 +1,14 @@ abstract class Base { + val lambda: Function0 + field = lambda + get + constructor(lambda: Function0) /* primary */ { super/*Any*/() /* () */ } - val lambda: Function0 - field = lambda - get - } object Test : Base { @@ -22,3 +22,4 @@ object Test : Base { } } + diff --git a/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.ir.txt b/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.ir.txt index b64e5fdd5f5..f605ea541be 100644 --- a/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.ir.txt +++ b/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/objectReferenceInFieldInitializer.kt CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:private <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:a visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -41,6 +37,10 @@ FILE fqName: fileName:/objectReferenceInFieldInitializer.kt RETURN type=kotlin.Nothing from='private final fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.kt.txt b/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.kt.txt index 4fa29836e27..bf7c3bf770c 100644 --- a/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.kt.txt +++ b/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.kt.txt @@ -1,10 +1,4 @@ object A { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - private val a: String field = "$" private get @@ -17,4 +11,11 @@ object A { field = 10000 private get + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/expressions/outerClassInstanceReference.ir.txt b/compiler/testData/ir/irText/expressions/outerClassInstanceReference.ir.txt index 4cc0e27a257..9b3fc6834a2 100644 --- a/compiler/testData/ir/irText/expressions/outerClassInstanceReference.ir.txt +++ b/compiler/testData/ir/irText/expressions/outerClassInstanceReference.ir.txt @@ -1,13 +1,6 @@ FILE fqName: fileName:/outerClassInstanceReference.kt CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:outer visibility:public modality:FINAL <> ($this:.Outer) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Outer - BLOCK_BODY CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner CONSTRUCTOR visibility:public <> ($this:.Outer) returnType:.Outer.Inner [primary] @@ -15,12 +8,6 @@ FILE fqName: fileName:/outerClassInstanceReference.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - FUN name:inner visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Outer.Inner - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun inner (): kotlin.Unit declared in .Outer.Inner' - CALL 'public final fun outer (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null - $this: GET_VAR ': .Outer declared in .Outer' type=.Outer 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 @@ -34,6 +21,16 @@ FILE fqName: fileName:/outerClassInstanceReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:inner visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun inner (): kotlin.Unit declared in .Outer.Inner' + CALL 'public final fun outer (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null + $this: GET_VAR ': .Outer declared in .Outer' type=.Outer origin=null + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any @@ -47,3 +44,6 @@ FILE fqName: fileName:/outerClassInstanceReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:outer visibility:public modality:FINAL <> ($this:.Outer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/outerClassInstanceReference.kt.txt b/compiler/testData/ir/irText/expressions/outerClassInstanceReference.kt.txt index b34d54aeee8..28459e267be 100644 --- a/compiler/testData/ir/irText/expressions/outerClassInstanceReference.kt.txt +++ b/compiler/testData/ir/irText/expressions/outerClassInstanceReference.kt.txt @@ -1,13 +1,4 @@ class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun outer() { - } - inner class Inner { constructor() /* primary */ { super/*Any*/() @@ -21,4 +12,14 @@ class Outer { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun outer() { + } + } + diff --git a/compiler/testData/ir/irText/expressions/posptonedPCLACallInsideStringInterpolation.ir.txt b/compiler/testData/ir/irText/expressions/posptonedPCLACallInsideStringInterpolation.ir.txt index 03e0053c7e2..e172261fd4d 100644 --- a/compiler/testData/ir/irText/expressions/posptonedPCLACallInsideStringInterpolation.ir.txt +++ b/compiler/testData/ir/irText/expressions/posptonedPCLACallInsideStringInterpolation.ir.txt @@ -6,10 +6,6 @@ FILE fqName: fileName:/posptonedPCLACallInsideStringInterpolation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Controller modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:yield visibility:public modality:FINAL <> ($this:.Controller.Controller>, k:K of .Controller) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Controller.Controller> - VALUE_PARAMETER name:k index:0 type:K of .Controller - BLOCK_BODY 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 @@ -23,16 +19,10 @@ FILE fqName: fileName:/posptonedPCLACallInsideStringInterpolation.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:generate visibility:public modality:FINAL (lambda:@[ExtensionFunctionType] kotlin.Function1<.Controller.generate>, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:lambda index:0 type:@[ExtensionFunctionType] kotlin.Function1<.Controller.generate>, kotlin.Unit> - BLOCK_BODY - FUN name:id visibility:public modality:FINAL (e:E of .id) returnType:E of .id - TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:e index:0 type:E of .id - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun id (e: E of .id): E of .id declared in ' - GET_VAR 'e: E of .id declared in .id' type=E of .id origin=null + FUN name:yield visibility:public modality:FINAL <> ($this:.Controller.Controller>, k:K of .Controller) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Controller.Controller> + VALUE_PARAMETER name:k index:0 type:K of .Controller + BLOCK_BODY FUN name:bar visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY @@ -52,3 +42,13 @@ FILE fqName: fileName:/posptonedPCLACallInsideStringInterpolation.kt CALL 'public final fun yield (k: K of .Controller): kotlin.Unit declared in .Controller' type=kotlin.Unit origin=null $this: GET_VAR '$this$generate: .Controller declared in .foo.' type=.Controller origin=null k: CONST String type=kotlin.String value="" + FUN name:generate visibility:public modality:FINAL (lambda:@[ExtensionFunctionType] kotlin.Function1<.Controller.generate>, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:lambda index:0 type:@[ExtensionFunctionType] kotlin.Function1<.Controller.generate>, kotlin.Unit> + BLOCK_BODY + FUN name:id visibility:public modality:FINAL (e:E of .id) returnType:E of .id + TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:e index:0 type:E of .id + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun id (e: E of .id): E of .id declared in ' + GET_VAR 'e: E of .id declared in .id' type=E of .id origin=null diff --git a/compiler/testData/ir/irText/expressions/posptonedPCLACallInsideStringInterpolation.kt.txt b/compiler/testData/ir/irText/expressions/posptonedPCLACallInsideStringInterpolation.kt.txt index de841287618..0844b03c2fd 100644 --- a/compiler/testData/ir/irText/expressions/posptonedPCLACallInsideStringInterpolation.kt.txt +++ b/compiler/testData/ir/irText/expressions/posptonedPCLACallInsideStringInterpolation.kt.txt @@ -10,13 +10,6 @@ class Controller { } -fun generate(lambda: @ExtensionFunctionType Function1, Unit>) { -} - -fun id(e: E): E { - return e -} - fun bar(s: String) { } @@ -27,3 +20,11 @@ fun foo() { } ) } + +fun generate(lambda: @ExtensionFunctionType Function1, Unit>) { +} + +fun id(e: E): E { + return e +} + diff --git a/compiler/testData/ir/irText/expressions/primitiveComparisons.ir.txt b/compiler/testData/ir/irText/expressions/primitiveComparisons.ir.txt index dda66849909..a6685388e13 100644 --- a/compiler/testData/ir/irText/expressions/primitiveComparisons.ir.txt +++ b/compiler/testData/ir/irText/expressions/primitiveComparisons.ir.txt @@ -39,46 +39,70 @@ FILE fqName: fileName:/primitiveComparisons.kt $this: GET_VAR 'a: kotlin.Byte declared in .btest4' type=kotlin.Byte origin=null arg1: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Byte' type=kotlin.Int origin=null $this: GET_VAR 'b: kotlin.Byte declared in .btest4' type=kotlin.Byte origin=null - FUN name:stest1 visibility:public modality:FINAL <> (a:kotlin.Short, b:kotlin.Short) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Short - VALUE_PARAMETER name:b index:1 type:kotlin.Short + FUN name:dtest1 visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Double + VALUE_PARAMETER name:b index:1 type:kotlin.Double BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun stest1 (a: kotlin.Short, b: kotlin.Short): kotlin.Boolean declared in ' - CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT - arg0: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null - $this: GET_VAR 'a: kotlin.Short declared in .stest1' type=kotlin.Short origin=null - arg1: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null - $this: GET_VAR 'b: kotlin.Short declared in .stest1' type=kotlin.Short origin=null - FUN name:stest2 visibility:public modality:FINAL <> (a:kotlin.Short, b:kotlin.Short) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Short - VALUE_PARAMETER name:b index:1 type:kotlin.Short + RETURN type=kotlin.Nothing from='public final fun dtest1 (a: kotlin.Double, b: kotlin.Double): kotlin.Boolean declared in ' + CALL 'public final fun greater (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT + arg0: GET_VAR 'a: kotlin.Double declared in .dtest1' type=kotlin.Double origin=null + arg1: GET_VAR 'b: kotlin.Double declared in .dtest1' type=kotlin.Double origin=null + FUN name:dtest2 visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Double + VALUE_PARAMETER name:b index:1 type:kotlin.Double BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun stest2 (a: kotlin.Short, b: kotlin.Short): kotlin.Boolean declared in ' - CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null - $this: GET_VAR 'a: kotlin.Short declared in .stest2' type=kotlin.Short origin=null - arg1: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null - $this: GET_VAR 'b: kotlin.Short declared in .stest2' type=kotlin.Short origin=null - FUN name:stest3 visibility:public modality:FINAL <> (a:kotlin.Short, b:kotlin.Short) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Short - VALUE_PARAMETER name:b index:1 type:kotlin.Short + RETURN type=kotlin.Nothing from='public final fun dtest2 (a: kotlin.Double, b: kotlin.Double): kotlin.Boolean declared in ' + CALL 'public final fun less (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'a: kotlin.Double declared in .dtest2' type=kotlin.Double origin=null + arg1: GET_VAR 'b: kotlin.Double declared in .dtest2' type=kotlin.Double origin=null + FUN name:dtest3 visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Double + VALUE_PARAMETER name:b index:1 type:kotlin.Double BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun stest3 (a: kotlin.Short, b: kotlin.Short): kotlin.Boolean declared in ' - CALL 'public final fun greaterOrEqual (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ - arg0: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null - $this: GET_VAR 'a: kotlin.Short declared in .stest3' type=kotlin.Short origin=null - arg1: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null - $this: GET_VAR 'b: kotlin.Short declared in .stest3' type=kotlin.Short origin=null - FUN name:stest4 visibility:public modality:FINAL <> (a:kotlin.Short, b:kotlin.Short) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Short - VALUE_PARAMETER name:b index:1 type:kotlin.Short + RETURN type=kotlin.Nothing from='public final fun dtest3 (a: kotlin.Double, b: kotlin.Double): kotlin.Boolean declared in ' + CALL 'public final fun greaterOrEqual (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ + arg0: GET_VAR 'a: kotlin.Double declared in .dtest3' type=kotlin.Double origin=null + arg1: GET_VAR 'b: kotlin.Double declared in .dtest3' type=kotlin.Double origin=null + FUN name:dtest4 visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Double + VALUE_PARAMETER name:b index:1 type:kotlin.Double BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun stest4 (a: kotlin.Short, b: kotlin.Short): kotlin.Boolean declared in ' - CALL 'public final fun lessOrEqual (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LTEQ - arg0: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null - $this: GET_VAR 'a: kotlin.Short declared in .stest4' type=kotlin.Short origin=null - arg1: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null - $this: GET_VAR 'b: kotlin.Short declared in .stest4' type=kotlin.Short origin=null + RETURN type=kotlin.Nothing from='public final fun dtest4 (a: kotlin.Double, b: kotlin.Double): kotlin.Boolean declared in ' + CALL 'public final fun lessOrEqual (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LTEQ + arg0: GET_VAR 'a: kotlin.Double declared in .dtest4' type=kotlin.Double origin=null + arg1: GET_VAR 'b: kotlin.Double declared in .dtest4' type=kotlin.Double origin=null + FUN name:ftest1 visibility:public modality:FINAL <> (a:kotlin.Float, b:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Float + VALUE_PARAMETER name:b index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ftest1 (a: kotlin.Float, b: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun greater (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT + arg0: GET_VAR 'a: kotlin.Float declared in .ftest1' type=kotlin.Float origin=null + arg1: GET_VAR 'b: kotlin.Float declared in .ftest1' type=kotlin.Float origin=null + FUN name:ftest2 visibility:public modality:FINAL <> (a:kotlin.Float, b:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Float + VALUE_PARAMETER name:b index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ftest2 (a: kotlin.Float, b: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun less (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'a: kotlin.Float declared in .ftest2' type=kotlin.Float origin=null + arg1: GET_VAR 'b: kotlin.Float declared in .ftest2' type=kotlin.Float origin=null + FUN name:ftest3 visibility:public modality:FINAL <> (a:kotlin.Float, b:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Float + VALUE_PARAMETER name:b index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ftest3 (a: kotlin.Float, b: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun greaterOrEqual (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ + arg0: GET_VAR 'a: kotlin.Float declared in .ftest3' type=kotlin.Float origin=null + arg1: GET_VAR 'b: kotlin.Float declared in .ftest3' type=kotlin.Float origin=null + FUN name:ftest4 visibility:public modality:FINAL <> (a:kotlin.Float, b:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Float + VALUE_PARAMETER name:b index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ftest4 (a: kotlin.Float, b: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun lessOrEqual (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LTEQ + arg0: GET_VAR 'a: kotlin.Float declared in .ftest4' type=kotlin.Float origin=null + arg1: GET_VAR 'b: kotlin.Float declared in .ftest4' type=kotlin.Float origin=null FUN name:itest1 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Boolean VALUE_PARAMETER name:a index:0 type:kotlin.Int VALUE_PARAMETER name:b index:1 type:kotlin.Int @@ -143,67 +167,43 @@ FILE fqName: fileName:/primitiveComparisons.kt CALL 'public final fun lessOrEqual (arg0: kotlin.Long, arg1: kotlin.Long): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LTEQ arg0: GET_VAR 'a: kotlin.Long declared in .ltest4' type=kotlin.Long origin=null arg1: GET_VAR 'b: kotlin.Long declared in .ltest4' type=kotlin.Long origin=null - FUN name:ftest1 visibility:public modality:FINAL <> (a:kotlin.Float, b:kotlin.Float) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Float - VALUE_PARAMETER name:b index:1 type:kotlin.Float + FUN name:stest1 visibility:public modality:FINAL <> (a:kotlin.Short, b:kotlin.Short) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Short + VALUE_PARAMETER name:b index:1 type:kotlin.Short BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun ftest1 (a: kotlin.Float, b: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public final fun greater (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT - arg0: GET_VAR 'a: kotlin.Float declared in .ftest1' type=kotlin.Float origin=null - arg1: GET_VAR 'b: kotlin.Float declared in .ftest1' type=kotlin.Float origin=null - FUN name:ftest2 visibility:public modality:FINAL <> (a:kotlin.Float, b:kotlin.Float) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Float - VALUE_PARAMETER name:b index:1 type:kotlin.Float + RETURN type=kotlin.Nothing from='public final fun stest1 (a: kotlin.Short, b: kotlin.Short): kotlin.Boolean declared in ' + CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT + arg0: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Short declared in .stest1' type=kotlin.Short origin=null + arg1: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null + $this: GET_VAR 'b: kotlin.Short declared in .stest1' type=kotlin.Short origin=null + FUN name:stest2 visibility:public modality:FINAL <> (a:kotlin.Short, b:kotlin.Short) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Short + VALUE_PARAMETER name:b index:1 type:kotlin.Short BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun ftest2 (a: kotlin.Float, b: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public final fun less (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: GET_VAR 'a: kotlin.Float declared in .ftest2' type=kotlin.Float origin=null - arg1: GET_VAR 'b: kotlin.Float declared in .ftest2' type=kotlin.Float origin=null - FUN name:ftest3 visibility:public modality:FINAL <> (a:kotlin.Float, b:kotlin.Float) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Float - VALUE_PARAMETER name:b index:1 type:kotlin.Float + RETURN type=kotlin.Nothing from='public final fun stest2 (a: kotlin.Short, b: kotlin.Short): kotlin.Boolean declared in ' + CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Short declared in .stest2' type=kotlin.Short origin=null + arg1: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null + $this: GET_VAR 'b: kotlin.Short declared in .stest2' type=kotlin.Short origin=null + FUN name:stest3 visibility:public modality:FINAL <> (a:kotlin.Short, b:kotlin.Short) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Short + VALUE_PARAMETER name:b index:1 type:kotlin.Short BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun ftest3 (a: kotlin.Float, b: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public final fun greaterOrEqual (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ - arg0: GET_VAR 'a: kotlin.Float declared in .ftest3' type=kotlin.Float origin=null - arg1: GET_VAR 'b: kotlin.Float declared in .ftest3' type=kotlin.Float origin=null - FUN name:ftest4 visibility:public modality:FINAL <> (a:kotlin.Float, b:kotlin.Float) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Float - VALUE_PARAMETER name:b index:1 type:kotlin.Float + RETURN type=kotlin.Nothing from='public final fun stest3 (a: kotlin.Short, b: kotlin.Short): kotlin.Boolean declared in ' + CALL 'public final fun greaterOrEqual (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ + arg0: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Short declared in .stest3' type=kotlin.Short origin=null + arg1: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null + $this: GET_VAR 'b: kotlin.Short declared in .stest3' type=kotlin.Short origin=null + FUN name:stest4 visibility:public modality:FINAL <> (a:kotlin.Short, b:kotlin.Short) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Short + VALUE_PARAMETER name:b index:1 type:kotlin.Short BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun ftest4 (a: kotlin.Float, b: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public final fun lessOrEqual (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LTEQ - arg0: GET_VAR 'a: kotlin.Float declared in .ftest4' type=kotlin.Float origin=null - arg1: GET_VAR 'b: kotlin.Float declared in .ftest4' type=kotlin.Float origin=null - FUN name:dtest1 visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Double - VALUE_PARAMETER name:b index:1 type:kotlin.Double - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun dtest1 (a: kotlin.Double, b: kotlin.Double): kotlin.Boolean declared in ' - CALL 'public final fun greater (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT - arg0: GET_VAR 'a: kotlin.Double declared in .dtest1' type=kotlin.Double origin=null - arg1: GET_VAR 'b: kotlin.Double declared in .dtest1' type=kotlin.Double origin=null - FUN name:dtest2 visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Double - VALUE_PARAMETER name:b index:1 type:kotlin.Double - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun dtest2 (a: kotlin.Double, b: kotlin.Double): kotlin.Boolean declared in ' - CALL 'public final fun less (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: GET_VAR 'a: kotlin.Double declared in .dtest2' type=kotlin.Double origin=null - arg1: GET_VAR 'b: kotlin.Double declared in .dtest2' type=kotlin.Double origin=null - FUN name:dtest3 visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Double - VALUE_PARAMETER name:b index:1 type:kotlin.Double - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun dtest3 (a: kotlin.Double, b: kotlin.Double): kotlin.Boolean declared in ' - CALL 'public final fun greaterOrEqual (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ - arg0: GET_VAR 'a: kotlin.Double declared in .dtest3' type=kotlin.Double origin=null - arg1: GET_VAR 'b: kotlin.Double declared in .dtest3' type=kotlin.Double origin=null - FUN name:dtest4 visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Double - VALUE_PARAMETER name:b index:1 type:kotlin.Double - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun dtest4 (a: kotlin.Double, b: kotlin.Double): kotlin.Boolean declared in ' - CALL 'public final fun lessOrEqual (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LTEQ - arg0: GET_VAR 'a: kotlin.Double declared in .dtest4' type=kotlin.Double origin=null - arg1: GET_VAR 'b: kotlin.Double declared in .dtest4' type=kotlin.Double origin=null + RETURN type=kotlin.Nothing from='public final fun stest4 (a: kotlin.Short, b: kotlin.Short): kotlin.Boolean declared in ' + CALL 'public final fun lessOrEqual (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LTEQ + arg0: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Short declared in .stest4' type=kotlin.Short origin=null + arg1: CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Short' type=kotlin.Int origin=null + $this: GET_VAR 'b: kotlin.Short declared in .stest4' type=kotlin.Short origin=null diff --git a/compiler/testData/ir/irText/expressions/primitiveComparisons.kt.txt b/compiler/testData/ir/irText/expressions/primitiveComparisons.kt.txt index 91ab888bf11..a7f0a092a66 100644 --- a/compiler/testData/ir/irText/expressions/primitiveComparisons.kt.txt +++ b/compiler/testData/ir/irText/expressions/primitiveComparisons.kt.txt @@ -14,20 +14,36 @@ fun btest4(a: Byte, b: Byte): Boolean { return lessOrEqual(arg0 = a.toInt(), arg1 = b.toInt()) } -fun stest1(a: Short, b: Short): Boolean { - return greater(arg0 = a.toInt(), arg1 = b.toInt()) +fun dtest1(a: Double, b: Double): Boolean { + return greater(arg0 = a, arg1 = b) } -fun stest2(a: Short, b: Short): Boolean { - return less(arg0 = a.toInt(), arg1 = b.toInt()) +fun dtest2(a: Double, b: Double): Boolean { + return less(arg0 = a, arg1 = b) } -fun stest3(a: Short, b: Short): Boolean { - return greaterOrEqual(arg0 = a.toInt(), arg1 = b.toInt()) +fun dtest3(a: Double, b: Double): Boolean { + return greaterOrEqual(arg0 = a, arg1 = b) } -fun stest4(a: Short, b: Short): Boolean { - return lessOrEqual(arg0 = a.toInt(), arg1 = b.toInt()) +fun dtest4(a: Double, b: Double): Boolean { + return lessOrEqual(arg0 = a, arg1 = b) +} + +fun ftest1(a: Float, b: Float): Boolean { + return greater(arg0 = a, arg1 = b) +} + +fun ftest2(a: Float, b: Float): Boolean { + return less(arg0 = a, arg1 = b) +} + +fun ftest3(a: Float, b: Float): Boolean { + return greaterOrEqual(arg0 = a, arg1 = b) +} + +fun ftest4(a: Float, b: Float): Boolean { + return lessOrEqual(arg0 = a, arg1 = b) } fun itest1(a: Int, b: Int): Boolean { @@ -62,34 +78,19 @@ fun ltest4(a: Long, b: Long): Boolean { return lessOrEqual(arg0 = a, arg1 = b) } -fun ftest1(a: Float, b: Float): Boolean { - return greater(arg0 = a, arg1 = b) +fun stest1(a: Short, b: Short): Boolean { + return greater(arg0 = a.toInt(), arg1 = b.toInt()) } -fun ftest2(a: Float, b: Float): Boolean { - return less(arg0 = a, arg1 = b) +fun stest2(a: Short, b: Short): Boolean { + return less(arg0 = a.toInt(), arg1 = b.toInt()) } -fun ftest3(a: Float, b: Float): Boolean { - return greaterOrEqual(arg0 = a, arg1 = b) +fun stest3(a: Short, b: Short): Boolean { + return greaterOrEqual(arg0 = a.toInt(), arg1 = b.toInt()) } -fun ftest4(a: Float, b: Float): Boolean { - return lessOrEqual(arg0 = a, arg1 = b) +fun stest4(a: Short, b: Short): Boolean { + return lessOrEqual(arg0 = a.toInt(), arg1 = b.toInt()) } -fun dtest1(a: Double, b: Double): Boolean { - return greater(arg0 = a, arg1 = b) -} - -fun dtest2(a: Double, b: Double): Boolean { - return less(arg0 = a, arg1 = b) -} - -fun dtest3(a: Double, b: Double): Boolean { - return greaterOrEqual(arg0 = a, arg1 = b) -} - -fun dtest4(a: Double, b: Double): Boolean { - return lessOrEqual(arg0 = a, arg1 = b) -} diff --git a/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.ir.txt b/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.ir.txt index d9484b7689c..b8d2c028938 100644 --- a/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.ir.txt +++ b/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.ir.txt @@ -53,6 +53,40 @@ FILE fqName: fileName:/primitivesImplicitConversions.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Byte declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Byte visibility:private [final,static]' type=kotlin.Byte origin=null + CLASS CLASS name:TestImplicitArguments modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestImplicitArguments + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Long visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Long declared in .TestImplicitArguments.' type=kotlin.Long origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestImplicitArguments) returnType:kotlin.Long + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestImplicitArguments + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in .TestImplicitArguments' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Long visibility:private [final]' type=kotlin.Long origin=null + receiver: GET_VAR ': .TestImplicitArguments declared in .TestImplicitArguments.' type=.TestImplicitArguments origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Long) returnType:.TestImplicitArguments [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Long + EXPRESSION_BODY + CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestImplicitArguments modality:FINAL visibility:public 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 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:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:test1 type:kotlin.Int? [val] @@ -78,37 +112,3 @@ FILE fqName: fileName:/primitivesImplicitConversions.kt CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: CONST Int type=kotlin.Int value=1 BLOCK_BODY - CLASS CLASS name:TestImplicitArguments modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestImplicitArguments - CONSTRUCTOR visibility:public <> (x:kotlin.Long) returnType:.TestImplicitArguments [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Long - EXPRESSION_BODY - CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CONST Int type=kotlin.Int value=1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestImplicitArguments modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Long visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.Long declared in .TestImplicitArguments.' type=kotlin.Long origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestImplicitArguments) returnType:kotlin.Long - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.TestImplicitArguments - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in .TestImplicitArguments' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Long visibility:private [final]' type=kotlin.Long origin=null - receiver: GET_VAR ': .TestImplicitArguments declared in .TestImplicitArguments.' type=.TestImplicitArguments 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: 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 diff --git a/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.kt.txt b/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.kt.txt index d92b6394649..bfd92549409 100644 --- a/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.kt.txt +++ b/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.kt.txt @@ -22,6 +22,19 @@ val test6: Byte field = -42B get +class TestImplicitArguments { + val x: Long + field = x + get + + constructor(x: Long = 1.unaryMinus()) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + fun test() { val test1: Int? = 42 val test2: Long = 42L @@ -35,15 +48,3 @@ fun test() { fun testImplicitArguments(x: Long = 1.unaryMinus()) { } -class TestImplicitArguments { - constructor(x: Long = 1.unaryMinus()) /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: Long - field = x - get - -} diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.fir.ir.txt b/compiler/testData/ir/irText/expressions/propertyReferences.fir.ir.txt index 18c805067ee..400fa17871d 100644 --- a/compiler/testData/ir/irText/expressions/propertyReferences.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/propertyReferences.fir.ir.txt @@ -1,93 +1,4 @@ FILE fqName: fileName:/propertyReferences.kt - CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - CONSTRUCTOR visibility:private <> () returnType:.Delegate [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:kProp index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any): kotlin.Int declared in .Delegate' - CONST Int type=kotlin.Int value=1 - FUN name:setValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any, value:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:kProp index:1 type:kotlin.Any - VALUE_PARAMETER name:value index:2 type:kotlin.Int - BLOCK_BODY - 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: 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 - CLASS CLASS name:C modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public superTypes:[kotlin.Any]' - PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null - PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:protected modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int 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: 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 PROPERTY name:valWithBackingField visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:valWithBackingField type:kotlin.Int visibility:private [final,static] EXPRESSION_BODY @@ -154,12 +65,6 @@ FILE fqName: fileName:/propertyReferences.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KMutableProperty0 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_varWithBackingFieldAndAccessors type:kotlin.reflect.KMutableProperty0 visibility:private [final,static]' type=kotlin.reflect.KMutableProperty0 origin=null - PROPERTY name:valWithAccessors visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:valWithAccessors visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=1 PROPERTY name:test_valWithAccessors visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_valWithAccessors type:kotlin.reflect.KProperty0 visibility:private [final,static] EXPRESSION_BODY @@ -169,16 +74,6 @@ FILE fqName: fileName:/propertyReferences.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KProperty0 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_valWithAccessors type:kotlin.reflect.KProperty0 visibility:private [final,static]' type=kotlin.reflect.KProperty0 origin=null - PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=1 - FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY PROPERTY name:test_varWithAccessors visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_varWithAccessors type:kotlin.reflect.KMutableProperty0 visibility:private [final,static] EXPRESSION_BODY @@ -294,3 +189,108 @@ FILE fqName: fileName:/propertyReferences.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KProperty1<.C, kotlin.Int> declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_varWithProtectedSet type:kotlin.reflect.KProperty1<.C, kotlin.Int> visibility:private [final,static]' type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=null + CLASS CLASS name:C modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:protected modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public 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 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 + CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate + CONSTRUCTOR visibility:private <> () returnType:.Delegate [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Delegate modality:FINAL visibility:public 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 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:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:kProp index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any): kotlin.Int declared in .Delegate' + CONST Int type=kotlin.Int value=1 + FUN name:setValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any, value:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:kProp index:1 type:kotlin.Any + VALUE_PARAMETER name:value index:2 type:kotlin.Int + BLOCK_BODY + PROPERTY name:valWithAccessors visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:valWithAccessors visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 + PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 + FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.fir.kt.txt b/compiler/testData/ir/irText/expressions/propertyReferences.fir.kt.txt index c7ccf5243df..47c964ba10b 100644 --- a/compiler/testData/ir/irText/expressions/propertyReferences.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/propertyReferences.fir.kt.txt @@ -1,38 +1,3 @@ -object Delegate { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - operator fun getValue(thisRef: Any?, kProp: Any): Int { - return 1 - } - - operator fun setValue(thisRef: Any?, kProp: Any, value: Int) { - } - -} - -open class C { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - var varWithPrivateSet: Int - field = 1 - get - private set - - var varWithProtectedSet: Int - field = 1 - get - protected set - -} - val valWithBackingField: Int field = 1 get @@ -63,22 +28,10 @@ val test_varWithBackingFieldAndAccessors: KMutableProperty0 field = ::varWithBackingFieldAndAccessors get -val valWithAccessors: Int - get(): Int { - return 1 - } - val test_valWithAccessors: KProperty0 field = ::valWithAccessors get -var varWithAccessors: Int - get(): Int { - return 1 - } - set(value: Int) { - } - val test_varWithAccessors: KMutableProperty0 field = ::varWithAccessors get @@ -129,3 +82,51 @@ val test_varWithPrivateSet: KProperty1 val test_varWithProtectedSet: KProperty1 field = C::varWithProtectedSet get + +open class C { + var varWithPrivateSet: Int + field = 1 + get + private set + + var varWithProtectedSet: Int + field = 1 + get + protected set + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +object Delegate { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + operator fun getValue(thisRef: Any?, kProp: Any): Int { + return 1 + } + + operator fun setValue(thisRef: Any?, kProp: Any, value: Int) { + } + +} + +val valWithAccessors: Int + get(): Int { + return 1 + } + +var varWithAccessors: Int + get(): Int { + return 1 + } + set(value: Int) { + } + diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.ir.txt b/compiler/testData/ir/irText/expressions/propertyReferences.ir.txt index 34c3dc9fb65..250c4af1596 100644 --- a/compiler/testData/ir/irText/expressions/propertyReferences.ir.txt +++ b/compiler/testData/ir/irText/expressions/propertyReferences.ir.txt @@ -1,93 +1,4 @@ FILE fqName: fileName:/propertyReferences.kt - CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - CONSTRUCTOR visibility:private <> () returnType:.Delegate [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:kProp index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any): kotlin.Int declared in .Delegate' - CONST Int type=kotlin.Int value=1 - FUN name:setValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any, value:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:kProp index:1 type:kotlin.Any - VALUE_PARAMETER name:value index:2 type:kotlin.Int - BLOCK_BODY - 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: 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 - CLASS CLASS name:C modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public superTypes:[kotlin.Any]' - PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null - PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:protected modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int 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: 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 PROPERTY name:valWithBackingField visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:valWithBackingField type:kotlin.Int visibility:private [final,static] EXPRESSION_BODY @@ -154,12 +65,6 @@ FILE fqName: fileName:/propertyReferences.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KMutableProperty0 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_varWithBackingFieldAndAccessors type:kotlin.reflect.KMutableProperty0 visibility:private [final,static]' type=kotlin.reflect.KMutableProperty0 origin=null - PROPERTY name:valWithAccessors visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:valWithAccessors visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=1 PROPERTY name:test_valWithAccessors visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_valWithAccessors type:kotlin.reflect.KProperty0 visibility:private [final,static] EXPRESSION_BODY @@ -169,16 +74,6 @@ FILE fqName: fileName:/propertyReferences.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KProperty0 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_valWithAccessors type:kotlin.reflect.KProperty0 visibility:private [final,static]' type=kotlin.reflect.KProperty0 origin=null - PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=1 - FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY PROPERTY name:test_varWithAccessors visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_varWithAccessors type:kotlin.reflect.KMutableProperty0 visibility:private [final,static] EXPRESSION_BODY @@ -294,3 +189,108 @@ FILE fqName: fileName:/propertyReferences.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KProperty1<.C, kotlin.Int> declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_varWithProtectedSet type:kotlin.reflect.KProperty1<.C, kotlin.Int> visibility:private [final,static]' type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=null + CLASS CLASS name:C modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:protected modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public 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 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 + CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate + CONSTRUCTOR visibility:private <> () returnType:.Delegate [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Delegate modality:FINAL visibility:public 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 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:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:kProp index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any): kotlin.Int declared in .Delegate' + CONST Int type=kotlin.Int value=1 + FUN name:setValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any, value:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:kProp index:1 type:kotlin.Any + VALUE_PARAMETER name:value index:2 type:kotlin.Int + BLOCK_BODY + PROPERTY name:valWithAccessors visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:valWithAccessors visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 + PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 + FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.kt.txt b/compiler/testData/ir/irText/expressions/propertyReferences.kt.txt index c7ccf5243df..47c964ba10b 100644 --- a/compiler/testData/ir/irText/expressions/propertyReferences.kt.txt +++ b/compiler/testData/ir/irText/expressions/propertyReferences.kt.txt @@ -1,38 +1,3 @@ -object Delegate { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - operator fun getValue(thisRef: Any?, kProp: Any): Int { - return 1 - } - - operator fun setValue(thisRef: Any?, kProp: Any, value: Int) { - } - -} - -open class C { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - var varWithPrivateSet: Int - field = 1 - get - private set - - var varWithProtectedSet: Int - field = 1 - get - protected set - -} - val valWithBackingField: Int field = 1 get @@ -63,22 +28,10 @@ val test_varWithBackingFieldAndAccessors: KMutableProperty0 field = ::varWithBackingFieldAndAccessors get -val valWithAccessors: Int - get(): Int { - return 1 - } - val test_valWithAccessors: KProperty0 field = ::valWithAccessors get -var varWithAccessors: Int - get(): Int { - return 1 - } - set(value: Int) { - } - val test_varWithAccessors: KMutableProperty0 field = ::varWithAccessors get @@ -129,3 +82,51 @@ val test_varWithPrivateSet: KProperty1 val test_varWithProtectedSet: KProperty1 field = C::varWithProtectedSet get + +open class C { + var varWithPrivateSet: Int + field = 1 + get + private set + + var varWithProtectedSet: Int + field = 1 + get + protected set + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +object Delegate { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + operator fun getValue(thisRef: Any?, kProp: Any): Int { + return 1 + } + + operator fun setValue(thisRef: Any?, kProp: Any, value: Int) { + } + +} + +val valWithAccessors: Int + get(): Int { + return 1 + } + +var varWithAccessors: Int + get(): Int { + return 1 + } + set(value: Int) { + } + diff --git a/compiler/testData/ir/irText/expressions/protectedJavaFieldRef.fir.ir.txt b/compiler/testData/ir/irText/expressions/protectedJavaFieldRef.fir.ir.txt index 76b91c96496..0119eca07b5 100644 --- a/compiler/testData/ir/irText/expressions/protectedJavaFieldRef.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/protectedJavaFieldRef.fir.ir.txt @@ -1,21 +1,11 @@ FILE fqName: fileName:/protectedJavaFieldRef.kt CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[p.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in p.Base' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[p.Base]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:j type:@[FlexibleNullability] kotlin.String? visibility:protected/*protected and package*/' type=kotlin.Unit origin=EQ receiver: GET_VAR ': .Derived declared in .Derived' type=.Derived origin=null value: CONST String type=kotlin.String value="" - FUN name:set visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Derived - BLOCK_BODY - SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:j type:@[FlexibleNullability] kotlin.String? visibility:protected/*protected and package*/' type=kotlin.Unit origin=EQ - receiver: GET_VAR ': .Derived declared in .Derived.set' type=.Derived origin=null - value: CONST String type=kotlin.String value="OK" PROPERTY name:ref visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ref type:kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> visibility:private [final] EXPRESSION_BODY @@ -28,6 +18,10 @@ FILE fqName: fileName:/protectedJavaFieldRef.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> declared in .Derived' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ref type:kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> visibility:private [final]' type=kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> origin=null receiver: GET_VAR ': .Derived declared in .Derived.' type=.Derived origin=null + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in p.Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[p.Base]' 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 p.Base @@ -41,3 +35,9 @@ FILE fqName: fileName:/protectedJavaFieldRef.kt overridden: public open fun toString (): kotlin.String declared in p.Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:set visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Derived + BLOCK_BODY + SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:j type:@[FlexibleNullability] kotlin.String? visibility:protected/*protected and package*/' type=kotlin.Unit origin=EQ + receiver: GET_VAR ': .Derived declared in .Derived.set' type=.Derived origin=null + value: CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/expressions/protectedJavaFieldRef.ir.txt b/compiler/testData/ir/irText/expressions/protectedJavaFieldRef.ir.txt index fd7b8965e21..9c0bf41c24b 100644 --- a/compiler/testData/ir/irText/expressions/protectedJavaFieldRef.ir.txt +++ b/compiler/testData/ir/irText/expressions/protectedJavaFieldRef.ir.txt @@ -1,21 +1,11 @@ FILE fqName: fileName:/protectedJavaFieldRef.kt CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[p.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in p.Base' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[p.Base]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:j type:@[FlexibleNullability] kotlin.String? visibility:protected/*protected and package*/' type=kotlin.Unit origin=EQ receiver: GET_VAR ': .Derived declared in .Derived' type=.Derived origin=null value: CONST String type=kotlin.String value="" - FUN name:set visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Derived - BLOCK_BODY - SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:j type:@[FlexibleNullability] kotlin.String? visibility:protected/*protected and package*/' type=kotlin.Unit origin=EQ - receiver: GET_VAR ': .Derived declared in .Derived.set' type=.Derived origin=null - value: CONST String type=kotlin.String value="OK" PROPERTY name:ref visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ref type:kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> visibility:private [final] EXPRESSION_BODY @@ -28,6 +18,10 @@ FILE fqName: fileName:/protectedJavaFieldRef.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> declared in .Derived' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ref type:kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> visibility:private [final]' type=kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> origin=null receiver: GET_VAR ': .Derived declared in .Derived.' type=.Derived origin=null + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in p.Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[p.Base]' 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 p.Base @@ -41,6 +35,12 @@ FILE fqName: fileName:/protectedJavaFieldRef.kt overridden: public open fun toString (): kotlin.String declared in p.Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:set visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Derived + BLOCK_BODY + SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:j type:@[FlexibleNullability] kotlin.String? visibility:protected/*protected and package*/' type=kotlin.Unit origin=EQ + receiver: GET_VAR ': .Derived declared in .Derived.set' type=.Derived origin=null + value: CONST String type=kotlin.String value="OK" PROPERTY FAKE_OVERRIDE name:j visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] overridden: protected/*protected and package*/ final j: @[FlexibleNullability] kotlin.String? diff --git a/compiler/testData/ir/irText/expressions/references.ir.txt b/compiler/testData/ir/irText/expressions/references.ir.txt index 093b9a8963c..b95caa5b8bd 100644 --- a/compiler/testData/ir/irText/expressions/references.ir.txt +++ b/compiler/testData/ir/irText/expressions/references.ir.txt @@ -17,12 +17,6 @@ FILE fqName: fileName:/references.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok2 type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null - PROPERTY name:ok3 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String - correspondingProperty: PROPERTY name:ok3 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' - CONST String type=kotlin.String value="OK" FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.String declared in ' @@ -42,6 +36,18 @@ FILE fqName: fileName:/references.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.String declared in ' CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=GET_PROPERTY + FUN name:test5 visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.String + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.String declared in ' + CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=GET_PROPERTY + $receiver: GET_VAR ': kotlin.String declared in .test5' type=kotlin.String origin=null + PROPERTY name:ok3 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:ok3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" PROPERTY name:okext visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.String correspondingProperty: PROPERTY name:okext visibility:public modality:FINAL [val] @@ -49,9 +55,3 @@ FILE fqName: fileName:/references.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' CONST String type=kotlin.String value="OK" - FUN name:test5 visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.String - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.String declared in ' - CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=GET_PROPERTY - $receiver: GET_VAR ': kotlin.String declared in .test5' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/references.kt.txt b/compiler/testData/ir/irText/expressions/references.kt.txt index ea8eb5ee47b..5070ad48158 100644 --- a/compiler/testData/ir/irText/expressions/references.kt.txt +++ b/compiler/testData/ir/irText/expressions/references.kt.txt @@ -6,11 +6,6 @@ val ok2: String field = () get -val ok3: String - get(): String { - return "OK" - } - fun test1(): String { return () } @@ -28,11 +23,17 @@ fun test4(): String { return () } +fun String.test5(): String { + return .() +} + +val ok3: String + get(): String { + return "OK" + } + val String.okext: String get(): String { return "OK" } -fun String.test5(): String { - return .() -} diff --git a/compiler/testData/ir/irText/expressions/reflectionLiterals.ir.txt b/compiler/testData/ir/irText/expressions/reflectionLiterals.ir.txt index e8059d40a6a..ab163b899dc 100644 --- a/compiler/testData/ir/irText/expressions/reflectionLiterals.ir.txt +++ b/compiler/testData/ir/irText/expressions/reflectionLiterals.ir.txt @@ -1,28 +1,4 @@ FILE fqName: fileName:/reflectionLiterals.kt - CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - 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: 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:bar visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY PROPERTY name:qux visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:qux type:kotlin.Int visibility:private [final,static] EXPRESSION_BODY @@ -88,3 +64,27 @@ FILE fqName: fileName:/reflectionLiterals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KFunction0 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.reflect.KFunction0 visibility:private [final,static]' type=kotlin.reflect.KFunction0 origin=null + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 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:foo visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/reflectionLiterals.kt.txt b/compiler/testData/ir/irText/expressions/reflectionLiterals.kt.txt index 48fe8deea3b..0c52175a16c 100644 --- a/compiler/testData/ir/irText/expressions/reflectionLiterals.kt.txt +++ b/compiler/testData/ir/irText/expressions/reflectionLiterals.kt.txt @@ -1,18 +1,3 @@ -class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun foo() { - } - -} - -fun bar() { -} - val qux: Int field = 1 get @@ -40,3 +25,19 @@ val test5: KFunction0 val test6: KFunction0 field = ::bar get + +class A { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun foo() { + } + +} + +fun bar() { +} + diff --git a/compiler/testData/ir/irText/expressions/safeAssignment.fir.ir.txt b/compiler/testData/ir/irText/expressions/safeAssignment.fir.ir.txt index 4165ff4065a..4d7d8460def 100644 --- a/compiler/testData/ir/irText/expressions/safeAssignment.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/safeAssignment.fir.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/safeAssignment.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.C [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private EXPRESSION_BODY @@ -25,6 +20,11 @@ FILE fqName: fileName:/safeAssignment.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/safeAssignment.fir.kt.txt b/compiler/testData/ir/irText/expressions/safeAssignment.fir.kt.txt index d58bda466fc..e84f091f928 100644 --- a/compiler/testData/ir/irText/expressions/safeAssignment.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/safeAssignment.fir.kt.txt @@ -1,15 +1,15 @@ class C { + var x: Int + field = x + get + set + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } - var x: Int - field = x - get - set - } fun test(nc: C?) { @@ -21,3 +21,4 @@ fun test(nc: C?) { } } /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/expressions/safeAssignment.ir.txt b/compiler/testData/ir/irText/expressions/safeAssignment.ir.txt index 862edbe48ab..5716892d849 100644 --- a/compiler/testData/ir/irText/expressions/safeAssignment.ir.txt +++ b/compiler/testData/ir/irText/expressions/safeAssignment.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/safeAssignment.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.C [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private EXPRESSION_BODY @@ -25,6 +20,11 @@ FILE fqName: fileName:/safeAssignment.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/safeAssignment.kt.txt b/compiler/testData/ir/irText/expressions/safeAssignment.kt.txt index 2fdb9a8ff67..d3245378561 100644 --- a/compiler/testData/ir/irText/expressions/safeAssignment.kt.txt +++ b/compiler/testData/ir/irText/expressions/safeAssignment.kt.txt @@ -1,15 +1,15 @@ class C { + var x: Int + field = x + get + set + constructor(x: Int) /* primary */ { super/*Any*/() /* () */ } - var x: Int - field = x - get - set - } fun test(nc: C?) { @@ -21,3 +21,4 @@ fun test(nc: C?) { } } } + diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.ir.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.ir.txt index 6a0d365fb33..08729a0dd23 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.ir.txt @@ -18,18 +18,12 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:p visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> ($receiver:test.C?) returnType:kotlin.Int - correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] - $receiver: VALUE_PARAMETER name: type:test.C? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' - CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> ($receiver:test.C?, value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] - $receiver: VALUE_PARAMETER name: type:test.C? - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY + FUN name:get visibility:public modality:FINAL <> ($receiver:kotlin.Int?, index:kotlin.Int) returnType:kotlin.Int [operator] + $receiver: VALUE_PARAMETER name: type:kotlin.Int? + VALUE_PARAMETER name:index index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (index: kotlin.Int): kotlin.Int declared in test' + CONST Int type=kotlin.Int value=42 FUN name:inc visibility:public modality:FINAL <> ($receiver:kotlin.Int?) returnType:kotlin.Int? [operator] $receiver: VALUE_PARAMETER name: type:kotlin.Int? BLOCK_BODY @@ -47,71 +41,77 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_0: kotlin.Int? declared in test.inc' type=kotlin.Int? origin=null - FUN name:get visibility:public modality:FINAL <> ($receiver:kotlin.Int?, index:kotlin.Int) returnType:kotlin.Int [operator] - $receiver: VALUE_PARAMETER name: type:kotlin.Int? - VALUE_PARAMETER name:index index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun get (index: kotlin.Int): kotlin.Int declared in test' - CONST Int type=kotlin.Int value=42 FUN name:set visibility:public modality:FINAL <> ($receiver:kotlin.Int?, index:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] $receiver: VALUE_PARAMETER name: type:kotlin.Int? VALUE_PARAMETER name:index index:0 type:kotlin.Int VALUE_PARAMETER name:value index:1 type:kotlin.Int BLOCK_BODY - FUN name:testProperty visibility:public modality:FINAL <> (nc:test.C?) returnType:kotlin.Unit - VALUE_PARAMETER name:nc index:0 type:test.C? - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Int? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:test.C? [val] - GET_VAR 'nc: test.C? declared in test.testProperty' type=test.C? origin=null - WHEN type=kotlin.Int? 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: test.C? declared in test.testProperty' type=test.C? 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: BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:test.C [val] - GET_VAR 'val tmp_1: test.C? declared in test.testProperty' type=test.C? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_2: test.C declared in test.testProperty' type=test.C origin=null - CALL 'public final fun (value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_2: test.C declared in test.testProperty' type=test.C origin=null - value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_3: kotlin.Int declared in test.testProperty' type=kotlin.Int origin=null - GET_VAR 'val tmp_3: kotlin.Int declared in test.testProperty' type=kotlin.Int origin=null FUN name:testArrayAccess visibility:public modality:FINAL <> (nc:test.C?) returnType:kotlin.Unit VALUE_PARAMETER name:nc index:0 type:test.C? BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Int? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:test.C? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:test.C? [val] GET_VAR 'nc: test.C? declared in test.testArrayAccess' type=test.C? origin=null WHEN type=kotlin.Int? 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_4: test.C? declared in test.testArrayAccess' type=test.C? origin=null + arg0: GET_VAR 'val tmp_1: test.C? declared in test.testArrayAccess' type=test.C? 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: BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int origin=GET_PROPERTY - $receiver: GET_VAR 'val tmp_4: test.C? declared in test.testArrayAccess' type=test.C? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] + $receiver: GET_VAR 'val tmp_1: test.C? declared in test.testArrayAccess' type=test.C? origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in test' type=kotlin.Int origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_5: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null - index: GET_VAR 'val tmp_6: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null + $receiver: GET_VAR 'val tmp_2: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null + index: GET_VAR 'val tmp_3: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_5: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null - index: GET_VAR 'val tmp_6: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null + $receiver: GET_VAR 'val tmp_2: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null + index: GET_VAR 'val tmp_3: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_7: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null - GET_VAR 'val tmp_7: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_4: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null + GET_VAR 'val tmp_4: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null + FUN name:testProperty visibility:public modality:FINAL <> (nc:test.C?) returnType:kotlin.Unit + VALUE_PARAMETER name:nc index:0 type:test.C? + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Int? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:test.C? [val] + GET_VAR 'nc: test.C? declared in test.testProperty' type=test.C? origin=null + WHEN type=kotlin.Int? 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_5: test.C? declared in test.testProperty' type=test.C? 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: BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:test.C [val] + GET_VAR 'val tmp_5: test.C? declared in test.testProperty' type=test.C? origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_6: test.C declared in test.testProperty' type=test.C origin=null + CALL 'public final fun (value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_6: test.C declared in test.testProperty' type=test.C origin=null + value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_7: kotlin.Int declared in test.testProperty' type=kotlin.Int origin=null + GET_VAR 'val tmp_7: kotlin.Int declared in test.testProperty' type=kotlin.Int origin=null + PROPERTY name:p visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> ($receiver:test.C?) returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:test.C? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> ($receiver:test.C?, value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:test.C? + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.kt.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.kt.txt index af02823bf98..f3b8db83be1 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.kt.txt @@ -9,12 +9,9 @@ class C { } -var C?.p: Int - get(): Int { - return 42 - } - set(value: Int) { - } +operator fun Int?.get(index: Int): Int { + return 42 +} operator fun Int?.inc(): Int? { return { // BLOCK @@ -26,40 +23,44 @@ operator fun Int?.inc(): Int? { } } -operator fun Int?.get(index: Int): Int { - return 42 -} - operator fun Int?.set(index: Int, value: Int) { } -fun testProperty(nc: C?) { +fun testArrayAccess(nc: C?) { { // BLOCK val tmp_1: C? = nc when { EQEQ(arg0 = tmp_1, arg1 = null) -> null else -> { // BLOCK - val tmp_2: C = tmp_1 - val tmp_3: Int = tmp_2.() - tmp_2.(value = tmp_3.inc()) - tmp_3 + val tmp_2: Int = tmp_1.() + val tmp_3: Int = 0 + val tmp_4: Int = tmp_2.get(index = tmp_3) + tmp_2.set(index = tmp_3, value = tmp_4.inc()) + tmp_4 } } } /*~> Unit */ } -fun testArrayAccess(nc: C?) { +fun testProperty(nc: C?) { { // BLOCK - val tmp_4: C? = nc + val tmp_5: C? = nc when { - EQEQ(arg0 = tmp_4, arg1 = null) -> null + EQEQ(arg0 = tmp_5, arg1 = null) -> null else -> { // BLOCK - val tmp_5: Int = tmp_4.() - val tmp_6: Int = 0 - val tmp_7: Int = tmp_5.get(index = tmp_6) - tmp_5.set(index = tmp_6, value = tmp_7.inc()) + val tmp_6: C = tmp_5 + val tmp_7: Int = tmp_6.() + tmp_6.(value = tmp_7.inc()) tmp_7 } } } /*~> Unit */ } + +var C?.p: Int + get(): Int { + return 42 + } + set(value: Int) { + } + diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.ir.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.ir.txt index 7049ea2e275..04e5afb723d 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.ir.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.ir.txt @@ -18,18 +18,12 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:p visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> ($receiver:test.C?) returnType:kotlin.Int - correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] - $receiver: VALUE_PARAMETER name: type:test.C? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' - CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> ($receiver:test.C?, value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] - $receiver: VALUE_PARAMETER name: type:test.C? - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY + FUN name:get visibility:public modality:FINAL <> ($receiver:kotlin.Int?, index:kotlin.Int) returnType:kotlin.Int [operator] + $receiver: VALUE_PARAMETER name: type:kotlin.Int? + VALUE_PARAMETER name:index index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (index: kotlin.Int): kotlin.Int declared in test' + CONST Int type=kotlin.Int value=42 FUN name:inc visibility:public modality:FINAL <> ($receiver:kotlin.Int?) returnType:kotlin.Int? [operator] $receiver: VALUE_PARAMETER name: type:kotlin.Int? BLOCK_BODY @@ -47,72 +41,78 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_0: kotlin.Int? declared in test.inc' type=kotlin.Int? origin=null - FUN name:get visibility:public modality:FINAL <> ($receiver:kotlin.Int?, index:kotlin.Int) returnType:kotlin.Int [operator] - $receiver: VALUE_PARAMETER name: type:kotlin.Int? - VALUE_PARAMETER name:index index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun get (index: kotlin.Int): kotlin.Int declared in test' - CONST Int type=kotlin.Int value=42 FUN name:set visibility:public modality:FINAL <> ($receiver:kotlin.Int?, index:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] $receiver: VALUE_PARAMETER name: type:kotlin.Int? VALUE_PARAMETER name:index index:0 type:kotlin.Int VALUE_PARAMETER name:value index:1 type:kotlin.Int BLOCK_BODY - FUN name:testProperty visibility:public modality:FINAL <> (nc:test.C?) returnType:kotlin.Unit - VALUE_PARAMETER name:nc index:0 type:test.C? - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Int? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:test.C? [val] - GET_VAR 'nc: test.C? declared in test.testProperty' type=test.C? origin=null - WHEN type=kotlin.Int? 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: test.C? declared in test.testProperty' type=test.C? 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: BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:test.C? [val] - GET_VAR 'val tmp_1: test.C? declared in test.testProperty' type=test.C? origin=null - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] - CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_2: test.C? declared in test.testProperty' type=test.C? origin=null - CALL 'public final fun (value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_2: test.C? declared in test.testProperty' type=test.C? origin=null - value: CALL 'public final fun inc (): kotlin.Int? declared in test' type=kotlin.Int? origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_3: kotlin.Int declared in test.testProperty' type=kotlin.Int origin=null - GET_VAR 'val tmp_3: kotlin.Int declared in test.testProperty' type=kotlin.Int origin=null FUN name:testArrayAccess visibility:public modality:FINAL <> (nc:test.C?) returnType:kotlin.Unit VALUE_PARAMETER name:nc index:0 type:test.C? BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int? [val] BLOCK type=kotlin.Int? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:test.C? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:test.C? [val] GET_VAR 'nc: test.C? declared in test.testArrayAccess' type=test.C? origin=null WHEN type=kotlin.Int? 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_5: test.C? declared in test.testArrayAccess' type=test.C? origin=null + arg0: GET_VAR 'val tmp_2: test.C? declared in test.testArrayAccess' type=test.C? 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 (): kotlin.Int declared in test' type=kotlin.Int origin=GET_PROPERTY - $receiver: GET_VAR 'val tmp_5: test.C? declared in test.testArrayAccess' type=test.C? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] + $receiver: GET_VAR 'val tmp_2: test.C? declared in test.testArrayAccess' type=test.C? origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in test' type=kotlin.Int origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_4: kotlin.Int? declared in test.testArrayAccess' type=kotlin.Int? origin=null - index: GET_VAR 'val tmp_6: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null + $receiver: GET_VAR 'val tmp_1: kotlin.Int? declared in test.testArrayAccess' type=kotlin.Int? origin=null + index: GET_VAR 'val tmp_3: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=POSTFIX_INCR - $receiver: GET_VAR 'val tmp_4: kotlin.Int? declared in test.testArrayAccess' type=kotlin.Int? origin=null - index: GET_VAR 'val tmp_6: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null + $receiver: GET_VAR 'val tmp_1: kotlin.Int? declared in test.testArrayAccess' type=kotlin.Int? origin=null + index: GET_VAR 'val tmp_3: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_7: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null - GET_VAR 'val tmp_7: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_4: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null + GET_VAR 'val tmp_4: kotlin.Int declared in test.testArrayAccess' type=kotlin.Int origin=null + FUN name:testProperty visibility:public modality:FINAL <> (nc:test.C?) returnType:kotlin.Unit + VALUE_PARAMETER name:nc index:0 type:test.C? + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Int? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:test.C? [val] + GET_VAR 'nc: test.C? declared in test.testProperty' type=test.C? origin=null + WHEN type=kotlin.Int? 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_5: test.C? declared in test.testProperty' type=test.C? 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: BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:test.C? [val] + GET_VAR 'val tmp_5: test.C? declared in test.testProperty' type=test.C? origin=null + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_6: test.C? declared in test.testProperty' type=test.C? origin=null + CALL 'public final fun (value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_6: test.C? declared in test.testProperty' type=test.C? origin=null + value: CALL 'public final fun inc (): kotlin.Int? declared in test' type=kotlin.Int? origin=POSTFIX_INCR + $receiver: GET_VAR 'val tmp_7: kotlin.Int declared in test.testProperty' type=kotlin.Int origin=null + GET_VAR 'val tmp_7: kotlin.Int declared in test.testProperty' type=kotlin.Int origin=null + PROPERTY name:p visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> ($receiver:test.C?) returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:test.C? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> ($receiver:test.C?, value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:test.C? + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt.txt index 5efca1ae3d7..5cd54b4742a 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt.txt @@ -9,12 +9,9 @@ class C { } -var C?.p: Int - get(): Int { - return 42 - } - set(value: Int) { - } +operator fun Int?.get(index: Int): Int { + return 42 +} operator fun Int?.inc(): Int? { return { // BLOCK @@ -26,42 +23,46 @@ operator fun Int?.inc(): Int? { } } -operator fun Int?.get(index: Int): Int { - return 42 +operator fun Int?.set(index: Int, value: Int) { } -operator fun Int?.set(index: Int, value: Int) { +fun testArrayAccess(nc: C?) { + { // BLOCK + val tmp_1: Int? = { // BLOCK + val tmp_2: C? = nc + when { + EQEQ(arg0 = tmp_2, arg1 = null) -> null + else -> tmp_2.() + } + } + val tmp_3: Int = 0 + val tmp_4: Int = tmp_1.get(index = tmp_3) + tmp_1.set(index = tmp_3, value = tmp_4.inc()) + tmp_4 + } /*~> Unit */ } fun testProperty(nc: C?) { { // BLOCK - val tmp_1: C? = nc + val tmp_5: C? = nc when { - EQEQ(arg0 = tmp_1, arg1 = null) -> null + EQEQ(arg0 = tmp_5, arg1 = null) -> null else -> { // BLOCK - val tmp_2: C? = tmp_1 + val tmp_6: C? = tmp_5 { // BLOCK - val tmp_3: Int = tmp_2.() - tmp_2.(value = tmp_3.inc()) - tmp_3 + val tmp_7: Int = tmp_6.() + tmp_6.(value = tmp_7.inc()) + tmp_7 } } } } /*~> Unit */ } -fun testArrayAccess(nc: C?) { - { // BLOCK - val tmp_4: Int? = { // BLOCK - val tmp_5: C? = nc - when { - EQEQ(arg0 = tmp_5, arg1 = null) -> null - else -> tmp_5.() - } - } - val tmp_6: Int = 0 - val tmp_7: Int = tmp_4.get(index = tmp_6) - tmp_4.set(index = tmp_6, value = tmp_7.inc()) - tmp_7 - } /*~> Unit */ -} +var C?.p: Int + get(): Int { + return 42 + } + set(value: Int) { + } + diff --git a/compiler/testData/ir/irText/expressions/safeCalls.fir.ir.txt b/compiler/testData/ir/irText/expressions/safeCalls.fir.ir.txt index 27d3f17eec2..74b0f6544fe 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.fir.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/safeCalls.kt CLASS CLASS name:Ref modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ref - CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.Ref [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Ref modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private EXPRESSION_BODY @@ -25,6 +20,11 @@ FILE fqName: fileName:/safeCalls.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Ref declared in .Ref.' type=.Ref origin=null value: GET_VAR ': kotlin.Int declared in .Ref.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.Ref [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Ref modality:FINAL visibility:public 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 declared in kotlin.Any @@ -40,13 +40,6 @@ FILE fqName: fileName:/safeCalls.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:IHost modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IHost - FUN name:extLength visibility:public modality:OPEN <> ($this:.IHost, $receiver:kotlin.String) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.IHost - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun extLength (): kotlin.Int declared in .IHost' - CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': kotlin.String declared in .IHost.extLength' type=kotlin.String 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 @@ -60,76 +53,104 @@ FILE fqName: fileName:/safeCalls.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:extLength visibility:public modality:OPEN <> ($this:.IHost, $receiver:kotlin.String) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.IHost + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun extLength (): kotlin.Int declared in .IHost' + CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': kotlin.String declared in .IHost.extLength' type=kotlin.String origin=null + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Int? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=42 + WHEN type=kotlin.Int? 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.Int declared in .box' type=kotlin.Int 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 foo (): kotlin.Int declared in ' type=kotlin.Int origin=null + $receiver: GET_VAR 'val tmp_0: kotlin.Int declared in .box' type=kotlin.Int origin=null + FUN name:foo visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Int + $receiver: VALUE_PARAMETER name: type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=239 FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:kotlin.Int? VALUE_PARAMETER name:x index:0 type:kotlin.String? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.String?): kotlin.Int? declared in ' BLOCK type=kotlin.Int? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.String? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] GET_VAR 'x: kotlin.String? declared in .test1' type=kotlin.String? origin=null WHEN type=kotlin.Int? 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.String? declared in .test1' type=kotlin.String? origin=null + arg0: GET_VAR 'val tmp_1: kotlin.String? declared in .test1' type=kotlin.String? 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 open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'val tmp_0: kotlin.String? declared in .test1' type=kotlin.String? origin=null + $this: GET_VAR 'val tmp_1: kotlin.String? declared in .test1' type=kotlin.String? origin=null FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:kotlin.Int? VALUE_PARAMETER name:x index:0 type:kotlin.String? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.String?): kotlin.Int? declared in ' BLOCK type=kotlin.Int? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val] GET_VAR 'x: kotlin.String? declared in .test2' type=kotlin.String? origin=null WHEN type=kotlin.Int? 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.String? declared in .test2' type=kotlin.String? origin=null + arg0: GET_VAR 'val tmp_2: kotlin.String? declared in .test2' type=kotlin.String? 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 open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_1: kotlin.String? declared in .test2' type=kotlin.String? origin=null + $this: GET_VAR 'val tmp_2: kotlin.String? declared in .test2' type=kotlin.String? origin=null FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.String?, y:kotlin.Any?) returnType:kotlin.Boolean? VALUE_PARAMETER name:x index:0 type:kotlin.String? VALUE_PARAMETER name:y index:1 type:kotlin.Any? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.String?, y: kotlin.Any?): kotlin.Boolean? declared in ' BLOCK type=kotlin.Boolean? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.String? [val] GET_VAR 'x: kotlin.String? declared in .test3' type=kotlin.String? origin=null WHEN type=kotlin.Boolean? 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? declared in .test3' type=kotlin.String? origin=null + arg0: GET_VAR 'val tmp_3: kotlin.String? declared in .test3' type=kotlin.String? 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 open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.String' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_2: kotlin.String? declared in .test3' type=kotlin.String? origin=null + $this: GET_VAR 'val tmp_3: kotlin.String? declared in .test3' type=kotlin.String? origin=null other: GET_VAR 'y: kotlin.Any? declared in .test3' type=kotlin.Any? origin=null FUN name:test4 visibility:public modality:FINAL <> (x:.Ref?) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:.Ref? BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Unit? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.Ref? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.Ref? [val] GET_VAR 'x: .Ref? declared in .test4' type=.Ref? origin=null WHEN type=kotlin.Unit? 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: .Ref? declared in .test4' type=.Ref? origin=null + arg0: GET_VAR 'val tmp_4: .Ref? declared in .test4' type=.Ref? 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 (: kotlin.Int): kotlin.Unit declared in .Ref' type=kotlin.Unit origin=EQ - $this: GET_VAR 'val tmp_3: .Ref? declared in .test4' type=.Ref? origin=null + $this: GET_VAR 'val tmp_4: .Ref? declared in .test4' type=.Ref? origin=null : CONST Int type=kotlin.Int value=0 FUN name:test5 visibility:public modality:FINAL <> ($receiver:.IHost, s:kotlin.String?) returnType:kotlin.Int? $receiver: VALUE_PARAMETER name: type:.IHost @@ -137,37 +158,16 @@ FILE fqName: fileName:/safeCalls.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test5 (s: kotlin.String?): kotlin.Int? declared in ' BLOCK type=kotlin.Int? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.String? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.String? [val] GET_VAR 's: kotlin.String? declared in .test5' type=kotlin.String? origin=null WHEN type=kotlin.Int? 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_4: kotlin.String? declared in .test5' type=kotlin.String? origin=null + arg0: GET_VAR 'val tmp_5: kotlin.String? declared in .test5' type=kotlin.String? 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 open fun extLength (): kotlin.Int declared in .IHost' type=kotlin.Int origin=null $this: GET_VAR ': .IHost declared in .test5' type=.IHost origin=null - $receiver: GET_VAR 'val tmp_4: kotlin.String? declared in .test5' type=kotlin.String? origin=null - FUN name:foo visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Int - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=239 - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Int? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=42 - WHEN type=kotlin.Int? 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_5: kotlin.Int declared in .box' type=kotlin.Int 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 foo (): kotlin.Int declared in ' type=kotlin.Int origin=null - $receiver: GET_VAR 'val tmp_5: kotlin.Int declared in .box' type=kotlin.Int origin=null + $receiver: GET_VAR 'val tmp_5: kotlin.String? declared in .test5' type=kotlin.String? origin=null diff --git a/compiler/testData/ir/irText/expressions/safeCalls.fir.kt.txt b/compiler/testData/ir/irText/expressions/safeCalls.fir.kt.txt index b6c9bddefc5..179ce08fd31 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.fir.kt.txt @@ -1,15 +1,15 @@ class Ref { + var value: Int + field = value + get + set + constructor(value: Int) /* primary */ { super/*Any*/() /* () */ } - var value: Int - field = value - get - set - } interface IHost { @@ -19,66 +19,67 @@ interface IHost { } -fun test1(x: String?): Int? { - return { // BLOCK - val tmp_0: String? = x +fun box() { + { // BLOCK + val tmp_0: Int = 42 when { EQEQ(arg0 = tmp_0, arg1 = null) -> null - else -> tmp_0.() - } - } -} - -fun test2(x: String?): Int? { - return { // BLOCK - val tmp_1: String? = x - when { - EQEQ(arg0 = tmp_1, arg1 = null) -> null - else -> tmp_1.hashCode() - } - } -} - -fun test3(x: String?, y: Any?): Boolean? { - return { // BLOCK - val tmp_2: String? = x - when { - EQEQ(arg0 = tmp_2, arg1 = null) -> null - else -> tmp_2.equals(other = y) - } - } -} - -fun test4(x: Ref?) { - { // BLOCK - val tmp_3: Ref? = x - when { - EQEQ(arg0 = tmp_3, arg1 = null) -> null - else -> tmp_3.( = 0) + else -> tmp_0.foo() } } /*~> Unit */ } -fun IHost.test5(s: String?): Int? { - return { // BLOCK - val tmp_4: String? = s - when { - EQEQ(arg0 = tmp_4, arg1 = null) -> null - else -> (, tmp_4).extLength() - } - } -} - fun Int.foo(): Int { return 239 } -fun box() { - { // BLOCK - val tmp_5: Int = 42 +fun test1(x: String?): Int? { + return { // BLOCK + val tmp_1: String? = x when { - EQEQ(arg0 = tmp_5, arg1 = null) -> null - else -> tmp_5.foo() + EQEQ(arg0 = tmp_1, arg1 = null) -> null + else -> tmp_1.() + } + } +} + +fun test2(x: String?): Int? { + return { // BLOCK + val tmp_2: String? = x + when { + EQEQ(arg0 = tmp_2, arg1 = null) -> null + else -> tmp_2.hashCode() + } + } +} + +fun test3(x: String?, y: Any?): Boolean? { + return { // BLOCK + val tmp_3: String? = x + when { + EQEQ(arg0 = tmp_3, arg1 = null) -> null + else -> tmp_3.equals(other = y) + } + } +} + +fun test4(x: Ref?) { + { // BLOCK + val tmp_4: Ref? = x + when { + EQEQ(arg0 = tmp_4, arg1 = null) -> null + else -> tmp_4.( = 0) } } /*~> Unit */ } + +fun IHost.test5(s: String?): Int? { + return { // BLOCK + val tmp_5: String? = s + when { + EQEQ(arg0 = tmp_5, arg1 = null) -> null + else -> (, tmp_5).extLength() + } + } +} + diff --git a/compiler/testData/ir/irText/expressions/safeCalls.ir.txt b/compiler/testData/ir/irText/expressions/safeCalls.ir.txt index 68aa03e51ca..e3d850ae35c 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.ir.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/safeCalls.kt CLASS CLASS name:Ref modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ref - CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.Ref [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Ref modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private EXPRESSION_BODY @@ -25,6 +20,11 @@ FILE fqName: fileName:/safeCalls.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Ref declared in .Ref.' type=.Ref origin=null value: GET_VAR ': kotlin.Int declared in .Ref.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.Ref [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Ref modality:FINAL visibility:public 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 declared in kotlin.Any @@ -40,13 +40,6 @@ FILE fqName: fileName:/safeCalls.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:IHost modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IHost - FUN name:extLength visibility:public modality:OPEN <> ($this:.IHost, $receiver:kotlin.String) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.IHost - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun extLength (): kotlin.Int declared in .IHost' - CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': kotlin.String declared in .IHost.extLength' type=kotlin.String 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 @@ -60,76 +53,104 @@ FILE fqName: fileName:/safeCalls.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:extLength visibility:public modality:OPEN <> ($this:.IHost, $receiver:kotlin.String) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.IHost + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun extLength (): kotlin.Int declared in .IHost' + CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': kotlin.String declared in .IHost.extLength' type=kotlin.String origin=null + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Int? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=42 + WHEN type=kotlin.Int? 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.Int declared in .box' type=kotlin.Int 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 foo (): kotlin.Int declared in ' type=kotlin.Int origin=null + $receiver: GET_VAR 'val tmp_0: kotlin.Int declared in .box' type=kotlin.Int origin=null + FUN name:foo visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Int + $receiver: VALUE_PARAMETER name: type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=239 FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:kotlin.Int? VALUE_PARAMETER name:x index:0 type:kotlin.String? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.String?): kotlin.Int? declared in ' BLOCK type=kotlin.Int? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.String? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] GET_VAR 'x: kotlin.String? declared in .test1' type=kotlin.String? origin=null WHEN type=kotlin.Int? 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.String? declared in .test1' type=kotlin.String? origin=null + arg0: GET_VAR 'val tmp_1: kotlin.String? declared in .test1' type=kotlin.String? 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 open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'val tmp_0: kotlin.String? declared in .test1' type=kotlin.String? origin=null + $this: GET_VAR 'val tmp_1: kotlin.String? declared in .test1' type=kotlin.String? origin=null FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:kotlin.Int? VALUE_PARAMETER name:x index:0 type:kotlin.String? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.String?): kotlin.Int? declared in ' BLOCK type=kotlin.Int? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val] GET_VAR 'x: kotlin.String? declared in .test2' type=kotlin.String? origin=null WHEN type=kotlin.Int? 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.String? declared in .test2' type=kotlin.String? origin=null + arg0: GET_VAR 'val tmp_2: kotlin.String? declared in .test2' type=kotlin.String? 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 open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_1: kotlin.String? declared in .test2' type=kotlin.String? origin=null + $this: GET_VAR 'val tmp_2: kotlin.String? declared in .test2' type=kotlin.String? origin=null FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.String?, y:kotlin.Any?) returnType:kotlin.Boolean? VALUE_PARAMETER name:x index:0 type:kotlin.String? VALUE_PARAMETER name:y index:1 type:kotlin.Any? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.String?, y: kotlin.Any?): kotlin.Boolean? declared in ' BLOCK type=kotlin.Boolean? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.String? [val] GET_VAR 'x: kotlin.String? declared in .test3' type=kotlin.String? origin=null WHEN type=kotlin.Boolean? 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? declared in .test3' type=kotlin.String? origin=null + arg0: GET_VAR 'val tmp_3: kotlin.String? declared in .test3' type=kotlin.String? 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 open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.String' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_2: kotlin.String? declared in .test3' type=kotlin.String? origin=null + $this: GET_VAR 'val tmp_3: kotlin.String? declared in .test3' type=kotlin.String? origin=null other: GET_VAR 'y: kotlin.Any? declared in .test3' type=kotlin.Any? origin=null FUN name:test4 visibility:public modality:FINAL <> (x:.Ref?) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:.Ref? BLOCK_BODY BLOCK type=kotlin.Unit origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.Ref? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.Ref? [val] GET_VAR 'x: .Ref? declared in .test4' type=.Ref? origin=null WHEN type=kotlin.Unit 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: .Ref? declared in .test4' type=.Ref? origin=null + arg0: GET_VAR 'val tmp_4: .Ref? declared in .test4' type=.Ref? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CONST Null type=kotlin.Nothing? value=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Ref' type=kotlin.Unit origin=EQ - $this: GET_VAR 'val tmp_3: .Ref? declared in .test4' type=.Ref? origin=null + $this: GET_VAR 'val tmp_4: .Ref? declared in .test4' type=.Ref? origin=null : CONST Int type=kotlin.Int value=0 FUN name:test5 visibility:public modality:FINAL <> ($receiver:.IHost, s:kotlin.String?) returnType:kotlin.Int? $receiver: VALUE_PARAMETER name: type:.IHost @@ -137,37 +158,16 @@ FILE fqName: fileName:/safeCalls.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test5 (s: kotlin.String?): kotlin.Int? declared in ' BLOCK type=kotlin.Int? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.String? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.String? [val] GET_VAR 's: kotlin.String? declared in .test5' type=kotlin.String? origin=null WHEN type=kotlin.Int? 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_4: kotlin.String? declared in .test5' type=kotlin.String? origin=null + arg0: GET_VAR 'val tmp_5: kotlin.String? declared in .test5' type=kotlin.String? 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 open fun extLength (): kotlin.Int declared in .IHost' type=kotlin.Int origin=null $this: GET_VAR ': .IHost declared in .test5' type=.IHost origin=null - $receiver: GET_VAR 'val tmp_4: kotlin.String? declared in .test5' type=kotlin.String? origin=null - FUN name:foo visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Int - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=239 - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Int? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=42 - WHEN type=kotlin.Int? 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_5: kotlin.Int declared in .box' type=kotlin.Int 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 foo (): kotlin.Int declared in ' type=kotlin.Int origin=null - $receiver: GET_VAR 'val tmp_5: kotlin.Int declared in .box' type=kotlin.Int origin=null + $receiver: GET_VAR 'val tmp_5: kotlin.String? declared in .test5' type=kotlin.String? origin=null diff --git a/compiler/testData/ir/irText/expressions/safeCalls.kt.txt b/compiler/testData/ir/irText/expressions/safeCalls.kt.txt index aefcb4e03d5..f600f84e59e 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.kt.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.kt.txt @@ -1,15 +1,15 @@ class Ref { + var value: Int + field = value + get + set + constructor(value: Int) /* primary */ { super/*Any*/() /* () */ } - var value: Int - field = value - get - set - } interface IHost { @@ -19,66 +19,67 @@ interface IHost { } -fun test1(x: String?): Int? { - return { // BLOCK - val tmp_0: String? = x +fun box() { + { // BLOCK + val tmp_0: Int = 42 when { EQEQ(arg0 = tmp_0, arg1 = null) -> null - else -> tmp_0.() + else -> tmp_0.foo() } - } -} - -fun test2(x: String?): Int? { - return { // BLOCK - val tmp_1: String? = x - when { - EQEQ(arg0 = tmp_1, arg1 = null) -> null - else -> tmp_1.hashCode() - } - } -} - -fun test3(x: String?, y: Any?): Boolean? { - return { // BLOCK - val tmp_2: String? = x - when { - EQEQ(arg0 = tmp_2, arg1 = null) -> null - else -> tmp_2.equals(other = y) - } - } -} - -fun test4(x: Ref?) { - { // BLOCK - val tmp_3: Ref? = x - when { - EQEQ(arg0 = tmp_3, arg1 = null) -> null /*~> Unit */ - else -> tmp_3.( = 0) - } - } -} - -fun IHost.test5(s: String?): Int? { - return { // BLOCK - val tmp_4: String? = s - when { - EQEQ(arg0 = tmp_4, arg1 = null) -> null - else -> (, tmp_4).extLength() - } - } + } /*~> Unit */ } fun Int.foo(): Int { return 239 } -fun box() { +fun test1(x: String?): Int? { + return { // BLOCK + val tmp_1: String? = x + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> null + else -> tmp_1.() + } + } +} + +fun test2(x: String?): Int? { + return { // BLOCK + val tmp_2: String? = x + when { + EQEQ(arg0 = tmp_2, arg1 = null) -> null + else -> tmp_2.hashCode() + } + } +} + +fun test3(x: String?, y: Any?): Boolean? { + return { // BLOCK + val tmp_3: String? = x + when { + EQEQ(arg0 = tmp_3, arg1 = null) -> null + else -> tmp_3.equals(other = y) + } + } +} + +fun test4(x: Ref?) { { // BLOCK - val tmp_5: Int = 42 + val tmp_4: Ref? = x + when { + EQEQ(arg0 = tmp_4, arg1 = null) -> null /*~> Unit */ + else -> tmp_4.( = 0) + } + } +} + +fun IHost.test5(s: String?): Int? { + return { // BLOCK + val tmp_5: String? = s when { EQEQ(arg0 = tmp_5, arg1 = null) -> null - else -> tmp_5.foo() + else -> (, tmp_5).extLength() } - } /*~> Unit */ + } } + diff --git a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.ir.txt b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.ir.txt index 1d2cf9cb7a2..5eb98c1faca 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.ir.txt @@ -1,4 +1,6 @@ FILE fqName: fileName:/samConstructors.kt + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY FUN name:test1 visibility:public modality:FINAL <> () returnType:java.lang.Runnable BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (): java.lang.Runnable declared in ' @@ -14,8 +16,6 @@ FILE fqName: fileName:/samConstructors.kt RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Function0): java.lang.Runnable declared in ' TYPE_OP type=java.lang.Runnable origin=SAM_CONVERSION typeOperand=java.lang.Runnable GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY FUN name:test3 visibility:public modality:FINAL <> () returnType:java.lang.Runnable BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3 (): java.lang.Runnable declared in ' diff --git a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.kt.txt index fe137c8037c..bc2ee987f83 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.kt.txt @@ -1,3 +1,6 @@ +fun foo() { +} + fun test1(): Runnable { return local fun () { return Unit @@ -9,9 +12,6 @@ fun test2(a: Function0): Runnable { return a /*-> Runnable */ } -fun foo() { -} - fun test3(): Runnable { return ::foo /*-> Runnable */ } diff --git a/compiler/testData/ir/irText/expressions/sam/samConstructors.ir.txt b/compiler/testData/ir/irText/expressions/sam/samConstructors.ir.txt index 70760e3d878..1257784f13e 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConstructors.ir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConstructors.ir.txt @@ -1,4 +1,6 @@ FILE fqName: fileName:/samConstructors.kt + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY FUN name:test1 visibility:public modality:FINAL <> () returnType:java.lang.Runnable BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (): java.lang.Runnable declared in ' @@ -14,8 +16,6 @@ FILE fqName: fileName:/samConstructors.kt RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Function0): java.lang.Runnable declared in ' TYPE_OP type=java.lang.Runnable origin=SAM_CONVERSION typeOperand=java.lang.Runnable GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY FUN name:test3 visibility:public modality:FINAL <> () returnType:java.lang.Runnable BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3 (): java.lang.Runnable declared in ' diff --git a/compiler/testData/ir/irText/expressions/sam/samConstructors.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConstructors.kt.txt index 8f37f4e186d..ab6798ade1b 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConstructors.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConstructors.kt.txt @@ -1,3 +1,6 @@ +fun foo() { +} + fun test1(): Runnable { return local fun () { return Unit @@ -9,9 +12,6 @@ fun test2(a: Function0): Runnable { return a /*-> Runnable */ } -fun foo() { -} - fun test3(): Runnable { return ::foo /*-> Runnable */ } @@ -22,3 +22,4 @@ fun test4(): Comparator { } /*-> Comparator */ } + diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.ir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.ir.txt index 9aebf5bcfc3..9c86ff1d1dc 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.ir.txt @@ -1,25 +1,7 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt - FUN name:test3 visibility:public modality:FINAL <> (f1:kotlin.Function1, f2:kotlin.Function1) returnType:.C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> - VALUE_PARAMETER name:f1 index:0 type:kotlin.Function1 - VALUE_PARAMETER name:f2 index:1 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3 (f1: kotlin.Function1, f2: kotlin.Function1): .C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> declared in ' - CONSTRUCTOR_CALL 'public constructor (jxy: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] Y of .C.D?>?) declared in .C.D' type=.C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> origin=null - : @[FlexibleNullability] kotlin.Int? - $outer: CONSTRUCTOR_CALL 'public constructor (jxx: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] X of .C?>?) declared in .C' type=.C<@[FlexibleNullability] kotlin.String?> origin=null - : @[FlexibleNullability] kotlin.String? - jxx: TYPE_OP type=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?> origin=SAM_CONVERSION typeOperand=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?> - GET_VAR 'f1: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null - jxy: TYPE_OP type=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Int?> origin=SAM_CONVERSION typeOperand=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Int?> - GET_VAR 'f2: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (j11:.J.Outer, T1 of .Outer>) returnType:.Outer.Outer> [primary] - VALUE_PARAMETER name:j11 index:0 type:.J.Outer, T1 of .Outer> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:j11 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:j11 type:.J.Outer, T1 of .Outer> visibility:private [final] EXPRESSION_BODY @@ -34,12 +16,6 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>, j12:.J.Outer, T2 of .Outer.Inner>) returnType:.Outer.Inner.Outer.Inner, T1 of .Outer> [primary] - $outer: VALUE_PARAMETER name: type:.Outer.Outer> - VALUE_PARAMETER name:j12 index:0 type:.J.Outer, T2 of .Outer.Inner> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' PROPERTY name:j12 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:j12 type:.J.Outer, T2 of .Outer.Inner> visibility:private [final] EXPRESSION_BODY @@ -51,6 +27,12 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt RETURN type=kotlin.Nothing from='public final fun (): .J.Outer, T2 of .Outer.Inner> declared in .Outer.Inner' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j12 type:.J.Outer, T2 of .Outer.Inner> visibility:private [final]' type=.J.Outer, T2 of .Outer.Inner> origin=null receiver: GET_VAR ': .Outer.Inner.Outer.Inner, T1 of .Outer> declared in .Outer.Inner.' type=.Outer.Inner.Outer.Inner, T1 of .Outer> origin=null + CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>, j12:.J.Outer, T2 of .Outer.Inner>) returnType:.Outer.Inner.Outer.Inner, T1 of .Outer> [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Outer> + VALUE_PARAMETER name:j12 index:0 type:.J.Outer, T2 of .Outer.Inner> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] 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 declared in kotlin.Any @@ -64,6 +46,11 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> (j11:.J.Outer, T1 of .Outer>) returnType:.Outer.Outer> [primary] + VALUE_PARAMETER name:j11 index:0 type:.J.Outer, T1 of .Outer> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any @@ -77,6 +64,19 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test3 visibility:public modality:FINAL <> (f1:kotlin.Function1, f2:kotlin.Function1) returnType:.C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> + VALUE_PARAMETER name:f1 index:0 type:kotlin.Function1 + VALUE_PARAMETER name:f2 index:1 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (f1: kotlin.Function1, f2: kotlin.Function1): .C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> declared in ' + CONSTRUCTOR_CALL 'public constructor (jxy: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] Y of .C.D?>?) declared in .C.D' type=.C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> origin=null + : @[FlexibleNullability] kotlin.Int? + $outer: CONSTRUCTOR_CALL 'public constructor (jxx: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] X of .C?>?) declared in .C' type=.C<@[FlexibleNullability] kotlin.String?> origin=null + : @[FlexibleNullability] kotlin.String? + jxx: TYPE_OP type=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?> origin=SAM_CONVERSION typeOperand=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?> + GET_VAR 'f1: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null + jxy: TYPE_OP type=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Int?> origin=SAM_CONVERSION typeOperand=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Int?> + GET_VAR 'f2: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null FUN name:test4 visibility:public modality:FINAL <> (f:kotlin.Function1, g:kotlin.Function1) returnType:.Outer.Inner<@[FlexibleNullability] kotlin.Any?, @[FlexibleNullability] kotlin.String?> VALUE_PARAMETER name:f index:0 type:kotlin.Function1 VALUE_PARAMETER name:g index:1 type:kotlin.Function1 diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.kt.txt index c1048ded706..5248499b82e 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.kt.txt @@ -1,33 +1,33 @@ -fun test3(f1: Function1, f2: Function1): D<@FlexibleNullability Int?, @FlexibleNullability String?> { - return C<@FlexibleNullability String?>(jxx = f1 /*-> J<@FlexibleNullability String?, @FlexibleNullability String?> */).D<@FlexibleNullability Int?>(jxy = f2 /*-> J<@FlexibleNullability String?, @FlexibleNullability Int?> */) -} - class Outer { - constructor(j11: J) /* primary */ { - super/*Any*/() - /* () */ - - } - val j11: J field = j11 get inner class Inner { + val j12: J + field = j12 + get + constructor(j12: J) /* primary */ { super/*Any*/() /* () */ } - val j12: J - field = j12 - get + } + + constructor(j11: J) /* primary */ { + super/*Any*/() + /* () */ } } +fun test3(f1: Function1, f2: Function1): D<@FlexibleNullability Int?, @FlexibleNullability String?> { + return C<@FlexibleNullability String?>(jxx = f1 /*-> J<@FlexibleNullability String?, @FlexibleNullability String?> */).D<@FlexibleNullability Int?>(jxy = f2 /*-> J<@FlexibleNullability String?, @FlexibleNullability Int?> */) +} + fun test4(f: Function1, g: Function1): Inner<@FlexibleNullability Any?, @FlexibleNullability String?> { return Outer<@FlexibleNullability String?>(j11 = f /*-> J<@FlexibleNullability String?, @FlexibleNullability String?> */).Inner<@FlexibleNullability Any?>(j12 = g /*-> J<@FlexibleNullability String?, @FlexibleNullability Any?> */) } @@ -40,3 +40,4 @@ fun testGenericJavaCtor2(x: Any) { x as Function1 /*~> Unit */ G<@FlexibleNullability String?, @FlexibleNullability Int?>(x = x /*as Function1 */ /*-> J<@FlexibleNullability Int?, @FlexibleNullability String?> */) /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.ir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.ir.txt index 4cf05cf77cf..069d1c3ff18 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.ir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.ir.txt @@ -1,25 +1,7 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt - FUN name:test3 visibility:public modality:FINAL <> (f1:kotlin.Function1, f2:kotlin.Function1) returnType:.C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> - VALUE_PARAMETER name:f1 index:0 type:kotlin.Function1 - VALUE_PARAMETER name:f2 index:1 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3 (f1: kotlin.Function1, f2: kotlin.Function1): .C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> declared in ' - CONSTRUCTOR_CALL 'public constructor (jxy: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] Y of .C.D?>?) declared in .C.D' type=.C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> origin=null - : @[FlexibleNullability] kotlin.Int? - $outer: CONSTRUCTOR_CALL 'public constructor (jxx: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] X of .C?>?) declared in .C' type=.C<@[FlexibleNullability] kotlin.String?> origin=null - : @[FlexibleNullability] kotlin.String? - jxx: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?>? - GET_VAR 'f1: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null - jxy: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Int?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Int?>? - GET_VAR 'f2: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (j11:.J.Outer, T1 of .Outer>) returnType:.Outer.Outer> [primary] - VALUE_PARAMETER name:j11 index:0 type:.J.Outer, T1 of .Outer> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:j11 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:j11 type:.J.Outer, T1 of .Outer> visibility:private [final] EXPRESSION_BODY @@ -34,12 +16,6 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>, j12:.J.Outer, T2 of .Outer.Inner>) returnType:.Outer.Inner.Outer.Inner, T1 of .Outer> [primary] - $outer: VALUE_PARAMETER name: type:.Outer.Outer> - VALUE_PARAMETER name:j12 index:0 type:.J.Outer, T2 of .Outer.Inner> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' PROPERTY name:j12 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:j12 type:.J.Outer, T2 of .Outer.Inner> visibility:private [final] EXPRESSION_BODY @@ -51,6 +27,12 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt RETURN type=kotlin.Nothing from='public final fun (): .J.Outer, T2 of .Outer.Inner> declared in .Outer.Inner' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j12 type:.J.Outer, T2 of .Outer.Inner> visibility:private [final]' type=.J.Outer, T2 of .Outer.Inner> origin=null receiver: GET_VAR ': .Outer.Inner.Outer.Inner, T1 of .Outer> declared in .Outer.Inner.' type=.Outer.Inner.Outer.Inner, T1 of .Outer> origin=null + CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>, j12:.J.Outer, T2 of .Outer.Inner>) returnType:.Outer.Inner.Outer.Inner, T1 of .Outer> [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Outer> + VALUE_PARAMETER name:j12 index:0 type:.J.Outer, T2 of .Outer.Inner> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] 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 declared in kotlin.Any @@ -64,6 +46,11 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> (j11:.J.Outer, T1 of .Outer>) returnType:.Outer.Outer> [primary] + VALUE_PARAMETER name:j11 index:0 type:.J.Outer, T1 of .Outer> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any @@ -77,6 +64,19 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test3 visibility:public modality:FINAL <> (f1:kotlin.Function1, f2:kotlin.Function1) returnType:.C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> + VALUE_PARAMETER name:f1 index:0 type:kotlin.Function1 + VALUE_PARAMETER name:f2 index:1 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (f1: kotlin.Function1, f2: kotlin.Function1): .C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> declared in ' + CONSTRUCTOR_CALL 'public constructor (jxy: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] Y of .C.D?>?) declared in .C.D' type=.C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> origin=null + : @[FlexibleNullability] kotlin.Int? + $outer: CONSTRUCTOR_CALL 'public constructor (jxx: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] X of .C?>?) declared in .C' type=.C<@[FlexibleNullability] kotlin.String?> origin=null + : @[FlexibleNullability] kotlin.String? + jxx: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?>? + GET_VAR 'f1: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null + jxy: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Int?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Int?>? + GET_VAR 'f2: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null FUN name:test4 visibility:public modality:FINAL <> (f:kotlin.Function1, g:kotlin.Function1) returnType:.Outer.Inner<@[FlexibleNullability] kotlin.Any?, @[FlexibleNullability] kotlin.String?> VALUE_PARAMETER name:f index:0 type:kotlin.Function1 VALUE_PARAMETER name:g index:1 type:kotlin.Function1 diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt.txt index 4de1ad8e837..58c835fd807 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt.txt @@ -1,33 +1,33 @@ -fun test3(f1: Function1, f2: Function1): D<@FlexibleNullability Int?, @FlexibleNullability String?> { - return C<@FlexibleNullability String?>(jxx = f1 /*-> @FlexibleNullability J<@FlexibleNullability String?, @FlexibleNullability String?>? */).D<@FlexibleNullability Int?>(jxy = f2 /*-> @FlexibleNullability J<@FlexibleNullability String?, @FlexibleNullability Int?>? */) -} - class Outer { - constructor(j11: J) /* primary */ { - super/*Any*/() - /* () */ - - } - val j11: J field = j11 get inner class Inner { + val j12: J + field = j12 + get + constructor(j12: J) /* primary */ { super/*Any*/() /* () */ } - val j12: J - field = j12 - get + } + + constructor(j11: J) /* primary */ { + super/*Any*/() + /* () */ } } +fun test3(f1: Function1, f2: Function1): D<@FlexibleNullability Int?, @FlexibleNullability String?> { + return C<@FlexibleNullability String?>(jxx = f1 /*-> @FlexibleNullability J<@FlexibleNullability String?, @FlexibleNullability String?>? */).D<@FlexibleNullability Int?>(jxy = f2 /*-> @FlexibleNullability J<@FlexibleNullability String?, @FlexibleNullability Int?>? */) +} + fun test4(f: Function1, g: Function1): Inner<@FlexibleNullability Any?, @FlexibleNullability String?> { return Outer<@FlexibleNullability String?>(j11 = f /*-> J<@FlexibleNullability String?, @FlexibleNullability String?> */).Inner<@FlexibleNullability Any?>(j12 = g /*-> J<@FlexibleNullability String?, @FlexibleNullability Any?> */) } diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.ir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.ir.txt index 3506aea4819..a0724f2867f 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.ir.txt @@ -9,6 +9,13 @@ FILE fqName: fileName:/samConversionToGeneric.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (x: @[FlexibleNullability] kotlin.String?): @[FlexibleNullability] kotlin.String? declared in .test1' GET_VAR 'x: @[FlexibleNullability] kotlin.String? declared in .test1.' type=@[FlexibleNullability] kotlin.String? origin=null + FUN name:test10 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + CALL 'public open fun bar2x (j2x: @[FlexibleNullability] .J2X<@[FlexibleNullability] Y of .H.bar2x?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Int? + j2x: TYPE_OP type=.J2X<@[FlexibleNullability] kotlin.Int?> origin=SAM_CONVERSION typeOperand=.J2X<@[FlexibleNullability] kotlin.Int?> + GET_VAR 'fn: kotlin.Function1 declared in .test10' type=kotlin.Function1 origin=null FUN name:test2 visibility:public modality:FINAL <> () returnType:.J<@[FlexibleNullability] kotlin.String?> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (): .J<@[FlexibleNullability] kotlin.String?> declared in ' @@ -85,10 +92,3 @@ FILE fqName: fileName:/samConversionToGeneric.kt : @[FlexibleNullability] kotlin.String? j: TYPE_OP type=.J<@[FlexibleNullability] kotlin.String?> origin=SAM_CONVERSION typeOperand=.J<@[FlexibleNullability] kotlin.String?> GET_VAR 'efn: @[ExtensionFunctionType] kotlin.Function1 declared in .test9' type=@[ExtensionFunctionType] kotlin.Function1 origin=null - FUN name:test10 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - CALL 'public open fun bar2x (j2x: @[FlexibleNullability] .J2X<@[FlexibleNullability] Y of .H.bar2x?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null - : @[FlexibleNullability] kotlin.Int? - j2x: TYPE_OP type=.J2X<@[FlexibleNullability] kotlin.Int?> origin=SAM_CONVERSION typeOperand=.J2X<@[FlexibleNullability] kotlin.Int?> - GET_VAR 'fn: kotlin.Function1 declared in .test10' type=kotlin.Function1 origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.kt.txt index 4b5201bcc10..00efc9b0e1c 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.kt.txt @@ -5,6 +5,10 @@ fun test1(): J { /*-> J */ } +fun test10(fn: Function1) { + bar2x<@FlexibleNullability Int?>(j2x = fn /*-> J2X<@FlexibleNullability Int?> */) +} + fun test2(): J<@FlexibleNullability String?> { return local fun (x: String): @FlexibleNullability String? { return x @@ -46,6 +50,3 @@ fun test9(efn: @ExtensionFunctionType Function1) { bar<@FlexibleNullability String?>(j = efn /*-> J<@FlexibleNullability String?> */) } -fun test10(fn: Function1) { - bar2x<@FlexibleNullability Int?>(j2x = fn /*-> J2X<@FlexibleNullability Int?> */) -} diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.ir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.ir.txt index b0dd2f02d6d..bbafa7b37d8 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.ir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.ir.txt @@ -9,6 +9,13 @@ FILE fqName: fileName:/samConversionToGeneric.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (x: @[FlexibleNullability] kotlin.String?): @[FlexibleNullability] kotlin.String? declared in .test1' GET_VAR 'x: @[FlexibleNullability] kotlin.String? declared in .test1.' type=@[FlexibleNullability] kotlin.String? origin=null + FUN name:test10 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + CALL 'public open fun bar2x (j2x: @[FlexibleNullability] .J2X<@[FlexibleNullability] Y of .H.bar2x?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Int? + j2x: TYPE_OP type=@[FlexibleNullability] .J2X<@[FlexibleNullability] kotlin.Int?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J2X<@[FlexibleNullability] kotlin.Int?>? + GET_VAR 'fn: kotlin.Function1 declared in .test10' type=kotlin.Function1 origin=null FUN name:test2 visibility:public modality:FINAL <> () returnType:.J<@[FlexibleNullability] kotlin.String?> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (): .J<@[FlexibleNullability] kotlin.String?> declared in ' @@ -85,10 +92,3 @@ FILE fqName: fileName:/samConversionToGeneric.kt : @[FlexibleNullability] kotlin.String? j: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?>? GET_VAR 'efn: @[ExtensionFunctionType] kotlin.Function1 declared in .test9' type=@[ExtensionFunctionType] kotlin.Function1 origin=null - FUN name:test10 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - CALL 'public open fun bar2x (j2x: @[FlexibleNullability] .J2X<@[FlexibleNullability] Y of .H.bar2x?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null - : @[FlexibleNullability] kotlin.Int? - j2x: TYPE_OP type=@[FlexibleNullability] .J2X<@[FlexibleNullability] kotlin.Int?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J2X<@[FlexibleNullability] kotlin.Int?>? - GET_VAR 'fn: kotlin.Function1 declared in .test10' type=kotlin.Function1 origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.kt.txt index d66d06283e8..ab24eda1978 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.kt.txt @@ -5,6 +5,10 @@ fun test1(): J { /*-> J */ } +fun test10(fn: Function1) { + bar2x<@FlexibleNullability Int?>(j2x = fn /*-> @FlexibleNullability J2X<@FlexibleNullability Int?>? */) +} + fun test2(): J<@FlexibleNullability String?> { return local fun (x: String): @FlexibleNullability String? { return x @@ -46,6 +50,3 @@ fun test9(efn: @ExtensionFunctionType Function1) { bar<@FlexibleNullability String?>(j = efn /*-> @FlexibleNullability J<@FlexibleNullability String?>? */) } -fun test10(fn: Function1) { - bar2x<@FlexibleNullability Int?>(j2x = fn /*-> @FlexibleNullability J2X<@FlexibleNullability Int?>? */) -} diff --git a/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.fir.ir.txt b/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.fir.ir.txt index 1e7343ac43f..b2adb710e09 100644 --- a/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.fir.ir.txt @@ -5,19 +5,6 @@ FILE fqName: fileName:/Derived.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base]' - FUN name:setValue visibility:public modality:FINAL <> ($this:.Derived, v:kotlin.Any) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Derived - VALUE_PARAMETER name:v index:0 type:kotlin.Any - BLOCK_BODY - WHEN type=kotlin.Unit origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String - GET_VAR 'v: kotlin.Any declared in .Derived.setValue' type=kotlin.Any origin=null - then: BLOCK type=kotlin.Unit origin=null - SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:@[FlexibleNullability] kotlin.String? visibility:public' type=kotlin.Unit origin=EQ - receiver: GET_VAR ': .Derived declared in .Derived.setValue' type=.Derived origin=null - value: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'v: kotlin.Any declared in .Derived.setValue' type=kotlin.Any 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 .Base @@ -31,3 +18,16 @@ FILE fqName: fileName:/Derived.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:setValue visibility:public modality:FINAL <> ($this:.Derived, v:kotlin.Any) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Derived + VALUE_PARAMETER name:v index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String + GET_VAR 'v: kotlin.Any declared in .Derived.setValue' type=kotlin.Any origin=null + then: BLOCK type=kotlin.Unit origin=null + SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:@[FlexibleNullability] kotlin.String? visibility:public' type=kotlin.Unit origin=EQ + receiver: GET_VAR ': .Derived declared in .Derived.setValue' type=.Derived origin=null + value: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'v: kotlin.Any declared in .Derived.setValue' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.ir.txt b/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.ir.txt index 58cf56445aa..4c7a07834ec 100644 --- a/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.ir.txt +++ b/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.ir.txt @@ -5,19 +5,6 @@ FILE fqName: fileName:/Derived.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base]' - FUN name:setValue visibility:public modality:FINAL <> ($this:.Derived, v:kotlin.Any) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Derived - VALUE_PARAMETER name:v index:0 type:kotlin.Any - BLOCK_BODY - WHEN type=kotlin.Unit origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String - GET_VAR 'v: kotlin.Any declared in .Derived.setValue' type=kotlin.Any origin=null - then: BLOCK type=kotlin.Unit origin=null - SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:@[FlexibleNullability] kotlin.String? visibility:public' type=kotlin.Unit origin=EQ - receiver: GET_VAR ': .Derived declared in .Derived.setValue' type=.Derived origin=null - value: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'v: kotlin.Any declared in .Derived.setValue' type=kotlin.Any 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 .Base @@ -31,6 +18,19 @@ FILE fqName: fileName:/Derived.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:setValue visibility:public modality:FINAL <> ($this:.Derived, v:kotlin.Any) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Derived + VALUE_PARAMETER name:v index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String + GET_VAR 'v: kotlin.Any declared in .Derived.setValue' type=kotlin.Any origin=null + then: BLOCK type=kotlin.Unit origin=null + SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:@[FlexibleNullability] kotlin.String? visibility:public' type=kotlin.Unit origin=EQ + receiver: GET_VAR ': .Derived declared in .Derived.setValue' type=.Derived origin=null + value: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'v: kotlin.Any declared in .Derived.setValue' type=kotlin.Any origin=null PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,var] overridden: public final value: @[FlexibleNullability] kotlin.String? diff --git a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.fir.ir.txt b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.fir.ir.txt index a677baa81bd..776a940fa89 100644 --- a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.fir.ir.txt @@ -19,39 +19,6 @@ FILE fqName:kotlin.internal fileName:/signedToUnsignedConversions_annotation.kt public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any FILE fqName: fileName:/signedToUnsignedConversions_test.kt - PROPERTY name:IMPLICIT_INT visibility:public modality:FINAL [const,val] - annotations: - ImplicitIntegerCoercion - FIELD PROPERTY_BACKING_FIELD name:IMPLICIT_INT type:kotlin.Int visibility:public [final,static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=255 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:IMPLICIT_INT visibility:public modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:IMPLICIT_INT type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null - PROPERTY name:EXPLICIT_INT visibility:public modality:FINAL [const,val] - annotations: - ImplicitIntegerCoercion - FIELD PROPERTY_BACKING_FIELD name:EXPLICIT_INT type:kotlin.Int visibility:public [final,static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=255 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:EXPLICIT_INT visibility:public modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:EXPLICIT_INT type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null - PROPERTY name:LONG_CONST visibility:public modality:FINAL [const,val] - annotations: - ImplicitIntegerCoercion - FIELD PROPERTY_BACKING_FIELD name:LONG_CONST type:kotlin.Long visibility:public [final,static] - EXPRESSION_BODY - CONST Long type=kotlin.Long value=255 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long - correspondingProperty: PROPERTY name:LONG_CONST visibility:public modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:LONG_CONST type:kotlin.Long visibility:public [final,static]' type=kotlin.Long origin=null PROPERTY name:NON_CONST visibility:public modality:FINAL [val] annotations: ImplicitIntegerCoercion @@ -63,35 +30,18 @@ FILE fqName: fileName:/signedToUnsignedConversions_test.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:NON_CONST type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null - PROPERTY name:BIGGER_THAN_UBYTE visibility:public modality:FINAL [const,val] - annotations: - ImplicitIntegerCoercion - FIELD PROPERTY_BACKING_FIELD name:BIGGER_THAN_UBYTE type:kotlin.Int visibility:public [final,static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=256 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:BIGGER_THAN_UBYTE visibility:public modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:BIGGER_THAN_UBYTE type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null - PROPERTY name:UINT_CONST visibility:public modality:FINAL [const,val] - annotations: - ImplicitIntegerCoercion - FIELD PROPERTY_BACKING_FIELD name:UINT_CONST type:kotlin.UInt visibility:public [final,static] - EXPRESSION_BODY - CONST Int type=kotlin.UInt value=42 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.UInt - correspondingProperty: PROPERTY name:UINT_CONST visibility:public modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.UInt declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:UINT_CONST type:kotlin.UInt visibility:public [final,static]' type=kotlin.UInt origin=null + FUN name:takeLong visibility:public modality:FINAL <> (l:kotlin.Long) returnType:kotlin.Unit + VALUE_PARAMETER name:l index:0 type:kotlin.Long + annotations: + ImplicitIntegerCoercion + BLOCK_BODY FUN name:takeUByte visibility:public modality:FINAL <> (u:kotlin.UByte) returnType:kotlin.Unit VALUE_PARAMETER name:u index:0 type:kotlin.UByte annotations: ImplicitIntegerCoercion BLOCK_BODY - FUN name:takeUShort visibility:public modality:FINAL <> (u:kotlin.UShort) returnType:kotlin.Unit - VALUE_PARAMETER name:u index:0 type:kotlin.UShort + FUN name:takeUBytes visibility:public modality:FINAL <> (u:kotlin.UByteArray) returnType:kotlin.Unit + VALUE_PARAMETER name:u index:0 type:kotlin.UByteArray varargElementType:kotlin.UByte [vararg] annotations: ImplicitIntegerCoercion BLOCK_BODY @@ -105,13 +55,8 @@ FILE fqName: fileName:/signedToUnsignedConversions_test.kt annotations: ImplicitIntegerCoercion BLOCK_BODY - FUN name:takeUBytes visibility:public modality:FINAL <> (u:kotlin.UByteArray) returnType:kotlin.Unit - VALUE_PARAMETER name:u index:0 type:kotlin.UByteArray varargElementType:kotlin.UByte [vararg] - annotations: - ImplicitIntegerCoercion - BLOCK_BODY - FUN name:takeLong visibility:public modality:FINAL <> (l:kotlin.Long) returnType:kotlin.Unit - VALUE_PARAMETER name:l index:0 type:kotlin.Long + FUN name:takeUShort visibility:public modality:FINAL <> (u:kotlin.UShort) returnType:kotlin.Unit + VALUE_PARAMETER name:u index:0 type:kotlin.UShort annotations: ImplicitIntegerCoercion BLOCK_BODY @@ -142,3 +87,58 @@ FILE fqName: fileName:/signedToUnsignedConversions_test.kt CALL 'public final fun toUByte (): kotlin.UByte declared in kotlin' type=kotlin.UByte origin=null $receiver: CONST Int type=kotlin.Int value=255 CONST Byte type=kotlin.UByte value=42 + PROPERTY name:BIGGER_THAN_UBYTE visibility:public modality:FINAL [const,val] + annotations: + ImplicitIntegerCoercion + FIELD PROPERTY_BACKING_FIELD name:BIGGER_THAN_UBYTE type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=256 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:BIGGER_THAN_UBYTE visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:BIGGER_THAN_UBYTE type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null + PROPERTY name:EXPLICIT_INT visibility:public modality:FINAL [const,val] + annotations: + ImplicitIntegerCoercion + FIELD PROPERTY_BACKING_FIELD name:EXPLICIT_INT type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=255 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:EXPLICIT_INT visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:EXPLICIT_INT type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null + PROPERTY name:IMPLICIT_INT visibility:public modality:FINAL [const,val] + annotations: + ImplicitIntegerCoercion + FIELD PROPERTY_BACKING_FIELD name:IMPLICIT_INT type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=255 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:IMPLICIT_INT visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:IMPLICIT_INT type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null + PROPERTY name:LONG_CONST visibility:public modality:FINAL [const,val] + annotations: + ImplicitIntegerCoercion + FIELD PROPERTY_BACKING_FIELD name:LONG_CONST type:kotlin.Long visibility:public [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.Long value=255 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:LONG_CONST visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:LONG_CONST type:kotlin.Long visibility:public [final,static]' type=kotlin.Long origin=null + PROPERTY name:UINT_CONST visibility:public modality:FINAL [const,val] + annotations: + ImplicitIntegerCoercion + FIELD PROPERTY_BACKING_FIELD name:UINT_CONST type:kotlin.UInt visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.UInt value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.UInt + correspondingProperty: PROPERTY name:UINT_CONST visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.UInt declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:UINT_CONST type:kotlin.UInt visibility:public [final,static]' type=kotlin.UInt origin=null diff --git a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.fir.kt.txt b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.fir.kt.txt index 6dbc5753b49..8d08531c3d2 100644 --- a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.fir.kt.txt @@ -12,40 +12,18 @@ open annotation class ImplicitIntegerCoercion : Annotation { // FILE: signedToUnsignedConversions_test.kt -@ImplicitIntegerCoercion -const val IMPLICIT_INT: Int - field = 255 - get - -@ImplicitIntegerCoercion -const val EXPLICIT_INT: Int - field = 255 - get - -@ImplicitIntegerCoercion -const val LONG_CONST: Long - field = 255L - get - @ImplicitIntegerCoercion val NON_CONST: Int field = 255 get -@ImplicitIntegerCoercion -const val BIGGER_THAN_UBYTE: Int - field = 256 - get - -@ImplicitIntegerCoercion -const val UINT_CONST: UInt - field = 42 - get +fun takeLong(@ImplicitIntegerCoercion l: Long) { +} fun takeUByte(@ImplicitIntegerCoercion u: UByte) { } -fun takeUShort(@ImplicitIntegerCoercion u: UShort) { +fun takeUBytes(@ImplicitIntegerCoercion vararg u: UByte) { } fun takeUInt(@ImplicitIntegerCoercion u: UInt) { @@ -54,10 +32,7 @@ fun takeUInt(@ImplicitIntegerCoercion u: UInt) { fun takeULong(@ImplicitIntegerCoercion u: ULong) { } -fun takeUBytes(@ImplicitIntegerCoercion vararg u: UByte) { -} - -fun takeLong(@ImplicitIntegerCoercion l: Long) { +fun takeUShort(@ImplicitIntegerCoercion u: UShort) { } fun test() { @@ -69,3 +44,29 @@ fun test() { takeULong(u = 255.toULong()) takeUBytes(u = [255.toUByte(), 255.toUByte(), 42B]) } + +@ImplicitIntegerCoercion +const val BIGGER_THAN_UBYTE: Int + field = 256 + get + +@ImplicitIntegerCoercion +const val EXPLICIT_INT: Int + field = 255 + get + +@ImplicitIntegerCoercion +const val IMPLICIT_INT: Int + field = 255 + get + +@ImplicitIntegerCoercion +const val LONG_CONST: Long + field = 255L + get + +@ImplicitIntegerCoercion +const val UINT_CONST: UInt + field = 42 + get + diff --git a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.ir.txt b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.ir.txt index 77f0936b2d1..df5c76db548 100644 --- a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.ir.txt +++ b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.ir.txt @@ -19,39 +19,6 @@ FILE fqName:kotlin.internal fileName:/signedToUnsignedConversions_annotation.kt public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any FILE fqName: fileName:/signedToUnsignedConversions_test.kt - PROPERTY name:IMPLICIT_INT visibility:public modality:FINAL [const,val] - annotations: - ImplicitIntegerCoercion - FIELD PROPERTY_BACKING_FIELD name:IMPLICIT_INT type:kotlin.Int visibility:public [final,static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=255 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:IMPLICIT_INT visibility:public modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:IMPLICIT_INT type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null - PROPERTY name:EXPLICIT_INT visibility:public modality:FINAL [const,val] - annotations: - ImplicitIntegerCoercion - FIELD PROPERTY_BACKING_FIELD name:EXPLICIT_INT type:kotlin.Int visibility:public [final,static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=255 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:EXPLICIT_INT visibility:public modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:EXPLICIT_INT type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null - PROPERTY name:LONG_CONST visibility:public modality:FINAL [const,val] - annotations: - ImplicitIntegerCoercion - FIELD PROPERTY_BACKING_FIELD name:LONG_CONST type:kotlin.Long visibility:public [final,static] - EXPRESSION_BODY - CONST Long type=kotlin.Long value=255 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long - correspondingProperty: PROPERTY name:LONG_CONST visibility:public modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:LONG_CONST type:kotlin.Long visibility:public [final,static]' type=kotlin.Long origin=null PROPERTY name:NON_CONST visibility:public modality:FINAL [val] annotations: ImplicitIntegerCoercion @@ -63,35 +30,18 @@ FILE fqName: fileName:/signedToUnsignedConversions_test.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:NON_CONST type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null - PROPERTY name:BIGGER_THAN_UBYTE visibility:public modality:FINAL [const,val] - annotations: - ImplicitIntegerCoercion - FIELD PROPERTY_BACKING_FIELD name:BIGGER_THAN_UBYTE type:kotlin.Int visibility:public [final,static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=256 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:BIGGER_THAN_UBYTE visibility:public modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:BIGGER_THAN_UBYTE type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null - PROPERTY name:UINT_CONST visibility:public modality:FINAL [const,val] - annotations: - ImplicitIntegerCoercion - FIELD PROPERTY_BACKING_FIELD name:UINT_CONST type:kotlin.UInt visibility:public [final,static] - EXPRESSION_BODY - CONST Int type=kotlin.UInt value=42 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.UInt - correspondingProperty: PROPERTY name:UINT_CONST visibility:public modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.UInt declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:UINT_CONST type:kotlin.UInt visibility:public [final,static]' type=kotlin.UInt origin=null + FUN name:takeLong visibility:public modality:FINAL <> (l:kotlin.Long) returnType:kotlin.Unit + VALUE_PARAMETER name:l index:0 type:kotlin.Long + annotations: + ImplicitIntegerCoercion + BLOCK_BODY FUN name:takeUByte visibility:public modality:FINAL <> (u:kotlin.UByte) returnType:kotlin.Unit VALUE_PARAMETER name:u index:0 type:kotlin.UByte annotations: ImplicitIntegerCoercion BLOCK_BODY - FUN name:takeUShort visibility:public modality:FINAL <> (u:kotlin.UShort) returnType:kotlin.Unit - VALUE_PARAMETER name:u index:0 type:kotlin.UShort + FUN name:takeUBytes visibility:public modality:FINAL <> (u:kotlin.UByteArray) returnType:kotlin.Unit + VALUE_PARAMETER name:u index:0 type:kotlin.UByteArray varargElementType:kotlin.UByte [vararg] annotations: ImplicitIntegerCoercion BLOCK_BODY @@ -105,13 +55,8 @@ FILE fqName: fileName:/signedToUnsignedConversions_test.kt annotations: ImplicitIntegerCoercion BLOCK_BODY - FUN name:takeUBytes visibility:public modality:FINAL <> (u:kotlin.UByteArray) returnType:kotlin.Unit - VALUE_PARAMETER name:u index:0 type:kotlin.UByteArray varargElementType:kotlin.UByte [vararg] - annotations: - ImplicitIntegerCoercion - BLOCK_BODY - FUN name:takeLong visibility:public modality:FINAL <> (l:kotlin.Long) returnType:kotlin.Unit - VALUE_PARAMETER name:l index:0 type:kotlin.Long + FUN name:takeUShort visibility:public modality:FINAL <> (u:kotlin.UShort) returnType:kotlin.Unit + VALUE_PARAMETER name:u index:0 type:kotlin.UShort annotations: ImplicitIntegerCoercion BLOCK_BODY @@ -142,3 +87,58 @@ FILE fqName: fileName:/signedToUnsignedConversions_test.kt CALL 'public final fun toUByte (): kotlin.UByte declared in kotlin' type=kotlin.UByte origin=null $receiver: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY CONST Byte type=kotlin.UByte value=42 + PROPERTY name:BIGGER_THAN_UBYTE visibility:public modality:FINAL [const,val] + annotations: + ImplicitIntegerCoercion + FIELD PROPERTY_BACKING_FIELD name:BIGGER_THAN_UBYTE type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=256 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:BIGGER_THAN_UBYTE visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:BIGGER_THAN_UBYTE type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null + PROPERTY name:EXPLICIT_INT visibility:public modality:FINAL [const,val] + annotations: + ImplicitIntegerCoercion + FIELD PROPERTY_BACKING_FIELD name:EXPLICIT_INT type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=255 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:EXPLICIT_INT visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:EXPLICIT_INT type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null + PROPERTY name:IMPLICIT_INT visibility:public modality:FINAL [const,val] + annotations: + ImplicitIntegerCoercion + FIELD PROPERTY_BACKING_FIELD name:IMPLICIT_INT type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=255 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:IMPLICIT_INT visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:IMPLICIT_INT type:kotlin.Int visibility:public [final,static]' type=kotlin.Int origin=null + PROPERTY name:LONG_CONST visibility:public modality:FINAL [const,val] + annotations: + ImplicitIntegerCoercion + FIELD PROPERTY_BACKING_FIELD name:LONG_CONST type:kotlin.Long visibility:public [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.Long value=255 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:LONG_CONST visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:LONG_CONST type:kotlin.Long visibility:public [final,static]' type=kotlin.Long origin=null + PROPERTY name:UINT_CONST visibility:public modality:FINAL [const,val] + annotations: + ImplicitIntegerCoercion + FIELD PROPERTY_BACKING_FIELD name:UINT_CONST type:kotlin.UInt visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.UInt value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.UInt + correspondingProperty: PROPERTY name:UINT_CONST visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.UInt declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:UINT_CONST type:kotlin.UInt visibility:public [final,static]' type=kotlin.UInt origin=null diff --git a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.kt.txt b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.kt.txt index 7773f4d600f..0411de33fd8 100644 --- a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.kt.txt +++ b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.kt.txt @@ -12,40 +12,18 @@ open annotation class ImplicitIntegerCoercion : Annotation { // FILE: signedToUnsignedConversions_test.kt -@ImplicitIntegerCoercion -const val IMPLICIT_INT: Int - field = 255 - get - -@ImplicitIntegerCoercion -const val EXPLICIT_INT: Int - field = 255 - get - -@ImplicitIntegerCoercion -const val LONG_CONST: Long - field = 255L - get - @ImplicitIntegerCoercion val NON_CONST: Int field = 255 get -@ImplicitIntegerCoercion -const val BIGGER_THAN_UBYTE: Int - field = 256 - get - -@ImplicitIntegerCoercion -const val UINT_CONST: UInt - field = 42 - get +fun takeLong(@ImplicitIntegerCoercion l: Long) { +} fun takeUByte(@ImplicitIntegerCoercion u: UByte) { } -fun takeUShort(@ImplicitIntegerCoercion u: UShort) { +fun takeUBytes(@ImplicitIntegerCoercion vararg u: UByte) { } fun takeUInt(@ImplicitIntegerCoercion u: UInt) { @@ -54,10 +32,7 @@ fun takeUInt(@ImplicitIntegerCoercion u: UInt) { fun takeULong(@ImplicitIntegerCoercion u: ULong) { } -fun takeUBytes(@ImplicitIntegerCoercion vararg u: UByte) { -} - -fun takeLong(@ImplicitIntegerCoercion l: Long) { +fun takeUShort(@ImplicitIntegerCoercion u: UShort) { } fun test() { @@ -69,3 +44,29 @@ fun test() { takeULong(u = ().toULong()) takeUBytes(u = [().toUByte(), ().toUByte(), 42B]) } + +@ImplicitIntegerCoercion +const val BIGGER_THAN_UBYTE: Int + field = 256 + get + +@ImplicitIntegerCoercion +const val EXPLICIT_INT: Int + field = 255 + get + +@ImplicitIntegerCoercion +const val IMPLICIT_INT: Int + field = 255 + get + +@ImplicitIntegerCoercion +const val LONG_CONST: Long + field = 255L + get + +@ImplicitIntegerCoercion +const val UINT_CONST: UInt + field = 42 + get + diff --git a/compiler/testData/ir/irText/expressions/simpleOperators.ir.txt b/compiler/testData/ir/irText/expressions/simpleOperators.ir.txt index 8a4f97bfa97..ef71375e9d0 100644 --- a/compiler/testData/ir/irText/expressions/simpleOperators.ir.txt +++ b/compiler/testData/ir/irText/expressions/simpleOperators.ir.txt @@ -7,46 +7,6 @@ FILE fqName: fileName:/simpleOperators.kt CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS $this: GET_VAR 'a: kotlin.Int declared in .test1' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test1' type=kotlin.Int origin=null - FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int - VALUE_PARAMETER name:a index:0 type:kotlin.Int - VALUE_PARAMETER name:b index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUS - $this: GET_VAR 'a: kotlin.Int declared in .test2' type=kotlin.Int origin=null - other: GET_VAR 'b: kotlin.Int declared in .test2' type=kotlin.Int origin=null - FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int - VALUE_PARAMETER name:a index:0 type:kotlin.Int - VALUE_PARAMETER name:b index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MUL - $this: GET_VAR 'a: kotlin.Int declared in .test3' type=kotlin.Int origin=null - other: GET_VAR 'b: kotlin.Int declared in .test3' type=kotlin.Int origin=null - FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int - VALUE_PARAMETER name:a index:0 type:kotlin.Int - VALUE_PARAMETER name:b index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=DIV - $this: GET_VAR 'a: kotlin.Int declared in .test4' type=kotlin.Int origin=null - other: GET_VAR 'b: kotlin.Int declared in .test4' type=kotlin.Int origin=null - FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int - VALUE_PARAMETER name:a index:0 type:kotlin.Int - VALUE_PARAMETER name:b index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PERC - $this: GET_VAR 'a: kotlin.Int declared in .test5' type=kotlin.Int origin=null - other: GET_VAR 'b: kotlin.Int declared in .test5' type=kotlin.Int origin=null - FUN name:test6 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.ranges.IntRange - VALUE_PARAMETER name:a index:0 type:kotlin.Int - VALUE_PARAMETER name:b index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test6 (a: kotlin.Int, b: kotlin.Int): kotlin.ranges.IntRange declared in ' - CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange declared in kotlin.Int' type=kotlin.ranges.IntRange origin=RANGE - $this: GET_VAR 'a: kotlin.Int declared in .test6' type=kotlin.Int origin=null - other: GET_VAR 'b: kotlin.Int declared in .test6' type=kotlin.Int origin=null FUN name:test1x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int VALUE_PARAMETER name:b index:1 type:kotlin.Int @@ -55,6 +15,14 @@ FILE fqName: fileName:/simpleOperators.kt CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'a: kotlin.Int declared in .test1x' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test1x' type=kotlin.Int origin=null + FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUS + $this: GET_VAR 'a: kotlin.Int declared in .test2' type=kotlin.Int origin=null + other: GET_VAR 'b: kotlin.Int declared in .test2' type=kotlin.Int origin=null FUN name:test2x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int VALUE_PARAMETER name:b index:1 type:kotlin.Int @@ -63,6 +31,14 @@ FILE fqName: fileName:/simpleOperators.kt CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'a: kotlin.Int declared in .test2x' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test2x' type=kotlin.Int origin=null + FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MUL + $this: GET_VAR 'a: kotlin.Int declared in .test3' type=kotlin.Int origin=null + other: GET_VAR 'b: kotlin.Int declared in .test3' type=kotlin.Int origin=null FUN name:test3x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int VALUE_PARAMETER name:b index:1 type:kotlin.Int @@ -71,6 +47,14 @@ FILE fqName: fileName:/simpleOperators.kt CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'a: kotlin.Int declared in .test3x' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test3x' type=kotlin.Int origin=null + FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=DIV + $this: GET_VAR 'a: kotlin.Int declared in .test4' type=kotlin.Int origin=null + other: GET_VAR 'b: kotlin.Int declared in .test4' type=kotlin.Int origin=null FUN name:test4x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int VALUE_PARAMETER name:b index:1 type:kotlin.Int @@ -79,6 +63,14 @@ FILE fqName: fileName:/simpleOperators.kt CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'a: kotlin.Int declared in .test4x' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test4x' type=kotlin.Int origin=null + FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PERC + $this: GET_VAR 'a: kotlin.Int declared in .test5' type=kotlin.Int origin=null + other: GET_VAR 'b: kotlin.Int declared in .test5' type=kotlin.Int origin=null FUN name:test5x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int VALUE_PARAMETER name:b index:1 type:kotlin.Int @@ -87,3 +79,11 @@ FILE fqName: fileName:/simpleOperators.kt CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'a: kotlin.Int declared in .test5x' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test5x' type=kotlin.Int origin=null + FUN name:test6 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.ranges.IntRange + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6 (a: kotlin.Int, b: kotlin.Int): kotlin.ranges.IntRange declared in ' + CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange declared in kotlin.Int' type=kotlin.ranges.IntRange origin=RANGE + $this: GET_VAR 'a: kotlin.Int declared in .test6' type=kotlin.Int origin=null + other: GET_VAR 'b: kotlin.Int declared in .test6' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/simpleOperators.kt.txt b/compiler/testData/ir/irText/expressions/simpleOperators.kt.txt index 99d1db7d1be..ab0278a8554 100644 --- a/compiler/testData/ir/irText/expressions/simpleOperators.kt.txt +++ b/compiler/testData/ir/irText/expressions/simpleOperators.kt.txt @@ -2,42 +2,43 @@ fun test1(a: Int, b: Int): Int { return a.plus(other = b) } +fun test1x(a: Int, b: Int): Int { + return a.plus(other = b) +} + fun test2(a: Int, b: Int): Int { return a.minus(other = b) } +fun test2x(a: Int, b: Int): Int { + return a.minus(other = b) +} + fun test3(a: Int, b: Int): Int { return a.times(other = b) } +fun test3x(a: Int, b: Int): Int { + return a.times(other = b) +} + fun test4(a: Int, b: Int): Int { return a.div(other = b) } +fun test4x(a: Int, b: Int): Int { + return a.div(other = b) +} + fun test5(a: Int, b: Int): Int { return a.rem(other = b) } +fun test5x(a: Int, b: Int): Int { + return a.rem(other = b) +} + fun test6(a: Int, b: Int): IntRange { return a.rangeTo(other = b) } -fun test1x(a: Int, b: Int): Int { - return a.plus(other = b) -} - -fun test2x(a: Int, b: Int): Int { - return a.minus(other = b) -} - -fun test3x(a: Int, b: Int): Int { - return a.times(other = b) -} - -fun test4x(a: Int, b: Int): Int { - return a.div(other = b) -} - -fun test5x(a: Int, b: Int): Int { - return a.rem(other = b) -} diff --git a/compiler/testData/ir/irText/expressions/smartCastAside.ir.txt b/compiler/testData/ir/irText/expressions/smartCastAside.ir.txt index 0b1c066e5bf..d32dfc489b5 100644 --- a/compiler/testData/ir/irText/expressions/smartCastAside.ir.txt +++ b/compiler/testData/ir/irText/expressions/smartCastAside.ir.txt @@ -1,8 +1,6 @@ FILE fqName: fileName:/smartCastAside.kt CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A 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 @@ -16,40 +14,40 @@ FILE fqName: fileName:/smartCastAside.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + 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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun foo (): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.A + 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 .A + $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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:bar visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.B - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.A - 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 .A - $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 .A - $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 .A - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:C modality:ABSTRACT visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - FUN name:baz visibility:public modality:ABSTRACT <> ($this:.C) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.A 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 .A $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun foo (): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.A 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 .A @@ -58,6 +56,8 @@ FILE fqName: fileName:/smartCastAside.kt overridden: public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:baz visibility:public modality:ABSTRACT <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C FUN name:test visibility:public modality:FINAL <> (param:.B) returnType:kotlin.Unit VALUE_PARAMETER name:param index:0 type:.B BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/smartCastAside2.fir.ir.txt b/compiler/testData/ir/irText/expressions/smartCastAside2.fir.ir.txt index 0376e309d62..28b1c3408b3 100644 --- a/compiler/testData/ir/irText/expressions/smartCastAside2.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/smartCastAside2.fir.ir.txt @@ -1,29 +1,4 @@ FILE fqName: fileName:/smartCastAside2.kt - FUN name:materialize visibility:public modality:FINAL () returnType:K of .materialize - TYPE_PARAMETER name:K index:0 variance: superTypes:[kotlin.Any?] reified:false - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun materialize (): K of .materialize declared in ' - CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Nothing origin=EXCLEXCL - : kotlin.Nothing - arg0: CONST Null type=kotlin.Nothing? value=null - CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo.Foo> - TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Foo.Foo>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Foo.Foo> - 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: 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 CLASS CLASS name:Bar modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Bar.Bar> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false @@ -31,8 +6,6 @@ FILE fqName: fileName:/smartCastAside2.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Bar modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.Bar.Bar>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Bar.Bar> 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 @@ -46,14 +19,41 @@ FILE fqName: fileName:/smartCastAside2.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:extFoo visibility:public modality:FINAL ($receiver:.Foo.extFoo>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Foo.extFoo> - BLOCK_BODY + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.Bar.Bar>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Bar.Bar> + CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo.Foo> + TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.Foo.Foo>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Foo.Foo> FUN name:extBar visibility:public modality:FINAL ($receiver:.Bar.extBar>) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false $receiver: VALUE_PARAMETER name: type:.Bar.extBar> BLOCK_BODY + FUN name:extFoo visibility:public modality:FINAL ($receiver:.Foo.extFoo>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Foo.extFoo> + BLOCK_BODY + FUN name:materialize visibility:public modality:FINAL () returnType:K of .materialize + TYPE_PARAMETER name:K index:0 variance: superTypes:[kotlin.Any?] reified:false + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun materialize (): K of .materialize declared in ' + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Nothing origin=EXCLEXCL + : kotlin.Nothing + arg0: CONST Null type=kotlin.Nothing? value=null FUN name:test_1 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/smartCastAside2.fir.kt.txt b/compiler/testData/ir/irText/expressions/smartCastAside2.fir.kt.txt index fb161941e6f..bba5dd27aad 100644 --- a/compiler/testData/ir/irText/expressions/smartCastAside2.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/smartCastAside2.fir.kt.txt @@ -1,12 +1,3 @@ -fun materialize(): K { - return CHECK_NOT_NULL(arg0 = null) -} - -interface Foo { - abstract fun foo() - -} - abstract class Bar { constructor() /* primary */ { super/*Any*/() @@ -18,12 +9,21 @@ abstract class Bar { } -fun Foo.extFoo() { +interface Foo { + abstract fun foo() + } fun Bar.extBar() { } +fun Foo.extFoo() { +} + +fun materialize(): K { + return CHECK_NOT_NULL(arg0 = null) +} + fun test_1(x: Any) { x as Bar /*~> Unit */ x /*as Bar */ as Foo /*~> Unit */ diff --git a/compiler/testData/ir/irText/expressions/smartCastAside2.ir.txt b/compiler/testData/ir/irText/expressions/smartCastAside2.ir.txt index c37448c8c71..3e73219e520 100644 --- a/compiler/testData/ir/irText/expressions/smartCastAside2.ir.txt +++ b/compiler/testData/ir/irText/expressions/smartCastAside2.ir.txt @@ -1,29 +1,4 @@ FILE fqName: fileName:/smartCastAside2.kt - FUN name:materialize visibility:public modality:FINAL () returnType:K of .materialize - TYPE_PARAMETER name:K index:0 variance: superTypes:[kotlin.Any?] reified:false - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun materialize (): K of .materialize declared in ' - CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Nothing origin=EXCLEXCL - : kotlin.Nothing - arg0: CONST Null type=kotlin.Nothing? value=null - CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo.Foo> - TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Foo.Foo>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Foo.Foo> - 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: 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 CLASS CLASS name:Bar modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Bar.Bar> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false @@ -31,8 +6,6 @@ FILE fqName: fileName:/smartCastAside2.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Bar modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.Bar.Bar>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Bar.Bar> 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 @@ -46,14 +19,41 @@ FILE fqName: fileName:/smartCastAside2.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:extFoo visibility:public modality:FINAL ($receiver:.Foo.extFoo>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Foo.extFoo> - BLOCK_BODY + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.Bar.Bar>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Bar.Bar> + CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo.Foo> + TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.Foo.Foo>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Foo.Foo> FUN name:extBar visibility:public modality:FINAL ($receiver:.Bar.extBar>) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false $receiver: VALUE_PARAMETER name: type:.Bar.extBar> BLOCK_BODY + FUN name:extFoo visibility:public modality:FINAL ($receiver:.Foo.extFoo>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Foo.extFoo> + BLOCK_BODY + FUN name:materialize visibility:public modality:FINAL () returnType:K of .materialize + TYPE_PARAMETER name:K index:0 variance: superTypes:[kotlin.Any?] reified:false + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun materialize (): K of .materialize declared in ' + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Nothing origin=EXCLEXCL + : kotlin.Nothing + arg0: CONST Null type=kotlin.Nothing? value=null FUN name:test_1 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/smartCastAside2.kt.txt b/compiler/testData/ir/irText/expressions/smartCastAside2.kt.txt index b470d27809b..c72a44f52ba 100644 --- a/compiler/testData/ir/irText/expressions/smartCastAside2.kt.txt +++ b/compiler/testData/ir/irText/expressions/smartCastAside2.kt.txt @@ -1,12 +1,3 @@ -fun materialize(): K { - return CHECK_NOT_NULL(arg0 = null) -} - -interface Foo { - abstract fun foo() - -} - abstract class Bar { constructor() /* primary */ { super/*Any*/() @@ -18,12 +9,21 @@ abstract class Bar { } -fun Foo.extFoo() { +interface Foo { + abstract fun foo() + } fun Bar.extBar() { } +fun Foo.extFoo() { +} + +fun materialize(): K { + return CHECK_NOT_NULL(arg0 = null) +} + fun test_1(x: Any) { x as Bar /*~> Unit */ x as Foo /*~> Unit */ diff --git a/compiler/testData/ir/irText/expressions/smartCasts.ir.txt b/compiler/testData/ir/irText/expressions/smartCasts.ir.txt index bf00e1a0f21..51e4d6e2241 100644 --- a/compiler/testData/ir/irText/expressions/smartCasts.ir.txt +++ b/compiler/testData/ir/irText/expressions/smartCasts.ir.txt @@ -1,10 +1,10 @@ FILE fqName: fileName:/smartCasts.kt - FUN name:expectsString visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY FUN name:expectsInt visibility:public modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Unit VALUE_PARAMETER name:i index:0 type:kotlin.Int BLOCK_BODY + FUN name:expectsString visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY FUN name:overloaded visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.String VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/smartCasts.kt.txt b/compiler/testData/ir/irText/expressions/smartCasts.kt.txt index 46afd042311..5b71fdfe237 100644 --- a/compiler/testData/ir/irText/expressions/smartCasts.kt.txt +++ b/compiler/testData/ir/irText/expressions/smartCasts.kt.txt @@ -1,7 +1,7 @@ -fun expectsString(s: String) { +fun expectsInt(i: Int) { } -fun expectsInt(i: Int) { +fun expectsString(s: String) { } fun overloaded(s: String): String { @@ -35,3 +35,4 @@ fun test3(x: Any): String { } return x /*as String */ } + diff --git a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.ir.txt b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.ir.txt index 92c8bc1feb2..91a3e6aa413 100644 --- a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.ir.txt +++ b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/specializedTypeAliasConstructorCall.kt CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell.Cell> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .Cell) returnType:.Cell.Cell> [primary] - VALUE_PARAMETER name:value index:0 type:T of .Cell - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,11 @@ FILE fqName: fileName:/specializedTypeAliasConstructorCall.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Cell declared in .Cell' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private [final]' type=T of .Cell origin=null receiver: GET_VAR ': .Cell.Cell> declared in .Cell.' type=.Cell.Cell> origin=null + CONSTRUCTOR visibility:public <> (value:T of .Cell) returnType:.Cell.Cell> [primary] + VALUE_PARAMETER name:value index:0 type:T of .Cell + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:FINAL visibility:public 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 declared in kotlin.Any @@ -31,10 +31,10 @@ FILE fqName: fileName:/specializedTypeAliasConstructorCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - TYPEALIAS name:IntAlias visibility:public expandedType:.Cell FUN name:test visibility:public modality:FINAL <> () returnType:.Cell BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test (): .Cell declared in ' CONSTRUCTOR_CALL 'public constructor (value: T of .Cell) declared in .Cell' type=.Cell origin=null : kotlin.Int value: CONST Int type=kotlin.Int value=42 + TYPEALIAS name:IntAlias visibility:public expandedType:.Cell diff --git a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt.txt b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt.txt index d355fdd2fd6..71dc6960912 100644 --- a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt.txt +++ b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt.txt @@ -1,17 +1,18 @@ class Cell { + val value: T + field = value + get + constructor(value: T) /* primary */ { super/*Any*/() /* () */ } - val value: T - field = value - get - } -typealias IntAlias = Cell fun test(): Cell { return Cell(value = 42) } + +typealias IntAlias = Cell diff --git a/compiler/testData/ir/irText/expressions/stringTemplates.ir.txt b/compiler/testData/ir/irText/expressions/stringTemplates.ir.txt index 4800fb044e6..50510e35640 100644 --- a/compiler/testData/ir/irText/expressions/stringTemplates.ir.txt +++ b/compiler/testData/ir/irText/expressions/stringTemplates.ir.txt @@ -1,8 +1,4 @@ FILE fqName: fileName:/stringTemplates.kt - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in ' - CONST String type=kotlin.String value="" PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final,static] EXPRESSION_BODY @@ -99,3 +95,7 @@ FILE fqName: fileName:/stringTemplates.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in ' + CONST String type=kotlin.String value="" diff --git a/compiler/testData/ir/irText/expressions/stringTemplates.kt.txt b/compiler/testData/ir/irText/expressions/stringTemplates.kt.txt index a43bdeb5208..8f68d9753d8 100644 --- a/compiler/testData/ir/irText/expressions/stringTemplates.kt.txt +++ b/compiler/testData/ir/irText/expressions/stringTemplates.kt.txt @@ -1,7 +1,3 @@ -fun foo(): String { - return "" -} - val x: Int field = 42 get @@ -41,3 +37,8 @@ val test8: String val test9: String field = () get + +fun foo(): String { + return "" +} + diff --git a/compiler/testData/ir/irText/expressions/suspendConversionInVararg.fir.ir.txt b/compiler/testData/ir/irText/expressions/suspendConversionInVararg.fir.ir.txt index a837810c2a2..0cb0483e1c8 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionInVararg.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionInVararg.fir.ir.txt @@ -1,31 +1,4 @@ FILE fqName: fileName:/suspendConversionInVararg.kt - FUN name:useSuspendVararg visibility:public modality:FINAL <> (sfn:kotlin.Array>) returnType:kotlin.Unit - VALUE_PARAMETER name:sfn index:0 type:kotlin.Array> varargElementType:kotlin.coroutines.SuspendFunction0 [vararg] - BLOCK_BODY - FUN name:testSuspendConversionInVarargElementsSome visibility:public modality:FINAL <> (f1:kotlin.Function0, sf2:kotlin.coroutines.SuspendFunction0, f3:kotlin.Function0) returnType:kotlin.Unit - VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 - VALUE_PARAMETER name:sf2 index:1 type:kotlin.coroutines.SuspendFunction0 - VALUE_PARAMETER name:f3 index:2 type:kotlin.Function0 - BLOCK_BODY - CALL 'public final fun useSuspendVararg (vararg sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: VARARG type=kotlin.Array> varargElementType=kotlin.coroutines.SuspendFunction0 - BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 - BLOCK_BODY - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome.suspendConversion' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'f1: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.Function0 origin=null - GET_VAR 'sf2: kotlin.coroutines.SuspendFunction0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=null - BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 - BLOCK_BODY - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome.suspendConversion' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'f3: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.Function0 origin=null FUN name:testSuspendConversionInVarargElementsAll visibility:public modality:FINAL <> (f1:kotlin.Function0, f2:kotlin.Function0, f3:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 VALUE_PARAMETER name:f2 index:1 type:kotlin.Function0 @@ -57,3 +30,30 @@ FILE fqName: fileName:/suspendConversionInVararg.kt $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll.suspendConversion' type=kotlin.Function0 origin=null FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit declared in .testSuspendConversionInVarargElementsAll' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null $receiver: GET_VAR 'f3: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll' type=kotlin.Function0 origin=null + FUN name:testSuspendConversionInVarargElementsSome visibility:public modality:FINAL <> (f1:kotlin.Function0, sf2:kotlin.coroutines.SuspendFunction0, f3:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 + VALUE_PARAMETER name:sf2 index:1 type:kotlin.coroutines.SuspendFunction0 + VALUE_PARAMETER name:f3 index:2 type:kotlin.Function0 + BLOCK_BODY + CALL 'public final fun useSuspendVararg (vararg sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: VARARG type=kotlin.Array> varargElementType=kotlin.coroutines.SuspendFunction0 + BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome.suspendConversion' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'f1: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.Function0 origin=null + GET_VAR 'sf2: kotlin.coroutines.SuspendFunction0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=null + BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome.suspendConversion' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'f3: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.Function0 origin=null + FUN name:useSuspendVararg visibility:public modality:FINAL <> (sfn:kotlin.Array>) returnType:kotlin.Unit + VALUE_PARAMETER name:sfn index:0 type:kotlin.Array> varargElementType:kotlin.coroutines.SuspendFunction0 [vararg] + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/suspendConversionInVararg.ir.txt b/compiler/testData/ir/irText/expressions/suspendConversionInVararg.ir.txt index 04d0b4b1f87..ae106425265 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionInVararg.ir.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionInVararg.ir.txt @@ -1,31 +1,4 @@ FILE fqName: fileName:/suspendConversionInVararg.kt - FUN name:useSuspendVararg visibility:public modality:FINAL <> (sfn:kotlin.Array>) returnType:kotlin.Unit - VALUE_PARAMETER name:sfn index:0 type:kotlin.Array> varargElementType:kotlin.coroutines.SuspendFunction0 [vararg] - BLOCK_BODY - FUN name:testSuspendConversionInVarargElementsSome visibility:public modality:FINAL <> (f1:kotlin.Function0, sf2:kotlin.coroutines.SuspendFunction0, f3:kotlin.Function0) returnType:kotlin.Unit - VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 - VALUE_PARAMETER name:sf2 index:1 type:kotlin.coroutines.SuspendFunction0 - VALUE_PARAMETER name:f3 index:2 type:kotlin.Function0 - BLOCK_BODY - CALL 'public final fun useSuspendVararg (vararg sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: VARARG type=kotlin.Array> varargElementType=kotlin.coroutines.SuspendFunction0 - BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 - BLOCK_BODY - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome.suspendConversion0' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion0 (): kotlin.Unit declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'f1: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.Function0 origin=null - GET_VAR 'sf2: kotlin.coroutines.SuspendFunction0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=null - BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion1 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 - BLOCK_BODY - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome.suspendConversion1' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion1 (): kotlin.Unit declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'f3: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.Function0 origin=null FUN name:testSuspendConversionInVarargElementsAll visibility:public modality:FINAL <> (f1:kotlin.Function0, f2:kotlin.Function0, f3:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 VALUE_PARAMETER name:f2 index:1 type:kotlin.Function0 @@ -57,3 +30,30 @@ FILE fqName: fileName:/suspendConversionInVararg.kt $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll.suspendConversion2' type=kotlin.Function0 origin=null FUNCTION_REFERENCE 'local final fun suspendConversion2 (): kotlin.Unit declared in .testSuspendConversionInVarargElementsAll' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null $receiver: GET_VAR 'f3: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll' type=kotlin.Function0 origin=null + FUN name:testSuspendConversionInVarargElementsSome visibility:public modality:FINAL <> (f1:kotlin.Function0, sf2:kotlin.coroutines.SuspendFunction0, f3:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 + VALUE_PARAMETER name:sf2 index:1 type:kotlin.coroutines.SuspendFunction0 + VALUE_PARAMETER name:f3 index:2 type:kotlin.Function0 + BLOCK_BODY + CALL 'public final fun useSuspendVararg (vararg sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: VARARG type=kotlin.Array> varargElementType=kotlin.coroutines.SuspendFunction0 + BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome.suspendConversion0' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (): kotlin.Unit declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'f1: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.Function0 origin=null + GET_VAR 'sf2: kotlin.coroutines.SuspendFunction0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=null + BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion1 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome.suspendConversion1' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion1 (): kotlin.Unit declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'f3: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.Function0 origin=null + FUN name:useSuspendVararg visibility:public modality:FINAL <> (sfn:kotlin.Array>) returnType:kotlin.Unit + VALUE_PARAMETER name:sfn index:0 type:kotlin.Array> varargElementType:kotlin.coroutines.SuspendFunction0 [vararg] + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.ir.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.ir.txt index 1a83edb4f10..1ce74e2d72a 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.ir.txt @@ -1,21 +1,4 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt - FUN name:useSuspend visibility:public modality:FINAL <> (sfn:kotlin.coroutines.SuspendFunction0) returnType:kotlin.Unit - VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction0 - BLOCK_BODY - FUN name:useSuspendExt visibility:public modality:FINAL <> (sfn:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit - VALUE_PARAMETER name:sfn index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 - BLOCK_BODY - FUN name:useSuspendArg visibility:public modality:FINAL <> (sfn:kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit - VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction1 - BLOCK_BODY - FUN name:useSuspendArgT visibility:public modality:FINAL (sfn:kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> - BLOCK_BODY - FUN name:useSuspendExtT visibility:public modality:FINAL (sfn:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:sfn index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> - BLOCK_BODY FUN name:produceFun visibility:public modality:FINAL <> () returnType:kotlin.Function0 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun produceFun (): kotlin.Function0 declared in ' @@ -24,29 +7,6 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .produceFun' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUN name:testSimple visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 - BLOCK_BODY - CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 - BLOCK_BODY - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function0 declared in .testSimple.suspendConversion' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit declared in .testSimple' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: kotlin.Function0 declared in .testSimple' type=kotlin.Function0 origin=null - FUN name:testSimpleNonVal visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 - BLOCK_BODY - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function0 declared in .testSimpleNonVal.suspendConversion' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit declared in .testSimpleNonVal' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: CALL 'public final fun produceFun (): kotlin.Function0 declared in ' type=kotlin.Function0 origin=null FUN name:testExtAsExt visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY @@ -61,79 +21,6 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt p1: GET_VAR 'p0: kotlin.Int declared in .testExtAsExt.suspendConversion' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun suspendConversion (p0: kotlin.Int): kotlin.Unit declared in .testExtAsExt' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExt' type=@[ExtensionFunctionType] kotlin.Function1 origin=null - FUN name:testExtAsSimple visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 - BLOCK_BODY - CALL 'public final fun useSuspendArg (sfn: kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: BLOCK type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1 - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple.suspendConversion' type=@[ExtensionFunctionType] kotlin.Function1 origin=null - p1: GET_VAR 'p0: kotlin.Int declared in .testExtAsSimple.suspendConversion' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: kotlin.Int): kotlin.Unit declared in .testExtAsSimple' type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple' type=@[ExtensionFunctionType] kotlin.Function1 origin=null - FUN name:testSimpleAsExt visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - CALL 'public final fun useSuspendExt (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function1 declared in .testSimpleAsExt.suspendConversion' type=kotlin.Function1 origin=null - p1: GET_VAR 'p0: kotlin.Int declared in .testSimpleAsExt.suspendConversion' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: kotlin.Int): kotlin.Unit declared in .testSimpleAsExt' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExt' type=kotlin.Function1 origin=null - FUN name:testSimpleAsSimpleT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : kotlin.Int - sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function1 declared in .testSimpleAsSimpleT.suspendConversion' type=kotlin.Function1 origin=null - p1: GET_VAR 'p0: T of .useSuspendArgT declared in .testSimpleAsSimpleT.suspendConversion' type=T of .useSuspendArgT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendArgT): kotlin.Unit declared in .testSimpleAsSimpleT' type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsSimpleT' type=kotlin.Function1 origin=null - FUN name:testSimpleAsExtT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : kotlin.Int - sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function1 declared in .testSimpleAsExtT.suspendConversion' type=kotlin.Function1 origin=null - p1: GET_VAR 'p0: T of .useSuspendExtT declared in .testSimpleAsExtT.suspendConversion' type=T of .useSuspendExtT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit declared in .testSimpleAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExtT' type=kotlin.Function1 origin=null - FUN name:testExtAsSimpleT visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 - BLOCK_BODY - CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : kotlin.Int - sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1, p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1 - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT.suspendConversion' type=@[ExtensionFunctionType] kotlin.Function1 origin=null - p1: GET_VAR 'p0: T of .useSuspendArgT declared in .testExtAsSimpleT.suspendConversion' type=T of .useSuspendArgT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendArgT): kotlin.Unit declared in .testExtAsSimpleT' type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT' type=@[ExtensionFunctionType] kotlin.Function1 origin=null FUN name:testExtAsExtT visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY @@ -149,54 +36,35 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt p1: GET_VAR 'p0: T of .useSuspendExtT declared in .testExtAsExtT.suspendConversion' type=T of .useSuspendExtT origin=null FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit declared in .testExtAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExtT' type=@[ExtensionFunctionType] kotlin.Function1 origin=null - FUN name:testSimpleSAsSimpleT visibility:public modality:FINAL (fn:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> + FUN name:testExtAsSimple visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 + BLOCK_BODY + CALL 'public final fun useSuspendArg (sfn: kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1 + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple.suspendConversion' type=@[ExtensionFunctionType] kotlin.Function1 origin=null + p1: GET_VAR 'p0: kotlin.Int declared in .testExtAsSimple.suspendConversion' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: kotlin.Int): kotlin.Unit declared in .testExtAsSimple' type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple' type=@[ExtensionFunctionType] kotlin.Function1 origin=null + FUN name:testExtAsSimpleT visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : S of .testSimpleSAsSimpleT + : kotlin.Int sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit>, p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1, p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1 VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT.suspendConversion' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=null - p1: GET_VAR 'p0: T of .useSuspendArgT declared in .testSimpleSAsSimpleT.suspendConversion' type=T of .useSuspendArgT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendArgT): kotlin.Unit declared in .testSimpleSAsSimpleT' type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=null - FUN name:testSimpleSAsExtT visibility:public modality:FINAL (fn:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> - BLOCK_BODY - CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : S of .testSimpleSAsExtT - sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit>, p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT.suspendConversion' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null - p1: GET_VAR 'p0: T of .useSuspendExtT declared in .testSimpleSAsExtT.suspendConversion' type=T of .useSuspendExtT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit declared in .testSimpleSAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null - FUN name:testExtSAsSimpleT visibility:public modality:FINAL (fn:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> - BLOCK_BODY - CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : S of .testExtSAsSimpleT - sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>, p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT.suspendConversion' type=@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null - p1: GET_VAR 'p0: T of .useSuspendArgT declared in .testExtSAsSimpleT.suspendConversion' type=T of .useSuspendArgT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendArgT): kotlin.Unit declared in .testExtSAsSimpleT' type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT' type=@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null + $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT.suspendConversion' type=@[ExtensionFunctionType] kotlin.Function1 origin=null + p1: GET_VAR 'p0: T of .useSuspendArgT declared in .testExtAsSimpleT.suspendConversion' type=T of .useSuspendArgT origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendArgT): kotlin.Unit declared in .testExtAsSimpleT' type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT' type=@[ExtensionFunctionType] kotlin.Function1 origin=null FUN name:testExtSAsExtT visibility:public modality:FINAL (fn:@[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> @@ -213,22 +81,138 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt p1: GET_VAR 'p0: T of .useSuspendExtT declared in .testExtSAsExtT.suspendConversion' type=T of .useSuspendExtT origin=null FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit declared in .testExtSAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> declared in .testExtSAsExtT' type=@[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> origin=null - FUN name:testSmartCastWithSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:kotlin.Any + FUN name:testExtSAsSimpleT visibility:public modality:FINAL (fn:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> + BLOCK_BODY + CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : S of .testExtSAsSimpleT + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>, p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT.suspendConversion' type=@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null + p1: GET_VAR 'p0: T of .useSuspendArgT declared in .testExtSAsSimpleT.suspendConversion' type=T of .useSuspendArgT origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendArgT): kotlin.Unit declared in .testExtSAsSimpleT' type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT' type=@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null + FUN name:testIntersectionVsSuspendConversion visibility:public modality:FINAL (x:T of .testIntersectionVsSuspendConversion) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Function0; kotlin.coroutines.SuspendFunction0] reified:false + VALUE_PARAMETER name:x index:0 type:T of .testIntersectionVsSuspendConversion + BLOCK_BODY + CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: GET_VAR 'x: T of .testIntersectionVsSuspendConversion declared in .testIntersectionVsSuspendConversion' type=T of .testIntersectionVsSuspendConversion origin=null + FUN name:testSimple visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 - GET_VAR 'a: kotlin.Any declared in .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 BLOCK_BODY CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function0 declared in .testSmartCastWithSuspendConversion.suspendConversion' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit declared in .testSmartCastWithSuspendConversion' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 - GET_VAR 'a: kotlin.Any declared in .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSimple.suspendConversion' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit declared in .testSimple' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: kotlin.Function0 declared in .testSimple' type=kotlin.Function0 origin=null + FUN name:testSimpleAsExt visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + CALL 'public final fun useSuspendExt (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function1 declared in .testSimpleAsExt.suspendConversion' type=kotlin.Function1 origin=null + p1: GET_VAR 'p0: kotlin.Int declared in .testSimpleAsExt.suspendConversion' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: kotlin.Int): kotlin.Unit declared in .testSimpleAsExt' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExt' type=kotlin.Function1 origin=null + FUN name:testSimpleAsExtT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Int + sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function1 declared in .testSimpleAsExtT.suspendConversion' type=kotlin.Function1 origin=null + p1: GET_VAR 'p0: T of .useSuspendExtT declared in .testSimpleAsExtT.suspendConversion' type=T of .useSuspendExtT origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit declared in .testSimpleAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExtT' type=kotlin.Function1 origin=null + FUN name:testSimpleAsSimpleT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Int + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function1 declared in .testSimpleAsSimpleT.suspendConversion' type=kotlin.Function1 origin=null + p1: GET_VAR 'p0: T of .useSuspendArgT declared in .testSimpleAsSimpleT.suspendConversion' type=T of .useSuspendArgT origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendArgT): kotlin.Unit declared in .testSimpleAsSimpleT' type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsSimpleT' type=kotlin.Function1 origin=null + FUN name:testSimpleNonVal visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSimpleNonVal.suspendConversion' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit declared in .testSimpleNonVal' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: CALL 'public final fun produceFun (): kotlin.Function0 declared in ' type=kotlin.Function0 origin=null + FUN name:testSimpleSAsExtT visibility:public modality:FINAL (fn:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> + BLOCK_BODY + CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : S of .testSimpleSAsExtT + sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit>, p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT.suspendConversion' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null + p1: GET_VAR 'p0: T of .useSuspendExtT declared in .testSimpleSAsExtT.suspendConversion' type=T of .useSuspendExtT origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit declared in .testSimpleSAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null + FUN name:testSimpleSAsSimpleT visibility:public modality:FINAL (fn:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> + BLOCK_BODY + CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : S of .testSimpleSAsSimpleT + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit>, p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT.suspendConversion' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=null + p1: GET_VAR 'p0: T of .useSuspendArgT declared in .testSimpleSAsSimpleT.suspendConversion' type=T of .useSuspendArgT origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendArgT): kotlin.Unit declared in .testSimpleSAsSimpleT' type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=null + FUN name:testSmartCastOnVarVsSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + BLOCK_BODY + VAR name:b type:kotlin.Function0 [var] + GET_VAR 'a: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=CAST typeOperand=kotlin.coroutines.SuspendFunction0 + GET_VAR 'var b: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null + CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=IMPLICIT_CAST typeOperand=kotlin.coroutines.SuspendFunction0 + GET_VAR 'var b: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null FUN name:testSmartCastOnVarWithSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -256,20 +240,36 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=IMPLICIT_CAST typeOperand=kotlin.coroutines.SuspendFunction0 GET_VAR 'a: kotlin.Function0 declared in .testSmartCastVsSuspendConversion' type=kotlin.Function0 origin=null - FUN name:testSmartCastOnVarVsSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + FUN name:testSmartCastWithSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY - VAR name:b type:kotlin.Function0 [var] - GET_VAR 'a: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=CAST typeOperand=kotlin.coroutines.SuspendFunction0 - GET_VAR 'var b: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any declared in .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=IMPLICIT_CAST typeOperand=kotlin.coroutines.SuspendFunction0 - GET_VAR 'var b: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null - FUN name:testIntersectionVsSuspendConversion visibility:public modality:FINAL (x:T of .testIntersectionVsSuspendConversion) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Function0; kotlin.coroutines.SuspendFunction0] reified:false - VALUE_PARAMETER name:x index:0 type:T of .testIntersectionVsSuspendConversion + sfn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSmartCastWithSuspendConversion.suspendConversion' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit declared in .testSmartCastWithSuspendConversion' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any declared in .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null + FUN name:useSuspend visibility:public modality:FINAL <> (sfn:kotlin.coroutines.SuspendFunction0) returnType:kotlin.Unit + VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction0 + BLOCK_BODY + FUN name:useSuspendArg visibility:public modality:FINAL <> (sfn:kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit + VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction1 + BLOCK_BODY + FUN name:useSuspendArgT visibility:public modality:FINAL (sfn:kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> + BLOCK_BODY + FUN name:useSuspendExt visibility:public modality:FINAL <> (sfn:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit + VALUE_PARAMETER name:sfn index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 + BLOCK_BODY + FUN name:useSuspendExtT visibility:public modality:FINAL (sfn:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:sfn index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> BLOCK_BODY - CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: GET_VAR 'x: T of .testIntersectionVsSuspendConversion declared in .testIntersectionVsSuspendConversion' type=T of .testIntersectionVsSuspendConversion origin=null diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.kt.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.kt.txt index 6161955eac5..5f42eef477c 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.kt.txt @@ -1,18 +1,3 @@ -fun useSuspend(sfn: SuspendFunction0) { -} - -fun useSuspendExt(sfn: @ExtensionFunctionType SuspendFunction1) { -} - -fun useSuspendArg(sfn: SuspendFunction1) { -} - -fun useSuspendArgT(sfn: SuspendFunction1) { -} - -fun useSuspendExtT(sfn: @ExtensionFunctionType SuspendFunction1) { -} - fun produceFun(): Function0 { return local fun () { return Unit @@ -20,26 +5,6 @@ fun produceFun(): Function0 { } -fun testSimple(fn: Function0) { - useSuspend(sfn = { // BLOCK - local suspend fun Function0.suspendConversion() { - callee.invoke() - } - - fn::suspendConversion - }) -} - -fun testSimpleNonVal() { - useSuspend(sfn = { // BLOCK - local suspend fun Function0.suspendConversion() { - callee.invoke() - } - - produceFun()::suspendConversion - }) -} - fun testExtAsExt(fn: @ExtensionFunctionType Function1) { useSuspendExt(sfn = { // BLOCK local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: Int) { @@ -50,56 +15,6 @@ fun testExtAsExt(fn: @ExtensionFunctionType Function1) { }) } -fun testExtAsSimple(fn: @ExtensionFunctionType Function1) { - useSuspendArg(sfn = { // BLOCK - local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: Int) { - callee.invoke(p1 = p0) - } - - fn::suspendConversion - }) -} - -fun testSimpleAsExt(fn: Function1) { - useSuspendExt(sfn = { // BLOCK - local suspend fun Function1.suspendConversion(p0: Int) { - callee.invoke(p1 = p0) - } - - fn::suspendConversion - }) -} - -fun testSimpleAsSimpleT(fn: Function1) { - useSuspendArgT(sfn = { // BLOCK - local suspend fun Function1.suspendConversion(p0: T) { - callee.invoke(p1 = p0) - } - - fn::suspendConversion - }) -} - -fun testSimpleAsExtT(fn: Function1) { - useSuspendExtT(sfn = { // BLOCK - local suspend fun Function1.suspendConversion(p0: T) { - callee.invoke(p1 = p0) - } - - fn::suspendConversion - }) -} - -fun testExtAsSimpleT(fn: @ExtensionFunctionType Function1) { - useSuspendArgT(sfn = { // BLOCK - local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: T) { - callee.invoke(p1 = p0) - } - - fn::suspendConversion - }) -} - fun testExtAsExtT(fn: @ExtensionFunctionType Function1) { useSuspendExtT(sfn = { // BLOCK local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: T) { @@ -110,9 +25,9 @@ fun testExtAsExtT(fn: @ExtensionFunctionType Function1) { }) } -fun testSimpleSAsSimpleT(fn: Function1) { - useSuspendArgT(sfn = { // BLOCK - local suspend fun Function1.suspendConversion(p0: T) { +fun testExtAsSimple(fn: @ExtensionFunctionType Function1) { + useSuspendArg(sfn = { // BLOCK + local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: Int) { callee.invoke(p1 = p0) } @@ -120,19 +35,9 @@ fun testSimpleSAsSimpleT(fn: Function1) { }) } -fun testSimpleSAsExtT(fn: Function1) { - useSuspendExtT(sfn = { // BLOCK - local suspend fun Function1.suspendConversion(p0: T) { - callee.invoke(p1 = p0) - } - - fn::suspendConversion - }) -} - -fun testExtSAsSimpleT(fn: @ExtensionFunctionType Function1) { - useSuspendArgT(sfn = { // BLOCK - local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: T) { +fun testExtAsSimpleT(fn: @ExtensionFunctionType Function1) { + useSuspendArgT(sfn = { // BLOCK + local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: T) { callee.invoke(p1 = p0) } @@ -150,17 +55,96 @@ fun testExtSAsExtT(fn: @ExtensionFunctionType Function1) { }) } -fun testSmartCastWithSuspendConversion(a: Any) { - a as Function0 /*~> Unit */ +fun testExtSAsSimpleT(fn: @ExtensionFunctionType Function1) { + useSuspendArgT(sfn = { // BLOCK + local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: T) { + callee.invoke(p1 = p0) + } + + fn::suspendConversion + }) +} + +fun testIntersectionVsSuspendConversion(x: T) where T : Function0, T : SuspendFunction0 { + useSuspend(sfn = x) +} + +fun testSimple(fn: Function0) { useSuspend(sfn = { // BLOCK local suspend fun Function0.suspendConversion() { callee.invoke() } - a /*as Function0 */::suspendConversion + fn::suspendConversion }) } +fun testSimpleAsExt(fn: Function1) { + useSuspendExt(sfn = { // BLOCK + local suspend fun Function1.suspendConversion(p0: Int) { + callee.invoke(p1 = p0) + } + + fn::suspendConversion + }) +} + +fun testSimpleAsExtT(fn: Function1) { + useSuspendExtT(sfn = { // BLOCK + local suspend fun Function1.suspendConversion(p0: T) { + callee.invoke(p1 = p0) + } + + fn::suspendConversion + }) +} + +fun testSimpleAsSimpleT(fn: Function1) { + useSuspendArgT(sfn = { // BLOCK + local suspend fun Function1.suspendConversion(p0: T) { + callee.invoke(p1 = p0) + } + + fn::suspendConversion + }) +} + +fun testSimpleNonVal() { + useSuspend(sfn = { // BLOCK + local suspend fun Function0.suspendConversion() { + callee.invoke() + } + + produceFun()::suspendConversion + }) +} + +fun testSimpleSAsExtT(fn: Function1) { + useSuspendExtT(sfn = { // BLOCK + local suspend fun Function1.suspendConversion(p0: T) { + callee.invoke(p1 = p0) + } + + fn::suspendConversion + }) +} + +fun testSimpleSAsSimpleT(fn: Function1) { + useSuspendArgT(sfn = { // BLOCK + local suspend fun Function1.suspendConversion(p0: T) { + callee.invoke(p1 = p0) + } + + fn::suspendConversion + }) +} + +fun testSmartCastOnVarVsSuspendConversion(a: Function0) { + var b: Function0 = a + b as SuspendFunction0 /*~> Unit */ + useSuspend(sfn = b /*as SuspendFunction0 */) +} + fun testSmartCastOnVarWithSuspendConversion(a: Any) { var b: Any = a b as Function0 /*~> Unit */ @@ -178,13 +162,29 @@ fun testSmartCastVsSuspendConversion(a: Function0) { useSuspend(sfn = a /*as SuspendFunction0 */) } -fun testSmartCastOnVarVsSuspendConversion(a: Function0) { - var b: Function0 = a - b as SuspendFunction0 /*~> Unit */ - useSuspend(sfn = b /*as SuspendFunction0 */) +fun testSmartCastWithSuspendConversion(a: Any) { + a as Function0 /*~> Unit */ + useSuspend(sfn = { // BLOCK + local suspend fun Function0.suspendConversion() { + callee.invoke() + } + + a /*as Function0 */::suspendConversion + }) } -fun testIntersectionVsSuspendConversion(x: T) where T : Function0, T : SuspendFunction0 { - useSuspend(sfn = x) +fun useSuspend(sfn: SuspendFunction0) { +} + +fun useSuspendArg(sfn: SuspendFunction1) { +} + +fun useSuspendArgT(sfn: SuspendFunction1) { +} + +fun useSuspendExt(sfn: @ExtensionFunctionType SuspendFunction1) { +} + +fun useSuspendExtT(sfn: @ExtensionFunctionType SuspendFunction1) { } diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.ir.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.ir.txt index 6a29a594200..6a84fdfac88 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.ir.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.ir.txt @@ -1,21 +1,4 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt - FUN name:useSuspend visibility:public modality:FINAL <> (sfn:kotlin.coroutines.SuspendFunction0) returnType:kotlin.Unit - VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction0 - BLOCK_BODY - FUN name:useSuspendExt visibility:public modality:FINAL <> (sfn:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit - VALUE_PARAMETER name:sfn index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 - BLOCK_BODY - FUN name:useSuspendArg visibility:public modality:FINAL <> (sfn:kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit - VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction1 - BLOCK_BODY - FUN name:useSuspendArgT visibility:public modality:FINAL (sfn:kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> - BLOCK_BODY - FUN name:useSuspendExtT visibility:public modality:FINAL (sfn:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:sfn index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> - BLOCK_BODY FUN name:produceFun visibility:public modality:FINAL <> () returnType:kotlin.Function0 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun produceFun (): kotlin.Function0 declared in ' @@ -24,29 +7,6 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .produceFun' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUN name:testSimple visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 - BLOCK_BODY - CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 - BLOCK_BODY - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function0 declared in .testSimple.suspendConversion0' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion0 (): kotlin.Unit declared in .testSimple' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: kotlin.Function0 declared in .testSimple' type=kotlin.Function0 origin=null - FUN name:testSimpleNonVal visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 - BLOCK_BODY - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function0 declared in .testSimpleNonVal.suspendConversion0' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion0 (): kotlin.Unit declared in .testSimpleNonVal' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: CALL 'public final fun produceFun (): kotlin.Function0 declared in ' type=kotlin.Function0 origin=null FUN name:testExtAsExt visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY @@ -61,79 +21,6 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt p1: GET_VAR 'p0: kotlin.Int declared in .testExtAsExt.suspendConversion0' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: kotlin.Int): kotlin.Unit declared in .testExtAsExt' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExt' type=@[ExtensionFunctionType] kotlin.Function1 origin=null - FUN name:testExtAsSimple visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 - BLOCK_BODY - CALL 'public final fun useSuspendArg (sfn: kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: BLOCK type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function1 declared in .testExtAsSimple.suspendConversion0' type=kotlin.Function1 origin=null - p1: GET_VAR 'p0: kotlin.Int declared in .testExtAsSimple.suspendConversion0' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: kotlin.Int): kotlin.Unit declared in .testExtAsSimple' type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple' type=@[ExtensionFunctionType] kotlin.Function1 origin=null - FUN name:testSimpleAsExt visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - CALL 'public final fun useSuspendExt (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1 - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1 declared in .testSimpleAsExt.suspendConversion0' type=@[ExtensionFunctionType] kotlin.Function1 origin=null - p1: GET_VAR 'p0: kotlin.Int declared in .testSimpleAsExt.suspendConversion0' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: kotlin.Int): kotlin.Unit declared in .testSimpleAsExt' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExt' type=kotlin.Function1 origin=null - FUN name:testSimpleAsSimpleT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : kotlin.Int - sfn: BLOCK type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function1 declared in .testSimpleAsSimpleT.suspendConversion0' type=kotlin.Function1 origin=null - p1: GET_VAR 'p0: kotlin.Int declared in .testSimpleAsSimpleT.suspendConversion0' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: kotlin.Int): kotlin.Unit declared in .testSimpleAsSimpleT' type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsSimpleT' type=kotlin.Function1 origin=null - FUN name:testSimpleAsExtT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 - BLOCK_BODY - CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : kotlin.Int - sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1 - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1 declared in .testSimpleAsExtT.suspendConversion0' type=@[ExtensionFunctionType] kotlin.Function1 origin=null - p1: GET_VAR 'p0: kotlin.Int declared in .testSimpleAsExtT.suspendConversion0' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: kotlin.Int): kotlin.Unit declared in .testSimpleAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExtT' type=kotlin.Function1 origin=null - FUN name:testExtAsSimpleT visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 - BLOCK_BODY - CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : kotlin.Int - sfn: BLOCK type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function1 declared in .testExtAsSimpleT.suspendConversion0' type=kotlin.Function1 origin=null - p1: GET_VAR 'p0: kotlin.Int declared in .testExtAsSimpleT.suspendConversion0' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: kotlin.Int): kotlin.Unit declared in .testExtAsSimpleT' type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT' type=@[ExtensionFunctionType] kotlin.Function1 origin=null FUN name:testExtAsExtT visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY @@ -149,54 +36,35 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt p1: GET_VAR 'p0: kotlin.Int declared in .testExtAsExtT.suspendConversion0' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: kotlin.Int): kotlin.Unit declared in .testExtAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExtT' type=@[ExtensionFunctionType] kotlin.Function1 origin=null - FUN name:testSimpleSAsSimpleT visibility:public modality:FINAL (fn:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> + FUN name:testExtAsSimple visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 + BLOCK_BODY + CALL 'public final fun useSuspendArg (sfn: kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function1 declared in .testExtAsSimple.suspendConversion0' type=kotlin.Function1 origin=null + p1: GET_VAR 'p0: kotlin.Int declared in .testExtAsSimple.suspendConversion0' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: kotlin.Int): kotlin.Unit declared in .testExtAsSimple' type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple' type=@[ExtensionFunctionType] kotlin.Function1 origin=null + FUN name:testExtAsSimpleT visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : S of .testSimpleSAsSimpleT - sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.testSimpleSAsSimpleT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit>, p0:S of .testSimpleSAsSimpleT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:S of .testSimpleSAsSimpleT + : kotlin.Int + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT.suspendConversion0' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=null - p1: GET_VAR 'p0: S of .testSimpleSAsSimpleT declared in .testSimpleSAsSimpleT.suspendConversion0' type=S of .testSimpleSAsSimpleT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: S of .testSimpleSAsSimpleT): kotlin.Unit declared in .testSimpleSAsSimpleT' type=kotlin.coroutines.SuspendFunction1.testSimpleSAsSimpleT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=null - FUN name:testSimpleSAsExtT visibility:public modality:FINAL (fn:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> - BLOCK_BODY - CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : S of .testSimpleSAsExtT - sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.testSimpleSAsExtT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1.testSimpleSAsExtT, kotlin.Unit>, p0:S of .testSimpleSAsExtT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:S of .testSimpleSAsExtT - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT.suspendConversion0' type=@[ExtensionFunctionType] kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null - p1: GET_VAR 'p0: S of .testSimpleSAsExtT declared in .testSimpleSAsExtT.suspendConversion0' type=S of .testSimpleSAsExtT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: S of .testSimpleSAsExtT): kotlin.Unit declared in .testSimpleSAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.testSimpleSAsExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null - FUN name:testExtSAsSimpleT visibility:public modality:FINAL (fn:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> - BLOCK_BODY - CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : S of .testExtSAsSimpleT - sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.testExtSAsSimpleT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>, p0:S of .testExtSAsSimpleT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:S of .testExtSAsSimpleT - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT.suspendConversion0' type=kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null - p1: GET_VAR 'p0: S of .testExtSAsSimpleT declared in .testExtSAsSimpleT.suspendConversion0' type=S of .testExtSAsSimpleT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: S of .testExtSAsSimpleT): kotlin.Unit declared in .testExtSAsSimpleT' type=kotlin.coroutines.SuspendFunction1.testExtSAsSimpleT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT' type=@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null + $this: GET_VAR 'callee: kotlin.Function1 declared in .testExtAsSimpleT.suspendConversion0' type=kotlin.Function1 origin=null + p1: GET_VAR 'p0: kotlin.Int declared in .testExtAsSimpleT.suspendConversion0' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: kotlin.Int): kotlin.Unit declared in .testExtAsSimpleT' type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT' type=@[ExtensionFunctionType] kotlin.Function1 origin=null FUN name:testExtSAsExtT visibility:public modality:FINAL (fn:@[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> @@ -213,22 +81,138 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt p1: GET_VAR 'p0: S of .testExtSAsExtT declared in .testExtSAsExtT.suspendConversion0' type=S of .testExtSAsExtT origin=null FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: S of .testExtSAsExtT): kotlin.Unit declared in .testExtSAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.testExtSAsExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> declared in .testExtSAsExtT' type=@[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> origin=null - FUN name:testSmartCastWithSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:kotlin.Any + FUN name:testExtSAsSimpleT visibility:public modality:FINAL (fn:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> + BLOCK_BODY + CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : S of .testExtSAsSimpleT + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.testExtSAsSimpleT, kotlin.Unit> origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>, p0:S of .testExtSAsSimpleT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:S of .testExtSAsSimpleT + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT.suspendConversion0' type=kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null + p1: GET_VAR 'p0: S of .testExtSAsSimpleT declared in .testExtSAsSimpleT.suspendConversion0' type=S of .testExtSAsSimpleT origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: S of .testExtSAsSimpleT): kotlin.Unit declared in .testExtSAsSimpleT' type=kotlin.coroutines.SuspendFunction1.testExtSAsSimpleT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT' type=@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null + FUN name:testIntersectionVsSuspendConversion visibility:public modality:FINAL (x:T of .testIntersectionVsSuspendConversion) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Function0; kotlin.coroutines.SuspendFunction0] reified:false + VALUE_PARAMETER name:x index:0 type:T of .testIntersectionVsSuspendConversion + BLOCK_BODY + CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: GET_VAR 'x: T of .testIntersectionVsSuspendConversion declared in .testIntersectionVsSuspendConversion' type=T of .testIntersectionVsSuspendConversion origin=null + FUN name:testSimple visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 - GET_VAR 'a: kotlin.Any declared in .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 BLOCK_BODY CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null - $this: GET_VAR 'callee: kotlin.Function0 declared in .testSmartCastWithSuspendConversion.suspendConversion0' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion0 (): kotlin.Unit declared in .testSmartCastWithSuspendConversion' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 - GET_VAR 'a: kotlin.Any declared in .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSimple.suspendConversion0' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (): kotlin.Unit declared in .testSimple' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: kotlin.Function0 declared in .testSimple' type=kotlin.Function0 origin=null + FUN name:testSimpleAsExt visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + CALL 'public final fun useSuspendExt (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1 + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1 declared in .testSimpleAsExt.suspendConversion0' type=@[ExtensionFunctionType] kotlin.Function1 origin=null + p1: GET_VAR 'p0: kotlin.Int declared in .testSimpleAsExt.suspendConversion0' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: kotlin.Int): kotlin.Unit declared in .testSimpleAsExt' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExt' type=kotlin.Function1 origin=null + FUN name:testSimpleAsExtT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Int + sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1 + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1 declared in .testSimpleAsExtT.suspendConversion0' type=@[ExtensionFunctionType] kotlin.Function1 origin=null + p1: GET_VAR 'p0: kotlin.Int declared in .testSimpleAsExtT.suspendConversion0' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: kotlin.Int): kotlin.Unit declared in .testSimpleAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExtT' type=kotlin.Function1 origin=null + FUN name:testSimpleAsSimpleT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 + BLOCK_BODY + CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Int + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function1 declared in .testSimpleAsSimpleT.suspendConversion0' type=kotlin.Function1 origin=null + p1: GET_VAR 'p0: kotlin.Int declared in .testSimpleAsSimpleT.suspendConversion0' type=kotlin.Int origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: kotlin.Int): kotlin.Unit declared in .testSimpleAsSimpleT' type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsSimpleT' type=kotlin.Function1 origin=null + FUN name:testSimpleNonVal visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSimpleNonVal.suspendConversion0' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (): kotlin.Unit declared in .testSimpleNonVal' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: CALL 'public final fun produceFun (): kotlin.Function0 declared in ' type=kotlin.Function0 origin=null + FUN name:testSimpleSAsExtT visibility:public modality:FINAL (fn:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> + BLOCK_BODY + CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : S of .testSimpleSAsExtT + sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.testSimpleSAsExtT, kotlin.Unit> origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1.testSimpleSAsExtT, kotlin.Unit>, p0:S of .testSimpleSAsExtT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:S of .testSimpleSAsExtT + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT.suspendConversion0' type=@[ExtensionFunctionType] kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null + p1: GET_VAR 'p0: S of .testSimpleSAsExtT declared in .testSimpleSAsExtT.suspendConversion0' type=S of .testSimpleSAsExtT origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: S of .testSimpleSAsExtT): kotlin.Unit declared in .testSimpleSAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.testSimpleSAsExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null + FUN name:testSimpleSAsSimpleT visibility:public modality:FINAL (fn:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> + BLOCK_BODY + CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : S of .testSimpleSAsSimpleT + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.testSimpleSAsSimpleT, kotlin.Unit> origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit>, p0:S of .testSimpleSAsSimpleT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:S of .testSimpleSAsSimpleT + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT.suspendConversion0' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=null + p1: GET_VAR 'p0: S of .testSimpleSAsSimpleT declared in .testSimpleSAsSimpleT.suspendConversion0' type=S of .testSimpleSAsSimpleT origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (p0: S of .testSimpleSAsSimpleT): kotlin.Unit declared in .testSimpleSAsSimpleT' type=kotlin.coroutines.SuspendFunction1.testSimpleSAsSimpleT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=null + FUN name:testSmartCastOnVarVsSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + BLOCK_BODY + VAR name:b type:kotlin.Function0 [var] + GET_VAR 'a: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=CAST typeOperand=kotlin.coroutines.SuspendFunction0 + GET_VAR 'var b: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null + CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=IMPLICIT_CAST typeOperand=kotlin.coroutines.SuspendFunction0 + GET_VAR 'var b: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null FUN name:testSmartCastOnVarWithSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -256,20 +240,36 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=IMPLICIT_CAST typeOperand=kotlin.coroutines.SuspendFunction0 GET_VAR 'a: kotlin.Function0 declared in .testSmartCastVsSuspendConversion' type=kotlin.Function0 origin=null - FUN name:testSmartCastOnVarVsSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + FUN name:testSmartCastWithSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY - VAR name:b type:kotlin.Function0 [var] - GET_VAR 'a: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=CAST typeOperand=kotlin.coroutines.SuspendFunction0 - GET_VAR 'var b: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any declared in .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=IMPLICIT_CAST typeOperand=kotlin.coroutines.SuspendFunction0 - GET_VAR 'var b: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null - FUN name:testIntersectionVsSuspendConversion visibility:public modality:FINAL (x:T of .testIntersectionVsSuspendConversion) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Function0; kotlin.coroutines.SuspendFunction0] reified:false - VALUE_PARAMETER name:x index:0 type:T of .testIntersectionVsSuspendConversion + sfn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSmartCastWithSuspendConversion.suspendConversion0' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (): kotlin.Unit declared in .testSmartCastWithSuspendConversion' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any declared in .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null + FUN name:useSuspend visibility:public modality:FINAL <> (sfn:kotlin.coroutines.SuspendFunction0) returnType:kotlin.Unit + VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction0 + BLOCK_BODY + FUN name:useSuspendArg visibility:public modality:FINAL <> (sfn:kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit + VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction1 + BLOCK_BODY + FUN name:useSuspendArgT visibility:public modality:FINAL (sfn:kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> + BLOCK_BODY + FUN name:useSuspendExt visibility:public modality:FINAL <> (sfn:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit + VALUE_PARAMETER name:sfn index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 + BLOCK_BODY + FUN name:useSuspendExtT visibility:public modality:FINAL (sfn:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:sfn index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> BLOCK_BODY - CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: GET_VAR 'x: T of .testIntersectionVsSuspendConversion declared in .testIntersectionVsSuspendConversion' type=T of .testIntersectionVsSuspendConversion origin=null diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.kt.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.kt.txt index 2764c6b660c..5b283e55ff4 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.kt.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.kt.txt @@ -1,18 +1,3 @@ -fun useSuspend(sfn: SuspendFunction0) { -} - -fun useSuspendExt(sfn: @ExtensionFunctionType SuspendFunction1) { -} - -fun useSuspendArg(sfn: SuspendFunction1) { -} - -fun useSuspendArgT(sfn: SuspendFunction1) { -} - -fun useSuspendExtT(sfn: @ExtensionFunctionType SuspendFunction1) { -} - fun produceFun(): Function0 { return local fun () { return Unit @@ -20,28 +5,18 @@ fun produceFun(): Function0 { } -fun testSimple(fn: Function0) { - useSuspend(sfn = { // BLOCK - local suspend fun Function0.suspendConversion0() { - callee.invoke() +fun testExtAsExt(fn: @ExtensionFunctionType Function1) { + useSuspendExt(sfn = { // BLOCK + local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: Int) { + callee.invoke(p1 = p0) } fn::suspendConversion0 }) } -fun testSimpleNonVal() { - useSuspend(sfn = { // BLOCK - local suspend fun Function0.suspendConversion0() { - callee.invoke() - } - - produceFun()::suspendConversion0 - }) -} - -fun testExtAsExt(fn: @ExtensionFunctionType Function1) { - useSuspendExt(sfn = { // BLOCK +fun testExtAsExtT(fn: @ExtensionFunctionType Function1) { + useSuspendExtT(sfn = { // BLOCK local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: Int) { callee.invoke(p1 = p0) } @@ -60,36 +35,6 @@ fun testExtAsSimple(fn: @ExtensionFunctionType Function1) { }) } -fun testSimpleAsExt(fn: Function1) { - useSuspendExt(sfn = { // BLOCK - local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: Int) { - callee.invoke(p1 = p0) - } - - fn::suspendConversion0 - }) -} - -fun testSimpleAsSimpleT(fn: Function1) { - useSuspendArgT(sfn = { // BLOCK - local suspend fun Function1.suspendConversion0(p0: Int) { - callee.invoke(p1 = p0) - } - - fn::suspendConversion0 - }) -} - -fun testSimpleAsExtT(fn: Function1) { - useSuspendExtT(sfn = { // BLOCK - local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: Int) { - callee.invoke(p1 = p0) - } - - fn::suspendConversion0 - }) -} - fun testExtAsSimpleT(fn: @ExtensionFunctionType Function1) { useSuspendArgT(sfn = { // BLOCK local suspend fun Function1.suspendConversion0(p0: Int) { @@ -100,27 +45,7 @@ fun testExtAsSimpleT(fn: @ExtensionFunctionType Function1) { }) } -fun testExtAsExtT(fn: @ExtensionFunctionType Function1) { - useSuspendExtT(sfn = { // BLOCK - local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: Int) { - callee.invoke(p1 = p0) - } - - fn::suspendConversion0 - }) -} - -fun testSimpleSAsSimpleT(fn: Function1) { - useSuspendArgT(sfn = { // BLOCK - local suspend fun Function1.suspendConversion0(p0: S) { - callee.invoke(p1 = p0) - } - - fn::suspendConversion0 - }) -} - -fun testSimpleSAsExtT(fn: Function1) { +fun testExtSAsExtT(fn: @ExtensionFunctionType Function1) { useSuspendExtT(sfn = { // BLOCK local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: S) { callee.invoke(p1 = p0) @@ -140,7 +65,61 @@ fun testExtSAsSimpleT(fn: @ExtensionFunctionType Function1) }) } -fun testExtSAsExtT(fn: @ExtensionFunctionType Function1) { +fun testIntersectionVsSuspendConversion(x: T) where T : Function0, T : SuspendFunction0 { + useSuspend(sfn = x) +} + +fun testSimple(fn: Function0) { + useSuspend(sfn = { // BLOCK + local suspend fun Function0.suspendConversion0() { + callee.invoke() + } + + fn::suspendConversion0 + }) +} + +fun testSimpleAsExt(fn: Function1) { + useSuspendExt(sfn = { // BLOCK + local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: Int) { + callee.invoke(p1 = p0) + } + + fn::suspendConversion0 + }) +} + +fun testSimpleAsExtT(fn: Function1) { + useSuspendExtT(sfn = { // BLOCK + local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: Int) { + callee.invoke(p1 = p0) + } + + fn::suspendConversion0 + }) +} + +fun testSimpleAsSimpleT(fn: Function1) { + useSuspendArgT(sfn = { // BLOCK + local suspend fun Function1.suspendConversion0(p0: Int) { + callee.invoke(p1 = p0) + } + + fn::suspendConversion0 + }) +} + +fun testSimpleNonVal() { + useSuspend(sfn = { // BLOCK + local suspend fun Function0.suspendConversion0() { + callee.invoke() + } + + produceFun()::suspendConversion0 + }) +} + +fun testSimpleSAsExtT(fn: Function1) { useSuspendExtT(sfn = { // BLOCK local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: S) { callee.invoke(p1 = p0) @@ -150,17 +129,22 @@ fun testExtSAsExtT(fn: @ExtensionFunctionType Function1) { }) } -fun testSmartCastWithSuspendConversion(a: Any) { - a as Function0 /*~> Unit */ - useSuspend(sfn = { // BLOCK - local suspend fun Function0.suspendConversion0() { - callee.invoke() +fun testSimpleSAsSimpleT(fn: Function1) { + useSuspendArgT(sfn = { // BLOCK + local suspend fun Function1.suspendConversion0(p0: S) { + callee.invoke(p1 = p0) } - a /*as Function0 */::suspendConversion0 + fn::suspendConversion0 }) } +fun testSmartCastOnVarVsSuspendConversion(a: Function0) { + var b: Function0 = a + b as SuspendFunction0 /*~> Unit */ + useSuspend(sfn = b /*as SuspendFunction0 */) +} + fun testSmartCastOnVarWithSuspendConversion(a: Any) { var b: Any = a b as Function0 /*~> Unit */ @@ -178,12 +162,29 @@ fun testSmartCastVsSuspendConversion(a: Function0) { useSuspend(sfn = a /*as SuspendFunction0 */) } -fun testSmartCastOnVarVsSuspendConversion(a: Function0) { - var b: Function0 = a - b as SuspendFunction0 /*~> Unit */ - useSuspend(sfn = b /*as SuspendFunction0 */) +fun testSmartCastWithSuspendConversion(a: Any) { + a as Function0 /*~> Unit */ + useSuspend(sfn = { // BLOCK + local suspend fun Function0.suspendConversion0() { + callee.invoke() + } + + a /*as Function0 */::suspendConversion0 + }) } -fun testIntersectionVsSuspendConversion(x: T) where T : Function0, T : SuspendFunction0 { - useSuspend(sfn = x) +fun useSuspend(sfn: SuspendFunction0) { } + +fun useSuspendArg(sfn: SuspendFunction1) { +} + +fun useSuspendArgT(sfn: SuspendFunction1) { +} + +fun useSuspendExt(sfn: @ExtensionFunctionType SuspendFunction1) { +} + +fun useSuspendExtT(sfn: @ExtensionFunctionType SuspendFunction1) { +} + diff --git a/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.fir.ir.txt b/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.fir.ir.txt index ef9f00c9f12..c5542de4a42 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.fir.ir.txt @@ -1,8 +1,6 @@ FILE fqName: fileName:/suspendConversionWithFunInterfaces.kt CLASS INTERFACE name:SuspendRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SuspendRunnable - FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.SuspendRunnable) returnType:kotlin.Unit [suspend] - $this: VALUE_PARAMETER name: type:.SuspendRunnable 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 @@ -16,9 +14,8 @@ FILE fqName: fileName:/suspendConversionWithFunInterfaces.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:foo1 visibility:public modality:FINAL <> (s:.SuspendRunnable) returnType:kotlin.Unit - VALUE_PARAMETER name:s index:0 type:.SuspendRunnable - BLOCK_BODY + FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.SuspendRunnable) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.SuspendRunnable FUN name:bar1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY FUN name:bar2 visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Int @@ -61,3 +58,6 @@ FILE fqName: fileName:/suspendConversionWithFunInterfaces.kt CALL 'public final fun bar3 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable FUNCTION_REFERENCE 'local final fun bar3 (): kotlin.Unit declared in .box' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun bar3 (): kotlin.Unit declared in + FUN name:foo1 visibility:public modality:FINAL <> (s:.SuspendRunnable) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:.SuspendRunnable + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.ir.txt b/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.ir.txt index ef9f00c9f12..c5542de4a42 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.ir.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.ir.txt @@ -1,8 +1,6 @@ FILE fqName: fileName:/suspendConversionWithFunInterfaces.kt CLASS INTERFACE name:SuspendRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SuspendRunnable - FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.SuspendRunnable) returnType:kotlin.Unit [suspend] - $this: VALUE_PARAMETER name: type:.SuspendRunnable 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 @@ -16,9 +14,8 @@ FILE fqName: fileName:/suspendConversionWithFunInterfaces.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:foo1 visibility:public modality:FINAL <> (s:.SuspendRunnable) returnType:kotlin.Unit - VALUE_PARAMETER name:s index:0 type:.SuspendRunnable - BLOCK_BODY + FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.SuspendRunnable) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.SuspendRunnable FUN name:bar1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY FUN name:bar2 visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Int @@ -61,3 +58,6 @@ FILE fqName: fileName:/suspendConversionWithFunInterfaces.kt CALL 'public final fun bar3 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable FUNCTION_REFERENCE 'local final fun bar3 (): kotlin.Unit declared in .box' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun bar3 (): kotlin.Unit declared in + FUN name:foo1 visibility:public modality:FINAL <> (s:.SuspendRunnable) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:.SuspendRunnable + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.ir.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.ir.txt deleted file mode 100644 index be5f9e2f24a..00000000000 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.ir.txt +++ /dev/null @@ -1,90 +0,0 @@ -FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt - PROPERTY name:n visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:n type:kotlin.Any? visibility:private [final,static] - EXPRESSION_BODY - CONST Null type=kotlin.Nothing? value=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? - correspondingProperty: PROPERTY name:n visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:n type:kotlin.Any? visibility:private [final,static]' type=kotlin.Any? origin=null - CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En - CONSTRUCTOR visibility:private <> (x:kotlin.String?) returnType:.En [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String? - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .En - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String? visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.String? declared in .En.' type=kotlin.String? origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.En) returnType:kotlin.String? - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.En - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String? declared in .En' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String? visibility:private [final]' type=kotlin.String? origin=null - receiver: GET_VAR ': .En declared in .En.' type=.En origin=null - ENUM_ENTRY name:ENTRY - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.String?) declared in .En' - x: BLOCK type=kotlin.String? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val] - CALL 'public final fun (): kotlin.Any? declared in ' type=kotlin.Any? origin=GET_PROPERTY - 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_0: kotlin.Any? declared in .En' 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 open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_0: kotlin.Any? declared in .En' type=kotlin.Any? origin=null - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.En> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:.En) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - VALUE_PARAMETER name:other index:0 type:.En - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.kt.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.kt.txt deleted file mode 100644 index 14bd40e8824..00000000000 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.kt.txt +++ /dev/null @@ -1,32 +0,0 @@ -val n: Any? - field = null - get - -enum class En : Enum { - private constructor(x: String?) /* primary */ { - super/*Enum*/() - /* () */ - - } - - val x: String? - field = x - get - - ENTRY = En(x = { // BLOCK - val tmp_0: Any? = () - when { - EQEQ(arg0 = tmp_0, arg1 = null) -> null - else -> tmp_0.toString() - } - }) - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): En /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} - diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.ir.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.ir.txt index b3d5f9552cd..17b146e405c 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.ir.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.ir.txt @@ -10,12 +10,6 @@ FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:n type:kotlin.Any? visibility:private [final,static]' type=kotlin.Any? origin=null CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En - CONSTRUCTOR visibility:private <> (x:kotlin.String?) returnType:.En [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String? - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .En - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String? visibility:private [final] EXPRESSION_BODY @@ -43,24 +37,17 @@ FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null $this: GET_VAR 'val tmp_0: kotlin.Any? declared in .En' type=kotlin.Any? origin=null - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + CONSTRUCTOR visibility:private <> (x:kotlin.String?) returnType:.En [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String? + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .En + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:.En) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -79,12 +66,25 @@ FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.En> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt index e1588e50e33..e6b2c25b01f 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val n: Any? = null enum class En(val x: String?) { diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt.txt index bae88378012..b0994939278 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt.txt @@ -3,12 +3,6 @@ val n: Any? get enum class En : Enum { - private constructor(x: String?) /* primary */ { - super/*Enum*/() - /* () */ - - } - val x: String? field = x get @@ -21,11 +15,18 @@ enum class En : Enum { } }) - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(x: String?) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): En /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } + diff --git a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.ir.txt b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.ir.txt index ac44f947bf4..bbcfbe9fff8 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.ir.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/temporaryInInitBlock.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (x:kotlin.Any?) returnType:.C [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Any? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String? visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.String? @@ -32,6 +27,11 @@ FILE fqName: fileName:/temporaryInInitBlock.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null $this: GET_VAR 'val tmp_0: kotlin.Any? declared in .C' type=kotlin.Any? origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Any?) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Any? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt.txt b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt.txt index 322b85f5439..9f92819a553 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt.txt @@ -1,10 +1,4 @@ class C { - constructor(x: Any?) /* primary */ { - super/*Any*/() - /* () */ - - } - val s: String? get @@ -18,4 +12,11 @@ class C { } } + constructor(x: Any?) /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.ir.txt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.ir.txt index cb64f0a02a1..ec4034c9167 100644 --- a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.ir.txt +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T of .Outer) returnType:.Outer.Outer> [primary] - VALUE_PARAMETER name:x index:0 type:T of .Outer - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:T of .Outer visibility:private [final] EXPRESSION_BODY @@ -20,12 +15,6 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt receiver: GET_VAR ': .Outer.Outer> declared in .Outer.' type=.Outer.Outer> origin=null CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer> - CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>, y:kotlin.Int) returnType:.Outer.Inner.Outer> [primary] - $outer: VALUE_PARAMETER name: type:.Outer.Outer> - VALUE_PARAMETER name:y index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any]' PROPERTY name:y visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -37,6 +26,12 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Outer.Inner' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Outer.Inner.Outer> declared in .Outer.Inner.' type=.Outer.Inner.Outer> origin=null + CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>, y:kotlin.Int) returnType:.Outer.Inner.Outer> [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Outer> + VALUE_PARAMETER name:y index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:OPEN visibility:public [inner] 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 declared in kotlin.Any @@ -50,6 +45,11 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> (x:T of .Outer) returnType:.Outer.Outer> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Outer + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 declared in kotlin.Any @@ -70,12 +70,6 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt BLOCK type=.test. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test. - CONSTRUCTOR visibility:public <> () returnType:.test. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (y: kotlin.Int) declared in .Outer.Inner' - $this: GET_VAR ': .Outer declared in .test' type=.Outer origin=null - y: CONST Int type=kotlin.Int value=42 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' PROPERTY name:xx visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -91,14 +85,12 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .test.' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .test. declared in .test..' type=.test. origin=null - PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] - overridden: - public final y: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:.Outer.Inner + CONSTRUCTOR visibility:public <> () returnType:.test. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (y: kotlin.Int) declared in .Outer.Inner' + $this: GET_VAR ': .Outer declared in .test' type=.Outer origin=null + y: CONST Int type=kotlin.Int value=42 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' 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 .Outer.Inner @@ -112,4 +104,12 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt overridden: public open fun toString (): kotlin.String declared in .Outer.Inner $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] + overridden: + public final y: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:.Outer.Inner CONSTRUCTOR_CALL 'public constructor () declared in .test.' type=.test. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt.txt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt.txt index 767928e903f..993bd75173f 100644 --- a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt.txt +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt.txt @@ -1,24 +1,24 @@ class Outer { - constructor(x: T) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: T field = x get open inner class Inner { + val y: Int + field = y + get + constructor(y: Int) /* primary */ { super/*Any*/() /* () */ } - val y: Int - field = y - get + } + + constructor(x: T) /* primary */ { + super/*Any*/() + /* () */ } @@ -27,18 +27,19 @@ class Outer { fun Outer.test(): Inner { return { // BLOCK local class : Inner { + val xx: Int + field = .().plus(other = .()) + get + constructor() /* primary */ { .super/*Inner*/(y = 42) /* () */ } - val xx: Int - field = .().plus(other = .()) - get - } () } } + diff --git a/compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.ir.txt b/compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.ir.txt index 5e7e2b96d1a..00fb2326c0e 100644 --- a/compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.ir.txt +++ b/compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/thisRefToObjectInNestedClassConstructorCall.kt CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base - CONSTRUCTOR visibility:public <> (x:kotlin.Any) returnType:.Base [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final] EXPRESSION_BODY @@ -17,6 +12,11 @@ FILE fqName: fileName:/thisRefToObjectInNestedClassConstructorCall.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .Base' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Any) returnType:.Base [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public 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 declared in kotlin.Any @@ -32,10 +32,6 @@ FILE fqName: fileName:/thisRefToObjectInNestedClassConstructorCall.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:private <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.Derived1 CONSTRUCTOR visibility:public <> () returnType:.Host.Derived1 [primary] @@ -43,14 +39,6 @@ FILE fqName: fileName:/thisRefToObjectInNestedClassConstructorCall.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Any) declared in .Base' x: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Host INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Any - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.Any [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Any declared in .Base - $this: VALUE_PARAMETER name: type:.Base 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 .Base @@ -64,6 +52,14 @@ FILE fqName: fileName:/thisRefToObjectInNestedClassConstructorCall.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Any + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.Any [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Any declared in .Base + $this: VALUE_PARAMETER name: type:.Base CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.Derived2 CONSTRUCTOR visibility:public <> () returnType:.Host.Derived2 [primary] @@ -71,14 +67,6 @@ FILE fqName: fileName:/thisRefToObjectInNestedClassConstructorCall.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Any) declared in .Base' x: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Host INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Base]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Any - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.Any [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Any declared in .Base - $this: VALUE_PARAMETER name: type:.Base 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 .Base @@ -92,6 +80,18 @@ FILE fqName: fileName:/thisRefToObjectInNestedClassConstructorCall.kt overridden: public open fun toString (): kotlin.String declared in .Base $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: kotlin.Any + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.Any [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Any declared in .Base + $this: VALUE_PARAMETER name: type:.Base + CONSTRUCTOR visibility:private <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.kt.txt b/compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.kt.txt index 17c69ed7c75..100c37efa7b 100644 --- a/compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.kt.txt +++ b/compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.kt.txt @@ -1,23 +1,17 @@ open class Base { + val x: Any + field = x + get + constructor(x: Any) /* primary */ { super/*Any*/() /* () */ } - val x: Any - field = x - get - } object Host { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - class Derived1 : Base { constructor() /* primary */ { super/*Base*/(x = Host) @@ -36,4 +30,11 @@ object Host { } + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.ir.txt b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.ir.txt index a7f4e68c345..9f59f6b84d2 100644 --- a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.ir.txt +++ b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.ir.txt @@ -1,4 +1,48 @@ FILE fqName: fileName:/thisReferenceBeforeClassDeclared.kt + CLASS CLASS name:WithCompanion modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.WithCompanion + CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.WithCompanion.Companion + CONSTRUCTOR visibility:private <> () returnType:.WithCompanion.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] 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 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:foo visibility:public modality:FINAL <> ($this:.WithCompanion.Companion) returnType:.WithCompanion.Companion + $this: VALUE_PARAMETER name: type:.WithCompanion.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): .WithCompanion.Companion declared in .WithCompanion.Companion' + GET_VAR ': .WithCompanion.Companion declared in .WithCompanion.Companion.foo' type=.WithCompanion.Companion origin=null + CONSTRUCTOR visibility:public <> (a:.WithCompanion.Companion) returnType:.WithCompanion [primary] + VALUE_PARAMETER name:a index:0 type:.WithCompanion.Companion + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:WithCompanion modality:OPEN visibility:public 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 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:test visibility:public modality:FINAL <> ($receiver:.WithCompanion) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.WithCompanion BLOCK_BODY @@ -49,47 +93,3 @@ FILE fqName: fileName:/thisReferenceBeforeClassDeclared.kt public open fun toString (): kotlin.String declared in .WithCompanion $this: VALUE_PARAMETER name: type:kotlin.Any CONSTRUCTOR_CALL 'public constructor () declared in .test.' type=.test. origin=OBJECT_LITERAL - CLASS CLASS name:WithCompanion modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.WithCompanion - CONSTRUCTOR visibility:public <> (a:.WithCompanion.Companion) returnType:.WithCompanion [primary] - VALUE_PARAMETER name:a index:0 type:.WithCompanion.Companion - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:WithCompanion modality:OPEN visibility:public superTypes:[kotlin.Any]' - CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.WithCompanion.Companion - CONSTRUCTOR visibility:private <> () returnType:.WithCompanion.Companion [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.WithCompanion.Companion) returnType:.WithCompanion.Companion - $this: VALUE_PARAMETER name: type:.WithCompanion.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): .WithCompanion.Companion declared in .WithCompanion.Companion' - GET_VAR ': .WithCompanion.Companion declared in .WithCompanion.Companion.foo' type=.WithCompanion.Companion 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: 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 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: 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 diff --git a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt.txt b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt.txt index d71c2556819..86a03f1978b 100644 --- a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt.txt +++ b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt.txt @@ -1,3 +1,25 @@ +open class WithCompanion { + companion object Companion { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun foo(): Companion { + return + } + + } + + constructor(a: Companion) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + fun WithCompanion.test() { val test1: = { // BLOCK local class : WithCompanion { @@ -25,24 +47,3 @@ fun WithCompanion.test() { } } -open class WithCompanion { - constructor(a: Companion) /* primary */ { - super/*Any*/() - /* () */ - - } - - companion object Companion { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun foo(): Companion { - return - } - - } - -} diff --git a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.ir.txt b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.ir.txt index 7006243cd6a..5ba21fcefd8 100644 --- a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.ir.txt @@ -1,4 +1,22 @@ FILE fqName: fileName:/typeAliasConstructorReference.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1.C> visibility:private [final,static] + EXPRESSION_BODY + FUNCTION_REFERENCE 'public constructor (x: kotlin.Int) declared in .C' type=kotlin.reflect.KFunction1.C> origin=null reflectionTarget= + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1.C> + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1.C> declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1.C> visibility:private [final,static]' type=kotlin.Function1.C> origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function1.Host.Nested> visibility:private [final,static] + EXPRESSION_BODY + FUNCTION_REFERENCE 'public constructor (x: kotlin.Int) declared in .Host.Nested' type=kotlin.reflect.KFunction1.Host.Nested> origin=null reflectionTarget= + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1.Host.Nested> + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1.Host.Nested> declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function1.Host.Nested> visibility:private [final,static]' type=kotlin.Function1.Host.Nested> origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.C [primary] @@ -19,13 +37,8 @@ FILE fqName: fileName:/typeAliasConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - TYPEALIAS name:CA visibility:public expandedType:.C CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:private <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Nested modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.Nested CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Host.Nested [primary] @@ -46,6 +59,10 @@ FILE fqName: fileName:/typeAliasConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:private <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public 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 declared in kotlin.Any @@ -59,22 +76,5 @@ FILE fqName: fileName:/typeAliasConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + TYPEALIAS name:CA visibility:public expandedType:.C TYPEALIAS name:NA visibility:public expandedType:.Host.Nested - PROPERTY name:test1 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1.C> visibility:private [final,static] - EXPRESSION_BODY - FUNCTION_REFERENCE 'public constructor (x: kotlin.Int) declared in .C' type=kotlin.reflect.KFunction1.C> origin=null reflectionTarget= - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1.C> - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1.C> declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1.C> visibility:private [final,static]' type=kotlin.Function1.C> origin=null - PROPERTY name:test2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function1.Host.Nested> visibility:private [final,static] - EXPRESSION_BODY - FUNCTION_REFERENCE 'public constructor (x: kotlin.Int) declared in .Host.Nested' type=kotlin.reflect.KFunction1.Host.Nested> origin=null reflectionTarget= - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1.Host.Nested> - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1.Host.Nested> declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function1.Host.Nested> visibility:private [final,static]' type=kotlin.Function1.Host.Nested> origin=null diff --git a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.kt.txt b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.kt.txt index b73db21ba5a..97dd2f46495 100644 --- a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.kt.txt @@ -1,3 +1,11 @@ +val test1: Function1 + field = C:: + get + +val test2: Function1 + field = Nested:: + get + class C { constructor(x: Int) /* primary */ { super/*Any*/() @@ -7,14 +15,7 @@ class C { } -typealias CA = C object Host { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - class Nested { constructor(x: Int) /* primary */ { super/*Any*/() @@ -24,13 +25,13 @@ object Host { } + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } +typealias CA = C typealias NA = Nested -val test1: Function1 - field = C:: - get - -val test2: Function1 - field = Nested:: - get diff --git a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.ir.txt b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.ir.txt index e98fbf608b7..a46e5448dce 100644 --- a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.ir.txt +++ b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.ir.txt @@ -1,4 +1,22 @@ FILE fqName: fileName:/typeAliasConstructorReference.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1.C> visibility:private [final,static] + EXPRESSION_BODY + FUNCTION_REFERENCE 'public constructor (x: kotlin.Int) declared in .C' type=kotlin.reflect.KFunction1<@[ParameterName(name = "x")] kotlin.Int, .C> origin=null reflectionTarget= + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1.C> + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1.C> declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1.C> visibility:private [final,static]' type=kotlin.Function1.C> origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function1.Host.Nested> visibility:private [final,static] + EXPRESSION_BODY + FUNCTION_REFERENCE 'public constructor (x: kotlin.Int) declared in .Host.Nested' type=kotlin.reflect.KFunction1<@[ParameterName(name = "x")] kotlin.Int, .Host.Nested> origin=null reflectionTarget= + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1.Host.Nested> + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1.Host.Nested> declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function1.Host.Nested> visibility:private [final,static]' type=kotlin.Function1.Host.Nested> origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.C [primary] @@ -19,13 +37,8 @@ FILE fqName: fileName:/typeAliasConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - TYPEALIAS name:CA visibility:public expandedType:.C CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:private <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Nested modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.Nested CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Host.Nested [primary] @@ -46,6 +59,10 @@ FILE fqName: fileName:/typeAliasConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:private <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public 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 declared in kotlin.Any @@ -59,22 +76,5 @@ FILE fqName: fileName:/typeAliasConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + TYPEALIAS name:CA visibility:public expandedType:.C TYPEALIAS name:NA visibility:public expandedType:.Host.Nested - PROPERTY name:test1 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1.C> visibility:private [final,static] - EXPRESSION_BODY - FUNCTION_REFERENCE 'public constructor (x: kotlin.Int) declared in .C' type=kotlin.reflect.KFunction1<@[ParameterName(name = "x")] kotlin.Int, .C> origin=null reflectionTarget= - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1.C> - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1.C> declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1.C> visibility:private [final,static]' type=kotlin.Function1.C> origin=null - PROPERTY name:test2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function1.Host.Nested> visibility:private [final,static] - EXPRESSION_BODY - FUNCTION_REFERENCE 'public constructor (x: kotlin.Int) declared in .Host.Nested' type=kotlin.reflect.KFunction1<@[ParameterName(name = "x")] kotlin.Int, .Host.Nested> origin=null reflectionTarget= - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1.Host.Nested> - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1.Host.Nested> declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function1.Host.Nested> visibility:private [final,static]' type=kotlin.Function1.Host.Nested> origin=null diff --git a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt.txt b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt.txt index b73db21ba5a..97dd2f46495 100644 --- a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt.txt +++ b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt.txt @@ -1,3 +1,11 @@ +val test1: Function1 + field = C:: + get + +val test2: Function1 + field = Nested:: + get + class C { constructor(x: Int) /* primary */ { super/*Any*/() @@ -7,14 +15,7 @@ class C { } -typealias CA = C object Host { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - class Nested { constructor(x: Int) /* primary */ { super/*Any*/() @@ -24,13 +25,13 @@ object Host { } + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } +typealias CA = C typealias NA = Nested -val test1: Function1 - field = C:: - get - -val test2: Function1 - field = Nested:: - get diff --git a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.ir.txt b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.ir.txt index 74ed78089e8..f9c06299b1b 100644 --- a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.ir.txt +++ b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.ir.txt @@ -1,51 +1,10 @@ FILE fqName: fileName:/typeParameterClassLiteral.kt - FUN name:classRefFun visibility:public modality:FINAL () returnType:kotlin.reflect.KClass.classRefFun> [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun classRefFun (): kotlin.reflect.KClass.classRefFun> declared in ' - CLASS_REFERENCE 'TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true' type=kotlin.reflect.KClass.classRefFun> - FUN name:classRefExtFun visibility:public modality:FINAL ($receiver:kotlin.Any) returnType:kotlin.reflect.KClass.classRefExtFun> [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true - $receiver: VALUE_PARAMETER name: type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun classRefExtFun (): kotlin.reflect.KClass.classRefExtFun> declared in ' - CLASS_REFERENCE 'TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true' type=kotlin.reflect.KClass.classRefExtFun> - PROPERTY name:classRefExtVal visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:kotlin.reflect.KClass.> [inline] - correspondingProperty: PROPERTY name:classRefExtVal visibility:public modality:FINAL [val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true - $receiver: VALUE_PARAMETER name: type:T of . - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass.> declared in ' - CLASS_REFERENCE 'TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true' type=kotlin.reflect.KClass.> CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host CONSTRUCTOR visibility:public <> () returnType:.Host [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:classRefGenericMemberFun visibility:public modality:FINAL ($this:.Host) returnType:kotlin.reflect.KClass.Host.classRefGenericMemberFun> [inline] - TYPE_PARAMETER name:TF index:0 variance: superTypes:[kotlin.Any] reified:true - $this: VALUE_PARAMETER name: type:.Host - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun classRefGenericMemberFun (): kotlin.reflect.KClass.Host.classRefGenericMemberFun> declared in .Host' - CLASS_REFERENCE 'TYPE_PARAMETER name:TF index:0 variance: superTypes:[kotlin.Any] reified:true' type=kotlin.reflect.KClass.Host.classRefGenericMemberFun> - FUN name:classRefGenericMemberExtFun visibility:public modality:FINAL ($this:.Host, $receiver:kotlin.Any) returnType:kotlin.reflect.KClass.Host.classRefGenericMemberExtFun> [inline] - TYPE_PARAMETER name:TF index:0 variance: superTypes:[kotlin.Any] reified:true - $this: VALUE_PARAMETER name: type:.Host - $receiver: VALUE_PARAMETER name: type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun classRefGenericMemberExtFun (): kotlin.reflect.KClass.Host.classRefGenericMemberExtFun> declared in .Host' - CLASS_REFERENCE 'TYPE_PARAMETER name:TF index:0 variance: superTypes:[kotlin.Any] reified:true' type=kotlin.reflect.KClass.Host.classRefGenericMemberExtFun> - PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($this:.Host, $receiver:TV of .Host.) returnType:kotlin.reflect.KClass.Host.> [inline] - correspondingProperty: PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val] - TYPE_PARAMETER name:TV index:0 variance: superTypes:[kotlin.Any] reified:true - $this: VALUE_PARAMETER name: type:.Host - $receiver: VALUE_PARAMETER name: type:TV of .Host. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass.Host.> declared in .Host' - CLASS_REFERENCE 'TYPE_PARAMETER name:TV index:0 variance: superTypes:[kotlin.Any] reified:true' type=kotlin.reflect.KClass.Host.> 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 @@ -59,3 +18,44 @@ FILE fqName: fileName:/typeParameterClassLiteral.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:classRefGenericMemberExtFun visibility:public modality:FINAL ($this:.Host, $receiver:kotlin.Any) returnType:kotlin.reflect.KClass.Host.classRefGenericMemberExtFun> [inline] + TYPE_PARAMETER name:TF index:0 variance: superTypes:[kotlin.Any] reified:true + $this: VALUE_PARAMETER name: type:.Host + $receiver: VALUE_PARAMETER name: type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun classRefGenericMemberExtFun (): kotlin.reflect.KClass.Host.classRefGenericMemberExtFun> declared in .Host' + CLASS_REFERENCE 'TYPE_PARAMETER name:TF index:0 variance: superTypes:[kotlin.Any] reified:true' type=kotlin.reflect.KClass.Host.classRefGenericMemberExtFun> + FUN name:classRefGenericMemberFun visibility:public modality:FINAL ($this:.Host) returnType:kotlin.reflect.KClass.Host.classRefGenericMemberFun> [inline] + TYPE_PARAMETER name:TF index:0 variance: superTypes:[kotlin.Any] reified:true + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun classRefGenericMemberFun (): kotlin.reflect.KClass.Host.classRefGenericMemberFun> declared in .Host' + CLASS_REFERENCE 'TYPE_PARAMETER name:TF index:0 variance: superTypes:[kotlin.Any] reified:true' type=kotlin.reflect.KClass.Host.classRefGenericMemberFun> + PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL ($this:.Host, $receiver:TV of .Host.) returnType:kotlin.reflect.KClass.Host.> [inline] + correspondingProperty: PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val] + TYPE_PARAMETER name:TV index:0 variance: superTypes:[kotlin.Any] reified:true + $this: VALUE_PARAMETER name: type:.Host + $receiver: VALUE_PARAMETER name: type:TV of .Host. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass.Host.> declared in .Host' + CLASS_REFERENCE 'TYPE_PARAMETER name:TV index:0 variance: superTypes:[kotlin.Any] reified:true' type=kotlin.reflect.KClass.Host.> + FUN name:classRefExtFun visibility:public modality:FINAL ($receiver:kotlin.Any) returnType:kotlin.reflect.KClass.classRefExtFun> [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true + $receiver: VALUE_PARAMETER name: type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun classRefExtFun (): kotlin.reflect.KClass.classRefExtFun> declared in ' + CLASS_REFERENCE 'TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true' type=kotlin.reflect.KClass.classRefExtFun> + FUN name:classRefFun visibility:public modality:FINAL () returnType:kotlin.reflect.KClass.classRefFun> [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun classRefFun (): kotlin.reflect.KClass.classRefFun> declared in ' + CLASS_REFERENCE 'TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true' type=kotlin.reflect.KClass.classRefFun> + PROPERTY name:classRefExtVal visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:kotlin.reflect.KClass.> [inline] + correspondingProperty: PROPERTY name:classRefExtVal visibility:public modality:FINAL [val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true + $receiver: VALUE_PARAMETER name: type:T of . + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass.> declared in ' + CLASS_REFERENCE 'TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:true' type=kotlin.reflect.KClass.> diff --git a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt.txt b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt.txt index 027260d6006..addbef23971 100644 --- a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt.txt +++ b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt.txt @@ -1,16 +1,3 @@ -inline fun classRefFun(): KClass { - return T::class -} - -inline fun Any.classRefExtFun(): KClass { - return T::class -} - -val T.classRefExtVal: KClass - inline get(): KClass { - return T::class - } - class Host { constructor() /* primary */ { super/*Any*/() @@ -18,11 +5,11 @@ class Host { } - inline fun classRefGenericMemberFun(): KClass { + inline fun Any.classRefGenericMemberExtFun(): KClass { return TF::class } - inline fun Any.classRefGenericMemberExtFun(): KClass { + inline fun classRefGenericMemberFun(): KClass { return TF::class } @@ -32,3 +19,17 @@ class Host { } } + +inline fun Any.classRefExtFun(): KClass { + return T::class +} + +inline fun classRefFun(): KClass { + return T::class +} + +val T.classRefExtVal: KClass + inline get(): KClass { + return T::class + } + diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.ir.txt b/compiler/testData/ir/irText/expressions/useImportedMember.ir.txt index 9ea9632db1f..3a7e586332a 100644 --- a/compiler/testData/ir/irText/expressions/useImportedMember.ir.txt +++ b/compiler/testData/ir/irText/expressions/useImportedMember.ir.txt @@ -1,7 +1,48 @@ FILE fqName: fileName:/useImportedMember.kt + CLASS CLASS name:BaseClass modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseClass + CONSTRUCTOR visibility:public <> () returnType:.BaseClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseClass modality:OPEN visibility:public 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 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 + PROPERTY name:fromClass visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL ($this:.BaseClass, $receiver:T of .BaseClass.) returnType:T of .BaseClass. + correspondingProperty: PROPERTY name:fromClass visibility:public modality:FINAL [val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.BaseClass + $receiver: VALUE_PARAMETER name: type:T of .BaseClass. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .BaseClass. declared in .BaseClass' + GET_VAR ': T of .BaseClass. declared in .BaseClass.' type=T of .BaseClass. origin=null CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> TYPE_PARAMETER name:G index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:fromInterface visibility:public modality:OPEN ($this:.I.I>, $receiver:T of .I.fromInterface) returnType:T of .I.fromInterface TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:.I.I> @@ -15,71 +56,8 @@ FILE fqName: fileName:/useImportedMember.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun genericFromSuper (g: G of .I): G of .I declared in .I' GET_VAR 'g: G of .I declared in .I.genericFromSuper' type=G of .I 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: 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 - CLASS CLASS name:BaseClass modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseClass - CONSTRUCTOR visibility:public <> () returnType:.BaseClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseClass modality:OPEN visibility:public superTypes:[kotlin.Any]' - PROPERTY name:fromClass visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($this:.BaseClass, $receiver:T of .BaseClass.) returnType:T of .BaseClass. - correspondingProperty: PROPERTY name:fromClass visibility:public modality:FINAL [val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.BaseClass - $receiver: VALUE_PARAMETER name: type:T of .BaseClass. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .BaseClass. declared in .BaseClass' - GET_VAR ': T of .BaseClass. declared in .BaseClass.' type=T of .BaseClass. 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: 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 CLASS OBJECT name:C modality:FINAL visibility:public superTypes:[.BaseClass; .I] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:private <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .BaseClass' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:C modality:FINAL visibility:public superTypes:[.BaseClass; .I]' - FUN name:f visibility:public modality:FINAL <> ($this:.C, s:kotlin.Int) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:s index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (s: kotlin.Int): kotlin.Int declared in .C' - CONST Int type=kotlin.Int value=1 - FUN name:f visibility:public modality:FINAL <> ($this:.C, s:kotlin.String) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (s: kotlin.String): kotlin.Int declared in .C' - CONST Int type=kotlin.Int value=2 - FUN name:f visibility:public modality:FINAL <> ($this:.C, $receiver:kotlin.Boolean) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.C - $receiver: VALUE_PARAMETER name: type:kotlin.Boolean - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in .C' - CONST Int type=kotlin.Int value=3 PROPERTY name:p visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private EXPRESSION_BODY @@ -99,56 +77,16 @@ FILE fqName: fileName:/useImportedMember.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null - PROPERTY name:ext visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.C, $receiver:kotlin.Int) returnType:kotlin.Int - correspondingProperty: PROPERTY name:ext visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - CONST Int type=kotlin.Int value=6 - FUN name:g1 visibility:public modality:FINAL ($this:.C, t:T of .C.g1) returnType:T of .C.g1 - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:t index:0 type:T of .C.g1 + CONSTRUCTOR visibility:private <> () returnType:.C [primary] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun g1 (t: T of .C.g1): T of .C.g1 declared in .C' - GET_VAR 't: T of .C.g1 declared in .C.g1' type=T of .C.g1 origin=null - PROPERTY name:g2 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($this:.C, $receiver:T of .C.) returnType:T of .C. - correspondingProperty: PROPERTY name:g2 visibility:public modality:FINAL [val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.C - $receiver: VALUE_PARAMETER name: type:T of .C. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .C. declared in .C' - GET_VAR ': T of .C. declared in .C.' type=T of .C. origin=null - PROPERTY FAKE_OVERRIDE name:fromClass visibility:public modality:FINAL [fake_override,val] - overridden: - public final fromClass: T of .BaseClass. - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL ($this:.BaseClass, $receiver:T of .C.) returnType:T of .C. [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:fromClass visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): T of .BaseClass. declared in .BaseClass - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.BaseClass - $receiver: VALUE_PARAMETER name: type:T of .C. + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .BaseClass' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:C modality:FINAL visibility:public superTypes:[.BaseClass; .I]' 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 .BaseClass public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .I $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 .BaseClass - public open fun hashCode (): kotlin.Int declared in .I - $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 .BaseClass - public open fun toString (): kotlin.String declared in .I - $this: VALUE_PARAMETER name: type:kotlin.Any FUN FAKE_OVERRIDE name:fromInterface visibility:public modality:OPEN ($this:.I, $receiver:T of .C.fromInterface) returnType:T of .C.fromInterface [fake_override] overridden: public open fun fromInterface (): T of .I.fromInterface declared in .I @@ -160,6 +98,68 @@ FILE fqName: fileName:/useImportedMember.kt public open fun genericFromSuper (g: G of .I): G of .I declared in .I $this: VALUE_PARAMETER name: type:.I VALUE_PARAMETER name:g index:0 type:kotlin.String + 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 .BaseClass + public open fun hashCode (): kotlin.Int declared in .I + $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 .BaseClass + public open fun toString (): kotlin.String declared in .I + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:FINAL <> ($this:.C, $receiver:kotlin.Boolean) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.C + $receiver: VALUE_PARAMETER name: type:kotlin.Boolean + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in .C' + CONST Int type=kotlin.Int value=3 + FUN name:f visibility:public modality:FINAL <> ($this:.C, s:kotlin.Int) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:s index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (s: kotlin.Int): kotlin.Int declared in .C' + CONST Int type=kotlin.Int value=1 + FUN name:f visibility:public modality:FINAL <> ($this:.C, s:kotlin.String) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (s: kotlin.String): kotlin.Int declared in .C' + CONST Int type=kotlin.Int value=2 + FUN name:g1 visibility:public modality:FINAL ($this:.C, t:T of .C.g1) returnType:T of .C.g1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:t index:0 type:T of .C.g1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun g1 (t: T of .C.g1): T of .C.g1 declared in .C' + GET_VAR 't: T of .C.g1 declared in .C.g1' type=T of .C.g1 origin=null + PROPERTY FAKE_OVERRIDE name:fromClass visibility:public modality:FINAL [fake_override,val] + overridden: + public final fromClass: T of .BaseClass. + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL ($this:.BaseClass, $receiver:T of .C.) returnType:T of .C. [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:fromClass visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): T of .BaseClass. declared in .BaseClass + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.BaseClass + $receiver: VALUE_PARAMETER name: type:T of .C. + PROPERTY name:ext visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.C, $receiver:kotlin.Int) returnType:kotlin.Int + correspondingProperty: PROPERTY name:ext visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + $receiver: VALUE_PARAMETER name: type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + CONST Int type=kotlin.Int value=6 + PROPERTY name:g2 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL ($this:.C, $receiver:T of .C.) returnType:T of .C. + correspondingProperty: PROPERTY name:g2 visibility:public modality:FINAL [val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.C + $receiver: VALUE_PARAMETER name: type:T of .C. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .C. declared in .C' + GET_VAR ': T of .C. declared in .C.' type=T of .C. origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY WHEN type=kotlin.Unit origin=IF diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.kt.txt b/compiler/testData/ir/irText/expressions/useImportedMember.kt.txt index 987ce65d2a2..02e091cebfa 100644 --- a/compiler/testData/ir/irText/expressions/useImportedMember.kt.txt +++ b/compiler/testData/ir/irText/expressions/useImportedMember.kt.txt @@ -1,14 +1,3 @@ -interface I { - fun T.fromInterface(): T { - return - } - - fun genericFromSuper(g: G): G { - return g - } - -} - open class BaseClass { constructor() /* primary */ { super/*Any*/() @@ -23,13 +12,33 @@ open class BaseClass { } +interface I { + fun T.fromInterface(): T { + return + } + + fun genericFromSuper(g: G): G { + return g + } + +} + object C : BaseClass, I { + var p: Int + field = 4 + get + set + private constructor() /* primary */ { super/*BaseClass*/() /* () */ } + fun Boolean.f(): Int { + return 3 + } + fun f(s: Int): Int { return 1 } @@ -38,24 +47,15 @@ object C : BaseClass, I { return 2 } - fun Boolean.f(): Int { - return 3 + fun g1(t: T): T { + return t } - var p: Int - field = 4 - get - set - val Int.ext: Int get(): Int { return 6 } - fun g1(t: T): T { - return t - } - val T.g2: T get(): T { return @@ -100,3 +100,4 @@ fun box(): String { } return "OK" } + diff --git a/compiler/testData/ir/irText/expressions/values.fir.ir.txt b/compiler/testData/ir/irText/expressions/values.fir.ir.txt deleted file mode 100644 index 05d1b1b62d8..00000000000 --- a/compiler/testData/ir/irText/expressions/values.fir.ir.txt +++ /dev/null @@ -1,138 +0,0 @@ -FILE fqName: fileName:/values.kt - CLASS ENUM_CLASS name:Enum modality:FINAL visibility:public superTypes:[kotlin.Enum<.Enum>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Enum - CONSTRUCTOR visibility:private <> () returnType:.Enum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .Enum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Enum modality:FINAL visibility:public superTypes:[kotlin.Enum<.Enum>]' - ENUM_ENTRY name:A - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Enum' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Enum> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Enum - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Enum> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>, other:.Enum) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> - VALUE_PARAMETER name:other index:0 type:.Enum - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.Enum>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> - CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:private <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public 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 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 - PROPERTY name:a visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final,static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null - CLASS CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z - CONSTRUCTOR visibility:public <> () returnType:.Z [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.Companion - CONSTRUCTOR visibility:private <> () returnType:.Z.Companion [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] 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 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 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: 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:test1 visibility:public modality:FINAL <> () returnType:.Enum - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1 (): .Enum declared in ' - GET_ENUM 'ENUM_ENTRY name:A' type=.Enum - FUN name:test2 visibility:public modality:FINAL <> () returnType:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2 (): .A declared in ' - GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A - FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Int declared in ' - CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - FUN name:test4 visibility:public modality:FINAL <> () returnType:.Z.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4 (): .Z.Companion declared in ' - GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.Z.Companion diff --git a/compiler/testData/ir/irText/expressions/values.fir.kt.txt b/compiler/testData/ir/irText/expressions/values.fir.kt.txt deleted file mode 100644 index f3324a849b5..00000000000 --- a/compiler/testData/ir/irText/expressions/values.fir.kt.txt +++ /dev/null @@ -1,64 +0,0 @@ -enum class Enum : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - - A = Enum() - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): Enum /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} - -object A { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -val a: Int - field = 0 - get - -class Z { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - companion object Companion { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - } - -} - -fun test1(): Enum { - return Enum.A -} - -fun test2(): A { - return A -} - -fun test3(): Int { - return () -} - -fun test4(): Companion { - return Companion -} diff --git a/compiler/testData/ir/irText/expressions/values.ir.txt b/compiler/testData/ir/irText/expressions/values.ir.txt index 5ec53b7051c..58087c79bbb 100644 --- a/compiler/testData/ir/irText/expressions/values.ir.txt +++ b/compiler/testData/ir/irText/expressions/values.ir.txt @@ -1,78 +1,4 @@ FILE fqName: fileName:/values.kt - CLASS ENUM_CLASS name:Enum modality:FINAL visibility:public superTypes:[kotlin.Enum<.Enum>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Enum - CONSTRUCTOR visibility:private <> () returnType:.Enum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .Enum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Enum modality:FINAL visibility:public superTypes:[kotlin.Enum<.Enum>]' - ENUM_ENTRY name:A - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Enum' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>, other:.Enum) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> - VALUE_PARAMETER name:other index:0 type:.Enum - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.Enum>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Enum> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Enum - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Enum> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:private <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public 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 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 PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final,static] EXPRESSION_BODY @@ -84,10 +10,6 @@ FILE fqName: fileName:/values.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null CLASS CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z - CONSTRUCTOR visibility:public <> () returnType:.Z [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.Companion CONSTRUCTOR visibility:private <> () returnType:.Z.Companion [primary] @@ -107,6 +29,84 @@ FILE fqName: fileName:/values.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.Z [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Z modality:FINAL visibility:public 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 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 + CLASS ENUM_CLASS name:Enum modality:FINAL visibility:public superTypes:[kotlin.Enum<.Enum>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Enum + ENUM_ENTRY name:A + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Enum' + CONSTRUCTOR visibility:private <> () returnType:.Enum [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .Enum + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Enum modality:FINAL visibility:public superTypes:[kotlin.Enum<.Enum>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Enum + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Enum> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>, other:.Enum) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> + VALUE_PARAMETER name:other index:0 type:.Enum + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.Enum>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Enum> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Enum>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Enum> + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/values.kt b/compiler/testData/ir/irText/expressions/values.kt index 8be84e0d350..1705b05e0fb 100644 --- a/compiler/testData/ir/irText/expressions/values.kt +++ b/compiler/testData/ir/irText/expressions/values.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class Enum { A } object A val a = 0 diff --git a/compiler/testData/ir/irText/expressions/values.kt.txt b/compiler/testData/ir/irText/expressions/values.kt.txt index f3324a849b5..f0056325543 100644 --- a/compiler/testData/ir/irText/expressions/values.kt.txt +++ b/compiler/testData/ir/irText/expressions/values.kt.txt @@ -1,16 +1,38 @@ +val a: Int + field = 0 + get + +class Z { + companion object Companion { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + enum class Enum : Enum { + A = Enum() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - A = Enum() + fun valueOf(value: String): Enum /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): Enum /* Synthetic body for ENUM_VALUEOF */ - val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ @@ -25,28 +47,6 @@ object A { } -val a: Int - field = 0 - get - -class Z { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - companion object Companion { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - } - -} - fun test1(): Enum { return Enum.A } @@ -62,3 +62,4 @@ fun test3(): Int { fun test4(): Companion { return Companion } + diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.ir.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.ir.txt index 01607218d1d..9dd501ffefd 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.ir.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.ir.txt @@ -1,4 +1,19 @@ FILE fqName: fileName:/variableAsFunctionCallWithGenerics.kt + FUN name:kt26531 visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun kt26531 (): kotlin.Int declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Int origin=INVOKE + $this: CALL 'public final fun (): kotlin.Function0.> declared in ' type=kotlin.Function0 origin=GET_PROPERTY + : kotlin.Int + $receiver: CONST Int type=kotlin.Int value=7 + FUN name:testGeneric1 visibility:public modality:FINAL <> (x:kotlin.String) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testGeneric1 (x: kotlin.String): kotlin.String declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.String origin=INVOKE + $this: CALL 'public final fun (): kotlin.Function0.> declared in ' type=kotlin.Function0 origin=GET_PROPERTY + : kotlin.String + $receiver: GET_VAR 'x: kotlin.String declared in .testGeneric1' type=kotlin.String origin=null PROPERTY name:gk visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:kotlin.Function0.> correspondingProperty: PROPERTY name:gk visibility:public modality:FINAL [val] @@ -11,14 +26,6 @@ FILE fqName: fileName:/variableAsFunctionCallWithGenerics.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): T of . declared in .' GET_VAR ': T of . declared in .' type=T of . origin=null - FUN name:testGeneric1 visibility:public modality:FINAL <> (x:kotlin.String) returnType:kotlin.String - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testGeneric1 (x: kotlin.String): kotlin.String declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.String origin=INVOKE - $this: CALL 'public final fun (): kotlin.Function0.> declared in ' type=kotlin.Function0 origin=GET_PROPERTY - : kotlin.String - $receiver: GET_VAR 'x: kotlin.String declared in .testGeneric1' type=kotlin.String origin=null PROPERTY name:kt26531Val visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:kotlin.Function0.> correspondingProperty: PROPERTY name:kt26531Val visibility:public modality:FINAL [val] @@ -31,10 +38,3 @@ FILE fqName: fileName:/variableAsFunctionCallWithGenerics.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): T of . declared in .' GET_VAR ': T of . declared in .' type=T of . origin=null - FUN name:kt26531 visibility:public modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun kt26531 (): kotlin.Int declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Int origin=INVOKE - $this: CALL 'public final fun (): kotlin.Function0.> declared in ' type=kotlin.Function0 origin=GET_PROPERTY - : kotlin.Int - $receiver: CONST Int type=kotlin.Int value=7 diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt.txt index aeb0d4a67d0..5cd36fb66b9 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt.txt @@ -1,3 +1,11 @@ +fun kt26531(): Int { + return 7.().invoke() +} + +fun testGeneric1(x: String): String { + return x.().invoke() +} + val T.gk: Function0 get(): Function0 { return local fun (): T { @@ -6,10 +14,6 @@ val T.gk: Function0 } -fun testGeneric1(x: String): String { - return x.().invoke() -} - val T.kt26531Val: Function0 get(): Function0 { return local fun (): T { @@ -18,6 +22,3 @@ val T.kt26531Val: Function0 } -fun kt26531(): Int { - return 7.().invoke() -} diff --git a/compiler/testData/ir/irText/expressions/when.fir.ir.txt b/compiler/testData/ir/irText/expressions/when.fir.ir.txt index 62ffaff8164..8b4ac76aace 100644 --- a/compiler/testData/ir/irText/expressions/when.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/when.fir.ir.txt @@ -18,43 +18,6 @@ FILE fqName: fileName:/when.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testWithSubject visibility:public modality:FINAL <> (x:kotlin.Any?) returnType:kotlin.String - VALUE_PARAMETER name:x index:0 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testWithSubject (x: kotlin.Any?): kotlin.String declared in ' - BLOCK type=kotlin.String origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val] - GET_VAR 'x: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null - WHEN type=kotlin.String origin=WHEN - 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? declared in .testWithSubject' type=kotlin.Any? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST String type=kotlin.String value="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? declared in .testWithSubject' type=kotlin.Any? origin=null - arg1: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A - then: CONST String type=kotlin.String value="A" - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String - GET_VAR 'val tmp_0: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null - then: CONST String type=kotlin.String value="String" - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Number - GET_VAR 'val tmp_0: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null - then: CONST String type=kotlin.String value="!Number" - BRANCH - if: CALL 'public final fun contains (element: T of kotlin.collections.contains): kotlin.Boolean declared in kotlin.collections' type=kotlin.Boolean origin=IN - : kotlin.Number - $receiver: CALL 'public final fun setOf (): kotlin.collections.Set declared in kotlin.collections' type=kotlin.collections.Set origin=null - : kotlin.Nothing - element: TYPE_OP type=kotlin.Number origin=IMPLICIT_CAST typeOperand=kotlin.Number - GET_VAR 'val tmp_0: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null - then: CONST String type=kotlin.String value="nothingness?" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST String type=kotlin.String value="something" FUN name:test visibility:public modality:FINAL <> (x:kotlin.Any?) returnType:kotlin.String VALUE_PARAMETER name:x index:0 type:kotlin.Any? BLOCK_BODY @@ -94,7 +57,7 @@ FILE fqName: fileName:/when.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testComma (x: kotlin.Int): kotlin.String declared in ' BLOCK type=kotlin.String origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] GET_VAR 'x: kotlin.Int declared in .testComma' type=kotlin.Int origin=null WHEN type=kotlin.String origin=WHEN BRANCH @@ -103,13 +66,13 @@ FILE fqName: fileName:/when.kt if: WHEN type=kotlin.Boolean origin=OROR 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=1 then: CONST Boolean type=kotlin.Boolean value=true BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=2 then: CONST Boolean type=kotlin.Boolean value=true BRANCH @@ -117,20 +80,20 @@ FILE fqName: fileName:/when.kt then: WHEN type=kotlin.Boolean origin=OROR 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=3 then: CONST Boolean type=kotlin.Boolean value=true BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=4 then: CONST String type=kotlin.String value="1234" BRANCH if: WHEN type=kotlin.Boolean origin=OROR 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=5 then: CONST Boolean type=kotlin.Boolean value=true BRANCH @@ -138,28 +101,65 @@ FILE fqName: fileName:/when.kt then: WHEN type=kotlin.Boolean origin=OROR 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=6 then: CONST Boolean type=kotlin.Boolean value=true BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=7 then: CONST String type=kotlin.String value="567" BRANCH if: WHEN type=kotlin.Boolean origin=OROR 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=8 then: CONST Boolean type=kotlin.Boolean value=true BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=9 then: CONST String type=kotlin.String value="89" BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="?" + FUN name:testWithSubject visibility:public modality:FINAL <> (x:kotlin.Any?) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testWithSubject (x: kotlin.Any?): kotlin.String declared in ' + BLOCK type=kotlin.String origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any? [val] + GET_VAR 'x: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null + WHEN type=kotlin.String origin=WHEN + 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? declared in .testWithSubject' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST String type=kotlin.String value="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? declared in .testWithSubject' type=kotlin.Any? origin=null + arg1: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A + then: CONST String type=kotlin.String value="A" + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String + GET_VAR 'val tmp_1: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null + then: CONST String type=kotlin.String value="String" + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Number + GET_VAR 'val tmp_1: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null + then: CONST String type=kotlin.String value="!Number" + BRANCH + if: CALL 'public final fun contains (element: T of kotlin.collections.contains): kotlin.Boolean declared in kotlin.collections' type=kotlin.Boolean origin=IN + : kotlin.Number + $receiver: CALL 'public final fun setOf (): kotlin.collections.Set declared in kotlin.collections' type=kotlin.collections.Set origin=null + : kotlin.Nothing + element: TYPE_OP type=kotlin.Number origin=IMPLICIT_CAST typeOperand=kotlin.Number + GET_VAR 'val tmp_1: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null + then: CONST String type=kotlin.String value="nothingness?" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST String type=kotlin.String value="something" diff --git a/compiler/testData/ir/irText/expressions/when.fir.kt.txt b/compiler/testData/ir/irText/expressions/when.fir.kt.txt index 53a8d9cb025..d910cc12a23 100644 --- a/compiler/testData/ir/irText/expressions/when.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/when.fir.kt.txt @@ -7,20 +7,6 @@ object A { } -fun testWithSubject(x: Any?): String { - return { // BLOCK - val tmp_0: Any? = x - when { - EQEQ(arg0 = tmp_0, arg1 = null) -> "null" - EQEQ(arg0 = tmp_0, arg1 = A) -> "A" - tmp_0 is String -> "String" - tmp_0 !is Number -> "!Number" - setOf().contains(element = tmp_0 /*as Number */) -> "nothingness?" - else -> "something" - } - } -} - fun test(x: Any?): String { return when { EQEQ(arg0 = x, arg1 = null) -> "null" @@ -34,31 +20,45 @@ fun test(x: Any?): String { fun testComma(x: Int): String { return { // BLOCK - val tmp_1: Int = x + val tmp_0: Int = x when { when { when { - EQEQ(arg0 = tmp_1, arg1 = 1) -> true - else -> EQEQ(arg0 = tmp_1, arg1 = 2) + EQEQ(arg0 = tmp_0, arg1 = 1) -> true + else -> EQEQ(arg0 = tmp_0, arg1 = 2) } -> true else -> when { - EQEQ(arg0 = tmp_1, arg1 = 3) -> true - else -> EQEQ(arg0 = tmp_1, arg1 = 4) + EQEQ(arg0 = tmp_0, arg1 = 3) -> true + else -> EQEQ(arg0 = tmp_0, arg1 = 4) } } -> "1234" when { - EQEQ(arg0 = tmp_1, arg1 = 5) -> true + EQEQ(arg0 = tmp_0, arg1 = 5) -> true else -> when { - EQEQ(arg0 = tmp_1, arg1 = 6) -> true - else -> EQEQ(arg0 = tmp_1, arg1 = 7) + EQEQ(arg0 = tmp_0, arg1 = 6) -> true + else -> EQEQ(arg0 = tmp_0, arg1 = 7) } } -> "567" when { - EQEQ(arg0 = tmp_1, arg1 = 8) -> true - else -> EQEQ(arg0 = tmp_1, arg1 = 9) + EQEQ(arg0 = tmp_0, arg1 = 8) -> true + else -> EQEQ(arg0 = tmp_0, arg1 = 9) } -> "89" else -> "?" } } } +fun testWithSubject(x: Any?): String { + return { // BLOCK + val tmp_1: Any? = x + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> "null" + EQEQ(arg0 = tmp_1, arg1 = A) -> "A" + tmp_1 is String -> "String" + tmp_1 !is Number -> "!Number" + setOf().contains(element = tmp_1 /*as Number */) -> "nothingness?" + else -> "something" + } + } +} + diff --git a/compiler/testData/ir/irText/expressions/when.ir.txt b/compiler/testData/ir/irText/expressions/when.ir.txt index f495f97fb3e..72e960c9dc9 100644 --- a/compiler/testData/ir/irText/expressions/when.ir.txt +++ b/compiler/testData/ir/irText/expressions/when.ir.txt @@ -18,44 +18,6 @@ FILE fqName: fileName:/when.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testWithSubject visibility:public modality:FINAL <> (x:kotlin.Any?) returnType:kotlin.String - VALUE_PARAMETER name:x index:0 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testWithSubject (x: kotlin.Any?): kotlin.String declared in ' - BLOCK type=kotlin.String origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val] - GET_VAR 'x: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null - WHEN type=kotlin.String origin=WHEN - 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? declared in .testWithSubject' type=kotlin.Any? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST String type=kotlin.String value="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? declared in .testWithSubject' type=kotlin.Any? origin=null - arg1: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A - then: CONST String type=kotlin.String value="A" - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String - GET_VAR 'val tmp_0: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null - then: CONST String type=kotlin.String value="String" - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCL - $this: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Number - GET_VAR 'val tmp_0: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null - then: CONST String type=kotlin.String value="!Number" - BRANCH - if: CALL 'public final fun contains (element: T of kotlin.collections.contains): kotlin.Boolean declared in kotlin.collections' type=kotlin.Boolean origin=IN - : kotlin.Number - $receiver: CALL 'public final fun setOf (): kotlin.collections.Set declared in kotlin.collections' type=kotlin.collections.Set origin=null - : kotlin.Nothing - element: TYPE_OP type=kotlin.Number origin=IMPLICIT_CAST typeOperand=kotlin.Number - GET_VAR 'val tmp_0: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null - then: CONST String type=kotlin.String value="nothingness?" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST String type=kotlin.String value="something" FUN name:test visibility:public modality:FINAL <> (x:kotlin.Any?) returnType:kotlin.String VALUE_PARAMETER name:x index:0 type:kotlin.Any? BLOCK_BODY @@ -95,7 +57,7 @@ FILE fqName: fileName:/when.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testComma (x: kotlin.Int): kotlin.String declared in ' BLOCK type=kotlin.String origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] GET_VAR 'x: kotlin.Int declared in .testComma' type=kotlin.Int origin=null WHEN type=kotlin.String origin=WHEN BRANCH @@ -106,25 +68,25 @@ FILE fqName: fileName:/when.kt if: WHEN type=kotlin.Boolean origin=WHEN_COMMA 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=1 then: CONST Boolean type=kotlin.Boolean value=true BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=2 then: CONST Boolean type=kotlin.Boolean value=true BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=3 then: CONST Boolean type=kotlin.Boolean value=true BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=4 then: CONST String type=kotlin.String value="1234" BRANCH @@ -133,34 +95,72 @@ FILE fqName: fileName:/when.kt if: WHEN type=kotlin.Boolean origin=WHEN_COMMA 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=5 then: CONST Boolean type=kotlin.Boolean value=true BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=6 then: CONST Boolean type=kotlin.Boolean value=true BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=7 then: CONST String type=kotlin.String value="567" BRANCH if: WHEN type=kotlin.Boolean origin=WHEN_COMMA 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=8 then: CONST Boolean type=kotlin.Boolean value=true BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: 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.Int declared in .testComma' type=kotlin.Int origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Int declared in .testComma' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=9 then: CONST String type=kotlin.String value="89" BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="?" + FUN name:testWithSubject visibility:public modality:FINAL <> (x:kotlin.Any?) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testWithSubject (x: kotlin.Any?): kotlin.String declared in ' + BLOCK type=kotlin.String origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any? [val] + GET_VAR 'x: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null + WHEN type=kotlin.String origin=WHEN + 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? declared in .testWithSubject' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST String type=kotlin.String value="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? declared in .testWithSubject' type=kotlin.Any? origin=null + arg1: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A + then: CONST String type=kotlin.String value="A" + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String + GET_VAR 'val tmp_1: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null + then: CONST String type=kotlin.String value="String" + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCL + $this: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Number + GET_VAR 'val tmp_1: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null + then: CONST String type=kotlin.String value="!Number" + BRANCH + if: CALL 'public final fun contains (element: T of kotlin.collections.contains): kotlin.Boolean declared in kotlin.collections' type=kotlin.Boolean origin=IN + : kotlin.Number + $receiver: CALL 'public final fun setOf (): kotlin.collections.Set declared in kotlin.collections' type=kotlin.collections.Set origin=null + : kotlin.Nothing + element: TYPE_OP type=kotlin.Number origin=IMPLICIT_CAST typeOperand=kotlin.Number + GET_VAR 'val tmp_1: kotlin.Any? declared in .testWithSubject' type=kotlin.Any? origin=null + then: CONST String type=kotlin.String value="nothingness?" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST String type=kotlin.String value="something" diff --git a/compiler/testData/ir/irText/expressions/when.kt.txt b/compiler/testData/ir/irText/expressions/when.kt.txt index 3915248054b..f8471abef93 100644 --- a/compiler/testData/ir/irText/expressions/when.kt.txt +++ b/compiler/testData/ir/irText/expressions/when.kt.txt @@ -7,20 +7,6 @@ object A { } -fun testWithSubject(x: Any?): String { - return { // BLOCK - val tmp_0: Any? = x - when { - EQEQ(arg0 = tmp_0, arg1 = null) -> "null" - EQEQ(arg0 = tmp_0, arg1 = A) -> "A" - tmp_0 is String -> "String" - tmp_0 is Number.not() -> "!Number" - setOf().contains(element = tmp_0 /*as Number */) -> "nothingness?" - else -> "something" - } - } -} - fun test(x: Any?): String { return when { EQEQ(arg0 = x, arg1 = null) -> "null" @@ -34,30 +20,45 @@ fun test(x: Any?): String { fun testComma(x: Int): String { return { // BLOCK - val tmp_1: Int = x + val tmp_0: Int = x when { when { when { when { - EQEQ(arg0 = tmp_1, arg1 = 1) -> true - else -> EQEQ(arg0 = tmp_1, arg1 = 2) + EQEQ(arg0 = tmp_0, arg1 = 1) -> true + else -> EQEQ(arg0 = tmp_0, arg1 = 2) } -> true - else -> EQEQ(arg0 = tmp_1, arg1 = 3) + else -> EQEQ(arg0 = tmp_0, arg1 = 3) } -> true - else -> EQEQ(arg0 = tmp_1, arg1 = 4) + else -> EQEQ(arg0 = tmp_0, arg1 = 4) } -> "1234" when { when { - EQEQ(arg0 = tmp_1, arg1 = 5) -> true - else -> EQEQ(arg0 = tmp_1, arg1 = 6) + EQEQ(arg0 = tmp_0, arg1 = 5) -> true + else -> EQEQ(arg0 = tmp_0, arg1 = 6) } -> true - else -> EQEQ(arg0 = tmp_1, arg1 = 7) + else -> EQEQ(arg0 = tmp_0, arg1 = 7) } -> "567" when { - EQEQ(arg0 = tmp_1, arg1 = 8) -> true - else -> EQEQ(arg0 = tmp_1, arg1 = 9) + EQEQ(arg0 = tmp_0, arg1 = 8) -> true + else -> EQEQ(arg0 = tmp_0, arg1 = 9) } -> "89" else -> "?" } } } + +fun testWithSubject(x: Any?): String { + return { // BLOCK + val tmp_1: Any? = x + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> "null" + EQEQ(arg0 = tmp_1, arg1 = A) -> "A" + tmp_1 is String -> "String" + tmp_1 is Number.not() -> "!Number" + setOf().contains(element = tmp_1 /*as Number */) -> "nothingness?" + else -> "something" + } + } +} + diff --git a/compiler/testData/ir/irText/expressions/whenReturnUnit.ir.txt b/compiler/testData/ir/irText/expressions/whenReturnUnit.ir.txt index 9fe6d9699b9..a13c11b1c74 100644 --- a/compiler/testData/ir/irText/expressions/whenReturnUnit.ir.txt +++ b/compiler/testData/ir/irText/expressions/whenReturnUnit.ir.txt @@ -1,7 +1,4 @@ FILE fqName: fileName:/whenReturnUnit.kt - FUN name:run visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit - VALUE_PARAMETER name:block index:0 type:kotlin.Function0 - BLOCK_BODY FUN name:branch visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY @@ -26,3 +23,6 @@ FILE fqName: fileName:/whenReturnUnit.kt arg1: CONST Int type=kotlin.Int value=2 then: CALL 'public final fun TODO (reason: kotlin.String): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null reason: CONST String type=kotlin.String value="2" + FUN name:run visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:block index:0 type:kotlin.Function0 + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/whenReturnUnit.kt.txt b/compiler/testData/ir/irText/expressions/whenReturnUnit.kt.txt index fb7dca4c892..c5106587556 100644 --- a/compiler/testData/ir/irText/expressions/whenReturnUnit.kt.txt +++ b/compiler/testData/ir/irText/expressions/whenReturnUnit.kt.txt @@ -1,6 +1,3 @@ -fun run(block: Function0) { -} - fun branch(x: Int) { return run(block = local fun () { { // BLOCK @@ -13,3 +10,7 @@ fun branch(x: Int) { } ) } + +fun run(block: Function0) { +} + diff --git a/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.fir.ir.txt b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.fir.ir.txt index 5578169cf4a..4ada8f468f0 100644 --- a/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.fir.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/whenSmartCastToEnum.kt CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En - CONSTRUCTOR visibility:private <> () returnType:.En [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .En - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' ENUM_ENTRY name:A init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' @@ -15,15 +10,16 @@ FILE fqName: fileName:/whenSmartCastToEnum.kt ENUM_ENTRY name:C init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> () returnType:.En [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .En + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.En> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:.En) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -42,6 +38,10 @@ FILE fqName: fileName:/whenSmartCastToEnum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.En> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation diff --git a/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.fir.kt.txt b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.fir.kt.txt index 6531e08cb7d..14872afec9b 100644 --- a/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.fir.kt.txt @@ -1,20 +1,20 @@ enum class En : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - A = En() B = En() C = En() - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): En /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ diff --git a/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.ir.txt b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.ir.txt index 5b0e0217f87..48171794320 100644 --- a/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.ir.txt +++ b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/whenSmartCastToEnum.kt CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En - CONSTRUCTOR visibility:private <> () returnType:.En [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .En - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' ENUM_ENTRY name:A init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' @@ -15,24 +10,16 @@ FILE fqName: fileName:/whenSmartCastToEnum.kt ENUM_ENTRY name:C init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .En' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + CONSTRUCTOR visibility:private <> () returnType:.En [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .En + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>, other:.En) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -51,15 +38,28 @@ FILE fqName: fileName:/whenSmartCastToEnum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.En> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.En>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.En> FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:r type:kotlin.String [var] diff --git a/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt.txt b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt.txt index c194d8b7ae0..5edf297c7de 100644 --- a/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt.txt +++ b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt.txt @@ -1,20 +1,20 @@ enum class En : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } - A = En() B = En() C = En() - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): En /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ @@ -57,3 +57,4 @@ fun test() { } } } + diff --git a/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.fir.ir.txt b/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.fir.ir.txt deleted file mode 100644 index 2d92db3703e..00000000000 --- a/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.fir.ir.txt +++ /dev/null @@ -1,29 +0,0 @@ -FILE fqName: fileName:/1.kt - CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.Java1] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java1' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.Java1]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.Java1, a:@[FlexibleNullability] .List?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun foo (a: @[FlexibleNullability] .List?): kotlin.Unit declared in .Java1 - $this: VALUE_PARAMETER name: type:.Java1 - VALUE_PARAMETER name:a index:0 type:@[FlexibleNullability] .List? - FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:.Java1) returnType:@[FlexibleNullability] .List? [fake_override] - overridden: - public open fun bar (): @[FlexibleNullability] .List? declared in .Java1 - $this: VALUE_PARAMETER name: type:.Java1 - 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 .Java1 - $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 .Java1 - $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 .Java1 - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.fir.kt.txt b/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.fir.kt.txt deleted file mode 100644 index edff9089c4c..00000000000 --- a/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.fir.kt.txt +++ /dev/null @@ -1,8 +0,0 @@ -class A : Java1 { - constructor() /* primary */ { - super/*Java1*/() - /* () */ - - } - -} diff --git a/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.ir.txt b/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.ir.txt index f10664ab62c..738974be3f3 100644 --- a/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.ir.txt +++ b/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.ir.txt @@ -5,11 +5,20 @@ FILE fqName: fileName:/1.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java1' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.Java1]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:.Java1) returnType:@[FlexibleNullability] .List? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] .List? declared in .Java1 + $this: VALUE_PARAMETER name: type:.Java1 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 .Java1 $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.Java1, a:@[FlexibleNullability] .List?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (a: @[FlexibleNullability] .List?): kotlin.Unit declared in .Java1 + $this: VALUE_PARAMETER name: type:.Java1 + VALUE_PARAMETER name:a index:0 type:@[FlexibleNullability] .List? 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 .Java1 @@ -18,12 +27,3 @@ FILE fqName: fileName:/1.kt overridden: public open fun toString (): kotlin.String declared in .Java1 $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.Java1, a:@[FlexibleNullability] .List?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun foo (a: @[FlexibleNullability] .List?): kotlin.Unit declared in .Java1 - $this: VALUE_PARAMETER name: type:.Java1 - VALUE_PARAMETER name:a index:0 type:@[FlexibleNullability] .List? - FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:.Java1) returnType:@[FlexibleNullability] .List? [fake_override] - overridden: - public open fun bar (): @[FlexibleNullability] .List? declared in .Java1 - $this: VALUE_PARAMETER name: type:.Java1 diff --git a/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.kt b/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.kt index de22988c792..463787da80f 100644 --- a/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.kt +++ b/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRaw.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // ISSUE: KT-65298 // TARGET_BACKEND: JVM // SEPARATE_SIGNATURE_DUMP_FOR_K2 diff --git a/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.fir.ir.txt b/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.fir.ir.txt index 57419b4dcf5..a0990c7561c 100644 --- a/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.fir.ir.txt +++ b/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.fir.ir.txt @@ -5,67 +5,6 @@ FILE fqName: fileName:/1.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java1' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:E modality:ABSTRACT visibility:public superTypes:[.Java1]' - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.Int declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun trimToSize (): kotlin.Unit declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun isEmpty (): kotlin.Boolean declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun contains (p0: @[FlexibleNullability] kotlin.Any?): kotlin.Boolean declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Any? - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] kotlin.Any?) returnType:kotlin.Int [fake_override] - overridden: - public open fun indexOf (p0: @[FlexibleNullability] kotlin.Any?): kotlin.Int declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Any? - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] kotlin.Any?) returnType:kotlin.Int [fake_override] - overridden: - public open fun lastIndexOf (p0: @[FlexibleNullability] kotlin.Any?): kotlin.Int declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Any? - FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - overridden: - public open fun clone (): @[EnhancedNullability] kotlin.Any declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? [fake_override] - overridden: - public open fun toArray (): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array?) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? [fake_override] - overridden: - public open fun toArray (p0: @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array?): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in .Java1 - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int) returnType:@[FlexibleNullability] kotlin.Any? [fake_override,operator] - overridden: - public open fun get (p0: kotlin.Int): @[FlexibleNullability] kotlin.Any? declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int, p1:@[FlexibleNullability] kotlin.Any?) returnType:@[FlexibleNullability] kotlin.Any? [fake_override,operator] - overridden: - public open fun set (p0: kotlin.Int, p1: @[FlexibleNullability] kotlin.Any?): @[FlexibleNullability] kotlin.Any? declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:@[FlexibleNullability] kotlin.Any? FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override] overridden: public open fun add (p0: @[FlexibleNullability] kotlin.Any?): kotlin.Boolean declared in .Java1 @@ -77,15 +16,6 @@ FILE fqName: fileName:/1.kt $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> VALUE_PARAMETER name:p0 index:0 type:kotlin.Int VALUE_PARAMETER name:p1 index:1 type:@[FlexibleNullability] kotlin.Any? - FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun remove (p0: @[FlexibleNullability] kotlin.Any?): kotlin.Boolean declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Any? - FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun clear (): kotlin.Unit declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[RawType] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] overridden: public open fun addAll (p0: @[RawType] kotlin.collections.Collection): kotlin.Boolean declared in .Java1 @@ -97,61 +27,131 @@ FILE fqName: fileName:/1.kt $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> VALUE_PARAMETER name:p0 index:0 type:kotlin.Int VALUE_PARAMETER name:p1 index:1 type:@[RawType] kotlin.collections.Collection + FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun clear (): kotlin.Unit declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[EnhancedNullability] kotlin.Any [fake_override] + overridden: + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun contains (p0: @[FlexibleNullability] kotlin.Any?): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Any? + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Any?>, p0:@[RawType] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun containsAll (p0: @[RawType] kotlin.collections.Collection): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:@[RawType] kotlin.collections.Collection + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (p0: kotlin.Any?): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int) returnType:@[FlexibleNullability] kotlin.Any? [fake_override,operator] + overridden: + public open fun get (p0: kotlin.Int): @[FlexibleNullability] kotlin.Any? declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.Any?> + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] kotlin.Any?) returnType:kotlin.Int [fake_override] + overridden: + public open fun indexOf (p0: @[FlexibleNullability] kotlin.Any?): kotlin.Int declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Any? + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun isEmpty (): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[RawType] kotlin.collections.MutableIterator [fake_override,operator] + overridden: + public open fun iterator (): @[RawType] kotlin.collections.MutableIterator declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] kotlin.Any?) returnType:kotlin.Int [fake_override] + overridden: + public open fun lastIndexOf (p0: @[FlexibleNullability] kotlin.Any?): kotlin.Int declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Any? + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[RawType] kotlin.collections.MutableListIterator [fake_override] + overridden: + public open fun listIterator (): @[RawType] kotlin.collections.MutableListIterator declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int) returnType:@[RawType] kotlin.collections.MutableListIterator [fake_override] + overridden: + public open fun listIterator (p0: kotlin.Int): @[RawType] kotlin.collections.MutableListIterator declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun remove (p0: @[FlexibleNullability] kotlin.Any?): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Any? + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[RawType] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (p0: @[RawType] kotlin.collections.Collection): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:@[RawType] kotlin.collections.Collection + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int) returnType:@[FlexibleNullability] kotlin.Any? [fake_override,operator] + overridden: + public open fun removeAt (p0: kotlin.Int): @[FlexibleNullability] kotlin.Any? declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] overridden: protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> VALUE_PARAMETER name:p0 index:0 type:kotlin.Int VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[RawType] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeAll (p0: @[RawType] kotlin.collections.Collection): kotlin.Boolean declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:@[RawType] kotlin.collections.Collection FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[RawType] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] overridden: public open fun retainAll (p0: @[RawType] kotlin.collections.Collection): kotlin.Boolean declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> VALUE_PARAMETER name:p0 index:0 type:@[RawType] kotlin.collections.Collection - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int) returnType:@[RawType] kotlin.collections.MutableListIterator [fake_override] + FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int, p1:@[FlexibleNullability] kotlin.Any?) returnType:@[FlexibleNullability] kotlin.Any? [fake_override,operator] overridden: - public open fun listIterator (p0: kotlin.Int): @[RawType] kotlin.collections.MutableListIterator declared in .Java1 + public open fun set (p0: kotlin.Int, p1: @[FlexibleNullability] kotlin.Any?): @[FlexibleNullability] kotlin.Any? declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[RawType] kotlin.collections.MutableListIterator [fake_override] - overridden: - public open fun listIterator (): @[RawType] kotlin.collections.MutableListIterator declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[RawType] kotlin.collections.MutableIterator [fake_override,operator] - overridden: - public open fun iterator (): @[RawType] kotlin.collections.MutableIterator declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p1 index:1 type:@[FlexibleNullability] kotlin.Any? FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int, p1:kotlin.Int) returnType:@[RawType] kotlin.collections.MutableList [fake_override] overridden: public open fun subList (p0: kotlin.Int, p1: kotlin.Int): @[RawType] kotlin.collections.MutableList declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> VALUE_PARAMETER name:p0 index:0 type:kotlin.Int VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? [fake_override] overridden: - public open fun equals (p0: kotlin.Any?): kotlin.Boolean declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Int [fake_override] + public open fun toArray (): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array?) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? [fake_override] overridden: - public open fun hashCode (): kotlin.Int declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Any?>, p0:@[RawType] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun containsAll (p0: @[RawType] kotlin.collections.Collection): kotlin.Boolean declared in .Java1 - $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:@[RawType] kotlin.collections.Collection + public open fun toArray (p0: @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array?): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Any?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] overridden: public open fun toString (): @[EnhancedNullability] kotlin.String declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int) returnType:@[FlexibleNullability] kotlin.Any? [fake_override,operator] + FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Unit [fake_override] overridden: - public open fun removeAt (p0: kotlin.Int): @[FlexibleNullability] kotlin.Any? declared in .Java1 + public open fun trimToSize (): kotlin.Unit declared in .Java1 $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.Int declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> diff --git a/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.ir.txt b/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.ir.txt index d15c628ce8f..bcba52f27cc 100644 --- a/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.ir.txt +++ b/compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.ir.txt @@ -31,25 +31,10 @@ FILE fqName: fileName:/1.kt overridden: public open fun clear (): kotlin.Unit declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[EnhancedNullability] @[RawType] kotlin.collections.MutableIterator [fake_override,operator] + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[EnhancedNullability] kotlin.Any [fake_override] overridden: - public open fun iterator (): @[EnhancedNullability] @[RawType] kotlin.collections.MutableIterator declared in .Java1 + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, element:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun remove (element: @[EnhancedNullability] @[FlexibleNullability] kotlin.Any?): kotlin.Boolean declared in .Java1 - $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any? - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, elements:@[RawType] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeAll (elements: @[RawType] kotlin.collections.Collection): kotlin.Boolean declared in .Java1 - $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:elements index:0 type:@[RawType] kotlin.collections.Collection - FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, elements:@[RawType] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun retainAll (elements: @[RawType] kotlin.collections.Collection): kotlin.Boolean declared in .Java1 - $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:elements index:0 type:@[RawType] kotlin.collections.Collection FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, element:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun contains (element: @[EnhancedNullability] @[FlexibleNullability] kotlin.Any?): kotlin.Boolean declared in .Java1 @@ -60,47 +45,78 @@ FILE fqName: fileName:/1.kt public open fun containsAll (elements: @[RawType] kotlin.collections.Collection): kotlin.Boolean declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.AbstractCollection<@[FlexibleNullability] kotlin.Any?> VALUE_PARAMETER name:elements index:0 type:@[RawType] kotlin.collections.Collection - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Boolean [fake_override] + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] overridden: - public open fun isEmpty (): kotlin.Boolean declared in .Java1 + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:@[RawType] java.util.AbstractList<@[FlexibleNullability] kotlin.Any?>, other:@[EnhancedNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: @[EnhancedNullability] kotlin.Any?): kotlin.Boolean declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.AbstractList<@[FlexibleNullability] kotlin.Any?> VALUE_PARAMETER name:other index:0 type:@[EnhancedNullability] kotlin.Any? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, index:kotlin.Int) returnType:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any? [fake_override,operator] + overridden: + public open fun get (index: kotlin.Int): @[EnhancedNullability] @[FlexibleNullability] kotlin.Any? declared in .Java1 + $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:index index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:@[RawType] java.util.AbstractList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Int [fake_override] overridden: public open fun hashCode (): kotlin.Int declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.AbstractList<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:@[RawType] java.util.AbstractCollection<@[FlexibleNullability] kotlin.Any?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, element:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any?) returnType:kotlin.Int [fake_override] overridden: - public open fun toString (): @[EnhancedNullability] kotlin.String declared in .Java1 - $this: VALUE_PARAMETER name: type:@[RawType] java.util.AbstractCollection<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] - overridden: - public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in .Java1 + public open fun indexOf (element: @[EnhancedNullability] @[FlexibleNullability] kotlin.Any?): kotlin.Int declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] kotlin.Array?) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any? + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Boolean [fake_override] overridden: - public open fun toArray (p0: @[FlexibleNullability] kotlin.Array?): @[FlexibleNullability] kotlin.Array? declared in .Java1 - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + public open fun isEmpty (): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[EnhancedNullability] @[RawType] kotlin.collections.MutableIterator [fake_override,operator] + overridden: + public open fun iterator (): @[EnhancedNullability] @[RawType] kotlin.collections.MutableIterator declared in .Java1 + $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, element:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any?) returnType:kotlin.Int [fake_override] + overridden: + public open fun lastIndexOf (element: @[EnhancedNullability] @[FlexibleNullability] kotlin.Any?): kotlin.Int declared in .Java1 + $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any? + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[EnhancedNullability] @[RawType] kotlin.collections.MutableListIterator [fake_override] + overridden: + public open fun listIterator (): @[EnhancedNullability] @[RawType] kotlin.collections.MutableListIterator declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array? FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, index:kotlin.Int) returnType:@[EnhancedNullability] @[RawType] kotlin.collections.MutableListIterator [fake_override] overridden: public open fun listIterator (index: kotlin.Int): @[EnhancedNullability] @[RawType] kotlin.collections.MutableListIterator declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[EnhancedNullability] @[RawType] kotlin.collections.MutableListIterator [fake_override] + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, element:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override] overridden: - public open fun listIterator (): @[EnhancedNullability] @[RawType] kotlin.collections.MutableListIterator declared in .Java1 + public open fun remove (element: @[EnhancedNullability] @[FlexibleNullability] kotlin.Any?): kotlin.Boolean declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any? + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, elements:@[RawType] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (elements: @[RawType] kotlin.collections.Collection): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:elements index:0 type:@[RawType] kotlin.collections.Collection FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int) returnType:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any? [fake_override] overridden: public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] @[FlexibleNullability] kotlin.Any? declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in .Java1 + $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, elements:@[RawType] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun retainAll (elements: @[RawType] kotlin.collections.Collection): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + VALUE_PARAMETER name:elements index:0 type:@[RawType] kotlin.collections.Collection FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, index:kotlin.Int, element:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any?) returnType:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any? [fake_override,operator] overridden: public open fun set (index: kotlin.Int, element: @[EnhancedNullability] @[FlexibleNullability] kotlin.Any?): @[EnhancedNullability] @[FlexibleNullability] kotlin.Any? declared in .Java1 @@ -113,40 +129,27 @@ FILE fqName: fileName:/1.kt $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, index:kotlin.Int) returnType:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any? [fake_override,operator] + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] overridden: - public open fun get (index: kotlin.Int): @[EnhancedNullability] @[FlexibleNullability] kotlin.Any? declared in .Java1 + public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, element:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any?) returnType:kotlin.Int [fake_override] + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:@[FlexibleNullability] kotlin.Array?) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] overridden: - public open fun indexOf (element: @[EnhancedNullability] @[FlexibleNullability] kotlin.Any?): kotlin.Int declared in .Java1 + public open fun toArray (p0: @[FlexibleNullability] kotlin.Array?): @[FlexibleNullability] kotlin.Array? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any? - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, element:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any?) returnType:kotlin.Int [fake_override] + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array? + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:@[RawType] java.util.AbstractCollection<@[FlexibleNullability] kotlin.Any?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] overridden: - public open fun lastIndexOf (element: @[EnhancedNullability] @[FlexibleNullability] kotlin.Any?): kotlin.Int declared in .Java1 - $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] @[FlexibleNullability] kotlin.Any? - FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in .Java1 - $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - overridden: - public open fun clone (): @[EnhancedNullability] kotlin.Any declared in .Java1 - $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> + public open fun toString (): @[EnhancedNullability] kotlin.String declared in .Java1 + $this: VALUE_PARAMETER name: type:@[RawType] java.util.AbstractCollection<@[FlexibleNullability] kotlin.Any?> FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>) returnType:kotlin.Unit [fake_override] overridden: public open fun trimToSize (): kotlin.Unit declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] overridden: - public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in .Java1 - $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + protected/*protected and package*/ final modCount: kotlin.Int PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] overridden: public open size: kotlin.Int @@ -155,6 +158,3 @@ FILE fqName: fileName:/1.kt overridden: public open fun (): kotlin.Int declared in .Java1 $this: VALUE_PARAMETER name: type:@[RawType] java.util.ArrayList<@[FlexibleNullability] kotlin.Any?> - PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] - overridden: - protected/*protected and package*/ final modCount: kotlin.Int diff --git a/compiler/testData/ir/irText/firProblems/AbstractMutableMap.fir.ir.txt b/compiler/testData/ir/irText/firProblems/AbstractMutableMap.fir.ir.txt index 21133fd5ff0..08e95bc781d 100644 --- a/compiler/testData/ir/irText/firProblems/AbstractMutableMap.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/AbstractMutableMap.fir.ir.txt @@ -9,78 +9,32 @@ FILE fqName: fileName:/AbstractMutableMap.kt : K of .MyMap : V of .MyMap INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyMap modality:FINAL visibility:public superTypes:[kotlin.collections.AbstractMutableMap.MyMap, V of .MyMap>]' - FUN name:put visibility:public modality:OPEN <> ($this:.MyMap.MyMap, V of .MyMap>, key:K of .MyMap, value:V of .MyMap) returnType:V of .MyMap? - overridden: - public abstract fun put (key: K of kotlin.collections.AbstractMutableMap, value: V of kotlin.collections.AbstractMutableMap): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:.MyMap.MyMap, V of .MyMap> - VALUE_PARAMETER name:key index:0 type:K of .MyMap - VALUE_PARAMETER name:value index:1 type:V of .MyMap - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun put (key: K of .MyMap, value: V of .MyMap): V of .MyMap? declared in .MyMap' - CONST Null type=kotlin.Nothing? value=null - PROPERTY name:entries visibility:public modality:OPEN [val] - overridden: - public abstract entries: kotlin.collections.MutableSet> - FUN name: visibility:public modality:OPEN <> ($this:.MyMap.MyMap, V of .MyMap>) returnType:kotlin.collections.MutableSet.MyMap, V of .MyMap>> - correspondingProperty: PROPERTY name:entries visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.collections.MutableSet> declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:.MyMap.MyMap, V of .MyMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.MutableSet.MyMap, V of .MyMap>> declared in .MyMap' - CALL 'public final fun mutableSetOf (): kotlin.collections.MutableSet declared in kotlin.collections' type=kotlin.collections.MutableSet.MyMap, V of .MyMap>> origin=null - : kotlin.collections.MutableMap.MutableEntry.MyMap, V of .MyMap> FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>) returnType:kotlin.Unit [fake_override] overridden: public open fun clear (): kotlin.Unit declared in kotlin.collections.AbstractMutableMap $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - FUN FAKE_OVERRIDE name:putAll visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, from:kotlin.collections.Map.MyMap, V of .MyMap>) returnType:kotlin.Unit [fake_override] + FUN FAKE_OVERRIDE name:clone visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.AbstractMap.MyMap, V of .MyMap>) returnType:@[FlexibleNullability] kotlin.Any? [fake_override] overridden: - public open fun putAll (from: kotlin.collections.Map): kotlin.Unit declared in kotlin.collections.AbstractMutableMap + protected/*protected and package*/ open fun clone (): @[FlexibleNullability] kotlin.Any? declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:java.util.AbstractMap.MyMap, V of .MyMap> + FUN FAKE_OVERRIDE name:compute visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in V of .MyMap?, out V of .MyMap?>) returnType:V of .MyMap? [fake_override] + overridden: + public open fun compute (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] java.util.function.BiFunction): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - VALUE_PARAMETER name:from index:0 type:kotlin.collections.Map.MyMap, V of .MyMap> - FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, key:K of .MyMap) returnType:V of .MyMap? [fake_override] + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in V of .MyMap?, out V of .MyMap?> + FUN FAKE_OVERRIDE name:computeIfAbsent visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] java.util.function.Function.MyMap, out @[EnhancedNullability] V of .MyMap>) returnType:@[EnhancedNullability] V of .MyMap [fake_override] overridden: - public open fun remove (key: K of kotlin.collections.AbstractMutableMap): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap + public open fun computeIfAbsent (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] java.util.function.Function): @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap declared in kotlin.collections.AbstractMutableMap $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - VALUE_PARAMETER name:key index:0 type:K of .MyMap - FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, key:K of .MyMap, value:V of .MyMap) returnType:kotlin.Boolean [fake_override] - annotations: - SinceKotlin(version = "1.1") - PlatformDependent + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] java.util.function.Function.MyMap, out @[EnhancedNullability] V of .MyMap> + FUN FAKE_OVERRIDE name:computeIfPresent visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in V of .MyMap, out V of .MyMap?>) returnType:V of .MyMap? [fake_override] overridden: - public open fun remove (key: K of kotlin.collections.AbstractMutableMap, value: V of kotlin.collections.AbstractMutableMap): kotlin.Boolean declared in kotlin.collections.AbstractMutableMap + public open fun computeIfPresent (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] java.util.function.BiFunction): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - VALUE_PARAMETER name:key index:0 type:K of .MyMap - VALUE_PARAMETER name:value index:1 type:V of .MyMap - PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] - overridden: - public open keys: kotlin.collections.MutableSet - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>) returnType:kotlin.collections.MutableSet.MyMap> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.MutableSet declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] - overridden: - public open values: kotlin.collections.MutableCollection - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>) returnType:kotlin.collections.MutableCollection.MyMap> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.MutableCollection declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.Map.MyMap, V of .MyMap>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.Int declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.collections.Map.MyMap, V of .MyMap> - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:kotlin.collections.Map.MyMap, V of .MyMap>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun isEmpty (): kotlin.Boolean declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.collections.Map.MyMap, V of .MyMap> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in V of .MyMap, out V of .MyMap?> FUN FAKE_OVERRIDE name:containsKey visibility:public modality:OPEN <> ($this:kotlin.collections.Map.MyMap, V of .MyMap>, key:K of .MyMap) returnType:kotlin.Boolean [fake_override] overridden: public open fun containsKey (key: K of kotlin.collections.AbstractMutableMap): kotlin.Boolean declared in kotlin.collections.AbstractMutableMap @@ -91,6 +45,16 @@ FILE fqName: fileName:/AbstractMutableMap.kt public open fun containsValue (value: V of kotlin.collections.AbstractMutableMap): kotlin.Boolean declared in kotlin.collections.AbstractMutableMap $this: VALUE_PARAMETER name: type:kotlin.collections.Map.MyMap, V of .MyMap> VALUE_PARAMETER name:value index:0 type:V of .MyMap + 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.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Map.MyMap, V of .MyMap>, p0:@[EnhancedNullability] java.util.function.BiConsumer.MyMap, in @[EnhancedNullability] V of .MyMap>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun forEach (p0: @[EnhancedNullability] java.util.function.BiConsumer): kotlin.Unit declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.collections.Map.MyMap, V of .MyMap> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.BiConsumer.MyMap, in @[EnhancedNullability] V of .MyMap> FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:kotlin.collections.Map.MyMap, V of .MyMap>, key:K of .MyMap) returnType:V of .MyMap? [fake_override,operator] overridden: public open fun get (key: K of kotlin.collections.AbstractMutableMap): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap @@ -105,22 +69,52 @@ FILE fqName: fileName:/AbstractMutableMap.kt $this: VALUE_PARAMETER name: type:kotlin.collections.Map.MyMap, V of .MyMap> VALUE_PARAMETER name:key index:0 type:K of .MyMap VALUE_PARAMETER name:defaultValue index:1 type:V of .MyMap - FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Map.MyMap, V of .MyMap>, p0:@[EnhancedNullability] java.util.function.BiConsumer.MyMap, in @[EnhancedNullability] V of .MyMap>) returnType:kotlin.Unit [fake_override] + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] overridden: - public open fun forEach (p0: @[EnhancedNullability] java.util.function.BiConsumer): kotlin.Unit declared in kotlin.collections.AbstractMutableMap + public open fun hashCode (): kotlin.Int declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:kotlin.collections.Map.MyMap, V of .MyMap>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun isEmpty (): kotlin.Boolean declared in kotlin.collections.AbstractMutableMap $this: VALUE_PARAMETER name: type:kotlin.collections.Map.MyMap, V of .MyMap> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.BiConsumer.MyMap, in @[EnhancedNullability] V of .MyMap> - FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in @[EnhancedNullability] V of .MyMap, out @[EnhancedNullability] V of .MyMap>) returnType:kotlin.Unit [fake_override] + FUN FAKE_OVERRIDE name:merge visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] {V of .MyMap & Any}, p2:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in V of .MyMap, out V of .MyMap?>) returnType:V of .MyMap? [fake_override] overridden: - public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.BiFunction): kotlin.Unit declared in kotlin.collections.AbstractMutableMap + public open fun merge (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] {V of kotlin.collections.AbstractMutableMap & Any}, p2: @[EnhancedNullability] java.util.function.BiFunction): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in @[EnhancedNullability] V of .MyMap, out @[EnhancedNullability] V of .MyMap> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] {V of .MyMap & Any} + VALUE_PARAMETER name:p2 index:2 type:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in V of .MyMap, out V of .MyMap?> + FUN FAKE_OVERRIDE name:putAll visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, from:kotlin.collections.Map.MyMap, V of .MyMap>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun putAll (from: kotlin.collections.Map): kotlin.Unit declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> + VALUE_PARAMETER name:from index:0 type:kotlin.collections.Map.MyMap, V of .MyMap> FUN FAKE_OVERRIDE name:putIfAbsent visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] V of .MyMap) returnType:V of .MyMap? [fake_override] overridden: public open fun putIfAbsent (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] V of .MyMap + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, key:K of .MyMap) returnType:V of .MyMap? [fake_override] + overridden: + public open fun remove (key: K of kotlin.collections.AbstractMutableMap): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> + VALUE_PARAMETER name:key index:0 type:K of .MyMap + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, key:K of .MyMap, value:V of .MyMap) returnType:kotlin.Boolean [fake_override] + annotations: + SinceKotlin(version = "1.1") + PlatformDependent + overridden: + public open fun remove (key: K of kotlin.collections.AbstractMutableMap, value: V of kotlin.collections.AbstractMutableMap): kotlin.Boolean declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> + VALUE_PARAMETER name:key index:0 type:K of .MyMap + VALUE_PARAMETER name:value index:1 type:V of .MyMap + FUN FAKE_OVERRIDE name:replace visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] V of .MyMap) returnType:V of .MyMap? [fake_override] + overridden: + public open fun replace (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] V of .MyMap FUN FAKE_OVERRIDE name:replace visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] V of .MyMap, p2:@[EnhancedNullability] V of .MyMap) returnType:kotlin.Boolean [fake_override] overridden: public open fun replace (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap, p2: @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap): kotlin.Boolean declared in kotlin.collections.AbstractMutableMap @@ -128,51 +122,57 @@ FILE fqName: fileName:/AbstractMutableMap.kt VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] V of .MyMap VALUE_PARAMETER name:p2 index:2 type:@[EnhancedNullability] V of .MyMap - FUN FAKE_OVERRIDE name:replace visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] V of .MyMap) returnType:V of .MyMap? [fake_override] + FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in @[EnhancedNullability] V of .MyMap, out @[EnhancedNullability] V of .MyMap>) returnType:kotlin.Unit [fake_override] overridden: - public open fun replace (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap + public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.BiFunction): kotlin.Unit declared in kotlin.collections.AbstractMutableMap $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] V of .MyMap - FUN FAKE_OVERRIDE name:computeIfAbsent visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] java.util.function.Function.MyMap, out @[EnhancedNullability] V of .MyMap>) returnType:@[EnhancedNullability] V of .MyMap [fake_override] - overridden: - public open fun computeIfAbsent (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] java.util.function.Function): @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] java.util.function.Function.MyMap, out @[EnhancedNullability] V of .MyMap> - FUN FAKE_OVERRIDE name:computeIfPresent visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in V of .MyMap, out V of .MyMap?>) returnType:V of .MyMap? [fake_override] - overridden: - public open fun computeIfPresent (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] java.util.function.BiFunction): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in V of .MyMap, out V of .MyMap?> - FUN FAKE_OVERRIDE name:compute visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in V of .MyMap?, out V of .MyMap?>) returnType:V of .MyMap? [fake_override] - overridden: - public open fun compute (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] java.util.function.BiFunction): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in V of .MyMap?, out V of .MyMap?> - FUN FAKE_OVERRIDE name:merge visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] {V of .MyMap & Any}, p2:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in V of .MyMap, out V of .MyMap?>) returnType:V of .MyMap? [fake_override] - overridden: - public open fun merge (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] {V of kotlin.collections.AbstractMutableMap & Any}, p2: @[EnhancedNullability] java.util.function.BiFunction): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] {V of .MyMap & Any} - VALUE_PARAMETER name:p2 index:2 type:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in V of .MyMap, out V of .MyMap?> - 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.collections.AbstractMutableMap - $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.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in @[EnhancedNullability] V of .MyMap, out @[EnhancedNullability] V of .MyMap> 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.collections.AbstractMutableMap $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:clone visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.AbstractMap.MyMap, V of .MyMap>) returnType:@[FlexibleNullability] kotlin.Any? [fake_override] + FUN name:put visibility:public modality:OPEN <> ($this:.MyMap.MyMap, V of .MyMap>, key:K of .MyMap, value:V of .MyMap) returnType:V of .MyMap? overridden: - protected/*protected and package*/ open fun clone (): @[FlexibleNullability] kotlin.Any? declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:java.util.AbstractMap.MyMap, V of .MyMap> + public abstract fun put (key: K of kotlin.collections.AbstractMutableMap, value: V of kotlin.collections.AbstractMutableMap): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:.MyMap.MyMap, V of .MyMap> + VALUE_PARAMETER name:key index:0 type:K of .MyMap + VALUE_PARAMETER name:value index:1 type:V of .MyMap + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun put (key: K of .MyMap, value: V of .MyMap): V of .MyMap? declared in .MyMap' + CONST Null type=kotlin.Nothing? value=null + PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] + overridden: + public open keys: kotlin.collections.MutableSet + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>) returnType:kotlin.collections.MutableSet.MyMap> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.collections.MutableSet declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.Map.MyMap, V of .MyMap>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.Int declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.collections.Map.MyMap, V of .MyMap> + PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] + overridden: + public open values: kotlin.collections.MutableCollection + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>) returnType:kotlin.collections.MutableCollection.MyMap> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.collections.MutableCollection declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> + PROPERTY name:entries visibility:public modality:OPEN [val] + overridden: + public abstract entries: kotlin.collections.MutableSet> + FUN name: visibility:public modality:OPEN <> ($this:.MyMap.MyMap, V of .MyMap>) returnType:kotlin.collections.MutableSet.MyMap, V of .MyMap>> + correspondingProperty: PROPERTY name:entries visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.collections.MutableSet> declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:.MyMap.MyMap, V of .MyMap> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.MutableSet.MyMap, V of .MyMap>> declared in .MyMap' + CALL 'public final fun mutableSetOf (): kotlin.collections.MutableSet declared in kotlin.collections' type=kotlin.collections.MutableSet.MyMap, V of .MyMap>> origin=null + : kotlin.collections.MutableMap.MutableEntry.MyMap, V of .MyMap> diff --git a/compiler/testData/ir/irText/firProblems/AbstractMutableMap.ir.txt b/compiler/testData/ir/irText/firProblems/AbstractMutableMap.ir.txt index 35c82bf6a68..8a61ee6720f 100644 --- a/compiler/testData/ir/irText/firProblems/AbstractMutableMap.ir.txt +++ b/compiler/testData/ir/irText/firProblems/AbstractMutableMap.ir.txt @@ -9,51 +9,6 @@ FILE fqName: fileName:/AbstractMutableMap.kt : K of .MyMap : V of .MyMap INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyMap modality:FINAL visibility:public superTypes:[kotlin.collections.AbstractMutableMap.MyMap, V of .MyMap>]' - FUN name:put visibility:public modality:OPEN <> ($this:.MyMap.MyMap, V of .MyMap>, key:K of .MyMap, value:V of .MyMap) returnType:V of .MyMap? - overridden: - public abstract fun put (key: K of kotlin.collections.AbstractMutableMap, value: V of kotlin.collections.AbstractMutableMap): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:.MyMap.MyMap, V of .MyMap> - VALUE_PARAMETER name:key index:0 type:K of .MyMap - VALUE_PARAMETER name:value index:1 type:V of .MyMap - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun put (key: K of .MyMap, value: V of .MyMap): V of .MyMap? declared in .MyMap' - CONST Null type=kotlin.Nothing? value=null - PROPERTY name:entries visibility:public modality:OPEN [val] - overridden: - public abstract entries: kotlin.collections.MutableSet> - FUN name: visibility:public modality:OPEN <> ($this:.MyMap.MyMap, V of .MyMap>) returnType:kotlin.collections.MutableSet.MyMap, V of .MyMap>> - correspondingProperty: PROPERTY name:entries visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.collections.MutableSet> declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:.MyMap.MyMap, V of .MyMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.MutableSet.MyMap, V of .MyMap>> declared in .MyMap' - CALL 'public final fun mutableSetOf (): kotlin.collections.MutableSet declared in kotlin.collections' type=kotlin.collections.MutableSet.MyMap, V of .MyMap>> origin=null - : kotlin.collections.MutableMap.MutableEntry.MyMap, V of .MyMap> - PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] - overridden: - public open keys: kotlin.collections.MutableSet - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>) returnType:kotlin.collections.MutableSet.MyMap> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.MutableSet declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.Map.MyMap, V of .MyMap>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.Int declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.collections.Map.MyMap, V of .MyMap> - PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] - overridden: - public open values: kotlin.collections.MutableCollection - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>) returnType:kotlin.collections.MutableCollection.MyMap> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.MutableCollection declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>) returnType:kotlin.Unit [fake_override] overridden: public open fun clear (): kotlin.Unit declared in kotlin.collections.AbstractMutableMap @@ -154,6 +109,12 @@ FILE fqName: fileName:/AbstractMutableMap.kt $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> VALUE_PARAMETER name:key index:0 type:K of .MyMap VALUE_PARAMETER name:value index:1 type:V of .MyMap + FUN FAKE_OVERRIDE name:replace visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] V of .MyMap) returnType:@[EnhancedNullability] V of .MyMap? [fake_override] + overridden: + public open fun replace (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap): @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] V of .MyMap FUN FAKE_OVERRIDE name:replace visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] V of .MyMap, p2:@[EnhancedNullability] V of .MyMap) returnType:kotlin.Boolean [fake_override] overridden: public open fun replace (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap, p2: @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap): kotlin.Boolean declared in kotlin.collections.AbstractMutableMap @@ -161,12 +122,6 @@ FILE fqName: fileName:/AbstractMutableMap.kt VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] V of .MyMap VALUE_PARAMETER name:p2 index:2 type:@[EnhancedNullability] V of .MyMap - FUN FAKE_OVERRIDE name:replace visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] K of .MyMap, p1:@[EnhancedNullability] V of .MyMap) returnType:@[EnhancedNullability] V of .MyMap? [fake_override] - overridden: - public open fun replace (p0: @[EnhancedNullability] K of kotlin.collections.AbstractMutableMap, p1: @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap): @[EnhancedNullability] V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap - $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] K of .MyMap - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] V of .MyMap FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>, p0:@[EnhancedNullability] java.util.function.BiFunction.MyMap, in @[EnhancedNullability] V of .MyMap, out @[EnhancedNullability] V of .MyMap>) returnType:kotlin.Unit [fake_override] overridden: public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.BiFunction): kotlin.Unit declared in kotlin.collections.AbstractMutableMap @@ -176,3 +131,48 @@ FILE fqName: fileName:/AbstractMutableMap.kt overridden: public open fun toString (): kotlin.String declared in kotlin.collections.AbstractMutableMap $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:put visibility:public modality:OPEN <> ($this:.MyMap.MyMap, V of .MyMap>, key:K of .MyMap, value:V of .MyMap) returnType:V of .MyMap? + overridden: + public abstract fun put (key: K of kotlin.collections.AbstractMutableMap, value: V of kotlin.collections.AbstractMutableMap): V of kotlin.collections.AbstractMutableMap? declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:.MyMap.MyMap, V of .MyMap> + VALUE_PARAMETER name:key index:0 type:K of .MyMap + VALUE_PARAMETER name:value index:1 type:V of .MyMap + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun put (key: K of .MyMap, value: V of .MyMap): V of .MyMap? declared in .MyMap' + CONST Null type=kotlin.Nothing? value=null + PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] + overridden: + public open keys: kotlin.collections.MutableSet + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>) returnType:kotlin.collections.MutableSet.MyMap> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.collections.MutableSet declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.Map.MyMap, V of .MyMap>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.Int declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.collections.Map.MyMap, V of .MyMap> + PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] + overridden: + public open values: kotlin.collections.MutableCollection + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.MutableMap.MyMap, V of .MyMap>) returnType:kotlin.collections.MutableCollection.MyMap> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.collections.MutableCollection declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableMap.MyMap, V of .MyMap> + PROPERTY name:entries visibility:public modality:OPEN [val] + overridden: + public abstract entries: kotlin.collections.MutableSet> + FUN name: visibility:public modality:OPEN <> ($this:.MyMap.MyMap, V of .MyMap>) returnType:kotlin.collections.MutableSet.MyMap, V of .MyMap>> + correspondingProperty: PROPERTY name:entries visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.collections.MutableSet> declared in kotlin.collections.AbstractMutableMap + $this: VALUE_PARAMETER name: type:.MyMap.MyMap, V of .MyMap> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.MutableSet.MyMap, V of .MyMap>> declared in .MyMap' + CALL 'public final fun mutableSetOf (): kotlin.collections.MutableSet declared in kotlin.collections' type=kotlin.collections.MutableSet.MyMap, V of .MyMap>> origin=null + : kotlin.collections.MutableMap.MutableEntry.MyMap, V of .MyMap> diff --git a/compiler/testData/ir/irText/firProblems/AllCandidates.fir.ir.txt b/compiler/testData/ir/irText/firProblems/AllCandidates.fir.ir.txt index ef42fecb8b4..cd4de3efc78 100644 --- a/compiler/testData/ir/irText/firProblems/AllCandidates.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/AllCandidates.fir.ir.txt @@ -1,11 +1,22 @@ FILE fqName: fileName:/AllCandidates.kt - CLASS CLASS name:ResolvedCall modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ResolvedCall.ResolvedCall> - TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.ResolvedCall.ResolvedCall> [primary] + CLASS CLASS name:MyCandidate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCandidate + PROPERTY name:resolvedCall visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:.ResolvedCall<*> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'resolvedCall: .ResolvedCall<*> declared in .MyCandidate.' type=.ResolvedCall<*> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyCandidate) returnType:.ResolvedCall<*> + correspondingProperty: PROPERTY name:resolvedCall visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.MyCandidate + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .ResolvedCall<*> declared in .MyCandidate' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:.ResolvedCall<*> visibility:private [final]' type=.ResolvedCall<*> origin=null + receiver: GET_VAR ': .MyCandidate declared in .MyCandidate.' type=.MyCandidate origin=null + CONSTRUCTOR visibility:public <> (resolvedCall:.ResolvedCall<*>) returnType:.MyCandidate [primary] + VALUE_PARAMETER name:resolvedCall index:0 type:.ResolvedCall<*> BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ResolvedCall modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyCandidate modality:FINAL visibility:public 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 declared in kotlin.Any @@ -19,24 +30,13 @@ FILE fqName: fileName:/AllCandidates.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:MyCandidate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCandidate - CONSTRUCTOR visibility:public <> (resolvedCall:.ResolvedCall<*>) returnType:.MyCandidate [primary] - VALUE_PARAMETER name:resolvedCall index:0 type:.ResolvedCall<*> + CLASS CLASS name:ResolvedCall modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ResolvedCall.ResolvedCall> + TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.ResolvedCall.ResolvedCall> [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyCandidate modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:resolvedCall visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:.ResolvedCall<*> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'resolvedCall: .ResolvedCall<*> declared in .MyCandidate.' type=.ResolvedCall<*> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyCandidate) returnType:.ResolvedCall<*> - correspondingProperty: PROPERTY name:resolvedCall visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.MyCandidate - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .ResolvedCall<*> declared in .MyCandidate' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:.ResolvedCall<*> visibility:private [final]' type=.ResolvedCall<*> origin=null - receiver: GET_VAR ': .MyCandidate declared in .MyCandidate.' type=.MyCandidate origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ResolvedCall modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/AllCandidates.fir.kt.txt b/compiler/testData/ir/irText/firProblems/AllCandidates.fir.kt.txt index 250b0a80165..b07bf26f5d7 100644 --- a/compiler/testData/ir/irText/firProblems/AllCandidates.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/AllCandidates.fir.kt.txt @@ -1,5 +1,9 @@ -class ResolvedCall { - constructor() /* primary */ { +class MyCandidate { + val resolvedCall: ResolvedCall<*> + field = resolvedCall + get + + constructor(resolvedCall: ResolvedCall<*>) /* primary */ { super/*Any*/() /* () */ @@ -7,17 +11,13 @@ class ResolvedCall { } -class MyCandidate { - constructor(resolvedCall: ResolvedCall<*>) /* primary */ { +class ResolvedCall { + constructor() /* primary */ { super/*Any*/() /* () */ } - val resolvedCall: ResolvedCall<*> - field = resolvedCall - get - } private fun allCandidatesResult(allCandidates: Collection): @FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>? { diff --git a/compiler/testData/ir/irText/firProblems/AllCandidates.ir.txt b/compiler/testData/ir/irText/firProblems/AllCandidates.ir.txt index 39a228c824f..b1bad64c7dd 100644 --- a/compiler/testData/ir/irText/firProblems/AllCandidates.ir.txt +++ b/compiler/testData/ir/irText/firProblems/AllCandidates.ir.txt @@ -1,11 +1,22 @@ FILE fqName: fileName:/AllCandidates.kt - CLASS CLASS name:ResolvedCall modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ResolvedCall.ResolvedCall> - TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.ResolvedCall.ResolvedCall> [primary] + CLASS CLASS name:MyCandidate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCandidate + PROPERTY name:resolvedCall visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:.ResolvedCall<*> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'resolvedCall: .ResolvedCall<*> declared in .MyCandidate.' type=.ResolvedCall<*> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyCandidate) returnType:.ResolvedCall<*> + correspondingProperty: PROPERTY name:resolvedCall visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.MyCandidate + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .ResolvedCall<*> declared in .MyCandidate' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:.ResolvedCall<*> visibility:private [final]' type=.ResolvedCall<*> origin=null + receiver: GET_VAR ': .MyCandidate declared in .MyCandidate.' type=.MyCandidate origin=null + CONSTRUCTOR visibility:public <> (resolvedCall:.ResolvedCall<*>) returnType:.MyCandidate [primary] + VALUE_PARAMETER name:resolvedCall index:0 type:.ResolvedCall<*> BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ResolvedCall modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyCandidate modality:FINAL visibility:public 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 declared in kotlin.Any @@ -19,24 +30,13 @@ FILE fqName: fileName:/AllCandidates.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:MyCandidate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCandidate - CONSTRUCTOR visibility:public <> (resolvedCall:.ResolvedCall<*>) returnType:.MyCandidate [primary] - VALUE_PARAMETER name:resolvedCall index:0 type:.ResolvedCall<*> + CLASS CLASS name:ResolvedCall modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ResolvedCall.ResolvedCall> + TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.ResolvedCall.ResolvedCall> [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyCandidate modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:resolvedCall visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:.ResolvedCall<*> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'resolvedCall: .ResolvedCall<*> declared in .MyCandidate.' type=.ResolvedCall<*> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyCandidate) returnType:.ResolvedCall<*> - correspondingProperty: PROPERTY name:resolvedCall visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.MyCandidate - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .ResolvedCall<*> declared in .MyCandidate' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:.ResolvedCall<*> visibility:private [final]' type=.ResolvedCall<*> origin=null - receiver: GET_VAR ': .MyCandidate declared in .MyCandidate.' type=.MyCandidate origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ResolvedCall modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/AllCandidates.kt.txt b/compiler/testData/ir/irText/firProblems/AllCandidates.kt.txt index 41e02d9ea96..17ef74eb31d 100644 --- a/compiler/testData/ir/irText/firProblems/AllCandidates.kt.txt +++ b/compiler/testData/ir/irText/firProblems/AllCandidates.kt.txt @@ -1,5 +1,9 @@ -class ResolvedCall { - constructor() /* primary */ { +class MyCandidate { + val resolvedCall: ResolvedCall<*> + field = resolvedCall + get + + constructor(resolvedCall: ResolvedCall<*>) /* primary */ { super/*Any*/() /* () */ @@ -7,17 +11,13 @@ class ResolvedCall { } -class MyCandidate { - constructor(resolvedCall: ResolvedCall<*>) /* primary */ { +class ResolvedCall { + constructor() /* primary */ { super/*Any*/() /* () */ } - val resolvedCall: ResolvedCall<*> - field = resolvedCall - get - } private fun allCandidatesResult(allCandidates: Collection): @FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>? { @@ -29,3 +29,4 @@ private fun allCandidatesResult(allCandidates: Collection fileName:/AnnotationInAnnotation.kt - CLASS ANNOTATION_CLASS name:Storage modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Storage - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Storage [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Storage modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.String declared in .Storage.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Storage) returnType:kotlin.String - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Storage - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Storage' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Storage declared in .Storage.' type=.Storage 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.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ANNOTATION_CLASS name:State modality:OPEN visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.State - CONSTRUCTOR visibility:public <> (name:kotlin.String, storages:kotlin.Array<.Storage>) returnType:.State [primary] - VALUE_PARAMETER name:name index:0 type:kotlin.String - VALUE_PARAMETER name:storages index:1 type:kotlin.Array<.Storage> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:State modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:name visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -60,6 +23,43 @@ FILE fqName: fileName:/AnnotationInAnnotation.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array<.Storage> declared in .State' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:storages type:kotlin.Array<.Storage> visibility:private [final]' type=kotlin.Array<.Storage> origin=null receiver: GET_VAR ': .State declared in .State.' type=.State origin=null + CONSTRUCTOR visibility:public <> (name:kotlin.String, storages:kotlin.Array<.Storage>) returnType:.State [primary] + VALUE_PARAMETER name:name index:0 type:kotlin.String + VALUE_PARAMETER name:storages index:1 type:kotlin.Array<.Storage> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:State 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Storage modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Storage + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .Storage.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Storage) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Storage + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Storage' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Storage declared in .Storage.' type=.Storage origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Storage [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Storage 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 declared in kotlin.Annotation diff --git a/compiler/testData/ir/irText/firProblems/AnnotationInAnnotation.kt.txt b/compiler/testData/ir/irText/firProblems/AnnotationInAnnotation.kt.txt index aa4d0f4ab3d..71104234393 100644 --- a/compiler/testData/ir/irText/firProblems/AnnotationInAnnotation.kt.txt +++ b/compiler/testData/ir/irText/firProblems/AnnotationInAnnotation.kt.txt @@ -1,23 +1,4 @@ -open annotation class Storage : Annotation { - constructor(value: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val value: String - field = value - get - -} - open annotation class State : Annotation { - constructor(name: String, storages: Array) /* primary */ { - super/*Any*/() - /* () */ - - } - val name: String field = name get @@ -26,6 +7,25 @@ open annotation class State : Annotation { field = storages get + constructor(name: String, storages: Array) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +open annotation class Storage : Annotation { + val value: String + field = value + get + + constructor(value: String) /* primary */ { + super/*Any*/() + /* () */ + + } + } @State(name = "1", storages = [Storage(value = "HELLO")]) @@ -37,3 +37,4 @@ class Test { } } + diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt deleted file mode 100644 index 1c438252441..00000000000 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt +++ /dev/null @@ -1,180 +0,0 @@ -FILE fqName: fileName:/AnnotationLoader.kt - CLASS INTERFACE name:Visitor modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visitor - FUN name:visit visibility:public modality:ABSTRACT <> ($this:.Visitor) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Visitor - FUN name:visitArray visibility:public modality:OPEN <> ($this:.Visitor) returnType:.Visitor? - $this: VALUE_PARAMETER name: type:.Visitor - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun visitArray (): .Visitor? declared in .Visitor' - CONST Null type=kotlin.Nothing? value=null - FUN name:visitAnnotation visibility:public modality:OPEN <> ($this:.Visitor) returnType:.Visitor? - $this: VALUE_PARAMETER name: type:.Visitor - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun visitAnnotation (): .Visitor? declared in .Visitor' - CONST Null type=kotlin.Nothing? value=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: 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 - CLASS CLASS name:AnnotationLoader modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnotationLoader - CONSTRUCTOR visibility:public <> () returnType:.AnnotationLoader [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AnnotationLoader modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:loadAnnotation visibility:public modality:FINAL <> ($this:.AnnotationLoader) returnType:.Visitor? - $this: VALUE_PARAMETER name: type:.AnnotationLoader - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun loadAnnotation (): .Visitor? declared in .AnnotationLoader' - BLOCK type=.AnnotationLoader.loadAnnotation. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnotationLoader.loadAnnotation. - CONSTRUCTOR visibility:public <> () returnType:.AnnotationLoader.loadAnnotation. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor]' - FUN name:visit visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation.) returnType:kotlin.Unit - overridden: - public abstract fun visit (): kotlin.Unit declared in .Visitor - $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation. - BLOCK_BODY - FUN name:visitArray visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation.) returnType:.Visitor? - overridden: - public open fun visitArray (): .Visitor? declared in .Visitor - $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun visitArray (): .Visitor? declared in .AnnotationLoader.loadAnnotation.' - BLOCK type=.AnnotationLoader.loadAnnotation..visitArray. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnotationLoader.loadAnnotation..visitArray. - CONSTRUCTOR visibility:public <> () returnType:.AnnotationLoader.loadAnnotation..visitArray. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor]' - FUN name:visit visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation..visitArray.) returnType:kotlin.Unit - overridden: - public abstract fun visit (): kotlin.Unit declared in .Visitor - $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation..visitArray. - BLOCK_BODY - CALL 'private final fun foo (): kotlin.Unit declared in .AnnotationLoader.loadAnnotation.' type=kotlin.Unit origin=null - $this: GET_VAR ': .AnnotationLoader.loadAnnotation. declared in .AnnotationLoader.loadAnnotation..visitArray' type=.AnnotationLoader.loadAnnotation. origin=null - FUN FAKE_OVERRIDE name:visitArray visibility:public modality:OPEN <> ($this:.Visitor) returnType:.Visitor? [fake_override] - overridden: - public open fun visitArray (): .Visitor? declared in .Visitor - $this: VALUE_PARAMETER name: type:.Visitor - FUN FAKE_OVERRIDE name:visitAnnotation visibility:public modality:OPEN <> ($this:.Visitor) returnType:.Visitor? [fake_override] - overridden: - public open fun visitAnnotation (): .Visitor? declared in .Visitor - $this: VALUE_PARAMETER name: type:.Visitor - 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 .Visitor - $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 .Visitor - $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 .Visitor - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .AnnotationLoader.loadAnnotation..visitArray.' type=.AnnotationLoader.loadAnnotation..visitArray. origin=OBJECT_LITERAL - FUN name:visitAnnotation visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation.) returnType:.Visitor? - overridden: - public open fun visitAnnotation (): .Visitor? declared in .Visitor - $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation. - BLOCK_BODY - VAR name:visitor type:.Visitor [val] - CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=.Visitor origin=EXCLEXCL - : .Visitor - arg0: CALL 'public final fun loadAnnotation (): .Visitor? declared in .AnnotationLoader' type=.Visitor? origin=null - $this: GET_VAR ': .AnnotationLoader declared in .AnnotationLoader.loadAnnotation' type=.AnnotationLoader origin=null - RETURN type=kotlin.Nothing from='public open fun visitAnnotation (): .Visitor? declared in .AnnotationLoader.loadAnnotation.' - BLOCK type=.AnnotationLoader.loadAnnotation..visitAnnotation. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnotationLoader.loadAnnotation..visitAnnotation. - CONSTRUCTOR visibility:public <> () returnType:.AnnotationLoader.loadAnnotation..visitAnnotation. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor]' - FIELD DELEGATE name:$$delegate_0 type:.Visitor visibility:private [final] - EXPRESSION_BODY - GET_VAR 'val visitor: .Visitor declared in .AnnotationLoader.loadAnnotation..visitAnnotation' type=.Visitor origin=null - FUN DELEGATED_MEMBER name:visitArray visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation..visitAnnotation.) returnType:.Visitor? - overridden: - public open fun visitArray (): .Visitor? declared in .Visitor - $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation..visitAnnotation. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun visitArray (): .Visitor? declared in .AnnotationLoader.loadAnnotation..visitAnnotation.' - CALL 'public open fun visitArray (): .Visitor? declared in .Visitor' type=.Visitor? origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Visitor visibility:private [final]' type=.Visitor origin=null - receiver: GET_VAR ': .AnnotationLoader.loadAnnotation..visitAnnotation. declared in .AnnotationLoader.loadAnnotation..visitAnnotation..visitArray' type=.AnnotationLoader.loadAnnotation..visitAnnotation. origin=null - FUN DELEGATED_MEMBER name:visitAnnotation visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation..visitAnnotation.) returnType:.Visitor? - overridden: - public open fun visitAnnotation (): .Visitor? declared in .Visitor - $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation..visitAnnotation. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun visitAnnotation (): .Visitor? declared in .AnnotationLoader.loadAnnotation..visitAnnotation.' - CALL 'public open fun visitAnnotation (): .Visitor? declared in .Visitor' type=.Visitor? origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Visitor visibility:private [final]' type=.Visitor origin=null - receiver: GET_VAR ': .AnnotationLoader.loadAnnotation..visitAnnotation. declared in .AnnotationLoader.loadAnnotation..visitAnnotation..visitAnnotation' type=.AnnotationLoader.loadAnnotation..visitAnnotation. origin=null - FUN name:visit visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation..visitAnnotation.) returnType:kotlin.Unit - overridden: - public abstract fun visit (): kotlin.Unit declared in .Visitor - $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation..visitAnnotation. - BLOCK_BODY - 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 .Visitor - $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 .Visitor - $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 .Visitor - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .AnnotationLoader.loadAnnotation..visitAnnotation.' type=.AnnotationLoader.loadAnnotation..visitAnnotation. origin=OBJECT_LITERAL - FUN name:foo visibility:private modality:FINAL <> ($this:.AnnotationLoader.loadAnnotation.) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation. - BLOCK_BODY - 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 .Visitor - $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 .Visitor - $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 .Visitor - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .AnnotationLoader.loadAnnotation.' type=.AnnotationLoader.loadAnnotation. origin=OBJECT_LITERAL - 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt deleted file mode 100644 index c37f2dd9dac..00000000000 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt +++ /dev/null @@ -1,90 +0,0 @@ -interface Visitor { - abstract fun visit() - - fun visitArray(): Visitor? { - return null - } - - fun visitAnnotation(): Visitor? { - return null - } - -} - -class AnnotationLoader { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun loadAnnotation(): Visitor? { - return { // BLOCK - local class : Visitor { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun visit() { - } - - override fun visitArray(): Visitor? { - return { // BLOCK - local class : Visitor { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun visit() { - .foo() - } - - } - - () - } - } - - override fun visitAnnotation(): Visitor? { - val visitor: Visitor = CHECK_NOT_NULL(arg0 = .loadAnnotation()) - return { // BLOCK - local class : Visitor { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Visitor = visitor - override fun visitArray(): Visitor? { - return .#$$delegate_0.visitArray() - } - - override fun visitAnnotation(): Visitor? { - return .#$$delegate_0.visitAnnotation() - } - - override fun visit() { - } - - } - - () - } - } - - private fun foo() { - } - - } - - () - } - } - -} - diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.ir.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.ir.txt index 74eefe9536f..7e148e22de6 100644 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.ir.txt +++ b/compiler/testData/ir/irText/firProblems/AnnotationLoader.ir.txt @@ -1,18 +1,10 @@ FILE fqName: fileName:/AnnotationLoader.kt - CLASS INTERFACE name:Visitor modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visitor - FUN name:visit visibility:public modality:ABSTRACT <> ($this:.Visitor) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Visitor - FUN name:visitArray visibility:public modality:OPEN <> ($this:.Visitor) returnType:.Visitor? - $this: VALUE_PARAMETER name: type:.Visitor + CLASS CLASS name:AnnotationLoader modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnotationLoader + CONSTRUCTOR visibility:public <> () returnType:.AnnotationLoader [primary] BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun visitArray (): .Visitor? declared in .Visitor' - CONST Null type=kotlin.Nothing? value=null - FUN name:visitAnnotation visibility:public modality:OPEN <> ($this:.Visitor) returnType:.Visitor? - $this: VALUE_PARAMETER name: type:.Visitor - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun visitAnnotation (): .Visitor? declared in .Visitor' - CONST Null type=kotlin.Nothing? value=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AnnotationLoader modality:FINAL visibility:public 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 declared in kotlin.Any @@ -26,12 +18,6 @@ FILE fqName: fileName:/AnnotationLoader.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:AnnotationLoader modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnotationLoader - CONSTRUCTOR visibility:public <> () returnType:.AnnotationLoader [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AnnotationLoader modality:FINAL visibility:public superTypes:[kotlin.Any]' FUN name:loadAnnotation visibility:public modality:FINAL <> ($this:.AnnotationLoader) returnType:.Visitor? $this: VALUE_PARAMETER name: type:.AnnotationLoader BLOCK_BODY @@ -43,53 +29,27 @@ FILE fqName: fileName:/AnnotationLoader.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor]' + 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 .Visitor + $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 .Visitor + $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 .Visitor + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:private modality:FINAL <> ($this:.AnnotationLoader.loadAnnotation.) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation. + BLOCK_BODY FUN name:visit visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation.) returnType:kotlin.Unit overridden: public abstract fun visit (): kotlin.Unit declared in .Visitor $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation. BLOCK_BODY - FUN name:visitArray visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation.) returnType:.Visitor? - overridden: - public open fun visitArray (): .Visitor? declared in .Visitor - $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun visitArray (): .Visitor? declared in .AnnotationLoader.loadAnnotation.' - BLOCK type=.AnnotationLoader.loadAnnotation..visitArray. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnotationLoader.loadAnnotation..visitArray. - CONSTRUCTOR visibility:public <> () returnType:.AnnotationLoader.loadAnnotation..visitArray. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor]' - FUN name:visit visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation..visitArray.) returnType:kotlin.Unit - overridden: - public abstract fun visit (): kotlin.Unit declared in .Visitor - $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation..visitArray. - BLOCK_BODY - CALL 'private final fun foo (): kotlin.Unit declared in .AnnotationLoader.loadAnnotation.' type=kotlin.Unit origin=null - $this: GET_VAR ': .AnnotationLoader.loadAnnotation. declared in .AnnotationLoader.loadAnnotation..visitArray' type=.AnnotationLoader.loadAnnotation. origin=null - FUN FAKE_OVERRIDE name:visitArray visibility:public modality:OPEN <> ($this:.Visitor) returnType:.Visitor? [fake_override] - overridden: - public open fun visitArray (): .Visitor? declared in .Visitor - $this: VALUE_PARAMETER name: type:.Visitor - FUN FAKE_OVERRIDE name:visitAnnotation visibility:public modality:OPEN <> ($this:.Visitor) returnType:.Visitor? [fake_override] - overridden: - public open fun visitAnnotation (): .Visitor? declared in .Visitor - $this: VALUE_PARAMETER name: type:.Visitor - 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 .Visitor - $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 .Visitor - $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 .Visitor - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .AnnotationLoader.loadAnnotation..visitArray.' type=.AnnotationLoader.loadAnnotation..visitArray. origin=OBJECT_LITERAL FUN name:visitAnnotation visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation.) returnType:.Visitor? overridden: public open fun visitAnnotation (): .Visitor? declared in .Visitor @@ -104,13 +64,13 @@ FILE fqName: fileName:/AnnotationLoader.kt BLOCK type=.AnnotationLoader.loadAnnotation..visitAnnotation. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnotationLoader.loadAnnotation..visitAnnotation. + FIELD DELEGATE name:$$delegate_0 type:.Visitor visibility:private [final] + EXPRESSION_BODY + GET_VAR 'val visitor: .Visitor declared in .AnnotationLoader.loadAnnotation..visitAnnotation' type=.Visitor origin=null CONSTRUCTOR visibility:public <> () returnType:.AnnotationLoader.loadAnnotation..visitAnnotation. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor]' - FIELD DELEGATE name:$$delegate_0 type:.Visitor visibility:private [final] - EXPRESSION_BODY - GET_VAR 'val visitor: .Visitor declared in .AnnotationLoader.loadAnnotation..visitAnnotation' type=.Visitor origin=null FUN DELEGATED_MEMBER name:visitAnnotation visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation..visitAnnotation.) returnType:.Visitor? overridden: public open fun visitAnnotation (): .Visitor? declared in .Visitor @@ -129,11 +89,6 @@ FILE fqName: fileName:/AnnotationLoader.kt CALL 'public open fun visitArray (): .Visitor? declared in .Visitor' type=.Visitor? origin=null $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Visitor visibility:private [final]' type=.Visitor origin=null receiver: GET_VAR ': .AnnotationLoader.loadAnnotation..visitAnnotation. declared in .AnnotationLoader.loadAnnotation..visitAnnotation..visitArray' type=.AnnotationLoader.loadAnnotation..visitAnnotation. origin=null - FUN name:visit visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation..visitAnnotation.) returnType:kotlin.Unit - overridden: - public abstract fun visit (): kotlin.Unit declared in .Visitor - $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation..visitAnnotation. - BLOCK_BODY 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 .Visitor @@ -147,24 +102,57 @@ FILE fqName: fileName:/AnnotationLoader.kt overridden: public open fun toString (): kotlin.String declared in .Visitor $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:visit visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation..visitAnnotation.) returnType:kotlin.Unit + overridden: + public abstract fun visit (): kotlin.Unit declared in .Visitor + $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation..visitAnnotation. + BLOCK_BODY CONSTRUCTOR_CALL 'public constructor () declared in .AnnotationLoader.loadAnnotation..visitAnnotation.' type=.AnnotationLoader.loadAnnotation..visitAnnotation. origin=OBJECT_LITERAL - FUN name:foo visibility:private modality:FINAL <> ($this:.AnnotationLoader.loadAnnotation.) returnType:kotlin.Unit + FUN name:visitArray visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation.) returnType:.Visitor? + overridden: + public open fun visitArray (): .Visitor? declared in .Visitor $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation. BLOCK_BODY - 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 .Visitor - $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 .Visitor - $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 .Visitor - $this: VALUE_PARAMETER name: type:kotlin.Any + RETURN type=kotlin.Nothing from='public open fun visitArray (): .Visitor? declared in .AnnotationLoader.loadAnnotation.' + BLOCK type=.AnnotationLoader.loadAnnotation..visitArray. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnotationLoader.loadAnnotation..visitArray. + CONSTRUCTOR visibility:public <> () returnType:.AnnotationLoader.loadAnnotation..visitArray. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor]' + 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 .Visitor + $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 .Visitor + $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 .Visitor + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:visitAnnotation visibility:public modality:OPEN <> ($this:.Visitor) returnType:.Visitor? [fake_override] + overridden: + public open fun visitAnnotation (): .Visitor? declared in .Visitor + $this: VALUE_PARAMETER name: type:.Visitor + FUN FAKE_OVERRIDE name:visitArray visibility:public modality:OPEN <> ($this:.Visitor) returnType:.Visitor? [fake_override] + overridden: + public open fun visitArray (): .Visitor? declared in .Visitor + $this: VALUE_PARAMETER name: type:.Visitor + FUN name:visit visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation..visitArray.) returnType:kotlin.Unit + overridden: + public abstract fun visit (): kotlin.Unit declared in .Visitor + $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation..visitArray. + BLOCK_BODY + CALL 'private final fun foo (): kotlin.Unit declared in .AnnotationLoader.loadAnnotation.' type=kotlin.Unit origin=null + $this: GET_VAR ': .AnnotationLoader.loadAnnotation. declared in .AnnotationLoader.loadAnnotation..visitArray' type=.AnnotationLoader.loadAnnotation. origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .AnnotationLoader.loadAnnotation..visitArray.' type=.AnnotationLoader.loadAnnotation..visitArray. origin=OBJECT_LITERAL CONSTRUCTOR_CALL 'public constructor () declared in .AnnotationLoader.loadAnnotation.' type=.AnnotationLoader.loadAnnotation. origin=OBJECT_LITERAL + CLASS INTERFACE name:Visitor modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visitor 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 @@ -178,3 +166,15 @@ FILE fqName: fileName:/AnnotationLoader.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:visit visibility:public modality:ABSTRACT <> ($this:.Visitor) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Visitor + FUN name:visitAnnotation visibility:public modality:OPEN <> ($this:.Visitor) returnType:.Visitor? + $this: VALUE_PARAMETER name: type:.Visitor + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun visitAnnotation (): .Visitor? declared in .Visitor' + CONST Null type=kotlin.Nothing? value=null + FUN name:visitArray visibility:public modality:OPEN <> ($this:.Visitor) returnType:.Visitor? + $this: VALUE_PARAMETER name: type:.Visitor + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun visitArray (): .Visitor? declared in .Visitor' + CONST Null type=kotlin.Nothing? value=null diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.kt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.kt index 46e7250cdea..03eef4101f0 100644 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.kt +++ b/compiler/testData/ir/irText/firProblems/AnnotationLoader.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Visitor { fun visit() diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.kt.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.kt.txt index 9f610c75666..114ce435ed3 100644 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.kt.txt +++ b/compiler/testData/ir/irText/firProblems/AnnotationLoader.kt.txt @@ -1,16 +1,3 @@ -interface Visitor { - abstract fun visit() - - fun visitArray(): Visitor? { - return null - } - - fun visitAnnotation(): Visitor? { - return null - } - -} - class AnnotationLoader { constructor() /* primary */ { super/*Any*/() @@ -27,9 +14,40 @@ class AnnotationLoader { } + private fun foo() { + } + override fun visit() { } + override fun visitAnnotation(): Visitor? { + val visitor: Visitor = CHECK_NOT_NULL(arg0 = .loadAnnotation()) + return { // BLOCK + local class : Visitor { + private /* final field */ val $$delegate_0: Visitor = visitor + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override fun visitAnnotation(): Visitor? { + return .#$$delegate_0.visitAnnotation() + } + + override fun visitArray(): Visitor? { + return .#$$delegate_0.visitArray() + } + + override fun visit() { + } + + } + + () + } + } + override fun visitArray(): Visitor? { return { // BLOCK local class : Visitor { @@ -49,37 +67,6 @@ class AnnotationLoader { } } - override fun visitAnnotation(): Visitor? { - val visitor: Visitor = CHECK_NOT_NULL(arg0 = .loadAnnotation()) - return { // BLOCK - local class : Visitor { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Visitor = visitor - override fun visitAnnotation(): Visitor? { - return .#$$delegate_0.visitAnnotation() - } - - override fun visitArray(): Visitor? { - return .#$$delegate_0.visitArray() - } - - override fun visit() { - } - - } - - () - } - } - - private fun foo() { - } - } () @@ -87,3 +74,17 @@ class AnnotationLoader { } } + +interface Visitor { + abstract fun visit() + + fun visitAnnotation(): Visitor? { + return null + } + + fun visitArray(): Visitor? { + return null + } + +} + diff --git a/compiler/testData/ir/irText/firProblems/ArrayListOverrides.fir.ir.txt b/compiler/testData/ir/irText/firProblems/ArrayListOverrides.fir.ir.txt index 191b8f626b1..075dee4d7e1 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayListOverrides.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayListOverrides.fir.ir.txt @@ -6,67 +6,6 @@ FILE fqName: fileName:/ArrayListOverrides.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in java.util.ArrayList' : kotlin.String INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A1 modality:FINAL visibility:public superTypes:[java.util.ArrayList]' - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] - overridden: - public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun contains (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] - overridden: - public open fun indexOf (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] - overridden: - public open fun lastIndexOf (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - overridden: - public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? [fake_override] - overridden: - public open fun toArray (): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList, p0:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.A1.toArray?>?) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.A1.toArray?>? [fake_override] - overridden: - public open fun toArray (p0: @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array?): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in java.util.ArrayList - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.A1.toArray?>? - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] - overridden: - public open fun get (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.String) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] - overridden: - public open fun set (p0: kotlin.Int, p1: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.String FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override] overridden: public open fun add (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList @@ -78,15 +17,6 @@ FILE fqName: fileName:/ArrayListOverrides.kt $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:kotlin.Int VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun remove (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] - overridden: - public open fun clear (): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] overridden: public open fun addAll (p0: @[EnhancedNullability] kotlin.collections.Collection): kotlin.Boolean declared in java.util.ArrayList @@ -98,96 +28,166 @@ FILE fqName: fileName:/ArrayListOverrides.kt $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:kotlin.Int VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.collections.Collection + FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] + overridden: + public open fun clear (): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] + overridden: + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun contains (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?>, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun containsAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>, p0:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (p0: kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.function.Consumer?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] + overridden: + public open fun get (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] + overridden: + public open fun indexOf (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.String> [fake_override,operator] + overridden: + public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] + overridden: + public open fun lastIndexOf (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun listIterator (p0: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection) returnType:@[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] kotlin.String?> [fake_override] + overridden: + public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun remove (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] + overridden: + public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.Predicate) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] overridden: protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:kotlin.Int VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] + FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Unit [fake_override] overridden: - public open fun removeAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String> FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] overridden: public open fun retainAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] + FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.String) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] overridden: - public open fun listIterator (p0: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + public open fun set (p0: kotlin.Int, p1: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.Comparator?) returnType:kotlin.Unit [fake_override] overridden: - public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.String> [fake_override,operator] + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator? + FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] kotlin.String?> [fake_override] overridden: - public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection) returnType:@[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] kotlin.String?> [fake_override] + overridden: + public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] kotlin.String> [fake_override] overridden: public open fun subList (p0: kotlin.Int, p1: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:kotlin.Int VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.function.Consumer?) returnType:kotlin.Unit [fake_override] + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? [fake_override] overridden: - public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in java.util.ArrayList + public open fun toArray (): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer? - FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] kotlin.String?> [fake_override] + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList, p0:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.A1.toArray?>?) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.A1.toArray?>? [fake_override] overridden: - public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList + public open fun toArray (p0: @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array?): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in java.util.ArrayList + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.Predicate) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate - FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String> - FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.Comparator?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator? - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>, p0:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (p0: kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> - FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?>, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun containsAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> - VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.A1.toArray?>? FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] overridden: public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> - FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection) returnType:@[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] kotlin.String?> [fake_override] + FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] overridden: - public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection - FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection) returnType:@[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] kotlin.String?> [fake_override] - overridden: - public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection - FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] - overridden: - public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList CLASS CLASS name:A2 modality:FINAL visibility:public superTypes:[java.util.ArrayList] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A2 CONSTRUCTOR visibility:public <> () returnType:.A2 [primary] @@ -195,6 +195,175 @@ FILE fqName: fileName:/ArrayListOverrides.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in java.util.ArrayList' : kotlin.String INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A2 modality:FINAL visibility:public superTypes:[java.util.ArrayList]' + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun add (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public open fun add (p0: kotlin.Int, p1: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (p0: @[EnhancedNullability] kotlin.collections.Collection): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.collections.Collection + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (p0: kotlin.Int, p1: @[EnhancedNullability] kotlin.collections.Collection): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.collections.Collection + FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] + overridden: + public open fun clear (): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] + overridden: + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun contains (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?>, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun containsAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>, p0:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (p0: kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.function.Consumer?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] + overridden: + public open fun get (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] + overridden: + public open fun indexOf (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.String> [fake_override,operator] + overridden: + public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] + overridden: + public open fun lastIndexOf (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun listIterator (p0: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection) returnType:@[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] kotlin.String?> [fake_override] + overridden: + public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] + overridden: + public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.Predicate) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate + FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String> + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun retainAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> + FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.String) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] + overridden: + public open fun set (p0: kotlin.Int, p1: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.Comparator?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator? + FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] kotlin.String?> [fake_override] + overridden: + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection) returnType:@[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] kotlin.String?> [fake_override] + overridden: + public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection + FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun subList (p0: kotlin.Int, p1: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? [fake_override] + overridden: + public open fun toArray (): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList, p0:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.A2.toArray?>?) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.A2.toArray?>? [fake_override] + overridden: + public open fun toArray (p0: @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array?): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in java.util.ArrayList + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.A2.toArray?>? + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] + overridden: + public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> + FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] + overridden: + public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList FUN name:remove visibility:public modality:OPEN <> ($this:.A2, x:kotlin.String) returnType:kotlin.Boolean overridden: public open fun remove (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList @@ -211,172 +380,3 @@ FILE fqName: fileName:/ArrayListOverrides.kt overridden: public open fun (): kotlin.Int declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] - overridden: - public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun contains (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] - overridden: - public open fun indexOf (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] - overridden: - public open fun lastIndexOf (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - overridden: - public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? [fake_override] - overridden: - public open fun toArray (): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList, p0:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.A2.toArray?>?) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.A2.toArray?>? [fake_override] - overridden: - public open fun toArray (p0: @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array?): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in java.util.ArrayList - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.A2.toArray?>? - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] - overridden: - public open fun get (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.String) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] - overridden: - public open fun set (p0: kotlin.Int, p1: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun add (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.String) returnType:kotlin.Unit [fake_override] - overridden: - public open fun add (p0: kotlin.Int, p1: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] - overridden: - public open fun clear (): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun addAll (p0: @[EnhancedNullability] kotlin.collections.Collection): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.collections.Collection - FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun addAll (p0: kotlin.Int, p1: @[EnhancedNullability] kotlin.collections.Collection): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.collections.Collection - FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> - FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun retainAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun listIterator (p0: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.String> [fake_override,operator] - overridden: - public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun subList (p0: kotlin.Int, p1: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.function.Consumer?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer? - FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] kotlin.String?> [fake_override] - overridden: - public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.Predicate) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate - FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String> - FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.Comparator?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator? - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>, p0:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (p0: kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> - FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?>, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun containsAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> - VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] - overridden: - public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> - FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection) returnType:@[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] kotlin.String?> [fake_override] - overridden: - public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection - FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection) returnType:@[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] kotlin.String?> [fake_override] - overridden: - public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection - FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] - overridden: - public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int diff --git a/compiler/testData/ir/irText/firProblems/ArrayListOverrides.ir.txt b/compiler/testData/ir/irText/firProblems/ArrayListOverrides.ir.txt index 8130357e5d5..c3d9c392014 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayListOverrides.ir.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayListOverrides.ir.txt @@ -32,25 +32,10 @@ FILE fqName: fileName:/ArrayListOverrides.kt overridden: public open fun clear (): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.String> [fake_override,operator] + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] overridden: - public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun remove (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> - FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun contains (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList @@ -61,32 +46,122 @@ FILE fqName: fileName:/ArrayListOverrides.kt public open fun containsAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] overridden: - public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>, other:@[EnhancedNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: @[EnhancedNullability] kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> VALUE_PARAMETER name:other index:0 type:@[EnhancedNullability] kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] - overridden: - public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.function.Consumer?) returnType:kotlin.Unit [fake_override] overridden: public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] + overridden: + public open fun get (index: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] + overridden: + public open fun indexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.String> [fake_override,operator] + overridden: + public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] + overridden: + public open fun lastIndexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun listIterator (index: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun remove (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override] + overridden: + public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.Predicate) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate + FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String> + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> + FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int, element:@[EnhancedNullability] kotlin.String) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] + overridden: + public open fun set (index: kotlin.Int, element: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.Comparator?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator? FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] kotlin.String?> [fake_override] overridden: public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> + FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int + VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] overridden: public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in java.util.ArrayList @@ -97,89 +172,17 @@ FILE fqName: fileName:/ArrayListOverrides.kt TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array.A1.toArray?>? - FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.Predicate) returnType:kotlin.Boolean [fake_override] + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] overridden: - public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate - FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> - FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun listIterator (index: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override] - overridden: - public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int, element:@[EnhancedNullability] kotlin.String) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] - overridden: - public open fun set (index: kotlin.Int, element: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int - VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] - overridden: - public open fun get (index: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] - overridden: - public open fun indexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] - overridden: - public open fun lastIndexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String> - FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.Comparator?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator? - FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - overridden: - public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList + public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] overridden: public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] overridden: - public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + protected/*protected and package*/ final modCount: kotlin.Int PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] overridden: public open size: kotlin.Int @@ -188,9 +191,6 @@ FILE fqName: fileName:/ArrayListOverrides.kt overridden: public open fun (): kotlin.Int declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] - overridden: - protected/*protected and package*/ final modCount: kotlin.Int CLASS CLASS name:A2 modality:FINAL visibility:public superTypes:[java.util.ArrayList] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A2 CONSTRUCTOR visibility:public <> () returnType:.A2 [primary] @@ -198,14 +198,6 @@ FILE fqName: fileName:/ArrayListOverrides.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in java.util.ArrayList' : @[FlexibleNullability] kotlin.String? INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A2 modality:FINAL visibility:public superTypes:[java.util.ArrayList]' - FUN name:remove visibility:public modality:OPEN <> ($this:.A2, x:kotlin.String) returnType:kotlin.Boolean - overridden: - public open fun remove (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:.A2 - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun remove (x: kotlin.String): kotlin.Boolean declared in .A2' - CONST Boolean type=kotlin.Boolean value=true FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override] overridden: public open fun add (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList @@ -232,20 +224,10 @@ FILE fqName: fileName:/ArrayListOverrides.kt overridden: public open fun clear (): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.String> [fake_override,operator] + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] overridden: - public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> - FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun contains (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList @@ -256,32 +238,117 @@ FILE fqName: fileName:/ArrayListOverrides.kt public open fun containsAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] overridden: - public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>, other:@[EnhancedNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: @[EnhancedNullability] kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> VALUE_PARAMETER name:other index:0 type:@[EnhancedNullability] kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] - overridden: - public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.function.Consumer?) returnType:kotlin.Unit [fake_override] overridden: public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] + overridden: + public open fun get (index: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.String?> + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] + overridden: + public open fun indexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.String> [fake_override,operator] + overridden: + public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] + overridden: + public open fun lastIndexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun listIterator (index: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override] + overridden: + public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.Predicate) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate + FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String> + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.String> + FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int, element:@[EnhancedNullability] kotlin.String) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] + overridden: + public open fun set (index: kotlin.Int, element: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] kotlin.String + FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.Comparator?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator? FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] kotlin.String?> [fake_override] overridden: public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> + FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] kotlin.String> [fake_override] + overridden: + public open fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int + VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] overridden: public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in java.util.ArrayList @@ -292,89 +359,25 @@ FILE fqName: fileName:/ArrayListOverrides.kt TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array.A2.toArray?>? - FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.Predicate) returnType:kotlin.Boolean [fake_override] + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] overridden: - public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate - FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> - FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun listIterator (index: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override] - overridden: - public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int, element:@[EnhancedNullability] kotlin.String) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] - overridden: - public open fun set (index: kotlin.Int, element: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] kotlin.String> [fake_override] - overridden: - public open fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int - VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.String [fake_override,operator] - overridden: - public open fun get (index: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] - overridden: - public open fun indexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.String) returnType:kotlin.Int [fake_override] - overridden: - public open fun lastIndexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.String - FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.String> - FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.Comparator?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator? - FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - overridden: - public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList + public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.String?> FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] overridden: public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + FUN name:remove visibility:public modality:OPEN <> ($this:.A2, x:kotlin.String) returnType:kotlin.Boolean overridden: - public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + public open fun remove (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:.A2 + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun remove (x: kotlin.String): kotlin.Boolean declared in .A2' + CONST Boolean type=kotlin.Boolean value=true + PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] + overridden: + protected/*protected and package*/ final modCount: kotlin.Int PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] overridden: public open size: kotlin.Int @@ -383,6 +386,3 @@ FILE fqName: fileName:/ArrayListOverrides.kt overridden: public open fun (): kotlin.Int declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList - PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] - overridden: - protected/*protected and package*/ final modCount: kotlin.Int diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt index 20127125475..aecbabfacf2 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt @@ -10,23 +10,6 @@ FILE fqName: fileName:/ArrayMap.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ArrayMap modality:SEALED visibility:public superTypes:[kotlin.collections.Iterable.ArrayMap>]' - PROPERTY name:size visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:size visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> - FUN name:set visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>, index:kotlin.Int, value:T of .ArrayMap) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:T of .ArrayMap - FUN name:get visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>, index:kotlin.Int) returnType:T of .ArrayMap? [operator] - $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN name:copy visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>) returnType:.ArrayMap.ArrayMap> - $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> - FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.Iterable.ArrayMap>) returnType:kotlin.collections.Iterator.ArrayMap> [fake_override,operator] - overridden: - public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.Iterable - $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable.ArrayMap> 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.collections.Iterable @@ -36,302 +19,30 @@ FILE fqName: fileName:/ArrayMap.kt overridden: public open fun hashCode (): kotlin.Int declared in kotlin.collections.Iterable $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.Iterable.ArrayMap>) returnType:kotlin.collections.Iterator.ArrayMap> [fake_override,operator] + overridden: + public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.Iterable + $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable.ArrayMap> 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.collections.Iterable $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:isEmpty visibility:public modality:FINAL <> ($receiver:.ArrayMap<*>) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:.ArrayMap<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun isEmpty (): kotlin.Boolean declared in ' - CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public abstract fun (): kotlin.Int declared in .ArrayMap' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .ArrayMap<*> declared in .isEmpty' type=.ArrayMap<*> origin=null - arg1: CONST Int type=kotlin.Int value=0 - FUN name:isNotEmpty visibility:public modality:FINAL <> ($receiver:.ArrayMap<*>) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:.ArrayMap<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun isNotEmpty (): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean 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 abstract fun (): kotlin.Int declared in .ArrayMap' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .ArrayMap<*> declared in .isNotEmpty' type=.ArrayMap<*> origin=null - arg1: CONST Int type=kotlin.Int value=0 - CLASS OBJECT name:EmptyArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.EmptyArrayMap - CONSTRUCTOR visibility:private <> () returnType:.EmptyArrayMap [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .ArrayMap' - : kotlin.Nothing - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:EmptyArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap]' - PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract size: kotlin.Int - FUN name: visibility:public modality:OPEN <> ($this:.EmptyArrayMap) returnType:kotlin.Int - correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.EmptyArrayMap - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .EmptyArrayMap' - CONST Int type=kotlin.Int value=0 - FUN name:set visibility:public modality:OPEN <> ($this:.EmptyArrayMap, index:kotlin.Int, value:kotlin.Nothing) returnType:kotlin.Unit [operator] - overridden: - public abstract fun set (index: kotlin.Int, value: T of .ArrayMap): kotlin.Unit declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.EmptyArrayMap + FUN name:copy visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>) returnType:.ArrayMap.ArrayMap> + $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> + FUN name:get visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>, index:kotlin.Int) returnType:T of .ArrayMap? [operator] + $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:kotlin.Nothing - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor () declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null - FUN name:get visibility:public modality:OPEN <> ($this:.EmptyArrayMap, index:kotlin.Int) returnType:kotlin.Nothing? [operator] - overridden: - public abstract fun get (index: kotlin.Int): T of .ArrayMap? declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.EmptyArrayMap + FUN name:set visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>, index:kotlin.Int, value:T of .ArrayMap) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> VALUE_PARAMETER name:index index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun get (index: kotlin.Int): kotlin.Nothing? declared in .EmptyArrayMap' - CONST Null type=kotlin.Nothing? value=null - FUN name:copy visibility:public modality:OPEN <> ($this:.EmptyArrayMap) returnType:.ArrayMap - overridden: - public abstract fun copy (): .ArrayMap.ArrayMap> declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.EmptyArrayMap - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun copy (): .ArrayMap declared in .EmptyArrayMap' - GET_VAR ': .EmptyArrayMap declared in .EmptyArrayMap.copy' type=.EmptyArrayMap origin=null - FUN name:iterator visibility:public modality:OPEN <> ($this:.EmptyArrayMap) returnType:kotlin.collections.Iterator [operator] - overridden: - public abstract fun iterator (): kotlin.collections.Iterator.ArrayMap> declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.EmptyArrayMap - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator declared in .EmptyArrayMap' - BLOCK type=.EmptyArrayMap.iterator. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.EmptyArrayMap.iterator. - CONSTRUCTOR visibility:public <> () returnType:.EmptyArrayMap.iterator. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator]' - FUN name:hasNext visibility:public modality:OPEN <> ($this:.EmptyArrayMap.iterator.) returnType:kotlin.Boolean [operator] - overridden: - public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator - $this: VALUE_PARAMETER name: type:.EmptyArrayMap.iterator. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hasNext (): kotlin.Boolean declared in .EmptyArrayMap.iterator.' - CONST Boolean type=kotlin.Boolean value=false - FUN name:next visibility:public modality:OPEN <> ($this:.EmptyArrayMap.iterator.) returnType:kotlin.Nothing [operator] - overridden: - public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator - $this: VALUE_PARAMETER name: type:.EmptyArrayMap.iterator. - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor () declared in java.util.NoSuchElementException' type=java.util.NoSuchElementException 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.collections.Iterator - $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.collections.Iterator - $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.collections.Iterator - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .EmptyArrayMap.iterator.' type=.EmptyArrayMap.iterator. origin=OBJECT_LITERAL - 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 .ArrayMap - $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 .ArrayMap - $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 .ArrayMap - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:OneElementArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap.OneElementArrayMap>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OneElementArrayMap.OneElementArrayMap> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:public <> (value:T of .OneElementArrayMap, index:kotlin.Int) returnType:.OneElementArrayMap.OneElementArrayMap> [primary] - VALUE_PARAMETER name:value index:0 type:T of .OneElementArrayMap - VALUE_PARAMETER name:index index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .ArrayMap' - : T of .OneElementArrayMap - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OneElementArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap.OneElementArrayMap>]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:T of .OneElementArrayMap visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: T of .OneElementArrayMap declared in .OneElementArrayMap.' type=T of .OneElementArrayMap origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:T of .OneElementArrayMap - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .OneElementArrayMap visibility:private [final]' type=T of .OneElementArrayMap origin=null - receiver: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.' type=.OneElementArrayMap.OneElementArrayMap> origin=null - PROPERTY name:index visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:index type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - GET_VAR 'index: kotlin.Int declared in .OneElementArrayMap.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:index visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .OneElementArrayMap' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:index type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.' type=.OneElementArrayMap.OneElementArrayMap> origin=null - PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract size: kotlin.Int - FUN name: visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .OneElementArrayMap' - CONST Int type=kotlin.Int value=1 - FUN name:set visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>, index:kotlin.Int, value:T of .OneElementArrayMap) returnType:kotlin.Unit [operator] - overridden: - public abstract fun set (index: kotlin.Int, value: T of .ArrayMap): kotlin.Unit declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:T of .OneElementArrayMap - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor () declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null - FUN name:get visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>, index:kotlin.Int) returnType:T of .OneElementArrayMap? [operator] - overridden: - public abstract fun get (index: kotlin.Int): T of .ArrayMap? declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun get (index: kotlin.Int): T of .OneElementArrayMap? declared in .OneElementArrayMap' - WHEN type=T of .OneElementArrayMap? origin=IF - 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 'index: kotlin.Int declared in .OneElementArrayMap.get' type=kotlin.Int origin=null - arg1: CALL 'public final fun (): kotlin.Int declared in .OneElementArrayMap' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.get' type=.OneElementArrayMap.OneElementArrayMap> origin=null - then: CALL 'public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' type=T of .OneElementArrayMap origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.get' type=.OneElementArrayMap.OneElementArrayMap> origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Null type=kotlin.Nothing? value=null - FUN name:copy visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:.ArrayMap.OneElementArrayMap> - overridden: - public abstract fun copy (): .ArrayMap.ArrayMap> declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun copy (): .ArrayMap.OneElementArrayMap> declared in .OneElementArrayMap' - CONSTRUCTOR_CALL 'public constructor (value: T of .OneElementArrayMap, index: kotlin.Int) declared in .OneElementArrayMap' type=.OneElementArrayMap.OneElementArrayMap> origin=null - : T of .OneElementArrayMap - value: CALL 'public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' type=T of .OneElementArrayMap origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.copy' type=.OneElementArrayMap.OneElementArrayMap> origin=null - index: CALL 'public final fun (): kotlin.Int declared in .OneElementArrayMap' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.copy' type=.OneElementArrayMap.OneElementArrayMap> origin=null - FUN name:iterator visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:kotlin.collections.Iterator.OneElementArrayMap> [operator] - overridden: - public abstract fun iterator (): kotlin.collections.Iterator.ArrayMap> declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator.OneElementArrayMap> declared in .OneElementArrayMap' - BLOCK type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator.OneElementArrayMap>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> - CONSTRUCTOR visibility:public <> () returnType:.OneElementArrayMap.iterator..OneElementArrayMap> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator.OneElementArrayMap>]' - PROPERTY name:notVisited visibility:private modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:notVisited type:kotlin.Boolean visibility:private - EXPRESSION_BODY - CONST Boolean type=kotlin.Boolean value=true - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>) returnType:kotlin.Boolean - correspondingProperty: PROPERTY name:notVisited visibility:private modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:notVisited type:kotlin.Boolean visibility:private' type=kotlin.Boolean origin=null - receiver: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>, :kotlin.Boolean) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:notVisited visibility:private modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> - VALUE_PARAMETER name: index:0 type:kotlin.Boolean - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:notVisited type:kotlin.Boolean visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null - value: GET_VAR ': kotlin.Boolean declared in .OneElementArrayMap.iterator..' type=kotlin.Boolean origin=null - FUN name:hasNext visibility:public modality:OPEN <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>) returnType:kotlin.Boolean [operator] - overridden: - public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hasNext (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' - CALL 'private final fun (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' type=kotlin.Boolean origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..hasNext' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null - FUN name:next visibility:public modality:OPEN <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>) returnType:T of .OneElementArrayMap [operator] - overridden: - public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> - BLOCK_BODY - WHEN type=kotlin.Nothing origin=IF - BRANCH - if: CALL 'private final fun (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' type=kotlin.Boolean origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..next' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null - then: BLOCK type=kotlin.Unit origin=null - CALL 'private final fun (: kotlin.Boolean): kotlin.Unit declared in .OneElementArrayMap.iterator.' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..next' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null - : CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun next (): T of .OneElementArrayMap declared in .OneElementArrayMap.iterator.' - CALL 'public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' type=T of .OneElementArrayMap origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.iterator' type=.OneElementArrayMap.OneElementArrayMap> origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: BLOCK type=kotlin.Unit origin=null - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor () declared in java.util.NoSuchElementException' type=java.util.NoSuchElementException 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.collections.Iterator - $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.collections.Iterator - $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.collections.Iterator - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .OneElementArrayMap.iterator.' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=OBJECT_LITERAL - 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 .ArrayMap - $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 .ArrayMap - $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 .ArrayMap - $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:value index:1 type:T of .ArrayMap + PROPERTY name:size visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:size visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> CLASS CLASS name:ArrayMapImpl modality:FINAL visibility:internal superTypes:[.ArrayMap.ArrayMapImpl>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.ArrayMapImpl> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:private <> (data:kotlin.Array) returnType:.ArrayMapImpl.ArrayMapImpl> [primary] - VALUE_PARAMETER name:data index:0 type:kotlin.Array - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .ArrayMap' - : T of .ArrayMapImpl - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ArrayMapImpl modality:FINAL visibility:internal superTypes:[.ArrayMap.ArrayMapImpl>]' PROPERTY name:data visibility:private modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:data type:kotlin.Array visibility:private EXPRESSION_BODY @@ -351,54 +62,6 @@ FILE fqName: fileName:/ArrayMap.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:data type:kotlin.Array visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.' type=.ArrayMapImpl.ArrayMapImpl> origin=null value: GET_VAR ': kotlin.Array declared in .ArrayMapImpl.' type=kotlin.Array origin=null - CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.Companion - CONSTRUCTOR visibility:private <> () returnType:.ArrayMapImpl.Companion [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' - PROPERTY name:DEFAULT_SIZE visibility:private modality:FINAL [const,val] - FIELD PROPERTY_BACKING_FIELD name:DEFAULT_SIZE type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=20 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ArrayMapImpl.Companion) returnType:kotlin.Int - correspondingProperty: PROPERTY name:DEFAULT_SIZE visibility:private modality:FINAL [const,val] - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Int declared in .ArrayMapImpl.Companion' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:DEFAULT_SIZE type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Companion declared in .ArrayMapImpl.Companion.' type=.ArrayMapImpl.Companion origin=null - PROPERTY name:INCREASE_K visibility:private modality:FINAL [const,val] - FIELD PROPERTY_BACKING_FIELD name:INCREASE_K type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=2 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ArrayMapImpl.Companion) returnType:kotlin.Int - correspondingProperty: PROPERTY name:INCREASE_K visibility:private modality:FINAL [const,val] - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Int declared in .ArrayMapImpl.Companion' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:INCREASE_K type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Companion declared in .ArrayMapImpl.Companion.' type=.ArrayMapImpl.Companion 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: 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 - CONSTRUCTOR visibility:public <> () returnType:.ArrayMapImpl.ArrayMapImpl> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'private constructor (data: kotlin.Array) declared in .ArrayMapImpl' - : T of .ArrayMapImpl - data: CALL 'public final fun arrayOfNulls (size: kotlin.Int): kotlin.Array declared in kotlin' type=kotlin.Array origin=null - : kotlin.Any - size: CONST Int type=kotlin.Int value=20 PROPERTY name:size visibility:public modality:OPEN [var] overridden: public abstract size: kotlin.Int @@ -422,6 +85,240 @@ FILE fqName: fileName:/ArrayMap.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:size type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.' type=.ArrayMapImpl.ArrayMapImpl> origin=null value: GET_VAR ': kotlin.Int declared in .ArrayMapImpl.' type=kotlin.Int origin=null + CLASS CLASS name:Entry modality:FINAL visibility:public [data] superTypes:[kotlin.collections.Map.Entry.ArrayMapImpl.Entry>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:key visibility:public modality:OPEN [val] + overridden: + public abstract key: K of kotlin.collections.Map.Entry + FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'key: kotlin.Int declared in .ArrayMapImpl.Entry.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:key visibility:public modality:OPEN [val] + overridden: + public abstract fun (): K of kotlin.collections.Map.Entry declared in kotlin.collections.Map.Entry + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .ArrayMapImpl.Entry' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + PROPERTY name:value visibility:public modality:OPEN [val] + overridden: + public abstract value: V of kotlin.collections.Map.Entry + FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry.' type=T of .ArrayMapImpl.Entry origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:T of .ArrayMapImpl.Entry + correspondingProperty: PROPERTY name:value visibility:public modality:OPEN [val] + overridden: + public abstract fun (): V of kotlin.collections.Map.Entry declared in kotlin.collections.Map.Entry + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + CONSTRUCTOR visibility:public <> (key:kotlin.Int, value:T of .ArrayMapImpl.Entry) returnType:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> [primary] + VALUE_PARAMETER name:key index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:T of .ArrayMapImpl.Entry + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Entry modality:FINAL visibility:public [data] superTypes:[kotlin.collections.Map.Entry.ArrayMapImpl.Entry>]' + FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .ArrayMapImpl.Entry' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.component1' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:component2 visibility:public modality:FINAL <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:T of .ArrayMapImpl.Entry [operator] + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component2 (): T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.component2' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>, key:kotlin.Int, value:T of .ArrayMapImpl.Entry) returnType:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + VALUE_PARAMETER name:key index:0 type:kotlin.Int + EXPRESSION_BODY + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.copy' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + VALUE_PARAMETER name:value index:1 type:T of .ArrayMapImpl.Entry + EXPRESSION_BODY + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.copy' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun copy (key: kotlin.Int, value: T of .ArrayMapImpl.Entry): .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry' + CONSTRUCTOR_CALL 'public constructor (key: kotlin.Int, value: T of .ArrayMapImpl.Entry) declared in .ArrayMapImpl.Entry' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + : T of .ArrayMapImpl.Entry + key: GET_VAR 'key: kotlin.Int declared in .ArrayMapImpl.Entry.copy' type=kotlin.Int origin=null + value: GET_VAR 'value: T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry.copy' type=T of .ArrayMapImpl.Entry origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + BLOCK_BODY + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ + arg0: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + arg1: GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + CONST Boolean type=kotlin.Boolean value=true + WHEN type=kotlin.Unit origin=null + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + CONST Boolean type=kotlin.Boolean value=false + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> [val] + TYPE_OP type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=CAST typeOperand=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean 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:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR 'val tmp_0: .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + CONST Boolean type=kotlin.Boolean value=false + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean 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:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR 'val tmp_0: .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + CONST Boolean type=kotlin.Boolean value=false + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.hashCode' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + SET_VAR 'var result: kotlin.Int declared in .ArrayMapImpl.Entry.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .ArrayMapImpl.Entry.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.hashCode' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.hashCode' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .ArrayMapImpl.Entry' + GET_VAR 'var result: kotlin.Int declared in .ArrayMapImpl.Entry.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .ArrayMapImpl.Entry' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Entry(" + CONST String type=kotlin.String value="key=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.toString' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="value=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.toString' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + CONST String type=kotlin.String value=")" + CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.Companion + CONSTRUCTOR visibility:private <> () returnType:.ArrayMapImpl.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] 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 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 + PROPERTY name:DEFAULT_SIZE visibility:private modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:DEFAULT_SIZE type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=20 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ArrayMapImpl.Companion) returnType:kotlin.Int + correspondingProperty: PROPERTY name:DEFAULT_SIZE visibility:private modality:FINAL [const,val] + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Int declared in .ArrayMapImpl.Companion' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:DEFAULT_SIZE type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Companion declared in .ArrayMapImpl.Companion.' type=.ArrayMapImpl.Companion origin=null + PROPERTY name:INCREASE_K visibility:private modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:INCREASE_K type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=2 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ArrayMapImpl.Companion) returnType:kotlin.Int + correspondingProperty: PROPERTY name:INCREASE_K visibility:private modality:FINAL [const,val] + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Int declared in .ArrayMapImpl.Companion' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:INCREASE_K type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Companion declared in .ArrayMapImpl.Companion.' type=.ArrayMapImpl.Companion origin=null + CONSTRUCTOR visibility:private <> (data:kotlin.Array) returnType:.ArrayMapImpl.ArrayMapImpl> [primary] + VALUE_PARAMETER name:data index:0 type:kotlin.Array + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .ArrayMap' + : T of .ArrayMapImpl + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ArrayMapImpl modality:FINAL visibility:internal superTypes:[.ArrayMap.ArrayMapImpl>]' + CONSTRUCTOR visibility:public <> () returnType:.ArrayMapImpl.ArrayMapImpl> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (data: kotlin.Array) declared in .ArrayMapImpl' + : T of .ArrayMapImpl + data: CALL 'public final fun arrayOfNulls (size: kotlin.Int): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Any + size: CONST Int type=kotlin.Int value=20 + 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 .ArrayMap + $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 .ArrayMap + $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 .ArrayMap + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:copy visibility:public modality:OPEN <> ($this:.ArrayMapImpl.ArrayMapImpl>) returnType:.ArrayMap.ArrayMapImpl> + overridden: + public abstract fun copy (): .ArrayMap.ArrayMap> declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun copy (): .ArrayMap.ArrayMapImpl> declared in .ArrayMapImpl' + CONSTRUCTOR_CALL 'private constructor (data: kotlin.Array) declared in .ArrayMapImpl' type=.ArrayMapImpl.ArrayMapImpl> origin=null + : T of .ArrayMapImpl + data: CALL 'public final fun copyOf (): kotlin.Array declared in kotlin.collections' type=kotlin.Array origin=null + : kotlin.Any? + $receiver: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY + $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.copy' type=.ArrayMapImpl.ArrayMapImpl> origin=null FUN name:ensureCapacity visibility:private modality:FINAL <> ($this:.ArrayMapImpl.ArrayMapImpl>, index:kotlin.Int) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> VALUE_PARAMETER name:index index:0 type:kotlin.Int @@ -445,39 +342,35 @@ FILE fqName: fileName:/ArrayMap.kt $this: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.ensureCapacity' type=.ArrayMapImpl.ArrayMapImpl> origin=null other: CONST Int type=kotlin.Int value=2 - FUN name:set visibility:public modality:OPEN <> ($this:.ArrayMapImpl.ArrayMapImpl>, index:kotlin.Int, value:T of .ArrayMapImpl) returnType:kotlin.Unit [operator] - overridden: - public abstract fun set (index: kotlin.Int, value: T of .ArrayMap): kotlin.Unit declared in .ArrayMap + FUN name:entries visibility:public modality:FINAL <> ($this:.ArrayMapImpl.ArrayMapImpl>) returnType:kotlin.collections.List<.ArrayMapImpl.Entry.ArrayMapImpl>> $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:T of .ArrayMapImpl BLOCK_BODY - CALL 'private final fun ensureCapacity (index: kotlin.Int): kotlin.Unit declared in .ArrayMapImpl' type=kotlin.Unit origin=null - $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null - index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null - WHEN type=kotlin.Unit origin=IF - 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: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Any? origin=GET_ARRAY_ELEMENT - $this: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY - $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null - index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] - CALL 'public open fun (): kotlin.Int declared in .ArrayMapImpl' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null - CALL 'private open fun (: kotlin.Int): kotlin.Unit declared in .ArrayMapImpl' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null - : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_0: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null - GET_VAR 'val tmp_0: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null - CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=null - $this: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY - $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null - index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null - value: GET_VAR 'value: T of .ArrayMapImpl declared in .ArrayMapImpl.set' type=T of .ArrayMapImpl origin=null + RETURN type=kotlin.Nothing from='public final fun entries (): kotlin.collections.List<.ArrayMapImpl.Entry.ArrayMapImpl>> declared in .ArrayMapImpl' + CALL 'public final fun mapIndexedNotNull (transform: kotlin.Function2<@[ParameterName(name = "index")] kotlin.Int, T of kotlin.collections.mapIndexedNotNull, R of kotlin.collections.mapIndexedNotNull?>): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.ArrayMapImpl.Entry.ArrayMapImpl>> origin=null + : kotlin.Any? + : .ArrayMapImpl.Entry.ArrayMapImpl> + $receiver: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY + $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.entries' type=.ArrayMapImpl.ArrayMapImpl> origin=null + transform: FUN_EXPR type=kotlin.Function2<@[ParameterName(name = "index")] kotlin.Int, kotlin.Any?, .ArrayMapImpl.Entry.ArrayMapImpl>?> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (index:@[ParameterName(name = "index")] kotlin.Int, value:kotlin.Any?) returnType:.ArrayMapImpl.Entry.ArrayMapImpl>? + VALUE_PARAMETER name:index index:0 type:@[ParameterName(name = "index")] kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (index: @[ParameterName(name = "index")] kotlin.Int, value: kotlin.Any?): .ArrayMapImpl.Entry.ArrayMapImpl>? declared in .ArrayMapImpl.entries' + WHEN type=.ArrayMapImpl.Entry.ArrayMapImpl>? origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean 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_VAR 'value: kotlin.Any? declared in .ArrayMapImpl.entries.' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONSTRUCTOR_CALL 'public constructor (key: kotlin.Int, value: T of .ArrayMapImpl.Entry) declared in .ArrayMapImpl.Entry' type=.ArrayMapImpl.Entry.ArrayMapImpl> origin=null + : T of .ArrayMapImpl + key: GET_VAR 'index: @[ParameterName(name = "index")] kotlin.Int declared in .ArrayMapImpl.entries.' type=@[ParameterName(name = "index")] kotlin.Int origin=null + value: TYPE_OP type=T of .ArrayMapImpl origin=CAST typeOperand=T of .ArrayMapImpl + GET_VAR 'value: kotlin.Any? declared in .ArrayMapImpl.entries.' type=kotlin.Any? origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Null type=kotlin.Nothing? value=null FUN name:get visibility:public modality:OPEN <> ($this:.ArrayMapImpl.ArrayMapImpl>, index:kotlin.Int) returnType:T of .ArrayMapImpl? [operator] overridden: public abstract fun get (index: kotlin.Int): T of .ArrayMap? declared in .ArrayMap @@ -491,18 +384,6 @@ FILE fqName: fileName:/ArrayMap.kt $receiver: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.get' type=.ArrayMapImpl.ArrayMapImpl> origin=null index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.get' type=kotlin.Int origin=null - FUN name:copy visibility:public modality:OPEN <> ($this:.ArrayMapImpl.ArrayMapImpl>) returnType:.ArrayMap.ArrayMapImpl> - overridden: - public abstract fun copy (): .ArrayMap.ArrayMap> declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun copy (): .ArrayMap.ArrayMapImpl> declared in .ArrayMapImpl' - CONSTRUCTOR_CALL 'private constructor (data: kotlin.Array) declared in .ArrayMapImpl' type=.ArrayMapImpl.ArrayMapImpl> origin=null - : T of .ArrayMapImpl - data: CALL 'public final fun copyOf (): kotlin.Array declared in kotlin.collections' type=kotlin.Array origin=null - : kotlin.Any? - $receiver: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY - $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.copy' type=.ArrayMapImpl.ArrayMapImpl> origin=null FUN name:iterator visibility:public modality:OPEN <> ($this:.ArrayMapImpl.ArrayMapImpl>) returnType:kotlin.collections.Iterator.ArrayMapImpl> [operator] overridden: public abstract fun iterator (): kotlin.collections.Iterator.ArrayMap> declared in .ArrayMap @@ -512,11 +393,6 @@ FILE fqName: fileName:/ArrayMap.kt BLOCK type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.AbstractIterator.ArrayMapImpl>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.iterator..ArrayMapImpl> - CONSTRUCTOR visibility:public <> () returnType:.ArrayMapImpl.iterator..ArrayMapImpl> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.collections.AbstractIterator' - : T of .ArrayMapImpl - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.AbstractIterator.ArrayMapImpl>]' PROPERTY name:index visibility:private modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:index type:kotlin.Int visibility:private EXPRESSION_BODY @@ -536,6 +412,41 @@ FILE fqName: fileName:/ArrayMap.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:index type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .ArrayMapImpl.iterator..ArrayMapImpl> declared in .ArrayMapImpl.iterator..' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=null value: GET_VAR ': kotlin.Int declared in .ArrayMapImpl.iterator..' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.ArrayMapImpl.iterator..ArrayMapImpl> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.collections.AbstractIterator' + : T of .ArrayMapImpl + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.AbstractIterator.ArrayMapImpl>]' + FUN FAKE_OVERRIDE name:done visibility:protected modality:FINAL <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>) returnType:kotlin.Unit [fake_override] + overridden: + protected final fun done (): kotlin.Unit declared in kotlin.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> + 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.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hasNext visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun hasNext (): kotlin.Boolean declared in kotlin.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> + 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.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:next visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>) returnType:T of .ArrayMapImpl [fake_override,operator] + overridden: + public open fun next (): T of kotlin.collections.AbstractIterator declared in kotlin.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> + FUN FAKE_OVERRIDE name:setNext visibility:protected modality:FINAL <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>, value:T of .ArrayMapImpl) returnType:kotlin.Unit [fake_override] + overridden: + protected final fun setNext (value: T of kotlin.collections.AbstractIterator): kotlin.Unit declared in kotlin.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> + VALUE_PARAMETER name:value index:0 type:T of .ArrayMapImpl + 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.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:computeNext visibility:protected modality:OPEN <> ($this:.ArrayMapImpl.iterator..ArrayMapImpl>) returnType:kotlin.Unit overridden: protected abstract fun computeNext (): kotlin.Unit declared in kotlin.collections.AbstractIterator @@ -594,36 +505,6 @@ FILE fqName: fileName:/ArrayMap.kt $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.iterator' type=.ArrayMapImpl.ArrayMapImpl> origin=null index: CALL 'private final fun (): kotlin.Int declared in .ArrayMapImpl.iterator.' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .ArrayMapImpl.iterator..ArrayMapImpl> declared in .ArrayMapImpl.iterator..computeNext' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=null - FUN FAKE_OVERRIDE name:done visibility:protected modality:FINAL <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>) returnType:kotlin.Unit [fake_override] - overridden: - protected final fun done (): kotlin.Unit declared in kotlin.collections.AbstractIterator - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> - FUN FAKE_OVERRIDE name:hasNext visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun hasNext (): kotlin.Boolean declared in kotlin.collections.AbstractIterator - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> - FUN FAKE_OVERRIDE name:next visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>) returnType:T of .ArrayMapImpl [fake_override,operator] - overridden: - public open fun next (): T of kotlin.collections.AbstractIterator declared in kotlin.collections.AbstractIterator - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> - FUN FAKE_OVERRIDE name:setNext visibility:protected modality:FINAL <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>, value:T of .ArrayMapImpl) returnType:kotlin.Unit [fake_override] - overridden: - protected final fun setNext (value: T of kotlin.collections.AbstractIterator): kotlin.Unit declared in kotlin.collections.AbstractIterator - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> - VALUE_PARAMETER name:value index:0 type:T of .ArrayMapImpl - 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.collections.AbstractIterator - $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.collections.AbstractIterator - $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.collections.AbstractIterator - $this: VALUE_PARAMETER name: type:kotlin.Any CONSTRUCTOR_CALL 'public constructor () declared in .ArrayMapImpl.iterator.' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=OBJECT_LITERAL FUN name:remove visibility:public modality:FINAL <> ($this:.ArrayMapImpl.ArrayMapImpl>, index:kotlin.Int) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> @@ -653,190 +534,71 @@ FILE fqName: fileName:/ArrayMap.kt $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.remove' type=.ArrayMapImpl.ArrayMapImpl> origin=null index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.remove' type=kotlin.Int origin=null value: CONST Null type=kotlin.Nothing? value=null - FUN name:entries visibility:public modality:FINAL <> ($this:.ArrayMapImpl.ArrayMapImpl>) returnType:kotlin.collections.List<.ArrayMapImpl.Entry.ArrayMapImpl>> + FUN name:set visibility:public modality:OPEN <> ($this:.ArrayMapImpl.ArrayMapImpl>, index:kotlin.Int, value:T of .ArrayMapImpl) returnType:kotlin.Unit [operator] + overridden: + public abstract fun set (index: kotlin.Int, value: T of .ArrayMap): kotlin.Unit declared in .ArrayMap $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:T of .ArrayMapImpl BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun entries (): kotlin.collections.List<.ArrayMapImpl.Entry.ArrayMapImpl>> declared in .ArrayMapImpl' - CALL 'public final fun mapIndexedNotNull (transform: kotlin.Function2<@[ParameterName(name = "index")] kotlin.Int, T of kotlin.collections.mapIndexedNotNull, R of kotlin.collections.mapIndexedNotNull?>): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.ArrayMapImpl.Entry.ArrayMapImpl>> origin=null - : kotlin.Any? - : .ArrayMapImpl.Entry.ArrayMapImpl> - $receiver: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY - $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.entries' type=.ArrayMapImpl.ArrayMapImpl> origin=null - transform: FUN_EXPR type=kotlin.Function2<@[ParameterName(name = "index")] kotlin.Int, kotlin.Any?, .ArrayMapImpl.Entry.ArrayMapImpl>?> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (index:@[ParameterName(name = "index")] kotlin.Int, value:kotlin.Any?) returnType:.ArrayMapImpl.Entry.ArrayMapImpl>? - VALUE_PARAMETER name:index index:0 type:@[ParameterName(name = "index")] kotlin.Int - VALUE_PARAMETER name:value index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (index: @[ParameterName(name = "index")] kotlin.Int, value: kotlin.Any?): .ArrayMapImpl.Entry.ArrayMapImpl>? declared in .ArrayMapImpl.entries' - WHEN type=.ArrayMapImpl.Entry.ArrayMapImpl>? origin=IF - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean 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_VAR 'value: kotlin.Any? declared in .ArrayMapImpl.entries.' type=kotlin.Any? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONSTRUCTOR_CALL 'public constructor (key: kotlin.Int, value: T of .ArrayMapImpl.Entry) declared in .ArrayMapImpl.Entry' type=.ArrayMapImpl.Entry.ArrayMapImpl> origin=null - : T of .ArrayMapImpl - key: GET_VAR 'index: @[ParameterName(name = "index")] kotlin.Int declared in .ArrayMapImpl.entries.' type=@[ParameterName(name = "index")] kotlin.Int origin=null - value: TYPE_OP type=T of .ArrayMapImpl origin=CAST typeOperand=T of .ArrayMapImpl - GET_VAR 'value: kotlin.Any? declared in .ArrayMapImpl.entries.' type=kotlin.Any? origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Null type=kotlin.Nothing? value=null - CLASS CLASS name:Entry modality:FINAL visibility:public [data] superTypes:[kotlin.collections.Map.Entry.ArrayMapImpl.Entry>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (key:kotlin.Int, value:T of .ArrayMapImpl.Entry) returnType:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> [primary] - VALUE_PARAMETER name:key index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:T of .ArrayMapImpl.Entry + CALL 'private final fun ensureCapacity (index: kotlin.Int): kotlin.Unit declared in .ArrayMapImpl' type=kotlin.Unit origin=null + $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null + index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null + WHEN type=kotlin.Unit origin=IF + 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: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Any? origin=GET_ARRAY_ELEMENT + $this: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY + $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null + index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] + CALL 'public open fun (): kotlin.Int declared in .ArrayMapImpl' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null + CALL 'private open fun (: kotlin.Int): kotlin.Unit declared in .ArrayMapImpl' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null + : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_3: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null + GET_VAR 'val tmp_3: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null + CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=null + $this: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY + $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null + index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null + value: GET_VAR 'value: T of .ArrayMapImpl declared in .ArrayMapImpl.set' type=T of .ArrayMapImpl origin=null + CLASS CLASS name:OneElementArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap.OneElementArrayMap>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OneElementArrayMap.OneElementArrayMap> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:T of .OneElementArrayMap visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: T of .OneElementArrayMap declared in .OneElementArrayMap.' type=T of .OneElementArrayMap origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:T of .OneElementArrayMap + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Entry modality:FINAL visibility:public [data] superTypes:[kotlin.collections.Map.Entry.ArrayMapImpl.Entry>]' - PROPERTY name:key visibility:public modality:OPEN [val] - overridden: - public abstract key: K of kotlin.collections.Map.Entry - FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - GET_VAR 'key: kotlin.Int declared in .ArrayMapImpl.Entry.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:key visibility:public modality:OPEN [val] - overridden: - public abstract fun (): K of kotlin.collections.Map.Entry declared in kotlin.collections.Map.Entry - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .ArrayMapImpl.Entry' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - PROPERTY name:value visibility:public modality:OPEN [val] - overridden: - public abstract value: V of kotlin.collections.Map.Entry - FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry.' type=T of .ArrayMapImpl.Entry origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:T of .ArrayMapImpl.Entry - correspondingProperty: PROPERTY name:value visibility:public modality:OPEN [val] - overridden: - public abstract fun (): V of kotlin.collections.Map.Entry declared in kotlin.collections.Map.Entry - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + RETURN type=kotlin.Nothing from='public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .OneElementArrayMap visibility:private [final]' type=T of .OneElementArrayMap origin=null + receiver: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.' type=.OneElementArrayMap.OneElementArrayMap> origin=null + PROPERTY name:index visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:index type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'index: kotlin.Int declared in .OneElementArrayMap.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:index visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .ArrayMapImpl.Entry' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.component1' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:component2 visibility:public modality:FINAL <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:T of .ArrayMapImpl.Entry [operator] - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component2 (): T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.component2' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>, key:kotlin.Int, value:T of .ArrayMapImpl.Entry) returnType:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - VALUE_PARAMETER name:key index:0 type:kotlin.Int - EXPRESSION_BODY - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.copy' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - VALUE_PARAMETER name:value index:1 type:T of .ArrayMapImpl.Entry - EXPRESSION_BODY - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.copy' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun copy (key: kotlin.Int, value: T of .ArrayMapImpl.Entry): .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry' - CONSTRUCTOR_CALL 'public constructor (key: kotlin.Int, value: T of .ArrayMapImpl.Entry) declared in .ArrayMapImpl.Entry' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - : T of .ArrayMapImpl.Entry - key: GET_VAR 'key: kotlin.Int declared in .ArrayMapImpl.Entry.copy' type=kotlin.Int origin=null - value: GET_VAR 'value: T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry.copy' type=T of .ArrayMapImpl.Entry origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .ArrayMapImpl.Entry' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Entry(" - CONST String type=kotlin.String value="key=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.toString' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="value=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.toString' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.hashCode' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - SET_VAR 'var result: kotlin.Int declared in .ArrayMapImpl.Entry.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .ArrayMapImpl.Entry.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.hashCode' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.hashCode' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .ArrayMapImpl.Entry' - GET_VAR 'var result: kotlin.Int declared in .ArrayMapImpl.Entry.hashCode' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - BLOCK_BODY - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ - arg0: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - arg1: GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' - CONST Boolean type=kotlin.Boolean value=true - WHEN type=kotlin.Unit origin=null - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' - CONST Boolean type=kotlin.Boolean value=false - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> [val] - TYPE_OP type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=CAST typeOperand=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean 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:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR 'val tmp_3: .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' - CONST Boolean type=kotlin.Boolean value=false - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean 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:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR 'val tmp_3: .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' - CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' - CONST Boolean type=kotlin.Boolean value=true + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .OneElementArrayMap' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:index type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.' type=.OneElementArrayMap.OneElementArrayMap> origin=null + CONSTRUCTOR visibility:public <> (value:T of .OneElementArrayMap, index:kotlin.Int) returnType:.OneElementArrayMap.OneElementArrayMap> [primary] + VALUE_PARAMETER name:value index:0 type:T of .OneElementArrayMap + VALUE_PARAMETER name:index index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .ArrayMap' + : T of .OneElementArrayMap + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OneElementArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap.OneElementArrayMap>]' 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 .ArrayMap @@ -850,3 +612,241 @@ FILE fqName: fileName:/ArrayMap.kt overridden: public open fun toString (): kotlin.String declared in .ArrayMap $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:copy visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:.ArrayMap.OneElementArrayMap> + overridden: + public abstract fun copy (): .ArrayMap.ArrayMap> declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun copy (): .ArrayMap.OneElementArrayMap> declared in .OneElementArrayMap' + CONSTRUCTOR_CALL 'public constructor (value: T of .OneElementArrayMap, index: kotlin.Int) declared in .OneElementArrayMap' type=.OneElementArrayMap.OneElementArrayMap> origin=null + : T of .OneElementArrayMap + value: CALL 'public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' type=T of .OneElementArrayMap origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.copy' type=.OneElementArrayMap.OneElementArrayMap> origin=null + index: CALL 'public final fun (): kotlin.Int declared in .OneElementArrayMap' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.copy' type=.OneElementArrayMap.OneElementArrayMap> origin=null + FUN name:get visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>, index:kotlin.Int) returnType:T of .OneElementArrayMap? [operator] + overridden: + public abstract fun get (index: kotlin.Int): T of .ArrayMap? declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun get (index: kotlin.Int): T of .OneElementArrayMap? declared in .OneElementArrayMap' + WHEN type=T of .OneElementArrayMap? origin=IF + 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 'index: kotlin.Int declared in .OneElementArrayMap.get' type=kotlin.Int origin=null + arg1: CALL 'public final fun (): kotlin.Int declared in .OneElementArrayMap' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.get' type=.OneElementArrayMap.OneElementArrayMap> origin=null + then: CALL 'public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' type=T of .OneElementArrayMap origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.get' type=.OneElementArrayMap.OneElementArrayMap> origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Null type=kotlin.Nothing? value=null + FUN name:iterator visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:kotlin.collections.Iterator.OneElementArrayMap> [operator] + overridden: + public abstract fun iterator (): kotlin.collections.Iterator.ArrayMap> declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator.OneElementArrayMap> declared in .OneElementArrayMap' + BLOCK type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator.OneElementArrayMap>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> + PROPERTY name:notVisited visibility:private modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:notVisited type:kotlin.Boolean visibility:private + EXPRESSION_BODY + CONST Boolean type=kotlin.Boolean value=true + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>) returnType:kotlin.Boolean + correspondingProperty: PROPERTY name:notVisited visibility:private modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:notVisited type:kotlin.Boolean visibility:private' type=kotlin.Boolean origin=null + receiver: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>, :kotlin.Boolean) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:notVisited visibility:private modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> + VALUE_PARAMETER name: index:0 type:kotlin.Boolean + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:notVisited type:kotlin.Boolean visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null + value: GET_VAR ': kotlin.Boolean declared in .OneElementArrayMap.iterator..' type=kotlin.Boolean origin=null + CONSTRUCTOR visibility:public <> () returnType:.OneElementArrayMap.iterator..OneElementArrayMap> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator.OneElementArrayMap>]' + 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.collections.Iterator + $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.collections.Iterator + $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.collections.Iterator + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:hasNext visibility:public modality:OPEN <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>) returnType:kotlin.Boolean [operator] + overridden: + public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hasNext (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' + CALL 'private final fun (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' type=kotlin.Boolean origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..hasNext' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null + FUN name:next visibility:public modality:OPEN <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>) returnType:T of .OneElementArrayMap [operator] + overridden: + public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> + BLOCK_BODY + WHEN type=kotlin.Nothing origin=IF + BRANCH + if: CALL 'private final fun (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' type=kotlin.Boolean origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..next' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null + then: BLOCK type=kotlin.Unit origin=null + CALL 'private final fun (: kotlin.Boolean): kotlin.Unit declared in .OneElementArrayMap.iterator.' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..next' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null + : CONST Boolean type=kotlin.Boolean value=false + RETURN type=kotlin.Nothing from='public open fun next (): T of .OneElementArrayMap declared in .OneElementArrayMap.iterator.' + CALL 'public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' type=T of .OneElementArrayMap origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.iterator' type=.OneElementArrayMap.OneElementArrayMap> origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: BLOCK type=kotlin.Unit origin=null + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor () declared in java.util.NoSuchElementException' type=java.util.NoSuchElementException origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .OneElementArrayMap.iterator.' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=OBJECT_LITERAL + FUN name:set visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>, index:kotlin.Int, value:T of .OneElementArrayMap) returnType:kotlin.Unit [operator] + overridden: + public abstract fun set (index: kotlin.Int, value: T of .ArrayMap): kotlin.Unit declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:T of .OneElementArrayMap + BLOCK_BODY + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor () declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null + PROPERTY name:size visibility:public modality:OPEN [val] + overridden: + public abstract size: kotlin.Int + FUN name: visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .OneElementArrayMap' + CONST Int type=kotlin.Int value=1 + CLASS OBJECT name:EmptyArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.EmptyArrayMap + CONSTRUCTOR visibility:private <> () returnType:.EmptyArrayMap [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .ArrayMap' + : kotlin.Nothing + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:EmptyArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap]' + 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 .ArrayMap + $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 .ArrayMap + $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 .ArrayMap + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:copy visibility:public modality:OPEN <> ($this:.EmptyArrayMap) returnType:.ArrayMap + overridden: + public abstract fun copy (): .ArrayMap.ArrayMap> declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.EmptyArrayMap + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun copy (): .ArrayMap declared in .EmptyArrayMap' + GET_VAR ': .EmptyArrayMap declared in .EmptyArrayMap.copy' type=.EmptyArrayMap origin=null + FUN name:get visibility:public modality:OPEN <> ($this:.EmptyArrayMap, index:kotlin.Int) returnType:kotlin.Nothing? [operator] + overridden: + public abstract fun get (index: kotlin.Int): T of .ArrayMap? declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.EmptyArrayMap + VALUE_PARAMETER name:index index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun get (index: kotlin.Int): kotlin.Nothing? declared in .EmptyArrayMap' + CONST Null type=kotlin.Nothing? value=null + FUN name:iterator visibility:public modality:OPEN <> ($this:.EmptyArrayMap) returnType:kotlin.collections.Iterator [operator] + overridden: + public abstract fun iterator (): kotlin.collections.Iterator.ArrayMap> declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.EmptyArrayMap + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator declared in .EmptyArrayMap' + BLOCK type=.EmptyArrayMap.iterator. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.EmptyArrayMap.iterator. + CONSTRUCTOR visibility:public <> () returnType:.EmptyArrayMap.iterator. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator]' + 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.collections.Iterator + $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.collections.Iterator + $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.collections.Iterator + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:hasNext visibility:public modality:OPEN <> ($this:.EmptyArrayMap.iterator.) returnType:kotlin.Boolean [operator] + overridden: + public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator + $this: VALUE_PARAMETER name: type:.EmptyArrayMap.iterator. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hasNext (): kotlin.Boolean declared in .EmptyArrayMap.iterator.' + CONST Boolean type=kotlin.Boolean value=false + FUN name:next visibility:public modality:OPEN <> ($this:.EmptyArrayMap.iterator.) returnType:kotlin.Nothing [operator] + overridden: + public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator + $this: VALUE_PARAMETER name: type:.EmptyArrayMap.iterator. + BLOCK_BODY + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor () declared in java.util.NoSuchElementException' type=java.util.NoSuchElementException origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .EmptyArrayMap.iterator.' type=.EmptyArrayMap.iterator. origin=OBJECT_LITERAL + FUN name:set visibility:public modality:OPEN <> ($this:.EmptyArrayMap, index:kotlin.Int, value:kotlin.Nothing) returnType:kotlin.Unit [operator] + overridden: + public abstract fun set (index: kotlin.Int, value: T of .ArrayMap): kotlin.Unit declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.EmptyArrayMap + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Nothing + BLOCK_BODY + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor () declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null + PROPERTY name:size visibility:public modality:OPEN [val] + overridden: + public abstract size: kotlin.Int + FUN name: visibility:public modality:OPEN <> ($this:.EmptyArrayMap) returnType:kotlin.Int + correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.EmptyArrayMap + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .EmptyArrayMap' + CONST Int type=kotlin.Int value=0 + FUN name:isEmpty visibility:public modality:FINAL <> ($receiver:.ArrayMap<*>) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:.ArrayMap<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun isEmpty (): kotlin.Boolean declared in ' + CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: CALL 'public abstract fun (): kotlin.Int declared in .ArrayMap' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .ArrayMap<*> declared in .isEmpty' type=.ArrayMap<*> origin=null + arg1: CONST Int type=kotlin.Int value=0 + FUN name:isNotEmpty visibility:public modality:FINAL <> ($receiver:.ArrayMap<*>) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:.ArrayMap<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun isNotEmpty (): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean 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 abstract fun (): kotlin.Int declared in .ArrayMap' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .ArrayMap<*> declared in .isNotEmpty' type=.ArrayMap<*> origin=null + arg1: CONST Int type=kotlin.Int value=0 diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt index d339b549037..62100a4db3b 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt @@ -5,159 +5,87 @@ sealed class ArrayMap : Iterable { } - abstract val size: Int - abstract get - - abstract operator fun set(index: Int, value: T) + abstract fun copy(): ArrayMap abstract operator fun get(index: Int): T? - abstract fun copy(): ArrayMap + abstract operator fun set(index: Int, value: T) -} - -fun ArrayMap<*>.isEmpty(): Boolean { - return EQEQ(arg0 = .(), arg1 = 0) -} - -fun ArrayMap<*>.isNotEmpty(): Boolean { - return EQEQ(arg0 = .(), arg1 = 0).not() -} - -internal object EmptyArrayMap : ArrayMap { - private constructor() /* primary */ { - super/*ArrayMap*/() - /* () */ - - } - - override val size: Int - override get(): Int { - return 0 - } - - override operator fun set(index: Int, value: Nothing) { - throw IllegalStateException() - } - - override operator fun get(index: Int): Nothing? { - return null - } - - override fun copy(): ArrayMap { - return - } - - override operator fun iterator(): Iterator { - return { // BLOCK - local class : Iterator { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override operator fun hasNext(): Boolean { - return false - } - - override operator fun next(): Nothing { - throw NoSuchElementException() - } - - } - - () - } - } - -} - -internal class OneElementArrayMap : ArrayMap { - constructor(value: T, index: Int) /* primary */ { - super/*ArrayMap*/() - /* () */ - - } - - val value: T - field = value - get - - val index: Int - field = index - get - - override val size: Int - override get(): Int { - return 1 - } - - override operator fun set(index: Int, value: T) { - throw IllegalStateException() - } - - override operator fun get(index: Int): T? { - return when { - EQEQ(arg0 = index, arg1 = .()) -> .() - else -> null - } - } - - override fun copy(): ArrayMap { - return OneElementArrayMap(value = .(), index = .()) - } - - override operator fun iterator(): Iterator { - return { // BLOCK - local class : Iterator { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - private var notVisited: Boolean - field = true - private get - private set - - override operator fun hasNext(): Boolean { - return .() - } - - override operator fun next(): T { - when { - .() -> { // BLOCK - .( = false) - return .() - } - else -> { // BLOCK - throw NoSuchElementException() - } - } - } - - } - - () - } - } + abstract val size: Int + abstract get } internal class ArrayMapImpl : ArrayMap { - private constructor(data: Array) /* primary */ { - super/*ArrayMap*/() - /* () */ - - } - private var data: Array field = data private get private set + override var size: Int + field = 0 + override get + private open set + + data class Entry : Entry { + override val key: Int + field = key + override get + + override val value: T + field = value + override get + + constructor(key: Int, value: T) /* primary */ { + super/*Any*/() + /* () */ + + } + + operator fun component1(): Int { + return .#key + } + + operator fun component2(): T { + return .#value + } + + fun copy(key: Int = .#key, value: T = .#value): Entry { + return Entry(key = key, value = value) + } + + override operator fun equals(other: Any?): Boolean { + when { + EQEQEQ(arg0 = , arg1 = other) -> return true + } + when { + other !is Entry -> return false + } + val tmp_0: Entry = other as Entry + when { + EQEQ(arg0 = .#key, arg1 = tmp_0.#key).not() -> return false + } + when { + EQEQ(arg0 = .#value, arg1 = tmp_0.#value).not() -> return false + } + return true + } + + override fun hashCode(): Int { + var result: Int = .#key.hashCode() + result = result.times(other = 31).plus(other = when { + EQEQ(arg0 = .#value, arg1 = null) -> 0 + else -> .#value.hashCode() + }) + return result + } + + override fun toString(): String { + return "Entry(" + "key=" + .#key + ", " + "value=" + .#value + ")" + } + + } + companion object Companion { private constructor() /* primary */ { super/*Any*/() @@ -175,14 +103,19 @@ internal class ArrayMapImpl : ArrayMap { } + private constructor(data: Array) /* primary */ { + super/*ArrayMap*/() + /* () */ + + } + constructor() { this/*ArrayMapImpl*/(data = arrayOfNulls(size = 20)) } - override var size: Int - field = 0 - override get - private open set + override fun copy(): ArrayMap { + return ArrayMapImpl(data = .().copyOf()) + } private fun ensureCapacity(index: Int) { when { @@ -192,40 +125,34 @@ internal class ArrayMapImpl : ArrayMap { } } - override operator fun set(index: Int, value: T) { - .ensureCapacity(index = index) - when { - EQEQ(arg0 = .().get(index = index), arg1 = null) -> { // BLOCK - val tmp_0: Int = .() - .( = tmp_0.inc()) - tmp_0 - } /*~> Unit */ + fun entries(): List> { + return .().mapIndexedNotNull>(transform = local fun (index: @ParameterName(name = "index") Int, value: Any?): Entry? { + return when { + EQEQ(arg0 = value, arg1 = null).not() -> Entry(key = index, value = value as T) + else -> null + } } - .().set(index = index, value = value) +) } override operator fun get(index: Int): T? { return .().getOrNull(index = index) as T? } - override fun copy(): ArrayMap { - return ArrayMapImpl(data = .().copyOf()) - } - override operator fun iterator(): Iterator { return { // BLOCK local class : AbstractIterator { + private var index: Int + field = -1 + private get + private set + constructor() /* primary */ { super/*AbstractIterator*/() /* () */ } - private var index: Int - field = -1 - private get - private set - protected override fun computeNext() { { // BLOCK do// COMPOSITE { @@ -266,74 +193,147 @@ internal class ArrayMapImpl : ArrayMap { .().set(index = index, value = null) } - fun entries(): List> { - return .().mapIndexedNotNull>(transform = local fun (index: @ParameterName(name = "index") Int, value: Any?): Entry? { - return when { - EQEQ(arg0 = value, arg1 = null).not() -> Entry(key = index, value = value as T) - else -> null - } + override operator fun set(index: Int, value: T) { + .ensureCapacity(index = index) + when { + EQEQ(arg0 = .().get(index = index), arg1 = null) -> { // BLOCK + val tmp_3: Int = .() + .( = tmp_3.inc()) + tmp_3 + } /*~> Unit */ } -) - } - - data class Entry : Entry { - constructor(key: Int, value: T) /* primary */ { - super/*Any*/() - /* () */ - - } - - override val key: Int - field = key - override get - - override val value: T - field = value - override get - - operator fun component1(): Int { - return .#key - } - - operator fun component2(): T { - return .#value - } - - fun copy(key: Int = .#key, value: T = .#value): Entry { - return Entry(key = key, value = value) - } - - override fun toString(): String { - return "Entry(" + "key=" + .#key + ", " + "value=" + .#value + ")" - } - - override fun hashCode(): Int { - var result: Int = .#key.hashCode() - result = result.times(other = 31).plus(other = when { - EQEQ(arg0 = .#value, arg1 = null) -> 0 - else -> .#value.hashCode() - }) - return result - } - - override operator fun equals(other: Any?): Boolean { - when { - EQEQEQ(arg0 = , arg1 = other) -> return true - } - when { - other !is Entry -> return false - } - val tmp_3: Entry = other as Entry - when { - EQEQ(arg0 = .#key, arg1 = tmp_3.#key).not() -> return false - } - when { - EQEQ(arg0 = .#value, arg1 = tmp_3.#value).not() -> return false - } - return true - } - + .().set(index = index, value = value) } } +internal class OneElementArrayMap : ArrayMap { + val value: T + field = value + get + + val index: Int + field = index + get + + constructor(value: T, index: Int) /* primary */ { + super/*ArrayMap*/() + /* () */ + + } + + override fun copy(): ArrayMap { + return OneElementArrayMap(value = .(), index = .()) + } + + override operator fun get(index: Int): T? { + return when { + EQEQ(arg0 = index, arg1 = .()) -> .() + else -> null + } + } + + override operator fun iterator(): Iterator { + return { // BLOCK + local class : Iterator { + private var notVisited: Boolean + field = true + private get + private set + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override operator fun hasNext(): Boolean { + return .() + } + + override operator fun next(): T { + when { + .() -> { // BLOCK + .( = false) + return .() + } + else -> { // BLOCK + throw NoSuchElementException() + } + } + } + + } + + () + } + } + + override operator fun set(index: Int, value: T) { + throw IllegalStateException() + } + + override val size: Int + override get(): Int { + return 1 + } + +} + +internal object EmptyArrayMap : ArrayMap { + private constructor() /* primary */ { + super/*ArrayMap*/() + /* () */ + + } + + override fun copy(): ArrayMap { + return + } + + override operator fun get(index: Int): Nothing? { + return null + } + + override operator fun iterator(): Iterator { + return { // BLOCK + local class : Iterator { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override operator fun hasNext(): Boolean { + return false + } + + override operator fun next(): Nothing { + throw NoSuchElementException() + } + + } + + () + } + } + + override operator fun set(index: Int, value: Nothing) { + throw IllegalStateException() + } + + override val size: Int + override get(): Int { + return 0 + } + +} + +fun ArrayMap<*>.isEmpty(): Boolean { + return EQEQ(arg0 = .(), arg1 = 0) +} + +fun ArrayMap<*>.isNotEmpty(): Boolean { + return EQEQ(arg0 = .(), arg1 = 0).not() +} + diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.ir.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.ir.txt index 6e989e0261b..edc3f4a613c 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.ir.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.ir.txt @@ -10,19 +10,6 @@ FILE fqName: fileName:/ArrayMap.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ArrayMap modality:SEALED visibility:public superTypes:[kotlin.collections.Iterable.ArrayMap>]' - PROPERTY name:size visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:size visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> - FUN name:set visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>, index:kotlin.Int, value:T of .ArrayMap) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:T of .ArrayMap - FUN name:get visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>, index:kotlin.Int) returnType:T of .ArrayMap? [operator] - $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN name:copy visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>) returnType:.ArrayMap.ArrayMap> - $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> 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.collections.Iterable @@ -40,298 +27,22 @@ FILE fqName: fileName:/ArrayMap.kt overridden: public open fun toString (): kotlin.String declared in kotlin.collections.Iterable $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:isEmpty visibility:public modality:FINAL <> ($receiver:.ArrayMap<*>) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:.ArrayMap<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun isEmpty (): kotlin.Boolean declared in ' - CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public abstract fun (): kotlin.Int declared in .ArrayMap' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .ArrayMap<*> declared in .isEmpty' type=.ArrayMap<*> origin=null - arg1: CONST Int type=kotlin.Int value=0 - FUN name:isNotEmpty visibility:public modality:FINAL <> ($receiver:.ArrayMap<*>) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:.ArrayMap<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun isNotEmpty (): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean 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 abstract fun (): kotlin.Int declared in .ArrayMap' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .ArrayMap<*> declared in .isNotEmpty' type=.ArrayMap<*> origin=null - arg1: CONST Int type=kotlin.Int value=0 - CLASS OBJECT name:EmptyArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.EmptyArrayMap - CONSTRUCTOR visibility:private <> () returnType:.EmptyArrayMap [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .ArrayMap' - : kotlin.Nothing - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:EmptyArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap]' - PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract size: kotlin.Int - FUN name: visibility:public modality:OPEN <> ($this:.EmptyArrayMap) returnType:kotlin.Int - correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.EmptyArrayMap - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .EmptyArrayMap' - CONST Int type=kotlin.Int value=0 - FUN name:set visibility:public modality:OPEN <> ($this:.EmptyArrayMap, index:kotlin.Int, value:kotlin.Nothing) returnType:kotlin.Unit [operator] - overridden: - public abstract fun set (index: kotlin.Int, value: T of .ArrayMap): kotlin.Unit declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.EmptyArrayMap + FUN name:copy visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>) returnType:.ArrayMap.ArrayMap> + $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> + FUN name:get visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>, index:kotlin.Int) returnType:T of .ArrayMap? [operator] + $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:kotlin.Nothing - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor () declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null - FUN name:get visibility:public modality:OPEN <> ($this:.EmptyArrayMap, index:kotlin.Int) returnType:kotlin.Nothing? [operator] - overridden: - public abstract fun get (index: kotlin.Int): T of .ArrayMap? declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.EmptyArrayMap + FUN name:set visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>, index:kotlin.Int, value:T of .ArrayMap) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> VALUE_PARAMETER name:index index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun get (index: kotlin.Int): kotlin.Nothing? declared in .EmptyArrayMap' - CONST Null type=kotlin.Nothing? value=null - FUN name:copy visibility:public modality:OPEN <> ($this:.EmptyArrayMap) returnType:.ArrayMap - overridden: - public abstract fun copy (): .ArrayMap.ArrayMap> declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.EmptyArrayMap - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun copy (): .ArrayMap declared in .EmptyArrayMap' - GET_VAR ': .EmptyArrayMap declared in .EmptyArrayMap.copy' type=.EmptyArrayMap origin=null - FUN name:iterator visibility:public modality:OPEN <> ($this:.EmptyArrayMap) returnType:kotlin.collections.Iterator [operator] - overridden: - public abstract fun iterator (): kotlin.collections.Iterator.ArrayMap> declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.EmptyArrayMap - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator declared in .EmptyArrayMap' - BLOCK type=.EmptyArrayMap.iterator. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.EmptyArrayMap.iterator. - CONSTRUCTOR visibility:public <> () returnType:.EmptyArrayMap.iterator. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator]' - FUN name:hasNext visibility:public modality:OPEN <> ($this:.EmptyArrayMap.iterator.) returnType:kotlin.Boolean [operator] - overridden: - public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator - $this: VALUE_PARAMETER name: type:.EmptyArrayMap.iterator. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hasNext (): kotlin.Boolean declared in .EmptyArrayMap.iterator.' - CONST Boolean type=kotlin.Boolean value=false - FUN name:next visibility:public modality:OPEN <> ($this:.EmptyArrayMap.iterator.) returnType:kotlin.Nothing [operator] - overridden: - public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator - $this: VALUE_PARAMETER name: type:.EmptyArrayMap.iterator. - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor () declared in java.util.NoSuchElementException' type=java.util.NoSuchElementException 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.collections.Iterator - $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.collections.Iterator - $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.collections.Iterator - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .EmptyArrayMap.iterator.' type=.EmptyArrayMap.iterator. origin=OBJECT_LITERAL - 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 .ArrayMap - $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 .ArrayMap - $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 .ArrayMap - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:OneElementArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap.OneElementArrayMap>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OneElementArrayMap.OneElementArrayMap> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:public <> (value:T of .OneElementArrayMap, index:kotlin.Int) returnType:.OneElementArrayMap.OneElementArrayMap> [primary] - VALUE_PARAMETER name:value index:0 type:T of .OneElementArrayMap - VALUE_PARAMETER name:index index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .ArrayMap' - : T of .OneElementArrayMap - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OneElementArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap.OneElementArrayMap>]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:T of .OneElementArrayMap visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: T of .OneElementArrayMap declared in .OneElementArrayMap.' type=T of .OneElementArrayMap origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:T of .OneElementArrayMap - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .OneElementArrayMap visibility:private [final]' type=T of .OneElementArrayMap origin=null - receiver: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.' type=.OneElementArrayMap.OneElementArrayMap> origin=null - PROPERTY name:index visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:index type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - GET_VAR 'index: kotlin.Int declared in .OneElementArrayMap.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:index visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .OneElementArrayMap' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:index type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.' type=.OneElementArrayMap.OneElementArrayMap> origin=null - PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract size: kotlin.Int - FUN name: visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .OneElementArrayMap' - CONST Int type=kotlin.Int value=1 - FUN name:set visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>, index:kotlin.Int, value:T of .OneElementArrayMap) returnType:kotlin.Unit [operator] - overridden: - public abstract fun set (index: kotlin.Int, value: T of .ArrayMap): kotlin.Unit declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:T of .OneElementArrayMap - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor () declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null - FUN name:get visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>, index:kotlin.Int) returnType:T of .OneElementArrayMap? [operator] - overridden: - public abstract fun get (index: kotlin.Int): T of .ArrayMap? declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun get (index: kotlin.Int): T of .OneElementArrayMap? declared in .OneElementArrayMap' - WHEN type=T of .OneElementArrayMap? origin=IF - 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 'index: kotlin.Int declared in .OneElementArrayMap.get' type=kotlin.Int origin=null - arg1: CALL 'public final fun (): kotlin.Int declared in .OneElementArrayMap' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.get' type=.OneElementArrayMap.OneElementArrayMap> origin=null - then: CALL 'public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' type=T of .OneElementArrayMap origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.get' type=.OneElementArrayMap.OneElementArrayMap> origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Null type=kotlin.Nothing? value=null - FUN name:copy visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:.ArrayMap.OneElementArrayMap> - overridden: - public abstract fun copy (): .ArrayMap.ArrayMap> declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun copy (): .ArrayMap.OneElementArrayMap> declared in .OneElementArrayMap' - CONSTRUCTOR_CALL 'public constructor (value: T of .OneElementArrayMap, index: kotlin.Int) declared in .OneElementArrayMap' type=.OneElementArrayMap.OneElementArrayMap> origin=null - : T of .OneElementArrayMap - value: CALL 'public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' type=T of .OneElementArrayMap origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.copy' type=.OneElementArrayMap.OneElementArrayMap> origin=null - index: CALL 'public final fun (): kotlin.Int declared in .OneElementArrayMap' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.copy' type=.OneElementArrayMap.OneElementArrayMap> origin=null - FUN name:iterator visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:kotlin.collections.Iterator.OneElementArrayMap> [operator] - overridden: - public abstract fun iterator (): kotlin.collections.Iterator.ArrayMap> declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator.OneElementArrayMap> declared in .OneElementArrayMap' - BLOCK type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator.OneElementArrayMap>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> - CONSTRUCTOR visibility:public <> () returnType:.OneElementArrayMap.iterator..OneElementArrayMap> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator.OneElementArrayMap>]' - PROPERTY name:notVisited visibility:private modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:notVisited type:kotlin.Boolean visibility:private - EXPRESSION_BODY - CONST Boolean type=kotlin.Boolean value=true - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>) returnType:kotlin.Boolean - correspondingProperty: PROPERTY name:notVisited visibility:private modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:notVisited type:kotlin.Boolean visibility:private' type=kotlin.Boolean origin=null - receiver: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>, :kotlin.Boolean) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:notVisited visibility:private modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> - VALUE_PARAMETER name: index:0 type:kotlin.Boolean - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:notVisited type:kotlin.Boolean visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null - value: GET_VAR ': kotlin.Boolean declared in .OneElementArrayMap.iterator..' type=kotlin.Boolean origin=null - FUN name:hasNext visibility:public modality:OPEN <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>) returnType:kotlin.Boolean [operator] - overridden: - public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hasNext (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' - CALL 'private final fun (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' type=kotlin.Boolean origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..hasNext' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null - FUN name:next visibility:public modality:OPEN <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>) returnType:T of .OneElementArrayMap [operator] - overridden: - public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator - $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> - BLOCK_BODY - WHEN type=kotlin.Unit origin=IF - BRANCH - if: CALL 'private final fun (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' type=kotlin.Boolean origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..next' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null - then: BLOCK type=kotlin.Unit origin=null - CALL 'private final fun (: kotlin.Boolean): kotlin.Unit declared in .OneElementArrayMap.iterator.' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..next' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null - : CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun next (): T of .OneElementArrayMap declared in .OneElementArrayMap.iterator.' - CALL 'public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' type=T of .OneElementArrayMap origin=GET_PROPERTY - $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.iterator' type=.OneElementArrayMap.OneElementArrayMap> origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: BLOCK type=kotlin.Unit origin=null - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor () declared in java.util.NoSuchElementException' type=java.util.NoSuchElementException 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.collections.Iterator - $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.collections.Iterator - $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.collections.Iterator - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .OneElementArrayMap.iterator.' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=OBJECT_LITERAL - 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 .ArrayMap - $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 .ArrayMap - $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 .ArrayMap - $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:value index:1 type:T of .ArrayMap + PROPERTY name:size visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.ArrayMap.ArrayMap>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:size visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.ArrayMap.ArrayMap> CLASS CLASS name:ArrayMapImpl modality:FINAL visibility:internal superTypes:[.ArrayMap.ArrayMapImpl>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.ArrayMapImpl> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:private <> (data:kotlin.Array) returnType:.ArrayMapImpl.ArrayMapImpl> [primary] - VALUE_PARAMETER name:data index:0 type:kotlin.Array - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .ArrayMap' - : T of .ArrayMapImpl - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ArrayMapImpl modality:FINAL visibility:internal superTypes:[.ArrayMap.ArrayMapImpl>]' PROPERTY name:data visibility:private modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:data type:kotlin.Array visibility:private EXPRESSION_BODY @@ -351,55 +62,6 @@ FILE fqName: fileName:/ArrayMap.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:data type:kotlin.Array visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.' type=.ArrayMapImpl.ArrayMapImpl> origin=null value: GET_VAR ': kotlin.Array declared in .ArrayMapImpl.' type=kotlin.Array origin=null - CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.Companion - CONSTRUCTOR visibility:private <> () returnType:.ArrayMapImpl.Companion [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' - PROPERTY name:DEFAULT_SIZE visibility:private modality:FINAL [const,val] - FIELD PROPERTY_BACKING_FIELD name:DEFAULT_SIZE type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=20 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ArrayMapImpl.Companion) returnType:kotlin.Int - correspondingProperty: PROPERTY name:DEFAULT_SIZE visibility:private modality:FINAL [const,val] - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Int declared in .ArrayMapImpl.Companion' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:DEFAULT_SIZE type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Companion declared in .ArrayMapImpl.Companion.' type=.ArrayMapImpl.Companion origin=null - PROPERTY name:INCREASE_K visibility:private modality:FINAL [const,val] - FIELD PROPERTY_BACKING_FIELD name:INCREASE_K type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=2 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ArrayMapImpl.Companion) returnType:kotlin.Int - correspondingProperty: PROPERTY name:INCREASE_K visibility:private modality:FINAL [const,val] - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Int declared in .ArrayMapImpl.Companion' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:INCREASE_K type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Companion declared in .ArrayMapImpl.Companion.' type=.ArrayMapImpl.Companion 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: 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 - CONSTRUCTOR visibility:public <> () returnType:.ArrayMapImpl.ArrayMapImpl> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'private constructor (data: kotlin.Array) declared in .ArrayMapImpl' - : T of .ArrayMapImpl - data: CALL 'public final fun arrayOfNulls (size: kotlin.Int): kotlin.Array declared in kotlin' type=kotlin.Array origin=null - : kotlin.Any - size: CALL 'private final fun (): kotlin.Int declared in .ArrayMapImpl.Companion' type=kotlin.Int origin=GET_PROPERTY - $this: GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.ArrayMapImpl.Companion PROPERTY name:size visibility:public modality:OPEN [var] overridden: public abstract size: kotlin.Int @@ -423,6 +85,241 @@ FILE fqName: fileName:/ArrayMap.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:size type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.' type=.ArrayMapImpl.ArrayMapImpl> origin=null value: GET_VAR ': kotlin.Int declared in .ArrayMapImpl.' type=kotlin.Int origin=null + CLASS CLASS name:Entry modality:FINAL visibility:public [data] superTypes:[kotlin.collections.Map.Entry.ArrayMapImpl.Entry>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:key visibility:public modality:OPEN [val] + overridden: + public abstract key: K of kotlin.collections.Map.Entry + FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'key: kotlin.Int declared in .ArrayMapImpl.Entry.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:key visibility:public modality:OPEN [val] + overridden: + public abstract fun (): K of kotlin.collections.Map.Entry declared in kotlin.collections.Map.Entry + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .ArrayMapImpl.Entry' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + PROPERTY name:value visibility:public modality:OPEN [val] + overridden: + public abstract value: V of kotlin.collections.Map.Entry + FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry.' type=T of .ArrayMapImpl.Entry origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:T of .ArrayMapImpl.Entry + correspondingProperty: PROPERTY name:value visibility:public modality:OPEN [val] + overridden: + public abstract fun (): V of kotlin.collections.Map.Entry declared in kotlin.collections.Map.Entry + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + CONSTRUCTOR visibility:public <> (key:kotlin.Int, value:T of .ArrayMapImpl.Entry) returnType:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> [primary] + VALUE_PARAMETER name:key index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:T of .ArrayMapImpl.Entry + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Entry modality:FINAL visibility:public [data] superTypes:[kotlin.collections.Map.Entry.ArrayMapImpl.Entry>]' + FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .ArrayMapImpl.Entry' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.component1' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:component2 visibility:public modality:FINAL <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:T of .ArrayMapImpl.Entry [operator] + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component2 (): T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.component2' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>, key:kotlin.Int, value:T of .ArrayMapImpl.Entry) returnType:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + VALUE_PARAMETER name:key index:0 type:kotlin.Int + EXPRESSION_BODY + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.copy' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + VALUE_PARAMETER name:value index:1 type:T of .ArrayMapImpl.Entry + EXPRESSION_BODY + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.copy' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun copy (key: kotlin.Int, value: T of .ArrayMapImpl.Entry): .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry' + CONSTRUCTOR_CALL 'public constructor (key: kotlin.Int, value: T of .ArrayMapImpl.Entry) declared in .ArrayMapImpl.Entry' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + : T of .ArrayMapImpl.Entry + key: GET_VAR 'key: kotlin.Int declared in .ArrayMapImpl.Entry.copy' type=kotlin.Int origin=null + value: GET_VAR 'value: T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry.copy' type=T of .ArrayMapImpl.Entry origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.Map.Entry + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + BLOCK_BODY + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ + arg0: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + arg1: GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + CONST Boolean type=kotlin.Boolean value=true + WHEN type=kotlin.Unit origin=null + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + CONST Boolean type=kotlin.Boolean value=false + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> [val] + TYPE_OP type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=CAST typeOperand=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean 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:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR 'val tmp_0: .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + CONST Boolean type=kotlin.Boolean value=false + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean 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:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR 'val tmp_0: .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + CONST Boolean type=kotlin.Boolean value=false + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.collections.Map.Entry + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.hashCode' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + SET_VAR 'var result: kotlin.Int declared in .ArrayMapImpl.Entry.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .ArrayMapImpl.Entry.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.hashCode' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.hashCode' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .ArrayMapImpl.Entry' + GET_VAR 'var result: kotlin.Int declared in .ArrayMapImpl.Entry.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.collections.Map.Entry + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .ArrayMapImpl.Entry' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Entry(" + CONST String type=kotlin.String value="key=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.toString' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="value=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null + receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.toString' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null + CONST String type=kotlin.String value=")" + CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.Companion + CONSTRUCTOR visibility:private <> () returnType:.ArrayMapImpl.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] 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 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 + PROPERTY name:DEFAULT_SIZE visibility:private modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:DEFAULT_SIZE type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=20 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ArrayMapImpl.Companion) returnType:kotlin.Int + correspondingProperty: PROPERTY name:DEFAULT_SIZE visibility:private modality:FINAL [const,val] + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Int declared in .ArrayMapImpl.Companion' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:DEFAULT_SIZE type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Companion declared in .ArrayMapImpl.Companion.' type=.ArrayMapImpl.Companion origin=null + PROPERTY name:INCREASE_K visibility:private modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:INCREASE_K type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=2 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ArrayMapImpl.Companion) returnType:kotlin.Int + correspondingProperty: PROPERTY name:INCREASE_K visibility:private modality:FINAL [const,val] + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Int declared in .ArrayMapImpl.Companion' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:INCREASE_K type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .ArrayMapImpl.Companion declared in .ArrayMapImpl.Companion.' type=.ArrayMapImpl.Companion origin=null + CONSTRUCTOR visibility:private <> (data:kotlin.Array) returnType:.ArrayMapImpl.ArrayMapImpl> [primary] + VALUE_PARAMETER name:data index:0 type:kotlin.Array + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .ArrayMap' + : T of .ArrayMapImpl + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ArrayMapImpl modality:FINAL visibility:internal superTypes:[.ArrayMap.ArrayMapImpl>]' + CONSTRUCTOR visibility:public <> () returnType:.ArrayMapImpl.ArrayMapImpl> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (data: kotlin.Array) declared in .ArrayMapImpl' + : T of .ArrayMapImpl + data: CALL 'public final fun arrayOfNulls (size: kotlin.Int): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Any + size: CALL 'private final fun (): kotlin.Int declared in .ArrayMapImpl.Companion' type=kotlin.Int origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.ArrayMapImpl.Companion + 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 .ArrayMap + $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 .ArrayMap + $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 .ArrayMap + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:copy visibility:public modality:OPEN <> ($this:.ArrayMapImpl.ArrayMapImpl>) returnType:.ArrayMap.ArrayMapImpl> + overridden: + public abstract fun copy (): .ArrayMap.ArrayMap> declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun copy (): .ArrayMap.ArrayMapImpl> declared in .ArrayMapImpl' + CONSTRUCTOR_CALL 'private constructor (data: kotlin.Array) declared in .ArrayMapImpl' type=.ArrayMapImpl.ArrayMapImpl> origin=null + : T of .ArrayMapImpl + data: CALL 'public final fun copyOf (): kotlin.Array declared in kotlin.collections' type=kotlin.Array origin=null + : kotlin.Any? + $receiver: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY + $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.copy' type=.ArrayMapImpl.ArrayMapImpl> origin=null FUN name:ensureCapacity visibility:private modality:FINAL <> ($this:.ArrayMapImpl.ArrayMapImpl>, index:kotlin.Int) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> VALUE_PARAMETER name:index index:0 type:kotlin.Int @@ -447,43 +344,35 @@ FILE fqName: fileName:/ArrayMap.kt $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.ensureCapacity' type=.ArrayMapImpl.ArrayMapImpl> origin=null other: CALL 'private final fun (): kotlin.Int declared in .ArrayMapImpl.Companion' type=kotlin.Int origin=GET_PROPERTY $this: GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.ArrayMapImpl.Companion - FUN name:set visibility:public modality:OPEN <> ($this:.ArrayMapImpl.ArrayMapImpl>, index:kotlin.Int, value:T of .ArrayMapImpl) returnType:kotlin.Unit [operator] - overridden: - public abstract fun set (index: kotlin.Int, value: T of .ArrayMap): kotlin.Unit declared in .ArrayMap + FUN name:entries visibility:public modality:FINAL <> ($this:.ArrayMapImpl.ArrayMapImpl>) returnType:kotlin.collections.List<.ArrayMapImpl.Entry.ArrayMapImpl>> $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:T of .ArrayMapImpl BLOCK_BODY - CALL 'private final fun ensureCapacity (index: kotlin.Int): kotlin.Unit declared in .ArrayMapImpl' type=kotlin.Unit origin=null - $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null - index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null - WHEN type=kotlin.Unit origin=IF - 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: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Any? origin=GET_ARRAY_ELEMENT - $this: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY - $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null - index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Int origin=null - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.ArrayMapImpl.ArrayMapImpl> [val] - GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null - BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] - CALL 'public open fun (): kotlin.Int declared in .ArrayMapImpl' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_0: .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null - CALL 'private open fun (: kotlin.Int): kotlin.Unit declared in .ArrayMapImpl' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_0: .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null - : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_1: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null - GET_VAR 'val tmp_1: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null - CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=EQ - $this: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY - $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null - index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null - value: GET_VAR 'value: T of .ArrayMapImpl declared in .ArrayMapImpl.set' type=T of .ArrayMapImpl origin=null + RETURN type=kotlin.Nothing from='public final fun entries (): kotlin.collections.List<.ArrayMapImpl.Entry.ArrayMapImpl>> declared in .ArrayMapImpl' + CALL 'public final fun mapIndexedNotNull (transform: kotlin.Function2<@[ParameterName(name = "index")] kotlin.Int, T of kotlin.collections.mapIndexedNotNull, R of kotlin.collections.mapIndexedNotNull?>): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.ArrayMapImpl.Entry.ArrayMapImpl>> origin=null + : kotlin.Any? + : .ArrayMapImpl.Entry.ArrayMapImpl> + $receiver: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY + $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.entries' type=.ArrayMapImpl.ArrayMapImpl> origin=null + transform: FUN_EXPR type=kotlin.Function2<@[ParameterName(name = "index")] kotlin.Int, kotlin.Any?, .ArrayMapImpl.Entry.ArrayMapImpl>?> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (index:kotlin.Int, value:kotlin.Any?) returnType:.ArrayMapImpl.Entry.ArrayMapImpl>? + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (index: kotlin.Int, value: kotlin.Any?): .ArrayMapImpl.Entry.ArrayMapImpl>? declared in .ArrayMapImpl.entries' + WHEN type=.ArrayMapImpl.Entry.ArrayMapImpl>? origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean 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_VAR 'value: kotlin.Any? declared in .ArrayMapImpl.entries.' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONSTRUCTOR_CALL 'public constructor (key: kotlin.Int, value: T of .ArrayMapImpl.Entry) declared in .ArrayMapImpl.Entry' type=.ArrayMapImpl.Entry.ArrayMapImpl> origin=null + : T of .ArrayMapImpl + key: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.entries.' type=kotlin.Int origin=null + value: TYPE_OP type=T of .ArrayMapImpl origin=CAST typeOperand=T of .ArrayMapImpl + GET_VAR 'value: kotlin.Any? declared in .ArrayMapImpl.entries.' type=kotlin.Any? origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Null type=kotlin.Nothing? value=null FUN name:get visibility:public modality:OPEN <> ($this:.ArrayMapImpl.ArrayMapImpl>, index:kotlin.Int) returnType:T of .ArrayMapImpl? [operator] overridden: public abstract fun get (index: kotlin.Int): T of .ArrayMap? declared in .ArrayMap @@ -497,18 +386,6 @@ FILE fqName: fileName:/ArrayMap.kt $receiver: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.get' type=.ArrayMapImpl.ArrayMapImpl> origin=null index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.get' type=kotlin.Int origin=null - FUN name:copy visibility:public modality:OPEN <> ($this:.ArrayMapImpl.ArrayMapImpl>) returnType:.ArrayMap.ArrayMapImpl> - overridden: - public abstract fun copy (): .ArrayMap.ArrayMap> declared in .ArrayMap - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun copy (): .ArrayMap.ArrayMapImpl> declared in .ArrayMapImpl' - CONSTRUCTOR_CALL 'private constructor (data: kotlin.Array) declared in .ArrayMapImpl' type=.ArrayMapImpl.ArrayMapImpl> origin=null - : T of .ArrayMapImpl - data: CALL 'public final fun copyOf (): kotlin.Array declared in kotlin.collections' type=kotlin.Array origin=null - : kotlin.Any? - $receiver: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY - $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.copy' type=.ArrayMapImpl.ArrayMapImpl> origin=null FUN name:iterator visibility:public modality:OPEN <> ($this:.ArrayMapImpl.ArrayMapImpl>) returnType:kotlin.collections.Iterator.ArrayMapImpl> [operator] overridden: public abstract fun iterator (): kotlin.collections.Iterator.ArrayMap> declared in .ArrayMap @@ -518,11 +395,6 @@ FILE fqName: fileName:/ArrayMap.kt BLOCK type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.AbstractIterator.ArrayMapImpl>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.iterator..ArrayMapImpl> - CONSTRUCTOR visibility:public <> () returnType:.ArrayMapImpl.iterator..ArrayMapImpl> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.collections.AbstractIterator' - : T of .ArrayMapImpl - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.AbstractIterator.ArrayMapImpl>]' PROPERTY name:index visibility:private modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:index type:kotlin.Int visibility:private EXPRESSION_BODY @@ -542,6 +414,41 @@ FILE fqName: fileName:/ArrayMap.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:index type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .ArrayMapImpl.iterator..ArrayMapImpl> declared in .ArrayMapImpl.iterator..' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=null value: GET_VAR ': kotlin.Int declared in .ArrayMapImpl.iterator..' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.ArrayMapImpl.iterator..ArrayMapImpl> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.collections.AbstractIterator' + : T of .ArrayMapImpl + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.AbstractIterator.ArrayMapImpl>]' + FUN FAKE_OVERRIDE name:done visibility:protected modality:FINAL <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>) returnType:kotlin.Unit [fake_override] + overridden: + protected final fun done (): kotlin.Unit declared in kotlin.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> + 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.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hasNext visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun hasNext (): kotlin.Boolean declared in kotlin.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> + 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.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:next visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>) returnType:T of .ArrayMapImpl [fake_override,operator] + overridden: + public open fun next (): T of kotlin.collections.AbstractIterator declared in kotlin.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> + FUN FAKE_OVERRIDE name:setNext visibility:protected modality:FINAL <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>, value:T of .ArrayMapImpl) returnType:kotlin.Unit [fake_override] + overridden: + protected final fun setNext (value: T of kotlin.collections.AbstractIterator): kotlin.Unit declared in kotlin.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> + VALUE_PARAMETER name:value index:0 type:T of .ArrayMapImpl + 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.collections.AbstractIterator + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:computeNext visibility:protected modality:OPEN <> ($this:.ArrayMapImpl.iterator..ArrayMapImpl>) returnType:kotlin.Unit overridden: protected abstract fun computeNext (): kotlin.Unit declared in kotlin.collections.AbstractIterator @@ -552,17 +459,17 @@ FILE fqName: fileName:/ArrayMap.kt body: COMPOSITE type=kotlin.Unit origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.ArrayMapImpl.iterator..ArrayMapImpl> [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.ArrayMapImpl.iterator..ArrayMapImpl> [val] GET_VAR ': .ArrayMapImpl.iterator..ArrayMapImpl> declared in .ArrayMapImpl.iterator..computeNext' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=null BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] CALL 'private final fun (): kotlin.Int declared in .ArrayMapImpl.iterator.' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_2: .ArrayMapImpl.iterator..ArrayMapImpl> declared in .ArrayMapImpl.iterator..computeNext' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=null + $this: GET_VAR 'val tmp_1: .ArrayMapImpl.iterator..ArrayMapImpl> declared in .ArrayMapImpl.iterator..computeNext' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=null CALL 'private final fun (: kotlin.Int): kotlin.Unit declared in .ArrayMapImpl.iterator.' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_2: .ArrayMapImpl.iterator..ArrayMapImpl> declared in .ArrayMapImpl.iterator..computeNext' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=null + $this: GET_VAR 'val tmp_1: .ArrayMapImpl.iterator..ArrayMapImpl> declared in .ArrayMapImpl.iterator..computeNext' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=null : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_3: kotlin.Int declared in .ArrayMapImpl.iterator..computeNext' type=kotlin.Int origin=null - GET_VAR 'val tmp_3: kotlin.Int declared in .ArrayMapImpl.iterator..computeNext' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_2: kotlin.Int declared in .ArrayMapImpl.iterator..computeNext' type=kotlin.Int origin=null + GET_VAR 'val tmp_2: kotlin.Int declared in .ArrayMapImpl.iterator..computeNext' type=kotlin.Int origin=null condition: WHEN type=kotlin.Boolean origin=ANDAND BRANCH if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT @@ -603,36 +510,6 @@ FILE fqName: fileName:/ArrayMap.kt $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.iterator' type=.ArrayMapImpl.ArrayMapImpl> origin=null index: CALL 'private final fun (): kotlin.Int declared in .ArrayMapImpl.iterator.' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .ArrayMapImpl.iterator..ArrayMapImpl> declared in .ArrayMapImpl.iterator..computeNext' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=null - FUN FAKE_OVERRIDE name:done visibility:protected modality:FINAL <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>) returnType:kotlin.Unit [fake_override] - overridden: - protected final fun done (): kotlin.Unit declared in kotlin.collections.AbstractIterator - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> - 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.collections.AbstractIterator - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hasNext visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun hasNext (): kotlin.Boolean declared in kotlin.collections.AbstractIterator - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> - 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.collections.AbstractIterator - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:next visibility:public modality:OPEN <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>) returnType:T of .ArrayMapImpl [fake_override,operator] - overridden: - public open fun next (): T of kotlin.collections.AbstractIterator declared in kotlin.collections.AbstractIterator - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> - FUN FAKE_OVERRIDE name:setNext visibility:protected modality:FINAL <> ($this:kotlin.collections.AbstractIterator.ArrayMapImpl>, value:T of .ArrayMapImpl) returnType:kotlin.Unit [fake_override] - overridden: - protected final fun setNext (value: T of kotlin.collections.AbstractIterator): kotlin.Unit declared in kotlin.collections.AbstractIterator - $this: VALUE_PARAMETER name: type:kotlin.collections.AbstractIterator.ArrayMapImpl> - VALUE_PARAMETER name:value index:0 type:T of .ArrayMapImpl - 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.collections.AbstractIterator - $this: VALUE_PARAMETER name: type:kotlin.Any CONSTRUCTOR_CALL 'public constructor () declared in .ArrayMapImpl.iterator.' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=OBJECT_LITERAL FUN name:remove visibility:public modality:FINAL <> ($this:.ArrayMapImpl.ArrayMapImpl>, index:kotlin.Int) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> @@ -650,206 +527,91 @@ FILE fqName: fileName:/ArrayMap.kt then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Int origin=null BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.ArrayMapImpl.ArrayMapImpl> [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.ArrayMapImpl.ArrayMapImpl> [val] GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.remove' type=.ArrayMapImpl.ArrayMapImpl> origin=null BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] CALL 'public open fun (): kotlin.Int declared in .ArrayMapImpl' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_4: .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.remove' type=.ArrayMapImpl.ArrayMapImpl> origin=null + $this: GET_VAR 'val tmp_3: .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.remove' type=.ArrayMapImpl.ArrayMapImpl> origin=null CALL 'private open fun (: kotlin.Int): kotlin.Unit declared in .ArrayMapImpl' type=kotlin.Unit origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_4: .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.remove' type=.ArrayMapImpl.ArrayMapImpl> origin=null + $this: GET_VAR 'val tmp_3: .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.remove' type=.ArrayMapImpl.ArrayMapImpl> origin=null : CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_5: kotlin.Int declared in .ArrayMapImpl.remove' type=kotlin.Int origin=null - GET_VAR 'val tmp_5: kotlin.Int declared in .ArrayMapImpl.remove' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_4: kotlin.Int declared in .ArrayMapImpl.remove' type=kotlin.Int origin=null + GET_VAR 'val tmp_4: kotlin.Int declared in .ArrayMapImpl.remove' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=EQ $this: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.remove' type=.ArrayMapImpl.ArrayMapImpl> origin=null index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.remove' type=kotlin.Int origin=null value: CONST Null type=kotlin.Nothing? value=null - FUN name:entries visibility:public modality:FINAL <> ($this:.ArrayMapImpl.ArrayMapImpl>) returnType:kotlin.collections.List<.ArrayMapImpl.Entry.ArrayMapImpl>> + FUN name:set visibility:public modality:OPEN <> ($this:.ArrayMapImpl.ArrayMapImpl>, index:kotlin.Int, value:T of .ArrayMapImpl) returnType:kotlin.Unit [operator] + overridden: + public abstract fun set (index: kotlin.Int, value: T of .ArrayMap): kotlin.Unit declared in .ArrayMap $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:T of .ArrayMapImpl BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun entries (): kotlin.collections.List<.ArrayMapImpl.Entry.ArrayMapImpl>> declared in .ArrayMapImpl' - CALL 'public final fun mapIndexedNotNull (transform: kotlin.Function2<@[ParameterName(name = "index")] kotlin.Int, T of kotlin.collections.mapIndexedNotNull, R of kotlin.collections.mapIndexedNotNull?>): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.ArrayMapImpl.Entry.ArrayMapImpl>> origin=null - : kotlin.Any? - : .ArrayMapImpl.Entry.ArrayMapImpl> - $receiver: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY - $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.entries' type=.ArrayMapImpl.ArrayMapImpl> origin=null - transform: FUN_EXPR type=kotlin.Function2<@[ParameterName(name = "index")] kotlin.Int, kotlin.Any?, .ArrayMapImpl.Entry.ArrayMapImpl>?> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (index:kotlin.Int, value:kotlin.Any?) returnType:.ArrayMapImpl.Entry.ArrayMapImpl>? - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (index: kotlin.Int, value: kotlin.Any?): .ArrayMapImpl.Entry.ArrayMapImpl>? declared in .ArrayMapImpl.entries' - WHEN type=.ArrayMapImpl.Entry.ArrayMapImpl>? origin=IF - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean 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_VAR 'value: kotlin.Any? declared in .ArrayMapImpl.entries.' type=kotlin.Any? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONSTRUCTOR_CALL 'public constructor (key: kotlin.Int, value: T of .ArrayMapImpl.Entry) declared in .ArrayMapImpl.Entry' type=.ArrayMapImpl.Entry.ArrayMapImpl> origin=null - : T of .ArrayMapImpl - key: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.entries.' type=kotlin.Int origin=null - value: TYPE_OP type=T of .ArrayMapImpl origin=CAST typeOperand=T of .ArrayMapImpl - GET_VAR 'value: kotlin.Any? declared in .ArrayMapImpl.entries.' type=kotlin.Any? origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Null type=kotlin.Nothing? value=null - CLASS CLASS name:Entry modality:FINAL visibility:public [data] superTypes:[kotlin.collections.Map.Entry.ArrayMapImpl.Entry>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (key:kotlin.Int, value:T of .ArrayMapImpl.Entry) returnType:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> [primary] - VALUE_PARAMETER name:key index:0 type:kotlin.Int - VALUE_PARAMETER name:value index:1 type:T of .ArrayMapImpl.Entry + CALL 'private final fun ensureCapacity (index: kotlin.Int): kotlin.Unit declared in .ArrayMapImpl' type=kotlin.Unit origin=null + $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null + index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null + WHEN type=kotlin.Unit origin=IF + 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: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Any? origin=GET_ARRAY_ELEMENT + $this: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY + $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null + index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Int origin=null + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:.ArrayMapImpl.ArrayMapImpl> [val] + GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] + CALL 'public open fun (): kotlin.Int declared in .ArrayMapImpl' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_5: .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null + CALL 'private open fun (: kotlin.Int): kotlin.Unit declared in .ArrayMapImpl' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_5: .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null + : CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_6: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null + GET_VAR 'val tmp_6: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null + CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=EQ + $this: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY + $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.set' type=.ArrayMapImpl.ArrayMapImpl> origin=null + index: GET_VAR 'index: kotlin.Int declared in .ArrayMapImpl.set' type=kotlin.Int origin=null + value: GET_VAR 'value: T of .ArrayMapImpl declared in .ArrayMapImpl.set' type=T of .ArrayMapImpl origin=null + CLASS CLASS name:OneElementArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap.OneElementArrayMap>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OneElementArrayMap.OneElementArrayMap> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:T of .OneElementArrayMap visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: T of .OneElementArrayMap declared in .OneElementArrayMap.' type=T of .OneElementArrayMap origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:T of .OneElementArrayMap + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Entry modality:FINAL visibility:public [data] superTypes:[kotlin.collections.Map.Entry.ArrayMapImpl.Entry>]' - PROPERTY name:key visibility:public modality:OPEN [val] - overridden: - public abstract key: K of kotlin.collections.Map.Entry - FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - GET_VAR 'key: kotlin.Int declared in .ArrayMapImpl.Entry.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:key visibility:public modality:OPEN [val] - overridden: - public abstract fun (): K of kotlin.collections.Map.Entry declared in kotlin.collections.Map.Entry - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .ArrayMapImpl.Entry' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - PROPERTY name:value visibility:public modality:OPEN [val] - overridden: - public abstract value: V of kotlin.collections.Map.Entry - FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry.' type=T of .ArrayMapImpl.Entry origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:T of .ArrayMapImpl.Entry - correspondingProperty: PROPERTY name:value visibility:public modality:OPEN [val] - overridden: - public abstract fun (): V of kotlin.collections.Map.Entry declared in kotlin.collections.Map.Entry - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + RETURN type=kotlin.Nothing from='public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .OneElementArrayMap visibility:private [final]' type=T of .OneElementArrayMap origin=null + receiver: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.' type=.OneElementArrayMap.OneElementArrayMap> origin=null + PROPERTY name:index visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:index type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'index: kotlin.Int declared in .OneElementArrayMap.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:index visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .ArrayMapImpl.Entry' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.component1' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:component2 visibility:public modality:FINAL <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:T of .ArrayMapImpl.Entry [operator] - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component2 (): T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.component2' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>, key:kotlin.Int, value:T of .ArrayMapImpl.Entry) returnType:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - VALUE_PARAMETER name:key index:0 type:kotlin.Int - EXPRESSION_BODY - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.copy' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - VALUE_PARAMETER name:value index:1 type:T of .ArrayMapImpl.Entry - EXPRESSION_BODY - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.copy' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun copy (key: kotlin.Int, value: T of .ArrayMapImpl.Entry): .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry' - CONSTRUCTOR_CALL 'public constructor (key: kotlin.Int, value: T of .ArrayMapImpl.Entry) declared in .ArrayMapImpl.Entry' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - : T of .ArrayMapImpl.Entry - key: GET_VAR 'key: kotlin.Int declared in .ArrayMapImpl.Entry.copy' type=kotlin.Int origin=null - value: GET_VAR 'value: T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry.copy' type=T of .ArrayMapImpl.Entry origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.collections.Map.Entry - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .ArrayMapImpl.Entry' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Entry(" - CONST String type=kotlin.String value="key=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.toString' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="value=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.toString' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.collections.Map.Entry - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.hashCode' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - SET_VAR 'var result: kotlin.Int declared in .ArrayMapImpl.Entry.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .ArrayMapImpl.Entry.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.hashCode' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.hashCode' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .ArrayMapImpl.Entry' - GET_VAR 'var result: kotlin.Int declared in .ArrayMapImpl.Entry.hashCode' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.Map.Entry - $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - BLOCK_BODY - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ - arg0: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - arg1: GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' - CONST Boolean type=kotlin.Boolean value=true - WHEN type=kotlin.Unit origin=null - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' - CONST Boolean type=kotlin.Boolean value=false - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> [val] - TYPE_OP type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=CAST typeOperand=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean 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:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR 'val tmp_6: .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' - CONST Boolean type=kotlin.Boolean value=false - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean 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:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null - receiver: GET_VAR 'val tmp_6: .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' - CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' - CONST Boolean type=kotlin.Boolean value=true + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .OneElementArrayMap' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:index type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.' type=.OneElementArrayMap.OneElementArrayMap> origin=null + CONSTRUCTOR visibility:public <> (value:T of .OneElementArrayMap, index:kotlin.Int) returnType:.OneElementArrayMap.OneElementArrayMap> [primary] + VALUE_PARAMETER name:value index:0 type:T of .OneElementArrayMap + VALUE_PARAMETER name:index index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .ArrayMap' + : T of .OneElementArrayMap + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OneElementArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap.OneElementArrayMap>]' 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 .ArrayMap @@ -863,3 +625,241 @@ FILE fqName: fileName:/ArrayMap.kt overridden: public open fun toString (): kotlin.String declared in .ArrayMap $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:copy visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:.ArrayMap.OneElementArrayMap> + overridden: + public abstract fun copy (): .ArrayMap.ArrayMap> declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun copy (): .ArrayMap.OneElementArrayMap> declared in .OneElementArrayMap' + CONSTRUCTOR_CALL 'public constructor (value: T of .OneElementArrayMap, index: kotlin.Int) declared in .OneElementArrayMap' type=.OneElementArrayMap.OneElementArrayMap> origin=null + : T of .OneElementArrayMap + value: CALL 'public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' type=T of .OneElementArrayMap origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.copy' type=.OneElementArrayMap.OneElementArrayMap> origin=null + index: CALL 'public final fun (): kotlin.Int declared in .OneElementArrayMap' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.copy' type=.OneElementArrayMap.OneElementArrayMap> origin=null + FUN name:get visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>, index:kotlin.Int) returnType:T of .OneElementArrayMap? [operator] + overridden: + public abstract fun get (index: kotlin.Int): T of .ArrayMap? declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun get (index: kotlin.Int): T of .OneElementArrayMap? declared in .OneElementArrayMap' + WHEN type=T of .OneElementArrayMap? origin=IF + 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 'index: kotlin.Int declared in .OneElementArrayMap.get' type=kotlin.Int origin=null + arg1: CALL 'public final fun (): kotlin.Int declared in .OneElementArrayMap' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.get' type=.OneElementArrayMap.OneElementArrayMap> origin=null + then: CALL 'public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' type=T of .OneElementArrayMap origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.get' type=.OneElementArrayMap.OneElementArrayMap> origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Null type=kotlin.Nothing? value=null + FUN name:iterator visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:kotlin.collections.Iterator.OneElementArrayMap> [operator] + overridden: + public abstract fun iterator (): kotlin.collections.Iterator.ArrayMap> declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator.OneElementArrayMap> declared in .OneElementArrayMap' + BLOCK type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator.OneElementArrayMap>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> + PROPERTY name:notVisited visibility:private modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:notVisited type:kotlin.Boolean visibility:private + EXPRESSION_BODY + CONST Boolean type=kotlin.Boolean value=true + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>) returnType:kotlin.Boolean + correspondingProperty: PROPERTY name:notVisited visibility:private modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:notVisited type:kotlin.Boolean visibility:private' type=kotlin.Boolean origin=null + receiver: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>, :kotlin.Boolean) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:notVisited visibility:private modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> + VALUE_PARAMETER name: index:0 type:kotlin.Boolean + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:notVisited type:kotlin.Boolean visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null + value: GET_VAR ': kotlin.Boolean declared in .OneElementArrayMap.iterator..' type=kotlin.Boolean origin=null + CONSTRUCTOR visibility:public <> () returnType:.OneElementArrayMap.iterator..OneElementArrayMap> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator.OneElementArrayMap>]' + 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.collections.Iterator + $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.collections.Iterator + $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.collections.Iterator + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:hasNext visibility:public modality:OPEN <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>) returnType:kotlin.Boolean [operator] + overridden: + public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hasNext (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' + CALL 'private final fun (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' type=kotlin.Boolean origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..hasNext' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null + FUN name:next visibility:public modality:OPEN <> ($this:.OneElementArrayMap.iterator..OneElementArrayMap>) returnType:T of .OneElementArrayMap [operator] + overridden: + public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'private final fun (): kotlin.Boolean declared in .OneElementArrayMap.iterator.' type=kotlin.Boolean origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..next' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null + then: BLOCK type=kotlin.Unit origin=null + CALL 'private final fun (: kotlin.Boolean): kotlin.Unit declared in .OneElementArrayMap.iterator.' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .OneElementArrayMap.iterator..OneElementArrayMap> declared in .OneElementArrayMap.iterator..next' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=null + : CONST Boolean type=kotlin.Boolean value=false + RETURN type=kotlin.Nothing from='public open fun next (): T of .OneElementArrayMap declared in .OneElementArrayMap.iterator.' + CALL 'public final fun (): T of .OneElementArrayMap declared in .OneElementArrayMap' type=T of .OneElementArrayMap origin=GET_PROPERTY + $this: GET_VAR ': .OneElementArrayMap.OneElementArrayMap> declared in .OneElementArrayMap.iterator' type=.OneElementArrayMap.OneElementArrayMap> origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: BLOCK type=kotlin.Unit origin=null + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor () declared in java.util.NoSuchElementException' type=java.util.NoSuchElementException origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .OneElementArrayMap.iterator.' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=OBJECT_LITERAL + FUN name:set visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>, index:kotlin.Int, value:T of .OneElementArrayMap) returnType:kotlin.Unit [operator] + overridden: + public abstract fun set (index: kotlin.Int, value: T of .ArrayMap): kotlin.Unit declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:T of .OneElementArrayMap + BLOCK_BODY + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor () declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null + PROPERTY name:size visibility:public modality:OPEN [val] + overridden: + public abstract size: kotlin.Int + FUN name: visibility:public modality:OPEN <> ($this:.OneElementArrayMap.OneElementArrayMap>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.OneElementArrayMap.OneElementArrayMap> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .OneElementArrayMap' + CONST Int type=kotlin.Int value=1 + CLASS OBJECT name:EmptyArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.EmptyArrayMap + CONSTRUCTOR visibility:private <> () returnType:.EmptyArrayMap [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .ArrayMap' + : kotlin.Nothing + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:EmptyArrayMap modality:FINAL visibility:internal superTypes:[.ArrayMap]' + 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 .ArrayMap + $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 .ArrayMap + $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 .ArrayMap + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:copy visibility:public modality:OPEN <> ($this:.EmptyArrayMap) returnType:.ArrayMap + overridden: + public abstract fun copy (): .ArrayMap.ArrayMap> declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.EmptyArrayMap + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun copy (): .ArrayMap declared in .EmptyArrayMap' + GET_VAR ': .EmptyArrayMap declared in .EmptyArrayMap.copy' type=.EmptyArrayMap origin=null + FUN name:get visibility:public modality:OPEN <> ($this:.EmptyArrayMap, index:kotlin.Int) returnType:kotlin.Nothing? [operator] + overridden: + public abstract fun get (index: kotlin.Int): T of .ArrayMap? declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.EmptyArrayMap + VALUE_PARAMETER name:index index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun get (index: kotlin.Int): kotlin.Nothing? declared in .EmptyArrayMap' + CONST Null type=kotlin.Nothing? value=null + FUN name:iterator visibility:public modality:OPEN <> ($this:.EmptyArrayMap) returnType:kotlin.collections.Iterator [operator] + overridden: + public abstract fun iterator (): kotlin.collections.Iterator.ArrayMap> declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.EmptyArrayMap + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator declared in .EmptyArrayMap' + BLOCK type=.EmptyArrayMap.iterator. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.EmptyArrayMap.iterator. + CONSTRUCTOR visibility:public <> () returnType:.EmptyArrayMap.iterator. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator]' + 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.collections.Iterator + $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.collections.Iterator + $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.collections.Iterator + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:hasNext visibility:public modality:OPEN <> ($this:.EmptyArrayMap.iterator.) returnType:kotlin.Boolean [operator] + overridden: + public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator + $this: VALUE_PARAMETER name: type:.EmptyArrayMap.iterator. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hasNext (): kotlin.Boolean declared in .EmptyArrayMap.iterator.' + CONST Boolean type=kotlin.Boolean value=false + FUN name:next visibility:public modality:OPEN <> ($this:.EmptyArrayMap.iterator.) returnType:kotlin.Nothing [operator] + overridden: + public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator + $this: VALUE_PARAMETER name: type:.EmptyArrayMap.iterator. + BLOCK_BODY + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor () declared in java.util.NoSuchElementException' type=java.util.NoSuchElementException origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .EmptyArrayMap.iterator.' type=.EmptyArrayMap.iterator. origin=OBJECT_LITERAL + FUN name:set visibility:public modality:OPEN <> ($this:.EmptyArrayMap, index:kotlin.Int, value:kotlin.Nothing) returnType:kotlin.Unit [operator] + overridden: + public abstract fun set (index: kotlin.Int, value: T of .ArrayMap): kotlin.Unit declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.EmptyArrayMap + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Nothing + BLOCK_BODY + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor () declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null + PROPERTY name:size visibility:public modality:OPEN [val] + overridden: + public abstract size: kotlin.Int + FUN name: visibility:public modality:OPEN <> ($this:.EmptyArrayMap) returnType:kotlin.Int + correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in .ArrayMap + $this: VALUE_PARAMETER name: type:.EmptyArrayMap + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .EmptyArrayMap' + CONST Int type=kotlin.Int value=0 + FUN name:isEmpty visibility:public modality:FINAL <> ($receiver:.ArrayMap<*>) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:.ArrayMap<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun isEmpty (): kotlin.Boolean declared in ' + CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: CALL 'public abstract fun (): kotlin.Int declared in .ArrayMap' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .ArrayMap<*> declared in .isEmpty' type=.ArrayMap<*> origin=null + arg1: CONST Int type=kotlin.Int value=0 + FUN name:isNotEmpty visibility:public modality:FINAL <> ($receiver:.ArrayMap<*>) returnType:kotlin.Boolean + $receiver: VALUE_PARAMETER name: type:.ArrayMap<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun isNotEmpty (): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean 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 abstract fun (): kotlin.Int declared in .ArrayMap' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .ArrayMap<*> declared in .isNotEmpty' type=.ArrayMap<*> origin=null + arg1: CONST Int type=kotlin.Int value=0 diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.kt.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.kt.txt index 1074389d65b..250488a8dce 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.kt.txt @@ -5,159 +5,87 @@ sealed class ArrayMap : Iterable { } - abstract val size: Int - abstract get - - abstract operator fun set(index: Int, value: T) + abstract fun copy(): ArrayMap abstract operator fun get(index: Int): T? - abstract fun copy(): ArrayMap + abstract operator fun set(index: Int, value: T) -} - -fun ArrayMap<*>.isEmpty(): Boolean { - return EQEQ(arg0 = .(), arg1 = 0) -} - -fun ArrayMap<*>.isNotEmpty(): Boolean { - return EQEQ(arg0 = .(), arg1 = 0).not() -} - -internal object EmptyArrayMap : ArrayMap { - private constructor() /* primary */ { - super/*ArrayMap*/() - /* () */ - - } - - override val size: Int - override get(): Int { - return 0 - } - - override operator fun set(index: Int, value: Nothing) { - throw IllegalStateException() - } - - override operator fun get(index: Int): Nothing? { - return null - } - - override fun copy(): ArrayMap { - return - } - - override operator fun iterator(): Iterator { - return { // BLOCK - local class : Iterator { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override operator fun hasNext(): Boolean { - return false - } - - override operator fun next(): Nothing { - throw NoSuchElementException() - } - - } - - () - } - } - -} - -internal class OneElementArrayMap : ArrayMap { - constructor(value: T, index: Int) /* primary */ { - super/*ArrayMap*/() - /* () */ - - } - - val value: T - field = value - get - - val index: Int - field = index - get - - override val size: Int - override get(): Int { - return 1 - } - - override operator fun set(index: Int, value: T) { - throw IllegalStateException() - } - - override operator fun get(index: Int): T? { - return when { - EQEQ(arg0 = index, arg1 = .()) -> .() - else -> null - } - } - - override fun copy(): ArrayMap { - return OneElementArrayMap(value = .(), index = .()) - } - - override operator fun iterator(): Iterator { - return { // BLOCK - local class : Iterator { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - private var notVisited: Boolean - field = true - private get - private set - - override operator fun hasNext(): Boolean { - return .() - } - - override operator fun next(): T { - when { - .() -> { // BLOCK - .( = false) - return .() - } - else -> { // BLOCK - throw NoSuchElementException() - } - } - } - - } - - () - } - } + abstract val size: Int + abstract get } internal class ArrayMapImpl : ArrayMap { - private constructor(data: Array) /* primary */ { - super/*ArrayMap*/() - /* () */ - - } - private var data: Array field = data private get private set + override var size: Int + field = 0 + override get + private open set + + data class Entry : Entry { + override val key: Int + field = key + override get + + override val value: T + field = value + override get + + constructor(key: Int, value: T) /* primary */ { + super/*Any*/() + /* () */ + + } + + operator fun component1(): Int { + return .#key + } + + operator fun component2(): T { + return .#value + } + + fun copy(key: Int = .#key, value: T = .#value): Entry { + return Entry(key = key, value = value) + } + + override operator fun equals(other: Any?): Boolean { + when { + EQEQEQ(arg0 = , arg1 = other) -> return true + } + when { + other !is Entry -> return false + } + val tmp_0: Entry = other as Entry + when { + EQEQ(arg0 = .#key, arg1 = tmp_0.#key).not() -> return false + } + when { + EQEQ(arg0 = .#value, arg1 = tmp_0.#value).not() -> return false + } + return true + } + + override fun hashCode(): Int { + var result: Int = .#key.hashCode() + result = result.times(other = 31).plus(other = when { + EQEQ(arg0 = .#value, arg1 = null) -> 0 + else -> .#value.hashCode() + }) + return result + } + + override fun toString(): String { + return "Entry(" + "key=" + .#key + ", " + "value=" + .#value + ")" + } + + } + companion object Companion { private constructor() /* primary */ { super/*Any*/() @@ -175,14 +103,19 @@ internal class ArrayMapImpl : ArrayMap { } + private constructor(data: Array) /* primary */ { + super/*ArrayMap*/() + /* () */ + + } + constructor() { this/*ArrayMapImpl*/(data = arrayOfNulls(size = Companion.())) } - override var size: Int - field = 0 - override get - private open set + override fun copy(): ArrayMap { + return ArrayMapImpl(data = .().copyOf()) + } private fun ensureCapacity(index: Int) { when { @@ -192,54 +125,43 @@ internal class ArrayMapImpl : ArrayMap { } } - override operator fun set(index: Int, value: T) { - .ensureCapacity(index = index) - when { - EQEQ(arg0 = .().get(index = index), arg1 = null) -> { // BLOCK - { // BLOCK - val tmp_0: ArrayMapImpl = - { // BLOCK - val tmp_1: Int = tmp_0.() - tmp_0.( = tmp_1.inc()) - tmp_1 - } - } - } /*~> Unit */ + fun entries(): List> { + return .().mapIndexedNotNull>(transform = local fun (index: Int, value: Any?): Entry? { + return when { + EQEQ(arg0 = value, arg1 = null).not() -> Entry(key = index, value = value as T) + else -> null + } } - .().set(index = index, value = value) +) } override operator fun get(index: Int): T? { return .().getOrNull(index = index) as T? } - override fun copy(): ArrayMap { - return ArrayMapImpl(data = .().copyOf()) - } - override operator fun iterator(): Iterator { return { // BLOCK local class : AbstractIterator { + private var index: Int + field = -1 + private get + private set + constructor() /* primary */ { super/*AbstractIterator*/() /* () */ } - private var index: Int - field = -1 - private get - private set - protected override fun computeNext() { { // BLOCK do// COMPOSITE { { // BLOCK - val tmp_2: = + val tmp_1: = { // BLOCK - val tmp_3: Int = tmp_2.() - tmp_2.( = tmp_3.inc()) - tmp_3 + val tmp_2: Int = tmp_1.() + tmp_1.( = tmp_2.inc()) + tmp_2 } } /*~> Unit */ // } while (when { @@ -267,11 +189,11 @@ internal class ArrayMapImpl : ArrayMap { when { EQEQ(arg0 = .().get(index = index), arg1 = null).not() -> { // BLOCK { // BLOCK - val tmp_4: ArrayMapImpl = + val tmp_3: ArrayMapImpl = { // BLOCK - val tmp_5: Int = tmp_4.() - tmp_4.( = tmp_5.dec()) - tmp_5 + val tmp_4: Int = tmp_3.() + tmp_3.( = tmp_4.dec()) + tmp_4 } } } /*~> Unit */ @@ -279,73 +201,152 @@ internal class ArrayMapImpl : ArrayMap { .().set(index = index, value = null) } - fun entries(): List> { - return .().mapIndexedNotNull>(transform = local fun (index: Int, value: Any?): Entry? { - return when { - EQEQ(arg0 = value, arg1 = null).not() -> Entry(key = index, value = value as T) - else -> null - } + override operator fun set(index: Int, value: T) { + .ensureCapacity(index = index) + when { + EQEQ(arg0 = .().get(index = index), arg1 = null) -> { // BLOCK + { // BLOCK + val tmp_5: ArrayMapImpl = + { // BLOCK + val tmp_6: Int = tmp_5.() + tmp_5.( = tmp_6.inc()) + tmp_6 + } + } + } /*~> Unit */ } -) - } - - data class Entry : Entry { - constructor(key: Int, value: T) /* primary */ { - super/*Any*/() - /* () */ - - } - - override val key: Int - field = key - override get - - override val value: T - field = value - override get - - operator fun component1(): Int { - return .#key - } - - operator fun component2(): T { - return .#value - } - - fun copy(key: Int = .#key, value: T = .#value): Entry { - return Entry(key = key, value = value) - } - - override fun toString(): String { - return "Entry(" + "key=" + .#key + ", " + "value=" + .#value + ")" - } - - override fun hashCode(): Int { - var result: Int = .#key.hashCode() - result = result.times(other = 31).plus(other = when { - EQEQ(arg0 = .#value, arg1 = null) -> 0 - else -> .#value.hashCode() - }) - return result - } - - override operator fun equals(other: Any?): Boolean { - when { - EQEQEQ(arg0 = , arg1 = other) -> return true - } - when { - other !is Entry -> return false - } - val tmp_6: Entry = other as Entry - when { - EQEQ(arg0 = .#key, arg1 = tmp_6.#key).not() -> return false - } - when { - EQEQ(arg0 = .#value, arg1 = tmp_6.#value).not() -> return false - } - return true - } - + .().set(index = index, value = value) } } + +internal class OneElementArrayMap : ArrayMap { + val value: T + field = value + get + + val index: Int + field = index + get + + constructor(value: T, index: Int) /* primary */ { + super/*ArrayMap*/() + /* () */ + + } + + override fun copy(): ArrayMap { + return OneElementArrayMap(value = .(), index = .()) + } + + override operator fun get(index: Int): T? { + return when { + EQEQ(arg0 = index, arg1 = .()) -> .() + else -> null + } + } + + override operator fun iterator(): Iterator { + return { // BLOCK + local class : Iterator { + private var notVisited: Boolean + field = true + private get + private set + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override operator fun hasNext(): Boolean { + return .() + } + + override operator fun next(): T { + when { + .() -> { // BLOCK + .( = false) + return .() + } + else -> { // BLOCK + throw NoSuchElementException() + } + } + } + + } + + () + } + } + + override operator fun set(index: Int, value: T) { + throw IllegalStateException() + } + + override val size: Int + override get(): Int { + return 1 + } + +} + +internal object EmptyArrayMap : ArrayMap { + private constructor() /* primary */ { + super/*ArrayMap*/() + /* () */ + + } + + override fun copy(): ArrayMap { + return + } + + override operator fun get(index: Int): Nothing? { + return null + } + + override operator fun iterator(): Iterator { + return { // BLOCK + local class : Iterator { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override operator fun hasNext(): Boolean { + return false + } + + override operator fun next(): Nothing { + throw NoSuchElementException() + } + + } + + () + } + } + + override operator fun set(index: Int, value: Nothing) { + throw IllegalStateException() + } + + override val size: Int + override get(): Int { + return 0 + } + +} + +fun ArrayMap<*>.isEmpty(): Boolean { + return EQEQ(arg0 = .(), arg1 = 0) +} + +fun ArrayMap<*>.isNotEmpty(): Boolean { + return EQEQ(arg0 = .(), arg1 = 0).not() +} + diff --git a/compiler/testData/ir/irText/firProblems/AssignmentOperator.fir.ir.txt b/compiler/testData/ir/irText/firProblems/AssignmentOperator.fir.ir.txt index fb63fd6b9d6..7ffc4ecb3b9 100644 --- a/compiler/testData/ir/irText/firProblems/AssignmentOperator.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/AssignmentOperator.fir.ir.txt @@ -1,10 +1,18 @@ FILE fqName:foo fileName:/AssignmentOperator.kt + PROPERTY name:array visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:array type:kotlin.Array visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Int + elements: VARARG type=kotlin.Array varargElementType=kotlin.Int + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Array + correspondingProperty: PROPERTY name:array visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in foo' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:array type:kotlin.Array visibility:private [final,static]' type=kotlin.Array origin=null CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.A - CONSTRUCTOR visibility:public <> () returnType:foo.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:prop visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:prop type:kotlin.Int visibility:private EXPRESSION_BODY @@ -24,6 +32,10 @@ FILE fqName:foo fileName:/AssignmentOperator.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': foo.A declared in foo.A.' type=foo.A origin=null value: GET_VAR ': kotlin.Int declared in foo.A.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:foo.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -39,10 +51,6 @@ FILE fqName:foo fileName:/AssignmentOperator.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.B - CONSTRUCTOR visibility:private <> () returnType:foo.B [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:prop visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:prop type:kotlin.Int visibility:private EXPRESSION_BODY @@ -62,6 +70,10 @@ FILE fqName:foo fileName:/AssignmentOperator.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': foo.B declared in foo.B.' type=foo.B origin=null value: GET_VAR ': kotlin.Int declared in foo.B.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:private <> () returnType:foo.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:B modality:FINAL visibility:public 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 declared in kotlin.Any @@ -75,18 +87,6 @@ FILE fqName:foo fileName:/AssignmentOperator.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:array visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:array type:kotlin.Array visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null - : kotlin.Int - elements: VARARG type=kotlin.Array varargElementType=kotlin.Int - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Array - correspondingProperty: PROPERTY name:array visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in foo' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:array type:kotlin.Array visibility:private [final,static]' type=kotlin.Array origin=null FUN name:id visibility:public modality:FINAL (t:T of foo.id) returnType:T of foo.id TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:t index:0 type:T of foo.id diff --git a/compiler/testData/ir/irText/firProblems/AssignmentOperator.fir.kt.txt b/compiler/testData/ir/irText/firProblems/AssignmentOperator.fir.kt.txt index 4cc9ec804bb..7a401dcea78 100644 --- a/compiler/testData/ir/irText/firProblems/AssignmentOperator.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/AssignmentOperator.fir.kt.txt @@ -1,37 +1,37 @@ package foo +val array: Array + field = arrayOf(elements = [0]) + get + class A { + var prop: Int + field = 0 + get + set + constructor() /* primary */ { super/*Any*/() /* () */ } +} + +object B { var prop: Int field = 0 get set -} - -object B { private constructor() /* primary */ { super/*Any*/() /* () */ } - var prop: Int - field = 0 - get - set - } -val array: Array - field = arrayOf(elements = [0]) - get - fun id(t: T): T { return t } @@ -162,3 +162,4 @@ fun runMe() { tmp_41.set(index = tmp_42, value = tmp_41.get(index = tmp_42).dec()) tmp_41.get(index = tmp_42) /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/firProblems/AssignmentOperator.ir.txt b/compiler/testData/ir/irText/firProblems/AssignmentOperator.ir.txt index 01ace2f0ef4..5b20fea4a5b 100644 --- a/compiler/testData/ir/irText/firProblems/AssignmentOperator.ir.txt +++ b/compiler/testData/ir/irText/firProblems/AssignmentOperator.ir.txt @@ -1,10 +1,18 @@ FILE fqName:foo fileName:/AssignmentOperator.kt + PROPERTY name:array visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:array type:kotlin.Array visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Int + elements: VARARG type=kotlin.Array varargElementType=kotlin.Int + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Array + correspondingProperty: PROPERTY name:array visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in foo' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:array type:kotlin.Array visibility:private [final,static]' type=kotlin.Array origin=null CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.A - CONSTRUCTOR visibility:public <> () returnType:foo.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:prop visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:prop type:kotlin.Int visibility:private EXPRESSION_BODY @@ -24,6 +32,10 @@ FILE fqName:foo fileName:/AssignmentOperator.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': foo.A declared in foo.A.' type=foo.A origin=null value: GET_VAR ': kotlin.Int declared in foo.A.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:foo.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -39,10 +51,6 @@ FILE fqName:foo fileName:/AssignmentOperator.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.B - CONSTRUCTOR visibility:private <> () returnType:foo.B [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:prop visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:prop type:kotlin.Int visibility:private EXPRESSION_BODY @@ -62,6 +70,10 @@ FILE fqName:foo fileName:/AssignmentOperator.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': foo.B declared in foo.B.' type=foo.B origin=null value: GET_VAR ': kotlin.Int declared in foo.B.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:private <> () returnType:foo.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:B modality:FINAL visibility:public 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 declared in kotlin.Any @@ -75,18 +87,6 @@ FILE fqName:foo fileName:/AssignmentOperator.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:array visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:array type:kotlin.Array visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null - : kotlin.Int - elements: VARARG type=kotlin.Array varargElementType=kotlin.Int - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Array - correspondingProperty: PROPERTY name:array visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in foo' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:array type:kotlin.Array visibility:private [final,static]' type=kotlin.Array origin=null FUN name:id visibility:public modality:FINAL (t:T of foo.id) returnType:T of foo.id TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:t index:0 type:T of foo.id diff --git a/compiler/testData/ir/irText/firProblems/AssignmentOperator.kt.txt b/compiler/testData/ir/irText/firProblems/AssignmentOperator.kt.txt index 194c1128c20..4cb38370ef3 100644 --- a/compiler/testData/ir/irText/firProblems/AssignmentOperator.kt.txt +++ b/compiler/testData/ir/irText/firProblems/AssignmentOperator.kt.txt @@ -1,37 +1,37 @@ package foo +val array: Array + field = arrayOf(elements = [0]) + get + class A { + var prop: Int + field = 0 + get + set + constructor() /* primary */ { super/*Any*/() /* () */ } +} + +object B { var prop: Int field = 0 get set -} - -object B { private constructor() /* primary */ { super/*Any*/() /* () */ } - var prop: Int - field = 0 - get - set - } -val array: Array - field = arrayOf(elements = [0]) - get - fun id(t: T): T { return t } @@ -198,3 +198,4 @@ fun runMe() { tmp_45.get(index = tmp_46) } /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.ir.txt b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.ir.txt index a9085feb72c..4a3a03e2d9f 100644 --- a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.ir.txt @@ -1,4 +1,92 @@ FILE fqName: fileName:/ClashResolutionDescriptor.kt + PROPERTY name:registrationMap visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:registrationMap type:java.util.HashMap visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun hashMapOf (): java.util.HashMap declared in kotlin.collections' type=java.util.HashMap origin=null + : java.lang.reflect.Type + : kotlin.Any + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> () returnType:java.util.HashMap + correspondingProperty: PROPERTY name:registrationMap visibility:private modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): java.util.HashMap declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:registrationMap type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null + CLASS CLASS name:ClashResolutionDescriptor modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.PlatformSpecificExtension.ClashResolutionDescriptor>] reified:false + PROPERTY name:resolver visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:resolver type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'resolver: .PlatformExtensionsClashResolver.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.PlatformExtensionsClashResolver.ClashResolutionDescriptor> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ClashResolutionDescriptor.ClashResolutionDescriptor>) returnType:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> + correspondingProperty: PROPERTY name:resolver visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): .PlatformExtensionsClashResolver.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolver type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> visibility:private [final]' type=.PlatformExtensionsClashResolver.ClashResolutionDescriptor> origin=null + receiver: GET_VAR ': .ClashResolutionDescriptor.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.ClashResolutionDescriptor.ClashResolutionDescriptor> origin=null + PROPERTY name:clashedComponents visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:clashedComponents type:kotlin.collections.List<.ComponentDescriptor> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'clashedComponents: kotlin.collections.List<.ComponentDescriptor> declared in .ClashResolutionDescriptor.' type=kotlin.collections.List<.ComponentDescriptor> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ClashResolutionDescriptor.ClashResolutionDescriptor>) returnType:kotlin.collections.List<.ComponentDescriptor> + correspondingProperty: PROPERTY name:clashedComponents visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.List<.ComponentDescriptor> declared in .ClashResolutionDescriptor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:clashedComponents type:kotlin.collections.List<.ComponentDescriptor> visibility:private [final]' type=kotlin.collections.List<.ComponentDescriptor> origin=null + receiver: GET_VAR ': .ClashResolutionDescriptor.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.ClashResolutionDescriptor.ClashResolutionDescriptor> origin=null + CONSTRUCTOR visibility:public <> (container:.ComponentContainer, resolver:.PlatformExtensionsClashResolver.ClashResolutionDescriptor>, clashedComponents:kotlin.collections.List<.ComponentDescriptor>) returnType:.ClashResolutionDescriptor.ClashResolutionDescriptor> [primary] + VALUE_PARAMETER name:container index:0 type:.ComponentContainer + VALUE_PARAMETER name:resolver index:1 type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> + VALUE_PARAMETER name:clashedComponents index:2 type:kotlin.collections.List<.ComponentDescriptor> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClashResolutionDescriptor modality:FINAL visibility:public 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 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 + CLASS CLASS name:PlatformExtensionsClashResolver modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.PlatformSpecificExtension.PlatformExtensionsClashResolver>] reified:false + PROPERTY name:applicableTo visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:applicableTo type:java.lang.Class.PlatformExtensionsClashResolver> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'applicableTo: java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver.' type=java.lang.Class.PlatformExtensionsClashResolver> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver>) returnType:java.lang.Class.PlatformExtensionsClashResolver> + correspondingProperty: PROPERTY name:applicableTo visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:applicableTo type:java.lang.Class.PlatformExtensionsClashResolver> visibility:private [final]' type=java.lang.Class.PlatformExtensionsClashResolver> origin=null + receiver: GET_VAR ': .PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver.' type=.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> origin=null + CONSTRUCTOR visibility:public <> (applicableTo:java.lang.Class.PlatformExtensionsClashResolver>) returnType:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> [primary] + VALUE_PARAMETER name:applicableTo index:0 type:java.lang.Class.PlatformExtensionsClashResolver> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PlatformExtensionsClashResolver modality:ABSTRACT visibility:public 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 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 CLASS INTERFACE name:ComponentContainer modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ComponentContainer FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -14,6 +102,21 @@ FILE fqName: fileName:/ClashResolutionDescriptor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:ComponentDescriptor modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ComponentDescriptor + 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: 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 CLASS INTERFACE name:PlatformSpecificExtension modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PlatformSpecificExtension.PlatformSpecificExtension> TYPE_PARAMETER name:S index:0 variance: superTypes:[.PlatformSpecificExtension.PlatformSpecificExtension>] reified:false @@ -30,109 +133,6 @@ FILE fqName: fileName:/ClashResolutionDescriptor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:ComponentDescriptor modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ComponentDescriptor - 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: 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 - CLASS CLASS name:PlatformExtensionsClashResolver modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> - TYPE_PARAMETER name:E index:0 variance: superTypes:[.PlatformSpecificExtension.PlatformExtensionsClashResolver>] reified:false - CONSTRUCTOR visibility:public <> (applicableTo:java.lang.Class.PlatformExtensionsClashResolver>) returnType:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> [primary] - VALUE_PARAMETER name:applicableTo index:0 type:java.lang.Class.PlatformExtensionsClashResolver> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PlatformExtensionsClashResolver modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - PROPERTY name:applicableTo visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:applicableTo type:java.lang.Class.PlatformExtensionsClashResolver> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'applicableTo: java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver.' type=java.lang.Class.PlatformExtensionsClashResolver> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver>) returnType:java.lang.Class.PlatformExtensionsClashResolver> - correspondingProperty: PROPERTY name:applicableTo visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:applicableTo type:java.lang.Class.PlatformExtensionsClashResolver> visibility:private [final]' type=java.lang.Class.PlatformExtensionsClashResolver> origin=null - receiver: GET_VAR ': .PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver.' type=.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> 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: 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 - CLASS CLASS name:ClashResolutionDescriptor modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> - TYPE_PARAMETER name:E index:0 variance: superTypes:[.PlatformSpecificExtension.ClashResolutionDescriptor>] reified:false - CONSTRUCTOR visibility:public <> (container:.ComponentContainer, resolver:.PlatformExtensionsClashResolver.ClashResolutionDescriptor>, clashedComponents:kotlin.collections.List<.ComponentDescriptor>) returnType:.ClashResolutionDescriptor.ClashResolutionDescriptor> [primary] - VALUE_PARAMETER name:container index:0 type:.ComponentContainer - VALUE_PARAMETER name:resolver index:1 type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> - VALUE_PARAMETER name:clashedComponents index:2 type:kotlin.collections.List<.ComponentDescriptor> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClashResolutionDescriptor modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:resolver visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:resolver type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'resolver: .PlatformExtensionsClashResolver.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.PlatformExtensionsClashResolver.ClashResolutionDescriptor> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ClashResolutionDescriptor.ClashResolutionDescriptor>) returnType:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> - correspondingProperty: PROPERTY name:resolver visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): .PlatformExtensionsClashResolver.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolver type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> visibility:private [final]' type=.PlatformExtensionsClashResolver.ClashResolutionDescriptor> origin=null - receiver: GET_VAR ': .ClashResolutionDescriptor.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.ClashResolutionDescriptor.ClashResolutionDescriptor> origin=null - PROPERTY name:clashedComponents visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:clashedComponents type:kotlin.collections.List<.ComponentDescriptor> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'clashedComponents: kotlin.collections.List<.ComponentDescriptor> declared in .ClashResolutionDescriptor.' type=kotlin.collections.List<.ComponentDescriptor> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ClashResolutionDescriptor.ClashResolutionDescriptor>) returnType:kotlin.collections.List<.ComponentDescriptor> - correspondingProperty: PROPERTY name:clashedComponents visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.List<.ComponentDescriptor> declared in .ClashResolutionDescriptor' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:clashedComponents type:kotlin.collections.List<.ComponentDescriptor> visibility:private [final]' type=kotlin.collections.List<.ComponentDescriptor> origin=null - receiver: GET_VAR ': .ClashResolutionDescriptor.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.ClashResolutionDescriptor.ClashResolutionDescriptor> 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: 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 - PROPERTY name:registrationMap visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:registrationMap type:java.util.HashMap visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun hashMapOf (): java.util.HashMap declared in kotlin.collections' type=java.util.HashMap origin=null - : java.lang.reflect.Type - : kotlin.Any - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> () returnType:java.util.HashMap - correspondingProperty: PROPERTY name:registrationMap visibility:private modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): java.util.HashMap declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:registrationMap type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null FUN name:resolveClashesIfAny visibility:public modality:FINAL <> (container:.ComponentContainer, clashResolvers:kotlin.collections.List<.PlatformExtensionsClashResolver<*>>) returnType:kotlin.Unit VALUE_PARAMETER name:container index:0 type:.ComponentContainer VALUE_PARAMETER name:clashResolvers index:1 type:kotlin.collections.List<.PlatformExtensionsClashResolver<*>> diff --git a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.kt.txt b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.kt.txt index b2ca4fbc02b..f10567e0554 100644 --- a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.kt.txt @@ -1,32 +1,8 @@ -interface ComponentContainer { -} - -interface PlatformSpecificExtension> { -} - -interface ComponentDescriptor { -} - -abstract class PlatformExtensionsClashResolver> { - constructor(applicableTo: Class) /* primary */ { - super/*Any*/() - /* () */ - - } - - val applicableTo: Class - field = applicableTo - get - -} +private val registrationMap: HashMap + field = hashMapOf() + private get class ClashResolutionDescriptor> { - constructor(container: ComponentContainer, resolver: PlatformExtensionsClashResolver, clashedComponents: List) /* primary */ { - super/*Any*/() - /* () */ - - } - private val resolver: PlatformExtensionsClashResolver field = resolver private get @@ -35,11 +11,35 @@ class ClashResolutionDescriptor> { field = clashedComponents private get + constructor(container: ComponentContainer, resolver: PlatformExtensionsClashResolver, clashedComponents: List) /* primary */ { + super/*Any*/() + /* () */ + + } + } -private val registrationMap: HashMap - field = hashMapOf() - private get +abstract class PlatformExtensionsClashResolver> { + val applicableTo: Class + field = applicableTo + get + + constructor(applicableTo: Class) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface ComponentContainer { +} + +interface ComponentDescriptor { +} + +interface PlatformSpecificExtension> { +} fun resolveClashesIfAny(container: ComponentContainer, clashResolvers: List>) { { // BLOCK @@ -59,3 +59,4 @@ fun resolveClashesIfAny(container: ComponentContainer, clashResolvers: List fileName:/ClashResolutionDescriptor.kt + PROPERTY name:registrationMap visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:registrationMap type:java.util.HashMap visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun hashMapOf (): java.util.HashMap declared in kotlin.collections' type=java.util.HashMap origin=null + : java.lang.reflect.Type + : kotlin.Any + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> () returnType:java.util.HashMap + correspondingProperty: PROPERTY name:registrationMap visibility:private modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): java.util.HashMap declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:registrationMap type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null + CLASS CLASS name:ClashResolutionDescriptor modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.PlatformSpecificExtension.ClashResolutionDescriptor>] reified:false + PROPERTY name:resolver visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:resolver type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'resolver: .PlatformExtensionsClashResolver.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.PlatformExtensionsClashResolver.ClashResolutionDescriptor> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ClashResolutionDescriptor.ClashResolutionDescriptor>) returnType:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> + correspondingProperty: PROPERTY name:resolver visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): .PlatformExtensionsClashResolver.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolver type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> visibility:private [final]' type=.PlatformExtensionsClashResolver.ClashResolutionDescriptor> origin=null + receiver: GET_VAR ': .ClashResolutionDescriptor.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.ClashResolutionDescriptor.ClashResolutionDescriptor> origin=null + PROPERTY name:clashedComponents visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:clashedComponents type:kotlin.collections.List<.ComponentDescriptor> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'clashedComponents: kotlin.collections.List<.ComponentDescriptor> declared in .ClashResolutionDescriptor.' type=kotlin.collections.List<.ComponentDescriptor> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ClashResolutionDescriptor.ClashResolutionDescriptor>) returnType:kotlin.collections.List<.ComponentDescriptor> + correspondingProperty: PROPERTY name:clashedComponents visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.List<.ComponentDescriptor> declared in .ClashResolutionDescriptor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:clashedComponents type:kotlin.collections.List<.ComponentDescriptor> visibility:private [final]' type=kotlin.collections.List<.ComponentDescriptor> origin=null + receiver: GET_VAR ': .ClashResolutionDescriptor.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.ClashResolutionDescriptor.ClashResolutionDescriptor> origin=null + CONSTRUCTOR visibility:public <> (container:.ComponentContainer, resolver:.PlatformExtensionsClashResolver.ClashResolutionDescriptor>, clashedComponents:kotlin.collections.List<.ComponentDescriptor>) returnType:.ClashResolutionDescriptor.ClashResolutionDescriptor> [primary] + VALUE_PARAMETER name:container index:0 type:.ComponentContainer + VALUE_PARAMETER name:resolver index:1 type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> + VALUE_PARAMETER name:clashedComponents index:2 type:kotlin.collections.List<.ComponentDescriptor> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClashResolutionDescriptor modality:FINAL visibility:public 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 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 + CLASS CLASS name:PlatformExtensionsClashResolver modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.PlatformSpecificExtension.PlatformExtensionsClashResolver>] reified:false + PROPERTY name:applicableTo visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:applicableTo type:java.lang.Class.PlatformExtensionsClashResolver> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'applicableTo: java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver.' type=java.lang.Class.PlatformExtensionsClashResolver> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver>) returnType:java.lang.Class.PlatformExtensionsClashResolver> + correspondingProperty: PROPERTY name:applicableTo visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:applicableTo type:java.lang.Class.PlatformExtensionsClashResolver> visibility:private [final]' type=java.lang.Class.PlatformExtensionsClashResolver> origin=null + receiver: GET_VAR ': .PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver.' type=.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> origin=null + CONSTRUCTOR visibility:public <> (applicableTo:java.lang.Class.PlatformExtensionsClashResolver>) returnType:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> [primary] + VALUE_PARAMETER name:applicableTo index:0 type:java.lang.Class.PlatformExtensionsClashResolver> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PlatformExtensionsClashResolver modality:ABSTRACT visibility:public 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 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 CLASS INTERFACE name:ComponentContainer modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ComponentContainer FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -14,6 +102,21 @@ FILE fqName: fileName:/ClashResolutionDescriptor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:ComponentDescriptor modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ComponentDescriptor + 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: 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 CLASS INTERFACE name:PlatformSpecificExtension modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PlatformSpecificExtension.PlatformSpecificExtension> TYPE_PARAMETER name:S index:0 variance: superTypes:[.PlatformSpecificExtension.PlatformSpecificExtension>] reified:false @@ -30,109 +133,6 @@ FILE fqName: fileName:/ClashResolutionDescriptor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:ComponentDescriptor modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ComponentDescriptor - 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: 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 - CLASS CLASS name:PlatformExtensionsClashResolver modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> - TYPE_PARAMETER name:E index:0 variance: superTypes:[.PlatformSpecificExtension.PlatformExtensionsClashResolver>] reified:false - CONSTRUCTOR visibility:public <> (applicableTo:java.lang.Class.PlatformExtensionsClashResolver>) returnType:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> [primary] - VALUE_PARAMETER name:applicableTo index:0 type:java.lang.Class.PlatformExtensionsClashResolver> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PlatformExtensionsClashResolver modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - PROPERTY name:applicableTo visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:applicableTo type:java.lang.Class.PlatformExtensionsClashResolver> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'applicableTo: java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver.' type=java.lang.Class.PlatformExtensionsClashResolver> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver>) returnType:java.lang.Class.PlatformExtensionsClashResolver> - correspondingProperty: PROPERTY name:applicableTo visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:applicableTo type:java.lang.Class.PlatformExtensionsClashResolver> visibility:private [final]' type=java.lang.Class.PlatformExtensionsClashResolver> origin=null - receiver: GET_VAR ': .PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver.' type=.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> 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: 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 - CLASS CLASS name:ClashResolutionDescriptor modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> - TYPE_PARAMETER name:E index:0 variance: superTypes:[.PlatformSpecificExtension.ClashResolutionDescriptor>] reified:false - CONSTRUCTOR visibility:public <> (container:.ComponentContainer, resolver:.PlatformExtensionsClashResolver.ClashResolutionDescriptor>, clashedComponents:kotlin.collections.List<.ComponentDescriptor>) returnType:.ClashResolutionDescriptor.ClashResolutionDescriptor> [primary] - VALUE_PARAMETER name:container index:0 type:.ComponentContainer - VALUE_PARAMETER name:resolver index:1 type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> - VALUE_PARAMETER name:clashedComponents index:2 type:kotlin.collections.List<.ComponentDescriptor> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClashResolutionDescriptor modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:resolver visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:resolver type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'resolver: .PlatformExtensionsClashResolver.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.PlatformExtensionsClashResolver.ClashResolutionDescriptor> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ClashResolutionDescriptor.ClashResolutionDescriptor>) returnType:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> - correspondingProperty: PROPERTY name:resolver visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): .PlatformExtensionsClashResolver.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolver type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> visibility:private [final]' type=.PlatformExtensionsClashResolver.ClashResolutionDescriptor> origin=null - receiver: GET_VAR ': .ClashResolutionDescriptor.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.ClashResolutionDescriptor.ClashResolutionDescriptor> origin=null - PROPERTY name:clashedComponents visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:clashedComponents type:kotlin.collections.List<.ComponentDescriptor> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'clashedComponents: kotlin.collections.List<.ComponentDescriptor> declared in .ClashResolutionDescriptor.' type=kotlin.collections.List<.ComponentDescriptor> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ClashResolutionDescriptor.ClashResolutionDescriptor>) returnType:kotlin.collections.List<.ComponentDescriptor> - correspondingProperty: PROPERTY name:clashedComponents visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.List<.ComponentDescriptor> declared in .ClashResolutionDescriptor' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:clashedComponents type:kotlin.collections.List<.ComponentDescriptor> visibility:private [final]' type=kotlin.collections.List<.ComponentDescriptor> origin=null - receiver: GET_VAR ': .ClashResolutionDescriptor.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.ClashResolutionDescriptor.ClashResolutionDescriptor> 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: 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 - PROPERTY name:registrationMap visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:registrationMap type:java.util.HashMap visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun hashMapOf (): java.util.HashMap declared in kotlin.collections' type=java.util.HashMap origin=null - : java.lang.reflect.Type - : kotlin.Any - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> () returnType:java.util.HashMap - correspondingProperty: PROPERTY name:registrationMap visibility:private modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): java.util.HashMap declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:registrationMap type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null FUN name:resolveClashesIfAny visibility:public modality:FINAL <> (container:.ComponentContainer, clashResolvers:kotlin.collections.List<.PlatformExtensionsClashResolver<*>>) returnType:kotlin.Unit VALUE_PARAMETER name:container index:0 type:.ComponentContainer VALUE_PARAMETER name:clashResolvers index:1 type:kotlin.collections.List<.PlatformExtensionsClashResolver<*>> diff --git a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt.txt b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt.txt index 0249a047a1f..0053904433c 100644 --- a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt.txt @@ -1,32 +1,8 @@ -interface ComponentContainer { -} - -interface PlatformSpecificExtension> { -} - -interface ComponentDescriptor { -} - -abstract class PlatformExtensionsClashResolver> { - constructor(applicableTo: Class) /* primary */ { - super/*Any*/() - /* () */ - - } - - val applicableTo: Class - field = applicableTo - get - -} +private val registrationMap: HashMap + field = hashMapOf() + private get class ClashResolutionDescriptor> { - constructor(container: ComponentContainer, resolver: PlatformExtensionsClashResolver, clashedComponents: List) /* primary */ { - super/*Any*/() - /* () */ - - } - private val resolver: PlatformExtensionsClashResolver field = resolver private get @@ -35,11 +11,35 @@ class ClashResolutionDescriptor> { field = clashedComponents private get + constructor(container: ComponentContainer, resolver: PlatformExtensionsClashResolver, clashedComponents: List) /* primary */ { + super/*Any*/() + /* () */ + + } + } -private val registrationMap: HashMap - field = hashMapOf() - private get +abstract class PlatformExtensionsClashResolver> { + val applicableTo: Class + field = applicableTo + get + + constructor(applicableTo: Class) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface ComponentContainer { +} + +interface ComponentDescriptor { +} + +interface PlatformSpecificExtension> { +} fun resolveClashesIfAny(container: ComponentContainer, clashResolvers: List>) { { // BLOCK @@ -59,3 +59,4 @@ fun resolveClashesIfAny(container: ComponentContainer, clashResolvers: List fileName:/DeepCopyIrTree.kt - CLASS INTERFACE name:IrType modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrType - 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: 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 - CLASS INTERFACE name:TypeRemapper modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TypeRemapper - FUN name:enterScope visibility:public modality:ABSTRACT <> ($this:.TypeRemapper, irTypeParametersContainer:.IrTypeParametersContainer) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TypeRemapper - VALUE_PARAMETER name:irTypeParametersContainer index:0 type:.IrTypeParametersContainer - FUN name:remapType visibility:public modality:ABSTRACT <> ($this:.TypeRemapper, type:.IrType) returnType:.IrType - $this: VALUE_PARAMETER name: type:.TypeRemapper - VALUE_PARAMETER name:type index:0 type:.IrType - FUN name:leaveScope visibility:public modality:ABSTRACT <> ($this:.TypeRemapper) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TypeRemapper - 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: 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 - CLASS INTERFACE name:IrTypeParametersContainer modality:ABSTRACT visibility:public superTypes:[.IrDeclaration; .IrDeclarationParent] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrTypeParametersContainer - PROPERTY name:typeParameters visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IrTypeParametersContainer) returnType:kotlin.collections.List<.IrTypeParameter> - correspondingProperty: PROPERTY name:typeParameters visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.IrTypeParametersContainer - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IrTypeParametersContainer, :kotlin.collections.List<.IrTypeParameter>) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:typeParameters visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.IrTypeParametersContainer - VALUE_PARAMETER name: index:0 type:kotlin.collections.List<.IrTypeParameter> - 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 .IrDeclaration - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IrDeclarationParent - $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 .IrDeclaration - public open fun hashCode (): kotlin.Int declared in .IrDeclarationParent - $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 .IrDeclaration - public open fun toString (): kotlin.String declared in .IrDeclarationParent - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IrDeclaration modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrDeclaration - 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: 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 - CLASS INTERFACE name:IrTypeParameter modality:ABSTRACT visibility:public superTypes:[.IrDeclaration] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrTypeParameter - PROPERTY name:superTypes visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IrTypeParameter) returnType:kotlin.collections.MutableList<.IrType> - correspondingProperty: PROPERTY name:superTypes visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IrTypeParameter - 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 .IrDeclaration - $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 .IrDeclaration - $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 .IrDeclaration - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IrDeclarationParent modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrDeclarationParent - 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: 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 CLASS CLASS name:DeepCopyIrTreeWithSymbols modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DeepCopyIrTreeWithSymbols - CONSTRUCTOR visibility:public <> (typeRemapper:.TypeRemapper) returnType:.DeepCopyIrTreeWithSymbols [primary] - VALUE_PARAMETER name:typeRemapper index:0 type:.TypeRemapper - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DeepCopyIrTreeWithSymbols modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:typeRemapper visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:typeRemapper type:.TypeRemapper visibility:private [final] EXPRESSION_BODY @@ -130,6 +12,24 @@ FILE fqName: fileName:/DeepCopyIrTree.kt RETURN type=kotlin.Nothing from='private final fun (): .TypeRemapper declared in .DeepCopyIrTreeWithSymbols' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:typeRemapper type:.TypeRemapper visibility:private [final]' type=.TypeRemapper origin=null receiver: GET_VAR ': .DeepCopyIrTreeWithSymbols declared in .DeepCopyIrTreeWithSymbols.' type=.DeepCopyIrTreeWithSymbols origin=null + CONSTRUCTOR visibility:public <> (typeRemapper:.TypeRemapper) returnType:.DeepCopyIrTreeWithSymbols [primary] + VALUE_PARAMETER name:typeRemapper index:0 type:.TypeRemapper + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DeepCopyIrTreeWithSymbols modality:FINAL visibility:public 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 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:copyTypeParameter visibility:private modality:FINAL <> ($this:.DeepCopyIrTreeWithSymbols, declaration:.IrTypeParameter) returnType:.IrTypeParameter $this: VALUE_PARAMETER name: type:.DeepCopyIrTreeWithSymbols VALUE_PARAMETER name:declaration index:0 type:.IrTypeParameter @@ -206,6 +106,8 @@ FILE fqName: fileName:/DeepCopyIrTree.kt $this: CALL 'private final fun (): .TypeRemapper declared in .DeepCopyIrTreeWithSymbols' type=.TypeRemapper origin=GET_PROPERTY $this: GET_VAR ': .DeepCopyIrTreeWithSymbols declared in .DeepCopyIrTreeWithSymbols.copyTypeParametersFrom' type=.DeepCopyIrTreeWithSymbols origin=null type: GET_VAR 'it: .IrType declared in .DeepCopyIrTreeWithSymbols.copyTypeParametersFrom..' type=.IrType origin=null + CLASS INTERFACE name:IrDeclaration modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrDeclaration 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 @@ -219,6 +121,104 @@ FILE fqName: fileName:/DeepCopyIrTree.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IrDeclarationParent modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrDeclarationParent + 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: 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 + CLASS INTERFACE name:IrType modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrType + 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: 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 + CLASS INTERFACE name:IrTypeParameter modality:ABSTRACT visibility:public superTypes:[.IrDeclaration] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrTypeParameter + 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 .IrDeclaration + $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 .IrDeclaration + $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 .IrDeclaration + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:superTypes visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IrTypeParameter) returnType:kotlin.collections.MutableList<.IrType> + correspondingProperty: PROPERTY name:superTypes visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.IrTypeParameter + CLASS INTERFACE name:IrTypeParametersContainer modality:ABSTRACT visibility:public superTypes:[.IrDeclaration; .IrDeclarationParent] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrTypeParametersContainer + 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 .IrDeclaration + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IrDeclarationParent + $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 .IrDeclaration + public open fun hashCode (): kotlin.Int declared in .IrDeclarationParent + $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 .IrDeclaration + public open fun toString (): kotlin.String declared in .IrDeclarationParent + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:typeParameters visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IrTypeParametersContainer) returnType:kotlin.collections.List<.IrTypeParameter> + correspondingProperty: PROPERTY name:typeParameters visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.IrTypeParametersContainer + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IrTypeParametersContainer, :kotlin.collections.List<.IrTypeParameter>) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:typeParameters visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.IrTypeParametersContainer + VALUE_PARAMETER name: index:0 type:kotlin.collections.List<.IrTypeParameter> + CLASS INTERFACE name:TypeRemapper modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TypeRemapper + 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: 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:enterScope visibility:public modality:ABSTRACT <> ($this:.TypeRemapper, irTypeParametersContainer:.IrTypeParametersContainer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TypeRemapper + VALUE_PARAMETER name:irTypeParametersContainer index:0 type:.IrTypeParametersContainer + FUN name:leaveScope visibility:public modality:ABSTRACT <> ($this:.TypeRemapper) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TypeRemapper + FUN name:remapType visibility:public modality:ABSTRACT <> ($this:.TypeRemapper, type:.IrType) returnType:.IrType + $this: VALUE_PARAMETER name: type:.TypeRemapper + VALUE_PARAMETER name:type index:0 type:.IrType FUN name:withinScope visibility:public modality:FINAL ($receiver:.TypeRemapper, irTypeParametersContainer:.IrTypeParametersContainer, fn:kotlin.Function0.withinScope>) returnType:T of .withinScope [inline] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false $receiver: VALUE_PARAMETER name: type:.TypeRemapper diff --git a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.fir.kt.txt b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.fir.kt.txt index 0eca7026446..93aa9d0143a 100644 --- a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.fir.kt.txt @@ -1,45 +1,14 @@ -interface IrType { -} - -interface TypeRemapper { - abstract fun enterScope(irTypeParametersContainer: IrTypeParametersContainer) - - abstract fun remapType(type: IrType): IrType - - abstract fun leaveScope() - -} - -interface IrTypeParametersContainer : IrDeclaration, IrDeclarationParent { - abstract var typeParameters: List - abstract get - abstract set - -} - -interface IrDeclaration { -} - -interface IrTypeParameter : IrDeclaration { - abstract val superTypes: MutableList - abstract get - -} - -interface IrDeclarationParent { -} - class DeepCopyIrTreeWithSymbols { + private val typeRemapper: TypeRemapper + field = typeRemapper + private get + constructor(typeRemapper: TypeRemapper) /* primary */ { super/*Any*/() /* () */ } - private val typeRemapper: TypeRemapper - field = typeRemapper - private get - private fun copyTypeParameter(declaration: IrTypeParameter): IrTypeParameter { return declaration } @@ -70,6 +39,37 @@ class DeepCopyIrTreeWithSymbols { } +interface IrDeclaration { +} + +interface IrDeclarationParent { +} + +interface IrType { +} + +interface IrTypeParameter : IrDeclaration { + abstract val superTypes: MutableList + abstract get + +} + +interface IrTypeParametersContainer : IrDeclaration, IrDeclarationParent { + abstract var typeParameters: List + abstract get + abstract set + +} + +interface TypeRemapper { + abstract fun enterScope(irTypeParametersContainer: IrTypeParametersContainer) + + abstract fun leaveScope() + + abstract fun remapType(type: IrType): IrType + +} + inline fun TypeRemapper.withinScope(irTypeParametersContainer: IrTypeParametersContainer, fn: Function0): T { .enterScope(irTypeParametersContainer = irTypeParametersContainer) val result: T = fn.invoke() diff --git a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.ir.txt b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.ir.txt index 641e7b29950..deac2124eb3 100644 --- a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.ir.txt +++ b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.ir.txt @@ -1,124 +1,6 @@ FILE fqName: fileName:/DeepCopyIrTree.kt - CLASS INTERFACE name:IrType modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrType - 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: 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 - CLASS INTERFACE name:TypeRemapper modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TypeRemapper - FUN name:enterScope visibility:public modality:ABSTRACT <> ($this:.TypeRemapper, irTypeParametersContainer:.IrTypeParametersContainer) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TypeRemapper - VALUE_PARAMETER name:irTypeParametersContainer index:0 type:.IrTypeParametersContainer - FUN name:remapType visibility:public modality:ABSTRACT <> ($this:.TypeRemapper, type:.IrType) returnType:.IrType - $this: VALUE_PARAMETER name: type:.TypeRemapper - VALUE_PARAMETER name:type index:0 type:.IrType - FUN name:leaveScope visibility:public modality:ABSTRACT <> ($this:.TypeRemapper) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.TypeRemapper - 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: 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 - CLASS INTERFACE name:IrTypeParametersContainer modality:ABSTRACT visibility:public superTypes:[.IrDeclaration; .IrDeclarationParent] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrTypeParametersContainer - PROPERTY name:typeParameters visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IrTypeParametersContainer) returnType:kotlin.collections.List<.IrTypeParameter> - correspondingProperty: PROPERTY name:typeParameters visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.IrTypeParametersContainer - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IrTypeParametersContainer, :kotlin.collections.List<.IrTypeParameter>) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:typeParameters visibility:public modality:ABSTRACT [var] - $this: VALUE_PARAMETER name: type:.IrTypeParametersContainer - VALUE_PARAMETER name: index:0 type:kotlin.collections.List<.IrTypeParameter> - 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 .IrDeclaration - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IrDeclarationParent - $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 .IrDeclaration - public open fun hashCode (): kotlin.Int declared in .IrDeclarationParent - $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 .IrDeclaration - public open fun toString (): kotlin.String declared in .IrDeclarationParent - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IrDeclaration modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrDeclaration - 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: 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 - CLASS INTERFACE name:IrTypeParameter modality:ABSTRACT visibility:public superTypes:[.IrDeclaration] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrTypeParameter - PROPERTY name:superTypes visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IrTypeParameter) returnType:kotlin.collections.MutableList<.IrType> - correspondingProperty: PROPERTY name:superTypes visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.IrTypeParameter - 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 .IrDeclaration - $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 .IrDeclaration - $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 .IrDeclaration - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IrDeclarationParent modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrDeclarationParent - 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: 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 CLASS CLASS name:DeepCopyIrTreeWithSymbols modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DeepCopyIrTreeWithSymbols - CONSTRUCTOR visibility:public <> (typeRemapper:.TypeRemapper) returnType:.DeepCopyIrTreeWithSymbols [primary] - VALUE_PARAMETER name:typeRemapper index:0 type:.TypeRemapper - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DeepCopyIrTreeWithSymbols modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:typeRemapper visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:typeRemapper type:.TypeRemapper visibility:private [final] EXPRESSION_BODY @@ -130,6 +12,24 @@ FILE fqName: fileName:/DeepCopyIrTree.kt RETURN type=kotlin.Nothing from='private final fun (): .TypeRemapper declared in .DeepCopyIrTreeWithSymbols' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:typeRemapper type:.TypeRemapper visibility:private [final]' type=.TypeRemapper origin=null receiver: GET_VAR ': .DeepCopyIrTreeWithSymbols declared in .DeepCopyIrTreeWithSymbols.' type=.DeepCopyIrTreeWithSymbols origin=null + CONSTRUCTOR visibility:public <> (typeRemapper:.TypeRemapper) returnType:.DeepCopyIrTreeWithSymbols [primary] + VALUE_PARAMETER name:typeRemapper index:0 type:.TypeRemapper + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DeepCopyIrTreeWithSymbols modality:FINAL visibility:public 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 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:copyTypeParameter visibility:private modality:FINAL <> ($this:.DeepCopyIrTreeWithSymbols, declaration:.IrTypeParameter) returnType:.IrTypeParameter $this: VALUE_PARAMETER name: type:.DeepCopyIrTreeWithSymbols VALUE_PARAMETER name:declaration index:0 type:.IrTypeParameter @@ -206,6 +106,8 @@ FILE fqName: fileName:/DeepCopyIrTree.kt $this: CALL 'private final fun (): .TypeRemapper declared in .DeepCopyIrTreeWithSymbols' type=.TypeRemapper origin=GET_PROPERTY $this: GET_VAR ': .DeepCopyIrTreeWithSymbols declared in .DeepCopyIrTreeWithSymbols.copyTypeParametersFrom' type=.DeepCopyIrTreeWithSymbols origin=null type: GET_VAR 'it: .IrType declared in .DeepCopyIrTreeWithSymbols.copyTypeParametersFrom..' type=.IrType origin=null + CLASS INTERFACE name:IrDeclaration modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrDeclaration 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 @@ -219,6 +121,104 @@ FILE fqName: fileName:/DeepCopyIrTree.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IrDeclarationParent modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrDeclarationParent + 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: 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 + CLASS INTERFACE name:IrType modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrType + 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: 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 + CLASS INTERFACE name:IrTypeParameter modality:ABSTRACT visibility:public superTypes:[.IrDeclaration] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrTypeParameter + 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 .IrDeclaration + $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 .IrDeclaration + $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 .IrDeclaration + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:superTypes visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IrTypeParameter) returnType:kotlin.collections.MutableList<.IrType> + correspondingProperty: PROPERTY name:superTypes visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.IrTypeParameter + CLASS INTERFACE name:IrTypeParametersContainer modality:ABSTRACT visibility:public superTypes:[.IrDeclaration; .IrDeclarationParent] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IrTypeParametersContainer + 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 .IrDeclaration + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IrDeclarationParent + $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 .IrDeclaration + public open fun hashCode (): kotlin.Int declared in .IrDeclarationParent + $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 .IrDeclaration + public open fun toString (): kotlin.String declared in .IrDeclarationParent + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:typeParameters visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IrTypeParametersContainer) returnType:kotlin.collections.List<.IrTypeParameter> + correspondingProperty: PROPERTY name:typeParameters visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.IrTypeParametersContainer + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IrTypeParametersContainer, :kotlin.collections.List<.IrTypeParameter>) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:typeParameters visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.IrTypeParametersContainer + VALUE_PARAMETER name: index:0 type:kotlin.collections.List<.IrTypeParameter> + CLASS INTERFACE name:TypeRemapper modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TypeRemapper + 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: 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:enterScope visibility:public modality:ABSTRACT <> ($this:.TypeRemapper, irTypeParametersContainer:.IrTypeParametersContainer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TypeRemapper + VALUE_PARAMETER name:irTypeParametersContainer index:0 type:.IrTypeParametersContainer + FUN name:leaveScope visibility:public modality:ABSTRACT <> ($this:.TypeRemapper) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TypeRemapper + FUN name:remapType visibility:public modality:ABSTRACT <> ($this:.TypeRemapper, type:.IrType) returnType:.IrType + $this: VALUE_PARAMETER name: type:.TypeRemapper + VALUE_PARAMETER name:type index:0 type:.IrType FUN name:withinScope visibility:public modality:FINAL ($receiver:.TypeRemapper, irTypeParametersContainer:.IrTypeParametersContainer, fn:kotlin.Function0.withinScope>) returnType:T of .withinScope [inline] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false $receiver: VALUE_PARAMETER name: type:.TypeRemapper diff --git a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt.txt b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt.txt index 3d4aa9f2ef6..91e8cebb618 100644 --- a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt.txt +++ b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt.txt @@ -1,45 +1,14 @@ -interface IrType { -} - -interface TypeRemapper { - abstract fun enterScope(irTypeParametersContainer: IrTypeParametersContainer) - - abstract fun remapType(type: IrType): IrType - - abstract fun leaveScope() - -} - -interface IrTypeParametersContainer : IrDeclaration, IrDeclarationParent { - abstract var typeParameters: List - abstract get - abstract set - -} - -interface IrDeclaration { -} - -interface IrTypeParameter : IrDeclaration { - abstract val superTypes: MutableList - abstract get - -} - -interface IrDeclarationParent { -} - class DeepCopyIrTreeWithSymbols { + private val typeRemapper: TypeRemapper + field = typeRemapper + private get + constructor(typeRemapper: TypeRemapper) /* primary */ { super/*Any*/() /* () */ } - private val typeRemapper: TypeRemapper - field = typeRemapper - private get - private fun copyTypeParameter(declaration: IrTypeParameter): IrTypeParameter { return declaration } @@ -70,9 +39,41 @@ class DeepCopyIrTreeWithSymbols { } +interface IrDeclaration { +} + +interface IrDeclarationParent { +} + +interface IrType { +} + +interface IrTypeParameter : IrDeclaration { + abstract val superTypes: MutableList + abstract get + +} + +interface IrTypeParametersContainer : IrDeclaration, IrDeclarationParent { + abstract var typeParameters: List + abstract get + abstract set + +} + +interface TypeRemapper { + abstract fun enterScope(irTypeParametersContainer: IrTypeParametersContainer) + + abstract fun leaveScope() + + abstract fun remapType(type: IrType): IrType + +} + inline fun TypeRemapper.withinScope(irTypeParametersContainer: IrTypeParametersContainer, fn: Function0): T { .enterScope(irTypeParametersContainer = irTypeParametersContainer) val result: T = fn.invoke() .leaveScope() return result } + diff --git a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.ir.txt b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.ir.txt deleted file mode 100644 index d36198deacd..00000000000 --- a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.ir.txt +++ /dev/null @@ -1,159 +0,0 @@ -FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt - CLASS CLASS name:Impl modality:FINAL visibility:public superTypes:[.Foo.A; .Foo.B] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Impl - CONSTRUCTOR visibility:public <> (b:.Foo.B) returnType:.Impl [primary] - VALUE_PARAMETER name:b index:0 type:.Foo.B - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Impl modality:FINAL visibility:public superTypes:[.Foo.A; .Foo.B]' - FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final] - EXPRESSION_BODY - GET_VAR 'b: .Foo.B declared in .Impl.' type=.Foo.B origin=null - FUN DELEGATED_MEMBER name:add visibility:public modality:OPEN <> ($this:.Impl, element:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Boolean - overridden: - public abstract fun add (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Foo.A - public abstract fun add (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Foo.B - $this: VALUE_PARAMETER name: type:.Impl - VALUE_PARAMETER name:element index:0 type:@[FlexibleNullability] kotlin.String? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun add (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Impl' - CALL 'public abstract fun add (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null - receiver: GET_VAR ': .Impl declared in .Impl.add' type=.Impl origin=null - element: GET_VAR 'element: @[FlexibleNullability] kotlin.String? declared in .Impl.add' type=@[FlexibleNullability] kotlin.String? origin=null - FUN DELEGATED_MEMBER name:addAll visibility:public modality:OPEN <> ($this:.Impl, elements:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Boolean - overridden: - public abstract fun addAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Foo.A - public abstract fun addAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Foo.B - $this: VALUE_PARAMETER name: type:.Impl - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun addAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Impl' - CALL 'public abstract fun addAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null - receiver: GET_VAR ': .Impl declared in .Impl.addAll' type=.Impl origin=null - elements: GET_VAR 'elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> declared in .Impl.addAll' type=kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> origin=null - FUN DELEGATED_MEMBER name:clear visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.Unit - overridden: - public abstract fun clear (): kotlin.Unit declared in .Foo.A - public abstract fun clear (): kotlin.Unit declared in .Foo.B - $this: VALUE_PARAMETER name: type:.Impl - BLOCK_BODY - CALL 'public abstract fun clear (): kotlin.Unit declared in .Foo.B' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null - receiver: GET_VAR ': .Impl declared in .Impl.clear' type=.Impl origin=null - FUN DELEGATED_MEMBER name:iterator visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.collections.MutableIterator<@[FlexibleNullability] kotlin.String?> [operator] - overridden: - public abstract fun iterator (): kotlin.collections.MutableIterator<@[FlexibleNullability] kotlin.String?> declared in .Foo.A - public abstract fun iterator (): kotlin.collections.MutableIterator<@[FlexibleNullability] kotlin.String?> declared in .Foo.B - $this: VALUE_PARAMETER name: type:.Impl - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.MutableIterator<@[FlexibleNullability] kotlin.String?> declared in .Impl' - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<@[FlexibleNullability] kotlin.String?> declared in .Foo.B' type=kotlin.collections.MutableIterator<@[FlexibleNullability] kotlin.String?> origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null - receiver: GET_VAR ': .Impl declared in .Impl.iterator' type=.Impl origin=null - FUN DELEGATED_MEMBER name:remove visibility:public modality:OPEN <> ($this:.Impl, element:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Boolean - overridden: - public abstract fun remove (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Foo.A - public abstract fun remove (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Foo.B - $this: VALUE_PARAMETER name: type:.Impl - VALUE_PARAMETER name:element index:0 type:@[FlexibleNullability] kotlin.String? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun remove (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Impl' - CALL 'public abstract fun remove (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null - receiver: GET_VAR ': .Impl declared in .Impl.remove' type=.Impl origin=null - element: GET_VAR 'element: @[FlexibleNullability] kotlin.String? declared in .Impl.remove' type=@[FlexibleNullability] kotlin.String? origin=null - FUN DELEGATED_MEMBER name:removeAll visibility:public modality:OPEN <> ($this:.Impl, elements:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Boolean - overridden: - public abstract fun removeAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Foo.A - public abstract fun removeAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Foo.B - $this: VALUE_PARAMETER name: type:.Impl - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun removeAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Impl' - CALL 'public abstract fun removeAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null - receiver: GET_VAR ': .Impl declared in .Impl.removeAll' type=.Impl origin=null - elements: GET_VAR 'elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> declared in .Impl.removeAll' type=kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> origin=null - FUN DELEGATED_MEMBER name:retainAll visibility:public modality:OPEN <> ($this:.Impl, elements:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Boolean - overridden: - public abstract fun retainAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Foo.A - public abstract fun retainAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Foo.B - $this: VALUE_PARAMETER name: type:.Impl - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun retainAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Impl' - CALL 'public abstract fun retainAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null - receiver: GET_VAR ': .Impl declared in .Impl.retainAll' type=.Impl origin=null - elements: GET_VAR 'elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> declared in .Impl.retainAll' type=kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> origin=null - FUN DELEGATED_MEMBER name:isEmpty visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.Boolean - overridden: - public abstract fun isEmpty (): kotlin.Boolean declared in .Foo.A - public abstract fun isEmpty (): kotlin.Boolean declared in .Foo.B - $this: VALUE_PARAMETER name: type:.Impl - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun isEmpty (): kotlin.Boolean declared in .Impl' - CALL 'public abstract fun isEmpty (): kotlin.Boolean declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null - receiver: GET_VAR ': .Impl declared in .Impl.isEmpty' type=.Impl origin=null - FUN DELEGATED_MEMBER name:contains visibility:public modality:OPEN <> ($this:.Impl, element:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Boolean [operator] - overridden: - public abstract fun contains (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Foo.A - public abstract fun contains (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Foo.B - $this: VALUE_PARAMETER name: type:.Impl - VALUE_PARAMETER name:element index:0 type:@[FlexibleNullability] kotlin.String? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun contains (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Impl' - CALL 'public abstract fun contains (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null - receiver: GET_VAR ': .Impl declared in .Impl.contains' type=.Impl origin=null - element: GET_VAR 'element: @[FlexibleNullability] kotlin.String? declared in .Impl.contains' type=@[FlexibleNullability] kotlin.String? origin=null - FUN DELEGATED_MEMBER name:containsAll visibility:public modality:OPEN <> ($this:.Impl, elements:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Boolean - overridden: - public abstract fun containsAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Foo.A - public abstract fun containsAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Foo.B - $this: VALUE_PARAMETER name: type:.Impl - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun containsAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Impl' - CALL 'public abstract fun containsAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null - receiver: GET_VAR ': .Impl declared in .Impl.containsAll' type=.Impl origin=null - elements: GET_VAR 'elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> declared in .Impl.containsAll' type=kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> origin=null - PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] - overridden: - public abstract size: kotlin.Int - public abstract size: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .Foo.A - public abstract fun (): kotlin.Int declared in .Foo.B - $this: VALUE_PARAMETER name: type:.Impl - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Impl' - CALL 'public abstract fun (): kotlin.Int declared in .Foo.B' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null - receiver: GET_VAR ': .Impl declared in .Impl.' type=.Impl 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 .Foo.A - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Foo.B - $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 .Foo.A - public open fun hashCode (): kotlin.Int declared in .Foo.B - $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 .Foo.A - public open fun toString (): kotlin.String declared in .Foo.B - $this: VALUE_PARAMETER name: type:kotlin.Any - 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 ' - CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.kt.txt b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.kt.txt deleted file mode 100644 index 66552866d53..00000000000 --- a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.kt.txt +++ /dev/null @@ -1,59 +0,0 @@ -class Impl : A, B { - constructor(b: B) /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: B = b - override fun add(element: @FlexibleNullability String?): Boolean { - return .#$$delegate_0.add(element = element) - } - - override fun addAll(elements: Collection<@FlexibleNullability String?>): Boolean { - return .#$$delegate_0.addAll(elements = elements) - } - - override fun clear() { - .#$$delegate_0.clear() - } - - override operator fun iterator(): MutableIterator<@FlexibleNullability String?> { - return .#$$delegate_0.iterator() - } - - override fun remove(element: @FlexibleNullability String?): Boolean { - return .#$$delegate_0.remove(element = element) - } - - override fun removeAll(elements: Collection<@FlexibleNullability String?>): Boolean { - return .#$$delegate_0.removeAll(elements = elements) - } - - override fun retainAll(elements: Collection<@FlexibleNullability String?>): Boolean { - return .#$$delegate_0.retainAll(elements = elements) - } - - override fun isEmpty(): Boolean { - return .#$$delegate_0.isEmpty() - } - - override operator fun contains(element: @FlexibleNullability String?): Boolean { - return .#$$delegate_0.contains(element = element) - } - - override fun containsAll(elements: Collection<@FlexibleNullability String?>): Boolean { - return .#$$delegate_0.containsAll(elements = elements) - } - - override val size: Int - override get(): Int { - return .#$$delegate_0.() - } - -} - -fun box(): String { - return "OK" -} - diff --git a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.ir.txt b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.ir.txt index 42d1262ec99..1d3b9d8b8bc 100644 --- a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.ir.txt +++ b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.ir.txt @@ -1,29 +1,14 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt CLASS CLASS name:Impl modality:FINAL visibility:public superTypes:[.Foo.A; .Foo.B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Impl + FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final] + EXPRESSION_BODY + GET_VAR 'b: .Foo.B declared in .Impl.' type=.Foo.B origin=null CONSTRUCTOR visibility:public <> (b:.Foo.B) returnType:.Impl [primary] VALUE_PARAMETER name:b index:0 type:.Foo.B BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Impl modality:FINAL visibility:public superTypes:[.Foo.A; .Foo.B]' - FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final] - EXPRESSION_BODY - GET_VAR 'b: .Foo.B declared in .Impl.' type=.Foo.B origin=null - PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] - overridden: - public abstract size: kotlin.Int - public abstract size: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .Foo.A - public abstract fun (): kotlin.Int declared in .Foo.B - $this: VALUE_PARAMETER name: type:.Impl - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Impl' - CALL 'public abstract fun (): kotlin.Int declared in .Foo.B' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null - receiver: GET_VAR ': .Impl declared in .Impl.' type=.Impl origin=null FUN DELEGATED_MEMBER name:add visibility:public modality:OPEN <> ($this:.Impl, element:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Boolean overridden: public abstract fun add (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Foo.A @@ -153,6 +138,21 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt public open fun toString (): kotlin.String declared in .Foo.A public open fun toString (): kotlin.String declared in .Foo.B $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] + overridden: + public abstract size: kotlin.Int + public abstract size: kotlin.Int + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.Int + correspondingProperty: PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in .Foo.A + public abstract fun (): kotlin.Int declared in .Foo.B + $this: VALUE_PARAMETER name: type:.Impl + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Impl' + CALL 'public abstract fun (): kotlin.Int declared in .Foo.B' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null + receiver: GET_VAR ': .Impl declared in .Impl.' type=.Impl 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 ' diff --git a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt index 5adc461fd0f..0002f4eecda 100644 --- a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt +++ b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // TARGET_BACKEND: JVM // FILE: Foo.java diff --git a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt.txt b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt.txt index 83dbb17d218..0e2c8353571 100644 --- a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt.txt +++ b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt.txt @@ -1,16 +1,11 @@ class Impl : A, B { + private /* final field */ val $$delegate_0: B = b constructor(b: B) /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: B = b - override val size: Int - override get(): Int { - return .#$$delegate_0.() - } - override fun add(element: @FlexibleNullability String?): Boolean { return .#$$delegate_0.add(element = element) } @@ -51,8 +46,14 @@ class Impl : A, B { return .#$$delegate_0.retainAll(elements = elements) } + override val size: Int + override get(): Int { + return .#$$delegate_0.() + } + } fun box(): String { return "OK" } + diff --git a/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.ir.txt b/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.ir.txt index f3585a00c16..48aa963c780 100644 --- a/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.ir.txt +++ b/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.ir.txt @@ -1,38 +1,10 @@ FILE fqName: fileName:/ErrorInDefaultValue.kt - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - FUN name:f visibility:public modality:ABSTRACT <> ($this:.A, x:kotlin.String) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:x index:0 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="OK" - 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: 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 CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B CONSTRUCTOR visibility:public <> () returnType:.B [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A]' - FUN name:f visibility:public modality:OPEN <> ($this:.B, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun f (x: kotlin.String): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun f (x: kotlin.String): kotlin.String declared in .B' - GET_VAR 'x: kotlin.String declared in .B.f' type=kotlin.String 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 .A @@ -46,13 +18,16 @@ FILE fqName: fileName:/ErrorInDefaultValue.kt overridden: public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:OPEN <> ($this:.B, x:kotlin.String) returnType:kotlin.String + overridden: + public abstract fun f (x: kotlin.String): kotlin.String declared in .A + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun f (x: kotlin.String): kotlin.String declared in .B' + GET_VAR 'x: kotlin.String declared in .B.f' type=kotlin.String origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (x:.A) returnType:.C [primary] - VALUE_PARAMETER name:x index:0 type:.A - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:.A visibility:private [final] EXPRESSION_BODY @@ -64,6 +39,11 @@ FILE fqName: fileName:/ErrorInDefaultValue.kt RETURN type=kotlin.Nothing from='public final fun (): .A declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:.A visibility:private [final]' type=.A origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> (x:.A) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:.A + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A]' FUN DELEGATED_MEMBER name:f visibility:public modality:OPEN <> ($this:.C, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun f (x: kotlin.String): kotlin.String declared in .A @@ -88,3 +68,23 @@ FILE fqName: fileName:/ErrorInDefaultValue.kt overridden: public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + 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: 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:f visibility:public modality:ABSTRACT <> ($this:.A, x:kotlin.String) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:x index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.kt.txt b/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.kt.txt index ad687810b26..d8e9ffae404 100644 --- a/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.kt.txt @@ -1,8 +1,3 @@ -interface A { - abstract fun f(x: String = "OK"): String - -} - class B : A { constructor() /* primary */ { super/*Any*/() @@ -17,18 +12,24 @@ class B : A { } class C : A { + val x: A + field = x + get + constructor(x: A) /* primary */ { super/*Any*/() /* () */ } - val x: A - field = x - get - override fun f(x: String): String { return .#x.f(x = x) } } + +interface A { + abstract fun f(x: String = "OK"): String + +} + diff --git a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.ir.txt b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.ir.txt index 82b0e279d47..917bb1bce93 100644 --- a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt CLASS CLASS name:Wrapper modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Wrapper - CONSTRUCTOR visibility:public <> () returnType:.Wrapper [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Wrapper modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:dummy visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:dummy type:.Wrapper.dummy. visibility:private [final] EXPRESSION_BODY @@ -15,14 +11,6 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Bar]' - PROPERTY FAKE_OVERRIDE name:foo visibility:public modality:OPEN [fake_override,val] - overridden: - public open foo: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Bar) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:foo visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Bar - $this: VALUE_PARAMETER name: type:.Bar 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 .Bar @@ -36,6 +24,14 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt overridden: public open fun toString (): kotlin.String declared in .Bar $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:foo visibility:public modality:OPEN [fake_override,val] + overridden: + public open foo: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Bar) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:foo visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Bar + $this: VALUE_PARAMETER name: type:.Bar CONSTRUCTOR_CALL 'public constructor () declared in .Wrapper.dummy.' type=.Wrapper.dummy. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Wrapper) returnType:.Wrapper.dummy. correspondingProperty: PROPERTY name:dummy visibility:private modality:FINAL [val] @@ -50,27 +46,14 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt BLOCK type=.Wrapper.bar. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Bar] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Wrapper.bar. - CONSTRUCTOR visibility:public <> () returnType:.Wrapper.bar. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Bar]' FIELD DELEGATE name:$$delegate_0 type:.Wrapper.dummy. visibility:private [final] EXPRESSION_BODY CALL 'private final fun (): .Wrapper.dummy. declared in .Wrapper' type=.Wrapper.dummy. origin=GET_PROPERTY $this: GET_VAR ': .Wrapper declared in .Wrapper' type=.Wrapper origin=null - PROPERTY DELEGATED_MEMBER name:foo visibility:public modality:OPEN [val] - overridden: - public open foo: kotlin.String - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Wrapper.bar.) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:foo visibility:public modality:OPEN [val] - overridden: - public open fun (): kotlin.String declared in .Bar - $this: VALUE_PARAMETER name: type:.Wrapper.bar. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Wrapper.bar.' - CALL 'public open fun (): kotlin.String declared in .Bar' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Wrapper.dummy. visibility:private [final]' type=.Wrapper.dummy. origin=null - receiver: GET_VAR ': .Wrapper.bar. declared in .Wrapper.bar..' type=.Wrapper.bar. origin=null + CONSTRUCTOR visibility:public <> () returnType:.Wrapper.bar. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Bar]' 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 .Bar @@ -84,6 +67,19 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt overridden: public open fun toString (): kotlin.String declared in .Bar $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY DELEGATED_MEMBER name:foo visibility:public modality:OPEN [val] + overridden: + public open foo: kotlin.String + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Wrapper.bar.) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:foo visibility:public modality:OPEN [val] + overridden: + public open fun (): kotlin.String declared in .Bar + $this: VALUE_PARAMETER name: type:.Wrapper.bar. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Wrapper.bar.' + CALL 'public open fun (): kotlin.String declared in .Bar' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Wrapper.dummy. visibility:private [final]' type=.Wrapper.dummy. origin=null + receiver: GET_VAR ': .Wrapper.bar. declared in .Wrapper.bar..' type=.Wrapper.bar. origin=null CONSTRUCTOR_CALL 'public constructor () declared in .Wrapper.bar.' type=.Wrapper.bar. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Wrapper) returnType:.Wrapper.bar. correspondingProperty: PROPERTY name:bar visibility:private modality:FINAL [val] @@ -92,6 +88,10 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt RETURN type=kotlin.Nothing from='private final fun (): .Wrapper.bar. declared in .Wrapper' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:.Wrapper.bar. visibility:private [final]' type=.Wrapper.bar. origin=null receiver: GET_VAR ': .Wrapper declared in .Wrapper.' type=.Wrapper origin=null + CONSTRUCTOR visibility:public <> () returnType:.Wrapper [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Wrapper modality:FINAL visibility:public 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 declared in kotlin.Any @@ -107,13 +107,6 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:Bar modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Bar - PROPERTY name:foo visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN <> ($this:.Bar) returnType:kotlin.String - correspondingProperty: PROPERTY name:foo visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.Bar - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Bar' - CONST String type=kotlin.String value="" 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 @@ -127,3 +120,10 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:foo visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.Bar) returnType:kotlin.String + correspondingProperty: PROPERTY name:foo visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.Bar + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Bar' + CONST String type=kotlin.String value="" diff --git a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.kt.txt b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.kt.txt index ccfb2029f5e..629a9bc98a8 100644 --- a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.kt.txt @@ -1,10 +1,4 @@ class Wrapper { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - private val dummy: field = { // BLOCK local class : Bar { @@ -23,13 +17,13 @@ class Wrapper { private val bar: field = { // BLOCK local class : Bar { + private /* final field */ val $$delegate_0: = .() constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: = .() override val foo: String override get(): String { return .#$$delegate_0.() @@ -41,6 +35,12 @@ class Wrapper { } private get + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } interface Bar { diff --git a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.ir.txt b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.ir.txt index 2030c5b08c7..ba1d0111fdf 100644 --- a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.ir.txt +++ b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt CLASS CLASS name:Wrapper modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Wrapper - CONSTRUCTOR visibility:public <> () returnType:.Wrapper [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Wrapper modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:dummy visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:dummy type:.Wrapper.dummy. visibility:private [final] EXPRESSION_BODY @@ -15,14 +11,6 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Bar]' - PROPERTY FAKE_OVERRIDE name:foo visibility:public modality:OPEN [fake_override,val] - overridden: - public open foo: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Bar) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:foo visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Bar - $this: VALUE_PARAMETER name: type:.Bar 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 .Bar @@ -36,6 +24,14 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt overridden: public open fun toString (): kotlin.String declared in .Bar $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:foo visibility:public modality:OPEN [fake_override,val] + overridden: + public open foo: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Bar) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:foo visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Bar + $this: VALUE_PARAMETER name: type:.Bar CONSTRUCTOR_CALL 'public constructor () declared in .Wrapper.dummy.' type=.Wrapper.dummy. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Wrapper) returnType:.Wrapper.dummy. correspondingProperty: PROPERTY name:dummy visibility:private modality:FINAL [val] @@ -50,27 +46,14 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt BLOCK type=.Wrapper.bar. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Bar] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Wrapper.bar. - CONSTRUCTOR visibility:public <> () returnType:.Wrapper.bar. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Bar]' FIELD DELEGATE name:$$delegate_0 type:.Wrapper.dummy. visibility:private [final] EXPRESSION_BODY CALL 'private final fun (): .Wrapper.dummy. declared in .Wrapper' type=.Wrapper.dummy. origin=GET_PROPERTY $this: GET_VAR ': .Wrapper declared in .Wrapper' type=.Wrapper origin=null - PROPERTY DELEGATED_MEMBER name:foo visibility:public modality:OPEN [val] - overridden: - public open foo: kotlin.String - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Wrapper.bar.) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:foo visibility:public modality:OPEN [val] - overridden: - public open fun (): kotlin.String declared in .Bar - $this: VALUE_PARAMETER name: type:.Wrapper.bar. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Wrapper.bar.' - CALL 'public open fun (): kotlin.String declared in .Wrapper.dummy.' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Wrapper.dummy. visibility:private [final]' type=.Wrapper.dummy. origin=null - receiver: GET_VAR ': .Wrapper.bar. declared in .Wrapper.bar..' type=.Wrapper.bar. origin=null + CONSTRUCTOR visibility:public <> () returnType:.Wrapper.bar. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Bar]' 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 .Bar @@ -84,6 +67,19 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt overridden: public open fun toString (): kotlin.String declared in .Bar $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY DELEGATED_MEMBER name:foo visibility:public modality:OPEN [val] + overridden: + public open foo: kotlin.String + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Wrapper.bar.) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:foo visibility:public modality:OPEN [val] + overridden: + public open fun (): kotlin.String declared in .Bar + $this: VALUE_PARAMETER name: type:.Wrapper.bar. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Wrapper.bar.' + CALL 'public open fun (): kotlin.String declared in .Wrapper.dummy.' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Wrapper.dummy. visibility:private [final]' type=.Wrapper.dummy. origin=null + receiver: GET_VAR ': .Wrapper.bar. declared in .Wrapper.bar..' type=.Wrapper.bar. origin=null CONSTRUCTOR_CALL 'public constructor () declared in .Wrapper.bar.' type=.Wrapper.bar. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Wrapper) returnType:.Wrapper.bar. correspondingProperty: PROPERTY name:bar visibility:private modality:FINAL [val] @@ -92,6 +88,10 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt RETURN type=kotlin.Nothing from='private final fun (): .Wrapper.bar. declared in .Wrapper' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:.Wrapper.bar. visibility:private [final]' type=.Wrapper.bar. origin=null receiver: GET_VAR ': .Wrapper declared in .Wrapper.' type=.Wrapper origin=null + CONSTRUCTOR visibility:public <> () returnType:.Wrapper [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Wrapper modality:FINAL visibility:public 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 declared in kotlin.Any @@ -107,13 +107,6 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:Bar modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Bar - PROPERTY name:foo visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN <> ($this:.Bar) returnType:kotlin.String - correspondingProperty: PROPERTY name:foo visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.Bar - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Bar' - CONST String type=kotlin.String value="" 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 @@ -127,3 +120,10 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:foo visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.Bar) returnType:kotlin.String + correspondingProperty: PROPERTY name:foo visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.Bar + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Bar' + CONST String type=kotlin.String value="" diff --git a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.kt.txt b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.kt.txt index c6f18bc7235..629a9bc98a8 100644 --- a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.kt.txt +++ b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.kt.txt @@ -1,10 +1,4 @@ class Wrapper { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - private val dummy: field = { // BLOCK local class : Bar { @@ -23,13 +17,13 @@ class Wrapper { private val bar: field = { // BLOCK local class : Bar { + private /* final field */ val $$delegate_0: = .() constructor() /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: = .() override val foo: String override get(): String { return .#$$delegate_0.() @@ -41,6 +35,12 @@ class Wrapper { } private get + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } interface Bar { @@ -50,3 +50,4 @@ interface Bar { } } + diff --git a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.ir.txt b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.ir.txt deleted file mode 100644 index 20de07cc068..00000000000 --- a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.ir.txt +++ /dev/null @@ -1,181 +0,0 @@ -FILE fqName: fileName:/Fir2IrClassifierStorage.kt - CLASS CLASS name:FirSession modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirSession - CONSTRUCTOR visibility:public <> (name:kotlin.String) returnType:.FirSession [primary] - VALUE_PARAMETER name:name index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirSession modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:name visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'name: kotlin.String declared in .FirSession.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirSession) returnType:kotlin.String - correspondingProperty: PROPERTY name:name visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.FirSession - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .FirSession' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .FirSession declared in .FirSession.' type=.FirSession 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: 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 - CLASS INTERFACE name:Fir2IrComponents modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fir2IrComponents - PROPERTY name:session visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Fir2IrComponents) returnType:.FirSession - correspondingProperty: PROPERTY name:session visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Fir2IrComponents - PROPERTY name:classifierStorage visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Fir2IrComponents) returnType:.Fir2IrClassifierStorage - correspondingProperty: PROPERTY name:classifierStorage visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Fir2IrComponents - 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: 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 - CLASS CLASS name:Fir2IrComponentsStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fir2IrComponentsStorage - CONSTRUCTOR visibility:public <> (session:.FirSession) returnType:.Fir2IrComponentsStorage [primary] - VALUE_PARAMETER name:session index:0 type:.FirSession - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Fir2IrComponentsStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents]' - PROPERTY name:session visibility:public modality:OPEN [val] - overridden: - public abstract session: .FirSession - FIELD PROPERTY_BACKING_FIELD name:session type:.FirSession visibility:private [final] - EXPRESSION_BODY - GET_VAR 'session: .FirSession declared in .Fir2IrComponentsStorage.' type=.FirSession origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.Fir2IrComponentsStorage) returnType:.FirSession - correspondingProperty: PROPERTY name:session visibility:public modality:OPEN [val] - overridden: - public abstract fun (): .FirSession declared in .Fir2IrComponents - $this: VALUE_PARAMETER name: type:.Fir2IrComponentsStorage - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): .FirSession declared in .Fir2IrComponentsStorage' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:session type:.FirSession visibility:private [final]' type=.FirSession origin=null - receiver: GET_VAR ': .Fir2IrComponentsStorage declared in .Fir2IrComponentsStorage.' type=.Fir2IrComponentsStorage origin=null - PROPERTY name:classifierStorage visibility:public modality:OPEN [lateinit,var] - overridden: - public abstract classifierStorage: .Fir2IrClassifierStorage - FIELD PROPERTY_BACKING_FIELD name:classifierStorage type:.Fir2IrClassifierStorage visibility:public - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.Fir2IrComponentsStorage) returnType:.Fir2IrClassifierStorage - correspondingProperty: PROPERTY name:classifierStorage visibility:public modality:OPEN [lateinit,var] - overridden: - public abstract fun (): .Fir2IrClassifierStorage declared in .Fir2IrComponents - $this: VALUE_PARAMETER name: type:.Fir2IrComponentsStorage - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): .Fir2IrClassifierStorage declared in .Fir2IrComponentsStorage' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:classifierStorage type:.Fir2IrClassifierStorage visibility:public' type=.Fir2IrClassifierStorage origin=null - receiver: GET_VAR ': .Fir2IrComponentsStorage declared in .Fir2IrComponentsStorage.' type=.Fir2IrComponentsStorage origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.Fir2IrComponentsStorage, :.Fir2IrClassifierStorage) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:classifierStorage visibility:public modality:OPEN [lateinit,var] - $this: VALUE_PARAMETER name: type:.Fir2IrComponentsStorage - VALUE_PARAMETER name: index:0 type:.Fir2IrClassifierStorage - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:classifierStorage type:.Fir2IrClassifierStorage visibility:public' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Fir2IrComponentsStorage declared in .Fir2IrComponentsStorage.' type=.Fir2IrComponentsStorage origin=null - value: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrComponentsStorage.' type=.Fir2IrClassifierStorage 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 .Fir2IrComponents - $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 .Fir2IrComponents - $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 .Fir2IrComponents - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Fir2IrClassifierStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fir2IrClassifierStorage - CONSTRUCTOR visibility:public <> (components:.Fir2IrComponents) returnType:.Fir2IrClassifierStorage [primary] - VALUE_PARAMETER name:components index:0 type:.Fir2IrComponents - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Fir2IrClassifierStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents]' - PROPERTY name:components visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final] - EXPRESSION_BODY - GET_VAR 'components: .Fir2IrComponents declared in .Fir2IrClassifierStorage.' type=.Fir2IrComponents origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Fir2IrClassifierStorage) returnType:.Fir2IrComponents - correspondingProperty: PROPERTY name:components visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): .Fir2IrComponents declared in .Fir2IrClassifierStorage' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final]' type=.Fir2IrComponents origin=null - receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null - PROPERTY DELEGATED_MEMBER name:session visibility:public modality:OPEN [val] - overridden: - public abstract session: .FirSession - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Fir2IrClassifierStorage) returnType:.FirSession - correspondingProperty: PROPERTY DELEGATED_MEMBER name:session visibility:public modality:OPEN [val] - overridden: - public abstract fun (): .FirSession declared in .Fir2IrComponents - $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): .FirSession declared in .Fir2IrClassifierStorage' - CALL 'public abstract fun (): .FirSession declared in .Fir2IrComponents' type=.FirSession origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final]' type=.Fir2IrComponents origin=null - receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null - PROPERTY DELEGATED_MEMBER name:classifierStorage visibility:public modality:OPEN [val] - overridden: - public abstract classifierStorage: .Fir2IrClassifierStorage - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Fir2IrClassifierStorage) returnType:.Fir2IrClassifierStorage - correspondingProperty: PROPERTY DELEGATED_MEMBER name:classifierStorage visibility:public modality:OPEN [val] - overridden: - public abstract fun (): .Fir2IrClassifierStorage declared in .Fir2IrComponents - $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage' - CALL 'public abstract fun (): .Fir2IrClassifierStorage declared in .Fir2IrComponents' type=.Fir2IrClassifierStorage origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final]' type=.Fir2IrComponents origin=null - receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null - PROPERTY name:name visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun (): kotlin.String declared in .FirSession' type=kotlin.String origin=GET_PROPERTY - $this: CALL 'public open fun (): .FirSession declared in .Fir2IrClassifierStorage' type=.FirSession origin=GET_PROPERTY - $this: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage' type=.Fir2IrClassifierStorage origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Fir2IrClassifierStorage) returnType:kotlin.String - correspondingProperty: PROPERTY name:name visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.String declared in .Fir2IrClassifierStorage' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage 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 .Fir2IrComponents - $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 .Fir2IrComponents - $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 .Fir2IrComponents - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.kt.txt b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.kt.txt deleted file mode 100644 index a8b227edf76..00000000000 --- a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.kt.txt +++ /dev/null @@ -1,65 +0,0 @@ -class FirSession { - constructor(name: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val name: String - field = name - get - -} - -interface Fir2IrComponents { - abstract val session: FirSession - abstract get - - abstract val classifierStorage: Fir2IrClassifierStorage - abstract get - -} - -class Fir2IrComponentsStorage : Fir2IrComponents { - constructor(session: FirSession) /* primary */ { - super/*Any*/() - /* () */ - - } - - override val session: FirSession - field = session - override get - - override lateinit var classifierStorage: Fir2IrClassifierStorage - override get - open set - -} - -class Fir2IrClassifierStorage : Fir2IrComponents { - constructor(components: Fir2IrComponents) /* primary */ { - super/*Any*/() - /* () */ - - } - - private val components: Fir2IrComponents - field = components - private get - - override val session: FirSession - override get(): FirSession { - return .#components.() - } - - override val classifierStorage: Fir2IrClassifierStorage - override get(): Fir2IrClassifierStorage { - return .#components.() - } - - private val name: String - field = .().() - private get - -} diff --git a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.ir.txt b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.ir.txt index 456b980b0b3..fd075a93fe7 100644 --- a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.ir.txt +++ b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.ir.txt @@ -1,65 +1,76 @@ FILE fqName: fileName:/Fir2IrClassifierStorage.kt - CLASS CLASS name:FirSession modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirSession - CONSTRUCTOR visibility:public <> (name:kotlin.String) returnType:.FirSession [primary] - VALUE_PARAMETER name:name index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirSession modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:name visibility:public modality:FINAL [val] + CLASS CLASS name:Fir2IrClassifierStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fir2IrClassifierStorage + PROPERTY name:components visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final] + EXPRESSION_BODY + GET_VAR 'components: .Fir2IrComponents declared in .Fir2IrClassifierStorage.' type=.Fir2IrComponents origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Fir2IrClassifierStorage) returnType:.Fir2IrComponents + correspondingProperty: PROPERTY name:components visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): .Fir2IrComponents declared in .Fir2IrClassifierStorage' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final]' type=.Fir2IrComponents origin=null + receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null + PROPERTY name:name visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] EXPRESSION_BODY - GET_VAR 'name: kotlin.String declared in .FirSession.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirSession) returnType:kotlin.String - correspondingProperty: PROPERTY name:name visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.FirSession + CALL 'public final fun (): kotlin.String declared in .FirSession' type=kotlin.String origin=GET_PROPERTY + $this: CALL 'public open fun (): .FirSession declared in .Fir2IrClassifierStorage' type=.FirSession origin=GET_PROPERTY + $this: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage' type=.Fir2IrClassifierStorage origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Fir2IrClassifierStorage) returnType:kotlin.String + correspondingProperty: PROPERTY name:name visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .FirSession' + RETURN type=kotlin.Nothing from='private final fun (): kotlin.String declared in .Fir2IrClassifierStorage' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .FirSession declared in .FirSession.' type=.FirSession 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: 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 - CLASS INTERFACE name:Fir2IrComponents modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fir2IrComponents - PROPERTY name:session visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Fir2IrComponents) returnType:.FirSession - correspondingProperty: PROPERTY name:session visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Fir2IrComponents - PROPERTY name:classifierStorage visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Fir2IrComponents) returnType:.Fir2IrClassifierStorage - correspondingProperty: PROPERTY name:classifierStorage visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Fir2IrComponents - 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: 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 - CLASS CLASS name:Fir2IrComponentsStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fir2IrComponentsStorage - CONSTRUCTOR visibility:public <> (session:.FirSession) returnType:.Fir2IrComponentsStorage [primary] - VALUE_PARAMETER name:session index:0 type:.FirSession + receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null + CONSTRUCTOR visibility:public <> (components:.Fir2IrComponents) returnType:.Fir2IrClassifierStorage [primary] + VALUE_PARAMETER name:components index:0 type:.Fir2IrComponents BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Fir2IrComponentsStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Fir2IrClassifierStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents]' + 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 .Fir2IrComponents + $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 .Fir2IrComponents + $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 .Fir2IrComponents + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY DELEGATED_MEMBER name:classifierStorage visibility:public modality:OPEN [val] + overridden: + public abstract classifierStorage: .Fir2IrClassifierStorage + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Fir2IrClassifierStorage) returnType:.Fir2IrClassifierStorage + correspondingProperty: PROPERTY DELEGATED_MEMBER name:classifierStorage visibility:public modality:OPEN [val] + overridden: + public abstract fun (): .Fir2IrClassifierStorage declared in .Fir2IrComponents + $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage' + CALL 'public abstract fun (): .Fir2IrClassifierStorage declared in .Fir2IrComponents' type=.Fir2IrClassifierStorage origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final]' type=.Fir2IrComponents origin=null + receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null + PROPERTY DELEGATED_MEMBER name:session visibility:public modality:OPEN [val] + overridden: + public abstract session: .FirSession + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Fir2IrClassifierStorage) returnType:.FirSession + correspondingProperty: PROPERTY DELEGATED_MEMBER name:session visibility:public modality:OPEN [val] + overridden: + public abstract fun (): .FirSession declared in .Fir2IrComponents + $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): .FirSession declared in .Fir2IrClassifierStorage' + CALL 'public abstract fun (): .FirSession declared in .Fir2IrComponents' type=.FirSession origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final]' type=.Fir2IrComponents origin=null + receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null + CLASS CLASS name:Fir2IrComponentsStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fir2IrComponentsStorage PROPERTY name:session visibility:public modality:OPEN [val] overridden: public abstract session: .FirSession @@ -96,76 +107,11 @@ FILE fqName: fileName:/Fir2IrClassifierStorage.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:classifierStorage type:.Fir2IrClassifierStorage visibility:public' type=kotlin.Unit origin=null receiver: GET_VAR ': .Fir2IrComponentsStorage declared in .Fir2IrComponentsStorage.' type=.Fir2IrComponentsStorage origin=null value: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrComponentsStorage.' type=.Fir2IrClassifierStorage 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 .Fir2IrComponents - $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 .Fir2IrComponents - $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 .Fir2IrComponents - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Fir2IrClassifierStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fir2IrClassifierStorage - CONSTRUCTOR visibility:public <> (components:.Fir2IrComponents) returnType:.Fir2IrClassifierStorage [primary] - VALUE_PARAMETER name:components index:0 type:.Fir2IrComponents + CONSTRUCTOR visibility:public <> (session:.FirSession) returnType:.Fir2IrComponentsStorage [primary] + VALUE_PARAMETER name:session index:0 type:.FirSession BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Fir2IrClassifierStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents]' - PROPERTY name:components visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final] - EXPRESSION_BODY - GET_VAR 'components: .Fir2IrComponents declared in .Fir2IrClassifierStorage.' type=.Fir2IrComponents origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Fir2IrClassifierStorage) returnType:.Fir2IrComponents - correspondingProperty: PROPERTY name:components visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): .Fir2IrComponents declared in .Fir2IrClassifierStorage' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final]' type=.Fir2IrComponents origin=null - receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null - PROPERTY DELEGATED_MEMBER name:classifierStorage visibility:public modality:OPEN [val] - overridden: - public abstract classifierStorage: .Fir2IrClassifierStorage - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Fir2IrClassifierStorage) returnType:.Fir2IrClassifierStorage - correspondingProperty: PROPERTY DELEGATED_MEMBER name:classifierStorage visibility:public modality:OPEN [val] - overridden: - public abstract fun (): .Fir2IrClassifierStorage declared in .Fir2IrComponents - $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage' - CALL 'public abstract fun (): .Fir2IrClassifierStorage declared in .Fir2IrComponents' type=.Fir2IrClassifierStorage origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final]' type=.Fir2IrComponents origin=null - receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null - PROPERTY DELEGATED_MEMBER name:session visibility:public modality:OPEN [val] - overridden: - public abstract session: .FirSession - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Fir2IrClassifierStorage) returnType:.FirSession - correspondingProperty: PROPERTY DELEGATED_MEMBER name:session visibility:public modality:OPEN [val] - overridden: - public abstract fun (): .FirSession declared in .Fir2IrComponents - $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): .FirSession declared in .Fir2IrClassifierStorage' - CALL 'public abstract fun (): .FirSession declared in .Fir2IrComponents' type=.FirSession origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final]' type=.Fir2IrComponents origin=null - receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null - PROPERTY name:name visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun (): kotlin.String declared in .FirSession' type=kotlin.String origin=GET_PROPERTY - $this: CALL 'public open fun (): .FirSession declared in .Fir2IrClassifierStorage' type=.FirSession origin=GET_PROPERTY - $this: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage' type=.Fir2IrClassifierStorage origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Fir2IrClassifierStorage) returnType:kotlin.String - correspondingProperty: PROPERTY name:name visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.String declared in .Fir2IrClassifierStorage' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Fir2IrComponentsStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents]' 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 .Fir2IrComponents @@ -179,3 +125,57 @@ FILE fqName: fileName:/Fir2IrClassifierStorage.kt overridden: public open fun toString (): kotlin.String declared in .Fir2IrComponents $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:FirSession modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirSession + PROPERTY name:name visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 'name: kotlin.String declared in .FirSession.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirSession) returnType:kotlin.String + correspondingProperty: PROPERTY name:name visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.FirSession + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .FirSession' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .FirSession declared in .FirSession.' type=.FirSession origin=null + CONSTRUCTOR visibility:public <> (name:kotlin.String) returnType:.FirSession [primary] + VALUE_PARAMETER name:name index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FirSession modality:FINAL visibility:public 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 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 + CLASS INTERFACE name:Fir2IrComponents modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Fir2IrComponents + 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: 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 + PROPERTY name:classifierStorage visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Fir2IrComponents) returnType:.Fir2IrClassifierStorage + correspondingProperty: PROPERTY name:classifierStorage visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.Fir2IrComponents + PROPERTY name:session visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Fir2IrComponents) returnType:.FirSession + correspondingProperty: PROPERTY name:session visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.Fir2IrComponents diff --git a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.kt b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.kt index 3fb5b303fdd..d6863fd1cbb 100644 --- a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.kt +++ b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class FirSession(val name: String) interface Fir2IrComponents { diff --git a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.kt.txt b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.kt.txt index e52d537d945..3f1a2f3196f 100644 --- a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.kt.txt +++ b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.kt.txt @@ -1,53 +1,18 @@ -class FirSession { - constructor(name: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val name: String - field = name - get - -} - -interface Fir2IrComponents { - abstract val session: FirSession - abstract get - - abstract val classifierStorage: Fir2IrClassifierStorage - abstract get - -} - -class Fir2IrComponentsStorage : Fir2IrComponents { - constructor(session: FirSession) /* primary */ { - super/*Any*/() - /* () */ - - } - - override val session: FirSession - field = session - override get - - override lateinit var classifierStorage: Fir2IrClassifierStorage - override get - open set - -} - class Fir2IrClassifierStorage : Fir2IrComponents { + private val components: Fir2IrComponents + field = components + private get + + private val name: String + field = .().() + private get + constructor(components: Fir2IrComponents) /* primary */ { super/*Any*/() /* () */ } - private val components: Fir2IrComponents - field = components - private get - override val classifierStorage: Fir2IrClassifierStorage override get(): Fir2IrClassifierStorage { return .#components.() @@ -58,8 +23,44 @@ class Fir2IrClassifierStorage : Fir2IrComponents { return .#components.() } - private val name: String - field = .().() - private get +} + +class Fir2IrComponentsStorage : Fir2IrComponents { + override val session: FirSession + field = session + override get + + override lateinit var classifierStorage: Fir2IrClassifierStorage + override get + open set + + constructor(session: FirSession) /* primary */ { + super/*Any*/() + /* () */ + + } } + +class FirSession { + val name: String + field = name + get + + constructor(name: String) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface Fir2IrComponents { + abstract val classifierStorage: Fir2IrClassifierStorage + abstract get + + abstract val session: FirSession + abstract get + +} + diff --git a/compiler/testData/ir/irText/firProblems/FirBuilder.ir.txt b/compiler/testData/ir/irText/firProblems/FirBuilder.ir.txt index 0c525efcb47..032b35a2d07 100644 --- a/compiler/testData/ir/irText/firProblems/FirBuilder.ir.txt +++ b/compiler/testData/ir/irText/firProblems/FirBuilder.ir.txt @@ -7,14 +7,6 @@ FILE fqName: fileName:/BaseFirBuilder.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseFirBuilder modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:withCapturedTypeParameters visibility:public modality:FINAL ($this:.BaseFirBuilder.BaseFirBuilder>, block:kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters>) returnType:T of .BaseFirBuilder.withCapturedTypeParameters [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.BaseFirBuilder.BaseFirBuilder> - VALUE_PARAMETER name:block index:0 type:kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withCapturedTypeParameters (block: kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters>): T of .BaseFirBuilder.withCapturedTypeParameters declared in .BaseFirBuilder' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .BaseFirBuilder.withCapturedTypeParameters origin=INVOKE - $this: GET_VAR 'block: kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters> declared in .BaseFirBuilder.withCapturedTypeParameters' type=kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters> origin=VARIABLE_AS_FUNCTION 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 @@ -28,6 +20,14 @@ FILE fqName: fileName:/BaseFirBuilder.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:withCapturedTypeParameters visibility:public modality:FINAL ($this:.BaseFirBuilder.BaseFirBuilder>, block:kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters>) returnType:T of .BaseFirBuilder.withCapturedTypeParameters [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.BaseFirBuilder.BaseFirBuilder> + VALUE_PARAMETER name:block index:0 type:kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun withCapturedTypeParameters (block: kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters>): T of .BaseFirBuilder.withCapturedTypeParameters declared in .BaseFirBuilder' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .BaseFirBuilder.withCapturedTypeParameters origin=INVOKE + $this: GET_VAR 'block: kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters> declared in .BaseFirBuilder.withCapturedTypeParameters' type=kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters> origin=VARIABLE_AS_FUNCTION Module: m2 FILE fqName: fileName:/FirBuilder.kt CLASS CLASS name:BaseConverter modality:OPEN visibility:public superTypes:[.BaseFirBuilder] @@ -37,12 +37,6 @@ FILE fqName: fileName:/FirBuilder.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .BaseFirBuilder' : kotlin.Any INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseConverter modality:OPEN visibility:public superTypes:[.BaseFirBuilder]' - FUN FAKE_OVERRIDE name:withCapturedTypeParameters visibility:public modality:FINAL ($this:.BaseFirBuilder, block:kotlin.Function0.BaseConverter.withCapturedTypeParameters>) returnType:T of .BaseConverter.withCapturedTypeParameters [inline,fake_override] - overridden: - public final fun withCapturedTypeParameters (block: kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters>): T of .BaseFirBuilder.withCapturedTypeParameters declared in .BaseFirBuilder - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.BaseFirBuilder - VALUE_PARAMETER name:block index:0 type:kotlin.Function0.BaseConverter.withCapturedTypeParameters> 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 .BaseFirBuilder @@ -56,18 +50,18 @@ FILE fqName: fileName:/FirBuilder.kt overridden: public open fun toString (): kotlin.String declared in .BaseFirBuilder $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:withCapturedTypeParameters visibility:public modality:FINAL ($this:.BaseFirBuilder, block:kotlin.Function0.BaseConverter.withCapturedTypeParameters>) returnType:T of .BaseConverter.withCapturedTypeParameters [inline,fake_override] + overridden: + public final fun withCapturedTypeParameters (block: kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters>): T of .BaseFirBuilder.withCapturedTypeParameters declared in .BaseFirBuilder + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.BaseFirBuilder + VALUE_PARAMETER name:block index:0 type:kotlin.Function0.BaseConverter.withCapturedTypeParameters> CLASS CLASS name:DeclarationsConverter modality:FINAL visibility:public superTypes:[.BaseConverter] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DeclarationsConverter CONSTRUCTOR visibility:public <> () returnType:.DeclarationsConverter [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .BaseConverter' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DeclarationsConverter modality:FINAL visibility:public superTypes:[.BaseConverter]' - FUN FAKE_OVERRIDE name:withCapturedTypeParameters visibility:public modality:FINAL ($this:.BaseFirBuilder, block:kotlin.Function0.DeclarationsConverter.withCapturedTypeParameters>) returnType:T of .DeclarationsConverter.withCapturedTypeParameters [inline,fake_override] - overridden: - public final fun withCapturedTypeParameters (block: kotlin.Function0.BaseConverter.withCapturedTypeParameters>): T of .BaseConverter.withCapturedTypeParameters declared in .BaseConverter - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.BaseFirBuilder - VALUE_PARAMETER name:block index:0 type:kotlin.Function0.DeclarationsConverter.withCapturedTypeParameters> 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 .BaseConverter @@ -81,3 +75,9 @@ FILE fqName: fileName:/FirBuilder.kt overridden: public open fun toString (): kotlin.String declared in .BaseConverter $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:withCapturedTypeParameters visibility:public modality:FINAL ($this:.BaseFirBuilder, block:kotlin.Function0.DeclarationsConverter.withCapturedTypeParameters>) returnType:T of .DeclarationsConverter.withCapturedTypeParameters [inline,fake_override] + overridden: + public final fun withCapturedTypeParameters (block: kotlin.Function0.BaseConverter.withCapturedTypeParameters>): T of .BaseConverter.withCapturedTypeParameters declared in .BaseConverter + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.BaseFirBuilder + VALUE_PARAMETER name:block index:0 type:kotlin.Function0.DeclarationsConverter.withCapturedTypeParameters> diff --git a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.ir.txt b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.ir.txt deleted file mode 100644 index 98c5c1b8e25..00000000000 --- a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.ir.txt +++ /dev/null @@ -1,62 +0,0 @@ -FILE fqName: fileName:/FlushFromAnonymous.kt - CLASS CLASS name:Serializer modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Serializer - CONSTRUCTOR visibility:public <> () returnType:.Serializer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Serializer modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:serialize visibility:public modality:FINAL <> ($this:.Serializer) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Serializer - BLOCK_BODY - VAR name:messageCollector type:.Serializer.createMessageCollector. [val] - CALL 'private final fun createMessageCollector (): .Serializer.createMessageCollector. declared in .Serializer' type=.Serializer.createMessageCollector. origin=null - $this: GET_VAR ': .Serializer declared in .Serializer.serialize' type=.Serializer origin=null - TRY type=kotlin.Unit - try: BLOCK type=kotlin.Unit origin=null - CATCH parameter=val e: kotlin.Throwable declared in .Serializer.serialize - VAR CATCH_PARAMETER name:e type:kotlin.Throwable [val] - BLOCK type=kotlin.Unit origin=null - CALL 'public open fun flush (): kotlin.Unit declared in .Serializer.createMessageCollector.' type=kotlin.Unit origin=null - $this: GET_VAR 'val messageCollector: .Serializer.createMessageCollector. declared in .Serializer.serialize' type=.Serializer.createMessageCollector. origin=null - FUN name:createMessageCollector visibility:private modality:FINAL <> ($this:.Serializer) returnType:.Serializer.createMessageCollector. - $this: VALUE_PARAMETER name: type:.Serializer - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun createMessageCollector (): .Serializer.createMessageCollector. declared in .Serializer' - BLOCK type=.Serializer.createMessageCollector. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Collector] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Serializer.createMessageCollector. - CONSTRUCTOR visibility:public <> () returnType:.Serializer.createMessageCollector. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Collector' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Collector]' - FUN FAKE_OVERRIDE name:flush visibility:public modality:OPEN <> ($this:.Collector) returnType:kotlin.Unit [fake_override] - overridden: - public open fun flush (): kotlin.Unit declared in .Collector - $this: VALUE_PARAMETER name: type:.Collector - 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 .Collector - $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 .Collector - $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 .Collector - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .Serializer.createMessageCollector.' type=.Serializer.createMessageCollector. origin=OBJECT_LITERAL - 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.kt.txt b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.kt.txt deleted file mode 100644 index 28f92c64e3d..00000000000 --- a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.kt.txt +++ /dev/null @@ -1,33 +0,0 @@ -class Serializer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun serialize() { - val messageCollector: = .createMessageCollector() - try { // BLOCK - } - catch (e: Throwable){ // BLOCK - messageCollector.flush() - } - - } - - private fun createMessageCollector(): { - return { // BLOCK - local class : Collector { - constructor() /* primary */ { - super/*Collector*/() - /* () */ - - } - - } - - () - } - } - -} diff --git a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.ir.txt b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.ir.txt index 3ddc7347bc5..4ae6ecbb575 100644 --- a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.ir.txt +++ b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.ir.txt @@ -5,19 +5,19 @@ FILE fqName: fileName:/FlushFromAnonymous.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Serializer modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:serialize visibility:public modality:FINAL <> ($this:.Serializer) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Serializer - BLOCK_BODY - VAR name:messageCollector type:.Serializer.createMessageCollector. [val] - CALL 'private final fun createMessageCollector (): .Serializer.createMessageCollector. declared in .Serializer' type=.Serializer.createMessageCollector. origin=null - $this: GET_VAR ': .Serializer declared in .Serializer.serialize' type=.Serializer origin=null - TRY type=kotlin.Unit - try: BLOCK type=kotlin.Unit origin=null - CATCH parameter=val e: kotlin.Throwable declared in .Serializer.serialize - VAR CATCH_PARAMETER name:e type:kotlin.Throwable [val] - BLOCK type=kotlin.Unit origin=null - CALL 'public open fun flush (): kotlin.Unit declared in .Serializer.createMessageCollector.' type=kotlin.Unit origin=null - $this: GET_VAR 'val messageCollector: .Serializer.createMessageCollector. declared in .Serializer.serialize' type=.Serializer.createMessageCollector. 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: 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:createMessageCollector visibility:private modality:FINAL <> ($this:.Serializer) returnType:.Serializer.createMessageCollector. $this: VALUE_PARAMETER name: type:.Serializer BLOCK_BODY @@ -34,6 +34,10 @@ FILE fqName: fileName:/FlushFromAnonymous.kt public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Collector $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:flush visibility:public modality:OPEN <> ($this:.Collector) returnType:kotlin.Unit [fake_override] + overridden: + public open fun flush (): kotlin.Unit declared in .Collector + $this: VALUE_PARAMETER name: type:.Collector 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 .Collector @@ -42,21 +46,17 @@ FILE fqName: fileName:/FlushFromAnonymous.kt overridden: public open fun toString (): kotlin.String declared in .Collector $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:flush visibility:public modality:OPEN <> ($this:.Collector) returnType:kotlin.Unit [fake_override] - overridden: - public open fun flush (): kotlin.Unit declared in .Collector - $this: VALUE_PARAMETER name: type:.Collector CONSTRUCTOR_CALL 'public constructor () declared in .Serializer.createMessageCollector.' type=.Serializer.createMessageCollector. origin=OBJECT_LITERAL - 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: 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:serialize visibility:public modality:FINAL <> ($this:.Serializer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Serializer + BLOCK_BODY + VAR name:messageCollector type:.Serializer.createMessageCollector. [val] + CALL 'private final fun createMessageCollector (): .Serializer.createMessageCollector. declared in .Serializer' type=.Serializer.createMessageCollector. origin=null + $this: GET_VAR ': .Serializer declared in .Serializer.serialize' type=.Serializer origin=null + TRY type=kotlin.Unit + try: BLOCK type=kotlin.Unit origin=null + CATCH parameter=val e: kotlin.Throwable declared in .Serializer.serialize + VAR CATCH_PARAMETER name:e type:kotlin.Throwable [val] + BLOCK type=kotlin.Unit origin=null + CALL 'public open fun flush (): kotlin.Unit declared in .Serializer.createMessageCollector.' type=kotlin.Unit origin=null + $this: GET_VAR 'val messageCollector: .Serializer.createMessageCollector. declared in .Serializer.serialize' type=.Serializer.createMessageCollector. origin=null diff --git a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.kt b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.kt index 5e9498307f2..76042ec429b 100644 --- a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.kt +++ b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // TARGET_BACKEND: JVM_IR // SKIP_KLIB_TEST diff --git a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.kt.txt b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.kt.txt index 28f92c64e3d..ecd09648d26 100644 --- a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.kt.txt +++ b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.kt.txt @@ -5,16 +5,6 @@ class Serializer { } - fun serialize() { - val messageCollector: = .createMessageCollector() - try { // BLOCK - } - catch (e: Throwable){ // BLOCK - messageCollector.flush() - } - - } - private fun createMessageCollector(): { return { // BLOCK local class : Collector { @@ -30,4 +20,15 @@ class Serializer { } } + fun serialize() { + val messageCollector: = .createMessageCollector() + try { // BLOCK + } + catch (e: Throwable){ // BLOCK + messageCollector.flush() + } + + } + } + diff --git a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.ir.txt b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.ir.txt index fe05339c17e..31467f73e50 100644 --- a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.ir.txt @@ -1,64 +1,42 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt - CLASS INTERFACE name:SymbolOwner modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SymbolOwner.SymbolOwner> - TYPE_PARAMETER name:E index:0 variance: superTypes:[.SymbolOwner.SymbolOwner>] reified:false + CLASS CLASS name:ImplicitReceiverStack modality:ABSTRACT visibility:public superTypes:[kotlin.collections.Iterable<.ImplicitReceiverValue<*>>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ImplicitReceiverStack + CONSTRUCTOR visibility:public <> () returnType:.ImplicitReceiverStack [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ImplicitReceiverStack modality:ABSTRACT visibility:public superTypes:[kotlin.collections.Iterable<.ImplicitReceiverValue<*>>]' 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 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.Iterable $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.ImplicitReceiverValue<*>>, p0:@[FlexibleNullability] java.util.function.Consumer.ImplicitReceiverValue<*>?>?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in kotlin.collections.Iterable + $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.ImplicitReceiverValue<*>> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.ImplicitReceiverValue<*>?>? 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 + public open fun hashCode (): kotlin.Int declared in kotlin.collections.Iterable $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.Iterable<.ImplicitReceiverValue<*>>) returnType:kotlin.collections.Iterator<.ImplicitReceiverValue<*>> [fake_override,operator] + overridden: + public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.Iterable + $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.ImplicitReceiverValue<*>> + FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.ImplicitReceiverValue<*>>) returnType:@[EnhancedNullability] java.util.Spliterator<@[EnhancedNullability] .ImplicitReceiverValue<*>> [fake_override] + overridden: + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[EnhancedNullability] T of kotlin.collections.Iterable> declared in kotlin.collections.Iterable + $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.ImplicitReceiverValue<*>> 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 - CLASS INTERFACE name:Symbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Symbol.Symbol> - TYPE_PARAMETER name:E index:0 variance: superTypes:[.SymbolOwner.Symbol>] reified:false - 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: 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 - CLASS INTERFACE name:ReceiverValue modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ReceiverValue - PROPERTY name:type visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.ReceiverValue) returnType:kotlin.String - correspondingProperty: PROPERTY name:type visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.ReceiverValue - 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: 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 + public open fun toString (): kotlin.String declared in kotlin.collections.Iterable $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:get visibility:public modality:ABSTRACT <> ($this:.ImplicitReceiverStack, name:kotlin.String?) returnType:.ImplicitReceiverValue<*>? [operator] + $this: VALUE_PARAMETER name: type:.ImplicitReceiverStack + VALUE_PARAMETER name:name index:0 type:kotlin.String? CLASS CLASS name:ImplicitReceiverValue modality:FINAL visibility:public superTypes:[.ReceiverValue] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ImplicitReceiverValue.ImplicitReceiverValue> TYPE_PARAMETER name:S index:0 variance: superTypes:[.Symbol<*>] reified:false - CONSTRUCTOR visibility:public <> (boundSymbol:S of .ImplicitReceiverValue?, type:kotlin.String) returnType:.ImplicitReceiverValue.ImplicitReceiverValue> [primary] - VALUE_PARAMETER name:boundSymbol index:0 type:S of .ImplicitReceiverValue? - VALUE_PARAMETER name:type index:1 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ImplicitReceiverValue modality:FINAL visibility:public superTypes:[.ReceiverValue]' PROPERTY name:boundSymbol visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:boundSymbol type:S of .ImplicitReceiverValue? visibility:private [final] EXPRESSION_BODY @@ -85,6 +63,12 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .ImplicitReceiverValue' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:type type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .ImplicitReceiverValue.ImplicitReceiverValue> declared in .ImplicitReceiverValue.' type=.ImplicitReceiverValue.ImplicitReceiverValue> origin=null + CONSTRUCTOR visibility:public <> (boundSymbol:S of .ImplicitReceiverValue?, type:kotlin.String) returnType:.ImplicitReceiverValue.ImplicitReceiverValue> [primary] + VALUE_PARAMETER name:boundSymbol index:0 type:S of .ImplicitReceiverValue? + VALUE_PARAMETER name:type index:1 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ImplicitReceiverValue modality:FINAL visibility:public superTypes:[.ReceiverValue]' 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 .ReceiverValue @@ -98,48 +82,8 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt overridden: public open fun toString (): kotlin.String declared in .ReceiverValue $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:ImplicitReceiverStack modality:ABSTRACT visibility:public superTypes:[kotlin.collections.Iterable<.ImplicitReceiverValue<*>>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ImplicitReceiverStack - CONSTRUCTOR visibility:public <> () returnType:.ImplicitReceiverStack [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ImplicitReceiverStack modality:ABSTRACT visibility:public superTypes:[kotlin.collections.Iterable<.ImplicitReceiverValue<*>>]' - FUN name:get visibility:public modality:ABSTRACT <> ($this:.ImplicitReceiverStack, name:kotlin.String?) returnType:.ImplicitReceiverValue<*>? [operator] - $this: VALUE_PARAMETER name: type:.ImplicitReceiverStack - VALUE_PARAMETER name:name index:0 type:kotlin.String? - FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.Iterable<.ImplicitReceiverValue<*>>) returnType:kotlin.collections.Iterator<.ImplicitReceiverValue<*>> [fake_override,operator] - overridden: - public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.Iterable - $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.ImplicitReceiverValue<*>> - FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.ImplicitReceiverValue<*>>, p0:@[FlexibleNullability] java.util.function.Consumer.ImplicitReceiverValue<*>?>?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in kotlin.collections.Iterable - $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.ImplicitReceiverValue<*>> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.ImplicitReceiverValue<*>?>? - FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.ImplicitReceiverValue<*>>) returnType:@[EnhancedNullability] java.util.Spliterator<@[EnhancedNullability] .ImplicitReceiverValue<*>> [fake_override] - overridden: - public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[EnhancedNullability] T of kotlin.collections.Iterable> declared in kotlin.collections.Iterable - $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.ImplicitReceiverValue<*>> - 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.collections.Iterable - $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.collections.Iterable - $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.collections.Iterable - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:PersistentImplicitReceiverStack modality:FINAL visibility:public superTypes:[.ImplicitReceiverStack; kotlin.collections.Iterable<.ImplicitReceiverValue<*>>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PersistentImplicitReceiverStack - CONSTRUCTOR visibility:public <> (stack:kotlin.collections.List<.ImplicitReceiverValue<*>>) returnType:.PersistentImplicitReceiverStack [primary] - VALUE_PARAMETER name:stack index:0 type:kotlin.collections.List<.ImplicitReceiverValue<*>> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .ImplicitReceiverStack' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PersistentImplicitReceiverStack modality:FINAL visibility:public superTypes:[.ImplicitReceiverStack; kotlin.collections.Iterable<.ImplicitReceiverValue<*>>]' PROPERTY name:stack visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:stack type:kotlin.collections.List<.ImplicitReceiverValue<*>> visibility:private [final] EXPRESSION_BODY @@ -151,16 +95,36 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.List<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stack type:kotlin.collections.List<.ImplicitReceiverValue<*>> visibility:private [final]' type=kotlin.collections.List<.ImplicitReceiverValue<*>> origin=null receiver: GET_VAR ': .PersistentImplicitReceiverStack declared in .PersistentImplicitReceiverStack.' type=.PersistentImplicitReceiverStack origin=null - FUN name:iterator visibility:public modality:OPEN <> ($this:.PersistentImplicitReceiverStack) returnType:kotlin.collections.Iterator<.ImplicitReceiverValue<*>> [operator] - overridden: - public abstract fun iterator (): kotlin.collections.Iterator<.ImplicitReceiverValue<*>> declared in .ImplicitReceiverStack - public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.Iterable - $this: VALUE_PARAMETER name: type:.PersistentImplicitReceiverStack + CONSTRUCTOR visibility:public <> (stack:kotlin.collections.List<.ImplicitReceiverValue<*>>) returnType:.PersistentImplicitReceiverStack [primary] + VALUE_PARAMETER name:stack index:0 type:kotlin.collections.List<.ImplicitReceiverValue<*>> BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' - CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator<.ImplicitReceiverValue<*>> origin=null - $this: CALL 'private final fun (): kotlin.collections.List<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' type=kotlin.collections.List<.ImplicitReceiverValue<*>> origin=GET_PROPERTY - $this: GET_VAR ': .PersistentImplicitReceiverStack declared in .PersistentImplicitReceiverStack.iterator' type=.PersistentImplicitReceiverStack origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .ImplicitReceiverStack' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PersistentImplicitReceiverStack modality:FINAL visibility:public superTypes:[.ImplicitReceiverStack; kotlin.collections.Iterable<.ImplicitReceiverValue<*>>]' + 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 .ImplicitReceiverStack + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.Iterable + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.ImplicitReceiverValue<*>>, p0:@[FlexibleNullability] java.util.function.Consumer.ImplicitReceiverValue<*>?>?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer.ImplicitReceiverValue<*>?>?): kotlin.Unit declared in .ImplicitReceiverStack + $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.ImplicitReceiverValue<*>> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.ImplicitReceiverValue<*>?>? + 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 .ImplicitReceiverStack + public open fun hashCode (): kotlin.Int declared in kotlin.collections.Iterable + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.ImplicitReceiverValue<*>>) returnType:@[EnhancedNullability] java.util.Spliterator<@[EnhancedNullability] .ImplicitReceiverValue<*>> [fake_override] + overridden: + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[EnhancedNullability] .ImplicitReceiverValue<*>> declared in .ImplicitReceiverStack + $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.ImplicitReceiverValue<*>> + 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 .ImplicitReceiverStack + public open fun toString (): kotlin.String declared in kotlin.collections.Iterable + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:get visibility:public modality:OPEN <> ($this:.PersistentImplicitReceiverStack, name:kotlin.String?) returnType:.ImplicitReceiverValue<*>? [operator] overridden: public abstract fun get (name: kotlin.String?): .ImplicitReceiverValue<*>? declared in .ImplicitReceiverStack @@ -172,50 +136,70 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt : .ImplicitReceiverValue<*> $receiver: CALL 'private final fun (): kotlin.collections.List<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' type=kotlin.collections.List<.ImplicitReceiverValue<*>> origin=GET_PROPERTY $this: GET_VAR ': .PersistentImplicitReceiverStack declared in .PersistentImplicitReceiverStack.get' type=.PersistentImplicitReceiverStack origin=null - FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.ImplicitReceiverValue<*>>, p0:@[FlexibleNullability] java.util.function.Consumer.ImplicitReceiverValue<*>?>?) returnType:kotlin.Unit [fake_override] + FUN name:iterator visibility:public modality:OPEN <> ($this:.PersistentImplicitReceiverStack) returnType:kotlin.collections.Iterator<.ImplicitReceiverValue<*>> [operator] overridden: - public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer.ImplicitReceiverValue<*>?>?): kotlin.Unit declared in .ImplicitReceiverStack - $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.ImplicitReceiverValue<*>> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.ImplicitReceiverValue<*>?>? - FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.ImplicitReceiverValue<*>>) returnType:@[EnhancedNullability] java.util.Spliterator<@[EnhancedNullability] .ImplicitReceiverValue<*>> [fake_override] - overridden: - public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[EnhancedNullability] .ImplicitReceiverValue<*>> declared in .ImplicitReceiverStack - $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.ImplicitReceiverValue<*>> + public abstract fun iterator (): kotlin.collections.Iterator<.ImplicitReceiverValue<*>> declared in .ImplicitReceiverStack + public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.Iterable + $this: VALUE_PARAMETER name: type:.PersistentImplicitReceiverStack + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' + CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator<.ImplicitReceiverValue<*>> origin=null + $this: CALL 'private final fun (): kotlin.collections.List<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' type=kotlin.collections.List<.ImplicitReceiverValue<*>> origin=GET_PROPERTY + $this: GET_VAR ': .PersistentImplicitReceiverStack declared in .PersistentImplicitReceiverStack.iterator' type=.PersistentImplicitReceiverStack origin=null + CLASS INTERFACE name:ReceiverValue modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ReceiverValue 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 .ImplicitReceiverStack - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.Iterable + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .ImplicitReceiverStack - public open fun hashCode (): kotlin.Int declared in kotlin.collections.Iterable + 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 .ImplicitReceiverStack - public open fun toString (): kotlin.String declared in kotlin.collections.Iterable + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:type visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.ReceiverValue) returnType:kotlin.String + correspondingProperty: PROPERTY name:type visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.ReceiverValue + CLASS INTERFACE name:Symbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Symbol.Symbol> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.SymbolOwner.Symbol>] reified:false + 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: 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 + CLASS INTERFACE name:SymbolOwner modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SymbolOwner.SymbolOwner> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.SymbolOwner.SymbolOwner>] reified:false + 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: 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:bar visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY - FUN name:foo visibility:public modality:FINAL <> (stack:.PersistentImplicitReceiverStack) returnType:kotlin.Unit - VALUE_PARAMETER name:stack index:0 type:.PersistentImplicitReceiverStack - BLOCK_BODY - CALL 'public final fun forEach (action: kotlin.Function1): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null - : .ImplicitReceiverValue<*> - $receiver: GET_VAR 'stack: .PersistentImplicitReceiverStack declared in .foo' type=.PersistentImplicitReceiverStack origin=null - action: FUN_EXPR type=kotlin.Function1<.ImplicitReceiverValue<*>, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:.ImplicitReceiverValue<*>) returnType:kotlin.Unit - VALUE_PARAMETER name:it index:0 type:.ImplicitReceiverValue<*> - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun (): S of .ImplicitReceiverValue? declared in .ImplicitReceiverValue' type=.Symbol<*>? origin=GET_PROPERTY - $this: GET_VAR 'it: .ImplicitReceiverValue<*> declared in .foo.' type=.ImplicitReceiverValue<*> origin=null - CALL 'public final fun bar (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null - s: CALL 'public open fun (): kotlin.String declared in .ImplicitReceiverValue' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR 'it: .ImplicitReceiverValue<*> declared in .foo.' type=.ImplicitReceiverValue<*> origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:stack type:.PersistentImplicitReceiverStack [val] @@ -254,3 +238,19 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun (): kotlin.String declared in .ImplicitReceiverValue' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR 'val tmp_0: .ImplicitReceiverValue<*>? declared in .box' type=.ImplicitReceiverValue<*>? origin=null + FUN name:foo visibility:public modality:FINAL <> (stack:.PersistentImplicitReceiverStack) returnType:kotlin.Unit + VALUE_PARAMETER name:stack index:0 type:.PersistentImplicitReceiverStack + BLOCK_BODY + CALL 'public final fun forEach (action: kotlin.Function1): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null + : .ImplicitReceiverValue<*> + $receiver: GET_VAR 'stack: .PersistentImplicitReceiverStack declared in .foo' type=.PersistentImplicitReceiverStack origin=null + action: FUN_EXPR type=kotlin.Function1<.ImplicitReceiverValue<*>, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:.ImplicitReceiverValue<*>) returnType:kotlin.Unit + VALUE_PARAMETER name:it index:0 type:.ImplicitReceiverValue<*> + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun (): S of .ImplicitReceiverValue? declared in .ImplicitReceiverValue' type=.Symbol<*>? origin=GET_PROPERTY + $this: GET_VAR 'it: .ImplicitReceiverValue<*> declared in .foo.' type=.ImplicitReceiverValue<*> origin=null + CALL 'public final fun bar (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: CALL 'public open fun (): kotlin.String declared in .ImplicitReceiverValue' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR 'it: .ImplicitReceiverValue<*> declared in .foo.' type=.ImplicitReceiverValue<*> origin=null diff --git a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.kt.txt b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.kt.txt index 026b49f0708..4c1cf31323d 100644 --- a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.kt.txt @@ -1,32 +1,3 @@ -interface SymbolOwner> { -} - -interface Symbol> { -} - -interface ReceiverValue { - abstract val type: String - abstract get - -} - -class ImplicitReceiverValue> : ReceiverValue { - constructor(boundSymbol: S?, type: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val boundSymbol: S? - field = boundSymbol - get - - override val type: String - field = type - override get - -} - abstract class ImplicitReceiverStack : Iterable> { constructor() /* primary */ { super/*Any*/() @@ -38,38 +9,59 @@ abstract class ImplicitReceiverStack : Iterable> { } +class ImplicitReceiverValue> : ReceiverValue { + val boundSymbol: S? + field = boundSymbol + get + + override val type: String + field = type + override get + + constructor(boundSymbol: S?, type: String) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + class PersistentImplicitReceiverStack : ImplicitReceiverStack, Iterable> { + private val stack: List> + field = stack + private get + constructor(stack: List>) /* primary */ { super/*ImplicitReceiverStack*/() /* () */ } - private val stack: List> - field = stack - private get + override operator fun get(name: String?): ImplicitReceiverValue<*>? { + return .().lastOrNull>() + } override operator fun iterator(): Iterator> { return .().iterator() } - override operator fun get(name: String?): ImplicitReceiverValue<*>? { - return .().lastOrNull>() - } +} +interface ReceiverValue { + abstract val type: String + abstract get + +} + +interface Symbol> { +} + +interface SymbolOwner> { } fun bar(s: String) { } -fun foo(stack: PersistentImplicitReceiverStack) { - stack.forEach>(action = local fun (it: ImplicitReceiverValue<*>) { - it.() /*~> Unit */ - bar(s = it.()) - } -) -} - fun box(): String { val stack: PersistentImplicitReceiverStack = PersistentImplicitReceiverStack(stack = listOf>(elements = [ImplicitReceiverValue(boundSymbol = null, type = "O"), ImplicitReceiverValue(boundSymbol = null, type = "K")])) foo(stack = stack) @@ -81,3 +73,12 @@ fun box(): String { } }) } + +fun foo(stack: PersistentImplicitReceiverStack) { + stack.forEach>(action = local fun (it: ImplicitReceiverValue<*>) { + it.() /*~> Unit */ + bar(s = it.()) + } +) +} + diff --git a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.ir.txt b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.ir.txt index c4cda1d19e5..5e8fd2f3186 100644 --- a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.ir.txt +++ b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.ir.txt @@ -1,112 +1,10 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt - CLASS INTERFACE name:SymbolOwner modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SymbolOwner.SymbolOwner> - TYPE_PARAMETER name:E index:0 variance: superTypes:[.SymbolOwner.SymbolOwner>] reified:false - 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: 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 - CLASS INTERFACE name:Symbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Symbol.Symbol> - TYPE_PARAMETER name:E index:0 variance: superTypes:[.SymbolOwner.Symbol>] reified:false - 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: 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 - CLASS INTERFACE name:ReceiverValue modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ReceiverValue - PROPERTY name:type visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.ReceiverValue) returnType:kotlin.String - correspondingProperty: PROPERTY name:type visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.ReceiverValue - 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: 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 - CLASS CLASS name:ImplicitReceiverValue modality:FINAL visibility:public superTypes:[.ReceiverValue] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ImplicitReceiverValue.ImplicitReceiverValue> - TYPE_PARAMETER name:S index:0 variance: superTypes:[.Symbol<*>] reified:false - CONSTRUCTOR visibility:public <> (boundSymbol:S of .ImplicitReceiverValue?, type:kotlin.String) returnType:.ImplicitReceiverValue.ImplicitReceiverValue> [primary] - VALUE_PARAMETER name:boundSymbol index:0 type:S of .ImplicitReceiverValue? - VALUE_PARAMETER name:type index:1 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ImplicitReceiverValue modality:FINAL visibility:public superTypes:[.ReceiverValue]' - PROPERTY name:boundSymbol visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:boundSymbol type:S of .ImplicitReceiverValue? visibility:private [final] - EXPRESSION_BODY - GET_VAR 'boundSymbol: S of .ImplicitReceiverValue? declared in .ImplicitReceiverValue.' type=S of .ImplicitReceiverValue? origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.ImplicitReceiverValue.ImplicitReceiverValue>) returnType:S of .ImplicitReceiverValue? - correspondingProperty: PROPERTY name:boundSymbol visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.ImplicitReceiverValue.ImplicitReceiverValue> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): S of .ImplicitReceiverValue? declared in .ImplicitReceiverValue' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:boundSymbol type:S of .ImplicitReceiverValue? visibility:private [final]' type=S of .ImplicitReceiverValue? origin=null - receiver: GET_VAR ': .ImplicitReceiverValue.ImplicitReceiverValue> declared in .ImplicitReceiverValue.' type=.ImplicitReceiverValue.ImplicitReceiverValue> origin=null - PROPERTY name:type visibility:public modality:OPEN [val] - overridden: - public abstract type: kotlin.String - FIELD PROPERTY_BACKING_FIELD name:type type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'type: kotlin.String declared in .ImplicitReceiverValue.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.ImplicitReceiverValue.ImplicitReceiverValue>) returnType:kotlin.String - correspondingProperty: PROPERTY name:type visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.String declared in .ReceiverValue - $this: VALUE_PARAMETER name: type:.ImplicitReceiverValue.ImplicitReceiverValue> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .ImplicitReceiverValue' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:type type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .ImplicitReceiverValue.ImplicitReceiverValue> declared in .ImplicitReceiverValue.' type=.ImplicitReceiverValue.ImplicitReceiverValue> 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 .ReceiverValue - $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 .ReceiverValue - $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 .ReceiverValue - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:ImplicitReceiverStack modality:ABSTRACT visibility:public superTypes:[kotlin.collections.Iterable<.ImplicitReceiverValue<*>>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ImplicitReceiverStack CONSTRUCTOR visibility:public <> () returnType:.ImplicitReceiverStack [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ImplicitReceiverStack modality:ABSTRACT visibility:public superTypes:[kotlin.collections.Iterable<.ImplicitReceiverValue<*>>]' - FUN name:get visibility:public modality:ABSTRACT <> ($this:.ImplicitReceiverStack, name:kotlin.String?) returnType:.ImplicitReceiverValue<*>? [operator] - $this: VALUE_PARAMETER name: type:.ImplicitReceiverStack - VALUE_PARAMETER name:name index:0 type:kotlin.String? 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.collections.Iterable @@ -133,13 +31,59 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt overridden: public open fun toString (): kotlin.String declared in kotlin.collections.Iterable $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:get visibility:public modality:ABSTRACT <> ($this:.ImplicitReceiverStack, name:kotlin.String?) returnType:.ImplicitReceiverValue<*>? [operator] + $this: VALUE_PARAMETER name: type:.ImplicitReceiverStack + VALUE_PARAMETER name:name index:0 type:kotlin.String? + CLASS CLASS name:ImplicitReceiverValue modality:FINAL visibility:public superTypes:[.ReceiverValue] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ImplicitReceiverValue.ImplicitReceiverValue> + TYPE_PARAMETER name:S index:0 variance: superTypes:[.Symbol<*>] reified:false + PROPERTY name:boundSymbol visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:boundSymbol type:S of .ImplicitReceiverValue? visibility:private [final] + EXPRESSION_BODY + GET_VAR 'boundSymbol: S of .ImplicitReceiverValue? declared in .ImplicitReceiverValue.' type=S of .ImplicitReceiverValue? origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.ImplicitReceiverValue.ImplicitReceiverValue>) returnType:S of .ImplicitReceiverValue? + correspondingProperty: PROPERTY name:boundSymbol visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.ImplicitReceiverValue.ImplicitReceiverValue> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): S of .ImplicitReceiverValue? declared in .ImplicitReceiverValue' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:boundSymbol type:S of .ImplicitReceiverValue? visibility:private [final]' type=S of .ImplicitReceiverValue? origin=null + receiver: GET_VAR ': .ImplicitReceiverValue.ImplicitReceiverValue> declared in .ImplicitReceiverValue.' type=.ImplicitReceiverValue.ImplicitReceiverValue> origin=null + PROPERTY name:type visibility:public modality:OPEN [val] + overridden: + public abstract type: kotlin.String + FIELD PROPERTY_BACKING_FIELD name:type type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 'type: kotlin.String declared in .ImplicitReceiverValue.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.ImplicitReceiverValue.ImplicitReceiverValue>) returnType:kotlin.String + correspondingProperty: PROPERTY name:type visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.String declared in .ReceiverValue + $this: VALUE_PARAMETER name: type:.ImplicitReceiverValue.ImplicitReceiverValue> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .ImplicitReceiverValue' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:type type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .ImplicitReceiverValue.ImplicitReceiverValue> declared in .ImplicitReceiverValue.' type=.ImplicitReceiverValue.ImplicitReceiverValue> origin=null + CONSTRUCTOR visibility:public <> (boundSymbol:S of .ImplicitReceiverValue?, type:kotlin.String) returnType:.ImplicitReceiverValue.ImplicitReceiverValue> [primary] + VALUE_PARAMETER name:boundSymbol index:0 type:S of .ImplicitReceiverValue? + VALUE_PARAMETER name:type index:1 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ImplicitReceiverValue modality:FINAL visibility:public superTypes:[.ReceiverValue]' + 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 .ReceiverValue + $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 .ReceiverValue + $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 .ReceiverValue + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:PersistentImplicitReceiverStack modality:FINAL visibility:public superTypes:[.ImplicitReceiverStack; kotlin.collections.Iterable<.ImplicitReceiverValue<*>>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PersistentImplicitReceiverStack - CONSTRUCTOR visibility:public <> (stack:kotlin.collections.List<.ImplicitReceiverValue<*>>) returnType:.PersistentImplicitReceiverStack [primary] - VALUE_PARAMETER name:stack index:0 type:kotlin.collections.List<.ImplicitReceiverValue<*>> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .ImplicitReceiverStack' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PersistentImplicitReceiverStack modality:FINAL visibility:public superTypes:[.ImplicitReceiverStack; kotlin.collections.Iterable<.ImplicitReceiverValue<*>>]' PROPERTY name:stack visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:stack type:kotlin.collections.List<.ImplicitReceiverValue<*>> visibility:private [final] EXPRESSION_BODY @@ -151,27 +95,11 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.List<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stack type:kotlin.collections.List<.ImplicitReceiverValue<*>> visibility:private [final]' type=kotlin.collections.List<.ImplicitReceiverValue<*>> origin=null receiver: GET_VAR ': .PersistentImplicitReceiverStack declared in .PersistentImplicitReceiverStack.' type=.PersistentImplicitReceiverStack origin=null - FUN name:iterator visibility:public modality:OPEN <> ($this:.PersistentImplicitReceiverStack) returnType:kotlin.collections.Iterator<.ImplicitReceiverValue<*>> [operator] - overridden: - public abstract fun iterator (): kotlin.collections.Iterator<.ImplicitReceiverValue<*>> declared in .ImplicitReceiverStack - public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.Iterable - $this: VALUE_PARAMETER name: type:.PersistentImplicitReceiverStack + CONSTRUCTOR visibility:public <> (stack:kotlin.collections.List<.ImplicitReceiverValue<*>>) returnType:.PersistentImplicitReceiverStack [primary] + VALUE_PARAMETER name:stack index:0 type:kotlin.collections.List<.ImplicitReceiverValue<*>> BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' - CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator<.ImplicitReceiverValue<*>> origin=null - $this: CALL 'private final fun (): kotlin.collections.List<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' type=kotlin.collections.List<.ImplicitReceiverValue<*>> origin=GET_PROPERTY - $this: GET_VAR ': .PersistentImplicitReceiverStack declared in .PersistentImplicitReceiverStack.iterator' type=.PersistentImplicitReceiverStack origin=null - FUN name:get visibility:public modality:OPEN <> ($this:.PersistentImplicitReceiverStack, name:kotlin.String?) returnType:.ImplicitReceiverValue<*>? [operator] - overridden: - public abstract fun get (name: kotlin.String?): .ImplicitReceiverValue<*>? declared in .ImplicitReceiverStack - $this: VALUE_PARAMETER name: type:.PersistentImplicitReceiverStack - VALUE_PARAMETER name:name index:0 type:kotlin.String? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun get (name: kotlin.String?): .ImplicitReceiverValue<*>? declared in .PersistentImplicitReceiverStack' - CALL 'public final fun lastOrNull (): T of kotlin.collections.lastOrNull? declared in kotlin.collections' type=.ImplicitReceiverValue<*>? origin=null - : .ImplicitReceiverValue<*> - $receiver: CALL 'private final fun (): kotlin.collections.List<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' type=kotlin.collections.List<.ImplicitReceiverValue<*>> origin=GET_PROPERTY - $this: GET_VAR ': .PersistentImplicitReceiverStack declared in .PersistentImplicitReceiverStack.get' type=.PersistentImplicitReceiverStack origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .ImplicitReceiverStack' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PersistentImplicitReceiverStack modality:FINAL visibility:public superTypes:[.ImplicitReceiverStack; kotlin.collections.Iterable<.ImplicitReceiverValue<*>>]' 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 .ImplicitReceiverStack @@ -199,25 +127,81 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt public open fun toString (): kotlin.String declared in .ImplicitReceiverStack public open fun toString (): kotlin.String declared in kotlin.collections.Iterable $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:get visibility:public modality:OPEN <> ($this:.PersistentImplicitReceiverStack, name:kotlin.String?) returnType:.ImplicitReceiverValue<*>? [operator] + overridden: + public abstract fun get (name: kotlin.String?): .ImplicitReceiverValue<*>? declared in .ImplicitReceiverStack + $this: VALUE_PARAMETER name: type:.PersistentImplicitReceiverStack + VALUE_PARAMETER name:name index:0 type:kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun get (name: kotlin.String?): .ImplicitReceiverValue<*>? declared in .PersistentImplicitReceiverStack' + CALL 'public final fun lastOrNull (): T of kotlin.collections.lastOrNull? declared in kotlin.collections' type=.ImplicitReceiverValue<*>? origin=null + : .ImplicitReceiverValue<*> + $receiver: CALL 'private final fun (): kotlin.collections.List<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' type=kotlin.collections.List<.ImplicitReceiverValue<*>> origin=GET_PROPERTY + $this: GET_VAR ': .PersistentImplicitReceiverStack declared in .PersistentImplicitReceiverStack.get' type=.PersistentImplicitReceiverStack origin=null + FUN name:iterator visibility:public modality:OPEN <> ($this:.PersistentImplicitReceiverStack) returnType:kotlin.collections.Iterator<.ImplicitReceiverValue<*>> [operator] + overridden: + public abstract fun iterator (): kotlin.collections.Iterator<.ImplicitReceiverValue<*>> declared in .ImplicitReceiverStack + public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.Iterable + $this: VALUE_PARAMETER name: type:.PersistentImplicitReceiverStack + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' + CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator<.ImplicitReceiverValue<*>> origin=null + $this: CALL 'private final fun (): kotlin.collections.List<.ImplicitReceiverValue<*>> declared in .PersistentImplicitReceiverStack' type=kotlin.collections.List<.ImplicitReceiverValue<*>> origin=GET_PROPERTY + $this: GET_VAR ': .PersistentImplicitReceiverStack declared in .PersistentImplicitReceiverStack.iterator' type=.PersistentImplicitReceiverStack origin=null + CLASS INTERFACE name:ReceiverValue modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ReceiverValue + 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: 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 + PROPERTY name:type visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.ReceiverValue) returnType:kotlin.String + correspondingProperty: PROPERTY name:type visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.ReceiverValue + CLASS INTERFACE name:Symbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Symbol.Symbol> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.SymbolOwner.Symbol>] reified:false + 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: 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 + CLASS INTERFACE name:SymbolOwner modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SymbolOwner.SymbolOwner> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.SymbolOwner.SymbolOwner>] reified:false + 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: 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:bar visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY - FUN name:foo visibility:public modality:FINAL <> (stack:.PersistentImplicitReceiverStack) returnType:kotlin.Unit - VALUE_PARAMETER name:stack index:0 type:.PersistentImplicitReceiverStack - BLOCK_BODY - CALL 'public final fun forEach (action: kotlin.Function1): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null - : .ImplicitReceiverValue<*> - $receiver: GET_VAR 'stack: .PersistentImplicitReceiverStack declared in .foo' type=.PersistentImplicitReceiverStack origin=null - action: FUN_EXPR type=kotlin.Function1<.ImplicitReceiverValue<*>, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:.ImplicitReceiverValue<*>) returnType:kotlin.Unit - VALUE_PARAMETER name:it index:0 type:.ImplicitReceiverValue<*> - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun (): S of .ImplicitReceiverValue? declared in .ImplicitReceiverValue' type=.Symbol<*>? origin=GET_PROPERTY - $this: GET_VAR 'it: .ImplicitReceiverValue<*> declared in .foo.' type=.ImplicitReceiverValue<*> origin=null - CALL 'public final fun bar (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null - s: CALL 'public open fun (): kotlin.String declared in .ImplicitReceiverValue' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR 'it: .ImplicitReceiverValue<*> declared in .foo.' type=.ImplicitReceiverValue<*> origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:stack type:.PersistentImplicitReceiverStack [val] @@ -256,3 +240,19 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun (): kotlin.String declared in .ImplicitReceiverValue' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR 'val tmp_0: .ImplicitReceiverValue<*>? declared in .box' type=.ImplicitReceiverValue<*>? origin=null + FUN name:foo visibility:public modality:FINAL <> (stack:.PersistentImplicitReceiverStack) returnType:kotlin.Unit + VALUE_PARAMETER name:stack index:0 type:.PersistentImplicitReceiverStack + BLOCK_BODY + CALL 'public final fun forEach (action: kotlin.Function1): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null + : .ImplicitReceiverValue<*> + $receiver: GET_VAR 'stack: .PersistentImplicitReceiverStack declared in .foo' type=.PersistentImplicitReceiverStack origin=null + action: FUN_EXPR type=kotlin.Function1<.ImplicitReceiverValue<*>, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:.ImplicitReceiverValue<*>) returnType:kotlin.Unit + VALUE_PARAMETER name:it index:0 type:.ImplicitReceiverValue<*> + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun (): S of .ImplicitReceiverValue? declared in .ImplicitReceiverValue' type=.Symbol<*>? origin=GET_PROPERTY + $this: GET_VAR 'it: .ImplicitReceiverValue<*> declared in .foo.' type=.ImplicitReceiverValue<*> origin=null + CALL 'public final fun bar (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: CALL 'public open fun (): kotlin.String declared in .ImplicitReceiverValue' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR 'it: .ImplicitReceiverValue<*> declared in .foo.' type=.ImplicitReceiverValue<*> origin=null diff --git a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt.txt b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt.txt index 026b49f0708..4c1cf31323d 100644 --- a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt.txt @@ -1,32 +1,3 @@ -interface SymbolOwner> { -} - -interface Symbol> { -} - -interface ReceiverValue { - abstract val type: String - abstract get - -} - -class ImplicitReceiverValue> : ReceiverValue { - constructor(boundSymbol: S?, type: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val boundSymbol: S? - field = boundSymbol - get - - override val type: String - field = type - override get - -} - abstract class ImplicitReceiverStack : Iterable> { constructor() /* primary */ { super/*Any*/() @@ -38,38 +9,59 @@ abstract class ImplicitReceiverStack : Iterable> { } +class ImplicitReceiverValue> : ReceiverValue { + val boundSymbol: S? + field = boundSymbol + get + + override val type: String + field = type + override get + + constructor(boundSymbol: S?, type: String) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + class PersistentImplicitReceiverStack : ImplicitReceiverStack, Iterable> { + private val stack: List> + field = stack + private get + constructor(stack: List>) /* primary */ { super/*ImplicitReceiverStack*/() /* () */ } - private val stack: List> - field = stack - private get + override operator fun get(name: String?): ImplicitReceiverValue<*>? { + return .().lastOrNull>() + } override operator fun iterator(): Iterator> { return .().iterator() } - override operator fun get(name: String?): ImplicitReceiverValue<*>? { - return .().lastOrNull>() - } +} +interface ReceiverValue { + abstract val type: String + abstract get + +} + +interface Symbol> { +} + +interface SymbolOwner> { } fun bar(s: String) { } -fun foo(stack: PersistentImplicitReceiverStack) { - stack.forEach>(action = local fun (it: ImplicitReceiverValue<*>) { - it.() /*~> Unit */ - bar(s = it.()) - } -) -} - fun box(): String { val stack: PersistentImplicitReceiverStack = PersistentImplicitReceiverStack(stack = listOf>(elements = [ImplicitReceiverValue(boundSymbol = null, type = "O"), ImplicitReceiverValue(boundSymbol = null, type = "K")])) foo(stack = stack) @@ -81,3 +73,12 @@ fun box(): String { } }) } + +fun foo(stack: PersistentImplicitReceiverStack) { + stack.forEach>(action = local fun (it: ImplicitReceiverValue<*>) { + it.() /*~> Unit */ + bar(s = it.()) + } +) +} + diff --git a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.ir.txt b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.ir.txt index 80d336b7edb..9d3edce73a8 100644 --- a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.ir.txt @@ -5,10 +5,6 @@ FILE fqName: fileName:/InnerClassInAnonymous.kt BLOCK type=.box. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box. - CONSTRUCTOR visibility:public <> () returnType:.box. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any]' PROPERTY name:end visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:end type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -20,14 +16,38 @@ FILE fqName: fileName:/InnerClassInAnonymous.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .box.' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:end type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .box. declared in .box..' type=.box. origin=null - FUN name:foo visibility:public modality:FINAL <> ($this:.box.) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.box. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .box.' - CALL 'public final fun bar (): kotlin.String declared in .box..Some' type=kotlin.String origin=null - $this: CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in .box..Some' type=.box..Some origin=null - $outer: GET_VAR ': .box. declared in .box..foo' type=.box. origin=null - s: CONST String type=kotlin.String value="O" + CLASS CLASS name:Base modality:OPEN visibility:local [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box..Base + PROPERTY name:s visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 's: kotlin.String declared in .box..Base.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.box..Base) returnType:kotlin.String + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.box..Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .box..Base' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .box..Base declared in .box..Base.' type=.box..Base origin=null + CONSTRUCTOR visibility:public <> ($this:.box., s:kotlin.String) returnType:.box..Base [primary] + $outer: VALUE_PARAMETER name: type:.box. + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:local [inner] 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 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 CLASS CLASS name:Some modality:FINAL visibility:local [inner] superTypes:[.box..Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box..Some CONSTRUCTOR visibility:public <> ($this:.box., s:kotlin.String) returnType:.box..Some [primary] @@ -38,6 +58,19 @@ FILE fqName: fileName:/InnerClassInAnonymous.kt $this: GET_VAR ': .box. declared in .box.' type=.box. origin=null s: GET_VAR 's: kotlin.String declared in .box..Some.' type=kotlin.String origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:local [inner] superTypes:[.box..Base]' + 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 .box..Base + $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 .box..Base + $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 .box..Base + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:bar visibility:public modality:FINAL <> ($this:.box..Some) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.box..Some BLOCK_BODY @@ -55,51 +88,10 @@ FILE fqName: fileName:/InnerClassInAnonymous.kt overridden: public final fun (): kotlin.String declared in .box..Base $this: VALUE_PARAMETER name: type:.box..Base - 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 .box..Base - $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 .box..Base - $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 .box..Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Base modality:OPEN visibility:local [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box..Base - CONSTRUCTOR visibility:public <> ($this:.box., s:kotlin.String) returnType:.box..Base [primary] - $outer: VALUE_PARAMETER name: type:.box. - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:local [inner] superTypes:[kotlin.Any]' - PROPERTY name:s visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 's: kotlin.String declared in .box..Base.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.box..Base) returnType:kotlin.String - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.box..Base - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .box..Base' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .box..Base declared in .box..Base.' type=.box..Base 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: 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 + CONSTRUCTOR visibility:public <> () returnType:.box. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local 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 declared in kotlin.Any @@ -113,6 +105,14 @@ FILE fqName: fileName:/InnerClassInAnonymous.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.box.) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.box. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .box.' + CALL 'public final fun bar (): kotlin.String declared in .box..Some' type=kotlin.String origin=null + $this: CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in .box..Some' type=.box..Some origin=null + $outer: GET_VAR ': .box. declared in .box..foo' type=.box. origin=null + s: CONST String type=kotlin.String value="O" CONSTRUCTOR_CALL 'public constructor () declared in .box.' type=.box. origin=OBJECT_LITERAL RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CALL 'public final fun foo (): kotlin.String declared in .box.' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.kt.txt b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.kt.txt index 04b3914c8a3..aa9bcf1a4d2 100644 --- a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.kt.txt @@ -1,18 +1,21 @@ fun box(): String { val obj: = { // BLOCK local class { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val end: String field = "K" get - fun foo(): String { - return .Some(s = "O").bar() + local open inner class Base { + val s: String + field = s + get + + constructor(s: String) /* primary */ { + super/*Any*/() + /* () */ + + } + } local inner class Some : Base { @@ -28,17 +31,14 @@ fun box(): String { } - local open inner class Base { - constructor(s: String) /* primary */ { - super/*Any*/() - /* () */ + constructor() /* primary */ { + super/*Any*/() + /* () */ - } - - val s: String - field = s - get + } + fun foo(): String { + return .Some(s = "O").bar() } } @@ -47,3 +47,4 @@ fun box(): String { } return obj.foo() } + diff --git a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.ir.txt b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.ir.txt index 70994e2f0e4..e41c3585d9c 100644 --- a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.ir.txt +++ b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.ir.txt @@ -5,10 +5,6 @@ FILE fqName: fileName:/InnerClassInAnonymous.kt BLOCK type=.box. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box. - CONSTRUCTOR visibility:public <> () returnType:.box. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any]' PROPERTY name:end visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:end type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -20,14 +16,38 @@ FILE fqName: fileName:/InnerClassInAnonymous.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .box.' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:end type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .box. declared in .box..' type=.box. origin=null - FUN name:foo visibility:public modality:FINAL <> ($this:.box.) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.box. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .box.' - CALL 'public final fun bar (): kotlin.String declared in .box..Some' type=kotlin.String origin=null - $this: CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in .box..Some' type=.box..Some origin=null - $outer: GET_VAR ': .box. declared in .box..foo' type=.box. origin=null - s: CONST String type=kotlin.String value="O" + CLASS CLASS name:Base modality:OPEN visibility:local [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box..Base + PROPERTY name:s visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 's: kotlin.String declared in .box..Base.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.box..Base) returnType:kotlin.String + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.box..Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .box..Base' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .box..Base declared in .box..Base.' type=.box..Base origin=null + CONSTRUCTOR visibility:public <> ($this:.box., s:kotlin.String) returnType:.box..Base [primary] + $outer: VALUE_PARAMETER name: type:.box. + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:local [inner] 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 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 CLASS CLASS name:Some modality:FINAL visibility:local [inner] superTypes:[.box..Base] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box..Some CONSTRUCTOR visibility:public <> ($this:.box., s:kotlin.String) returnType:.box..Some [primary] @@ -38,6 +58,19 @@ FILE fqName: fileName:/InnerClassInAnonymous.kt $this: GET_VAR ': .box. declared in .box..Some.' type=.box. origin=null s: GET_VAR 's: kotlin.String declared in .box..Some.' type=kotlin.String origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:local [inner] superTypes:[.box..Base]' + 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 .box..Base + $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 .box..Base + $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 .box..Base + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:bar visibility:public modality:FINAL <> ($this:.box..Some) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.box..Some BLOCK_BODY @@ -55,51 +88,10 @@ FILE fqName: fileName:/InnerClassInAnonymous.kt overridden: public final fun (): kotlin.String declared in .box..Base $this: VALUE_PARAMETER name: type:.box..Base - 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 .box..Base - $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 .box..Base - $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 .box..Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Base modality:OPEN visibility:local [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box..Base - CONSTRUCTOR visibility:public <> ($this:.box., s:kotlin.String) returnType:.box..Base [primary] - $outer: VALUE_PARAMETER name: type:.box. - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:local [inner] superTypes:[kotlin.Any]' - PROPERTY name:s visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 's: kotlin.String declared in .box..Base.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.box..Base) returnType:kotlin.String - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.box..Base - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .box..Base' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .box..Base declared in .box..Base.' type=.box..Base 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: 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 + CONSTRUCTOR visibility:public <> () returnType:.box. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local 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 declared in kotlin.Any @@ -113,6 +105,14 @@ FILE fqName: fileName:/InnerClassInAnonymous.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.box.) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.box. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .box.' + CALL 'public final fun bar (): kotlin.String declared in .box..Some' type=kotlin.String origin=null + $this: CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) declared in .box..Some' type=.box..Some origin=null + $outer: GET_VAR ': .box. declared in .box..foo' type=.box. origin=null + s: CONST String type=kotlin.String value="O" CONSTRUCTOR_CALL 'public constructor () declared in .box.' type=.box. origin=OBJECT_LITERAL RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CALL 'public final fun foo (): kotlin.String declared in .box.' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt.txt b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt.txt index 04b3914c8a3..aa9bcf1a4d2 100644 --- a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt.txt +++ b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt.txt @@ -1,18 +1,21 @@ fun box(): String { val obj: = { // BLOCK local class { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val end: String field = "K" get - fun foo(): String { - return .Some(s = "O").bar() + local open inner class Base { + val s: String + field = s + get + + constructor(s: String) /* primary */ { + super/*Any*/() + /* () */ + + } + } local inner class Some : Base { @@ -28,17 +31,14 @@ fun box(): String { } - local open inner class Base { - constructor(s: String) /* primary */ { - super/*Any*/() - /* () */ + constructor() /* primary */ { + super/*Any*/() + /* () */ - } - - val s: String - field = s - get + } + fun foo(): String { + return .Some(s = "O").bar() } } @@ -47,3 +47,4 @@ fun box(): String { } return obj.foo() } + diff --git a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.ir.txt b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.ir.txt index f75375a053a..ebb7baf0e2c 100644 --- a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.ir.txt +++ b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.ir.txt @@ -1,4 +1,7 @@ FILE fqName: fileName:/IntArrayAsVararg.kt + FUN name:consumeVarargs visibility:public modality:FINAL <> (arr:kotlin.IntArray) returnType:kotlin.Unit + VALUE_PARAMETER name:arr index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun consumeVarargs (vararg arr: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -12,6 +15,3 @@ FILE fqName: fileName:/IntArrayAsVararg.kt elements: VARARG type=kotlin.IntArray varargElementType=kotlin.Int CONST Int type=kotlin.Int value=41 CONST Int type=kotlin.Int value=42 - FUN name:consumeVarargs visibility:public modality:FINAL <> (arr:kotlin.IntArray) returnType:kotlin.Unit - VALUE_PARAMETER name:arr index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] - BLOCK_BODY diff --git a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt.txt b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt.txt index 9adf015c91c..f5f0dec3802 100644 --- a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt.txt +++ b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt.txt @@ -1,7 +1,8 @@ +fun consumeVarargs(vararg arr: Int) { +} + fun test() { consumeVarargs(arr = [1, 2]) consumeVarargs(arr = [*intArrayOf(elements = [41, 42])]) } -fun consumeVarargs(vararg arr: Int) { -} diff --git a/compiler/testData/ir/irText/firProblems/Modality.ir.txt b/compiler/testData/ir/irText/firProblems/Modality.ir.txt index f929dbb3db6..067472b7918 100644 --- a/compiler/testData/ir/irText/firProblems/Modality.ir.txt +++ b/compiler/testData/ir/irText/firProblems/Modality.ir.txt @@ -1,7 +1,53 @@ FILE fqName: fileName:/Modality.kt - CLASS INTERFACE name:Substitutable modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Substitutable.Substitutable> - TYPE_PARAMETER name:T index:0 variance:out superTypes:[.DeclarationDescriptorNonRoot] reified:false + CLASS CLASS name:Atom modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Atom + PROPERTY name:candidateDescriptor visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:candidateDescriptor type:.CallableDescriptor visibility:private [final] + EXPRESSION_BODY + GET_VAR 'candidateDescriptor: .CallableDescriptor declared in .Atom.' type=.CallableDescriptor origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Atom) returnType:.CallableDescriptor + correspondingProperty: PROPERTY name:candidateDescriptor visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Atom + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .CallableDescriptor declared in .Atom' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:candidateDescriptor type:.CallableDescriptor visibility:private [final]' type=.CallableDescriptor origin=null + receiver: GET_VAR ': .Atom declared in .Atom.' type=.Atom origin=null + CONSTRUCTOR visibility:public <> (candidateDescriptor:.CallableDescriptor) returnType:.Atom [primary] + VALUE_PARAMETER name:candidateDescriptor index:0 type:.CallableDescriptor + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Atom modality:FINAL visibility:public 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 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 + CLASS CLASS name:KotlinResolutionCandidate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KotlinResolutionCandidate + PROPERTY name:resolvedCall visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:.Atom visibility:private [final] + EXPRESSION_BODY + GET_VAR 'resolvedCall: .Atom declared in .KotlinResolutionCandidate.' type=.Atom origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.KotlinResolutionCandidate) returnType:.Atom + correspondingProperty: PROPERTY name:resolvedCall visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.KotlinResolutionCandidate + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .Atom declared in .KotlinResolutionCandidate' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:.Atom visibility:private [final]' type=.Atom origin=null + receiver: GET_VAR ': .KotlinResolutionCandidate declared in .KotlinResolutionCandidate.' type=.KotlinResolutionCandidate origin=null + CONSTRUCTOR visibility:public <> (resolvedCall:.Atom) returnType:.KotlinResolutionCandidate [primary] + VALUE_PARAMETER name:resolvedCall index:0 type:.Atom + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KotlinResolutionCandidate modality:FINAL visibility:public 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 declared in kotlin.Any @@ -21,9 +67,25 @@ FILE fqName: fileName:/Modality.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ResolutionPart modality:ABSTRACT visibility:public 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 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:process visibility:public modality:ABSTRACT <> ($this:.ResolutionPart, $receiver:.KotlinResolutionCandidate) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.ResolutionPart $receiver: VALUE_PARAMETER name: type:.KotlinResolutionCandidate + CLASS INTERFACE name:Substitutable modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Substitutable.Substitutable> + TYPE_PARAMETER name:T index:0 variance:out superTypes:[.DeclarationDescriptorNonRoot] reified:false 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 @@ -37,67 +99,24 @@ FILE fqName: fileName:/Modality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:KotlinResolutionCandidate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KotlinResolutionCandidate - CONSTRUCTOR visibility:public <> (resolvedCall:.Atom) returnType:.KotlinResolutionCandidate [primary] - VALUE_PARAMETER name:resolvedCall index:0 type:.Atom + CLASS OBJECT name:Final modality:FINAL visibility:public superTypes:[.Modality] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Final + CONSTRUCTOR visibility:private <> () returnType:.Final [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KotlinResolutionCandidate modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:resolvedCall visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:.Atom visibility:private [final] - EXPRESSION_BODY - GET_VAR 'resolvedCall: .Atom declared in .KotlinResolutionCandidate.' type=.Atom origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.KotlinResolutionCandidate) returnType:.Atom - correspondingProperty: PROPERTY name:resolvedCall visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.KotlinResolutionCandidate - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .Atom declared in .KotlinResolutionCandidate' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:.Atom visibility:private [final]' type=.Atom origin=null - receiver: GET_VAR ': .KotlinResolutionCandidate declared in .KotlinResolutionCandidate.' type=.KotlinResolutionCandidate origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Final modality:FINAL visibility:public superTypes:[.Modality]' 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 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Modality $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 + public open fun hashCode (): kotlin.Int declared in .Modality $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 - CLASS CLASS name:Atom modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Atom - CONSTRUCTOR visibility:public <> (candidateDescriptor:.CallableDescriptor) returnType:.Atom [primary] - VALUE_PARAMETER name:candidateDescriptor index:0 type:.CallableDescriptor - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Atom modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:candidateDescriptor visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:candidateDescriptor type:.CallableDescriptor visibility:private [final] - EXPRESSION_BODY - GET_VAR 'candidateDescriptor: .CallableDescriptor declared in .Atom.' type=.CallableDescriptor origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Atom) returnType:.CallableDescriptor - correspondingProperty: PROPERTY name:candidateDescriptor visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Atom - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .CallableDescriptor declared in .Atom' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:candidateDescriptor type:.CallableDescriptor visibility:private [final]' type=.CallableDescriptor origin=null - receiver: GET_VAR ': .Atom declared in .Atom.' type=.Atom 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: 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 + public open fun toString (): kotlin.String declared in .Modality $this: VALUE_PARAMETER name: type:kotlin.Any CLASS OBJECT name:Owner modality:FINAL visibility:public superTypes:[.ResolutionPart] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Owner @@ -105,6 +124,19 @@ FILE fqName: fileName:/Modality.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .ResolutionPart' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Owner modality:FINAL visibility:public superTypes:[.ResolutionPart]' + 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 .ResolutionPart + $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 .ResolutionPart + $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 .ResolutionPart + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:process visibility:public modality:OPEN <> ($this:.Owner, $receiver:.KotlinResolutionCandidate) returnType:kotlin.String overridden: public abstract fun process (): kotlin.String declared in .ResolutionPart @@ -135,35 +167,3 @@ FILE fqName: fileName:/Modality.kt CONST String type=kotlin.String value="OK" RETURN type=kotlin.Nothing from='public open fun process (): kotlin.String declared in .Owner' CONST String type=kotlin.String value="FAIL" - 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 .ResolutionPart - $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 .ResolutionPart - $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 .ResolutionPart - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Final modality:FINAL visibility:public superTypes:[.Modality] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Final - CONSTRUCTOR visibility:private <> () returnType:.Final [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Final modality:FINAL visibility:public superTypes:[.Modality]' - 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 .Modality - $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 .Modality - $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 .Modality - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/Modality.kt.txt b/compiler/testData/ir/irText/firProblems/Modality.kt.txt index c322a4d8fc7..653cda57492 100644 --- a/compiler/testData/ir/irText/firProblems/Modality.kt.txt +++ b/compiler/testData/ir/irText/firProblems/Modality.kt.txt @@ -1,4 +1,27 @@ -interface Substitutable { +class Atom { + val candidateDescriptor: CallableDescriptor + field = candidateDescriptor + get + + constructor(candidateDescriptor: CallableDescriptor) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class KotlinResolutionCandidate { + val resolvedCall: Atom + field = resolvedCall + get + + constructor(resolvedCall: Atom) /* primary */ { + super/*Any*/() + /* () */ + + } + } abstract class ResolutionPart { @@ -12,30 +35,16 @@ abstract class ResolutionPart { } -class KotlinResolutionCandidate { - constructor(resolvedCall: Atom) /* primary */ { - super/*Any*/() - /* () */ - - } - - val resolvedCall: Atom - field = resolvedCall - get - +interface Substitutable { } -class Atom { - constructor(candidateDescriptor: CallableDescriptor) /* primary */ { +object Final : Modality { + private constructor() /* primary */ { super/*Any*/() /* () */ } - val candidateDescriptor: CallableDescriptor - field = candidateDescriptor - get - } object Owner : ResolutionPart { @@ -60,11 +69,3 @@ object Owner : ResolutionPart { } -object Final : Modality { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} diff --git a/compiler/testData/ir/irText/firProblems/MultiList.fir.ir.txt b/compiler/testData/ir/irText/firProblems/MultiList.fir.ir.txt index d0a589c5f72..c1899a5bdfd 100644 --- a/compiler/testData/ir/irText/firProblems/MultiList.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/MultiList.fir.ir.txt @@ -1,12 +1,196 @@ FILE fqName: fileName:/MultiList.kt + CLASS CLASS name:FinalList modality:FINAL visibility:public superTypes:[.SomeList] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FinalList + CONSTRUCTOR visibility:public <> () returnType:.FinalList [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .SomeList' + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FinalList modality:FINAL visibility:public superTypes:[.SomeList]' + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] .Some) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun add (p0: @[EnhancedNullability] .Some.SomeList>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] .Some + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int, p1:@[EnhancedNullability] .Some) returnType:kotlin.Unit [fake_override] + overridden: + public open fun add (p0: kotlin.Int, p1: @[EnhancedNullability] .Some.SomeList>): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] .Some + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] kotlin.collections.Collection.Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (p0: @[EnhancedNullability] kotlin.collections.Collection.Some.SomeList>>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.collections.Collection.Some> + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.collections.Collection.Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (p0: kotlin.Int, p1: @[EnhancedNullability] kotlin.collections.Collection.Some.SomeList>>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.collections.Collection.Some> + FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun clear (): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[EnhancedNullability] kotlin.Any [fake_override] + overridden: + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, element:.Some) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun contains (element: .Some.SomeList>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + VALUE_PARAMETER name:element index:0 type:.Some + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, elements:kotlin.collections.Collection<.Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun containsAll (elements: kotlin.collections.Collection<.Some.SomeList>>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.Some> + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + 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 .SomeList + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.Some>, p0:@[FlexibleNullability] java.util.function.Consumer.Some?>?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer.Some.SomeList>?>?): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.Some?>? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, index:kotlin.Int) returnType:.Some [fake_override,operator] + overridden: + public open fun get (index: kotlin.Int): .Some.SomeList> declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + 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 .SomeList + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, element:.Some) returnType:kotlin.Int [fake_override] + overridden: + public open fun indexOf (element: .Some.SomeList>): kotlin.Int declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + VALUE_PARAMETER name:element index:0 type:.Some + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun isEmpty (): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] .Some> [fake_override,operator] + overridden: + public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, element:.Some) returnType:kotlin.Int [fake_override] + overridden: + public open fun lastIndexOf (element: .Some.SomeList>): kotlin.Int declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + VALUE_PARAMETER name:element index:0 type:.Some + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some> [fake_override] + overridden: + public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some> [fake_override] + overridden: + public open fun listIterator (p0: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some> [fake_override] + overridden: + public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some> + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] .Some) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun remove (p0: @[EnhancedNullability] .Some.SomeList>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] .Some + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.collections.Collection<@[EnhancedNullability] .Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (p0: kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some> + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int) returnType:@[EnhancedNullability] .Some [fake_override,operator] + overridden: + public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] .Some.SomeList> declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] java.util.function.Predicate.Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate.Some.SomeList>>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate.Some> + FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some.SomeList>>): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some> + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.collections.Collection<@[EnhancedNullability] .Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun retainAll (p0: kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some> + FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int, p1:@[EnhancedNullability] .Some) returnType:@[EnhancedNullability] .Some [fake_override,operator] + overridden: + public open fun set (p0: kotlin.Int, p1: @[EnhancedNullability] .Some.SomeList>): @[EnhancedNullability] .Some.SomeList> declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] .Some + FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[FlexibleNullability] java.util.Comparator.Some?>?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun sort (p0: @[FlexibleNullability] java.util.Comparator.Some.SomeList>?>?): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator.Some?>? + FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some?> [fake_override] + overridden: + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.SomeList>?> declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some> [fake_override] + overridden: + public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some> + FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int, p1:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] .Some> [fake_override] + overridden: + public open fun subList (p0: kotlin.Int, p1: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? [fake_override] + overridden: + public open fun toArray (): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList<.Some>, p0:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.FinalList.toArray?>?) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.FinalList.toArray?>? [fake_override] + overridden: + public open fun toArray (p0: @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.SomeList.toArray?>?): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.SomeList.toArray?>? declared in .SomeList + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.FinalList.toArray?>? + 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 .SomeList + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun trimToSize (): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.Int declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> CLASS CLASS name:Some modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Some.Some> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .Some) returnType:.Some.Some> [primary] - VALUE_PARAMETER name:value index:0 type:T of .Some - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final] EXPRESSION_BODY @@ -18,6 +202,11 @@ FILE fqName: fileName:/MultiList.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Some declared in .Some' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null receiver: GET_VAR ': .Some.Some> declared in .Some.' type=.Some.Some> origin=null + CONSTRUCTOR visibility:public <> (value:T of .Some) returnType:.Some.Some> [primary] + VALUE_PARAMETER name:value index:0 type:T of .Some + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Some.Some>) returnType:T of .Some [operator] $this: VALUE_PARAMETER name: type:.Some.Some> BLOCK_BODY @@ -35,36 +224,6 @@ FILE fqName: fileName:/MultiList.kt CONSTRUCTOR_CALL 'public constructor (value: T of .Some) declared in .Some' type=.Some.Some> origin=null : T of .Some value: GET_VAR 'value: T of .Some declared in .Some.copy' type=T of .Some origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Some.Some>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Some.Some> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Some' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Some(" - CONST String type=kotlin.String value="value=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null - receiver: GET_VAR ': .Some.Some> declared in .Some.toString' type=.Some.Some> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Some.Some>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Some.Some> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Some' - WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null - receiver: GET_VAR ': .Some.Some> declared in .Some.hashCode' type=.Some.Some> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null - receiver: GET_VAR ': .Some.Some> declared in .Some.hashCode' type=.Some.Some> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Some.Some>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -99,95 +258,36 @@ FILE fqName: fileName:/MultiList.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Some' CONST Boolean type=kotlin.Boolean value=true - CLASS INTERFACE name:MyList modality:ABSTRACT visibility:public superTypes:[kotlin.collections.List<.Some.MyList>>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList.MyList> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN FAKE_OVERRIDE name:contains visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, element:.Some.MyList>) returnType:kotlin.Boolean [fake_override,operator] + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Some.Some>) returnType:kotlin.Int overridden: - public abstract fun contains (element: E of kotlin.collections.List): kotlin.Boolean declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> - VALUE_PARAMETER name:element index:0 type:.Some.MyList> - FUN FAKE_OVERRIDE name:containsAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, elements:kotlin.collections.Collection<.Some.MyList>>) returnType:kotlin.Boolean [fake_override] + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Some.Some> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Some' + WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null + receiver: GET_VAR ': .Some.Some> declared in .Some.hashCode' type=.Some.Some> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null + receiver: GET_VAR ': .Some.Some> declared in .Some.hashCode' type=.Some.Some> origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Some.Some>) returnType:kotlin.String overridden: - public abstract fun containsAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.Some.MyList>> - FUN FAKE_OVERRIDE name:get visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, index:kotlin.Int) returnType:.Some.MyList> [fake_override,operator] - overridden: - public abstract fun get (index: kotlin.Int): E of kotlin.collections.List declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, element:.Some.MyList>) returnType:kotlin.Int [fake_override] - overridden: - public abstract fun indexOf (element: E of kotlin.collections.List): kotlin.Int declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> - VALUE_PARAMETER name:element index:0 type:.Some.MyList> - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> - FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>) returnType:kotlin.collections.Iterator<.Some.MyList>> [fake_override,operator] - overridden: - public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, element:.Some.MyList>) returnType:kotlin.Int [fake_override] - overridden: - public abstract fun lastIndexOf (element: E of kotlin.collections.List): kotlin.Int declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> - VALUE_PARAMETER name:element index:0 type:.Some.MyList> - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>) returnType:kotlin.collections.ListIterator<.Some.MyList>> [fake_override] - overridden: - public abstract fun listIterator (): kotlin.collections.ListIterator declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, index:kotlin.Int) returnType:kotlin.collections.ListIterator<.Some.MyList>> [fake_override] - overridden: - public abstract fun listIterator (index: kotlin.Int): kotlin.collections.ListIterator declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:subList visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:kotlin.collections.List<.Some.MyList>> [fake_override] - overridden: - public abstract fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.List declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> - VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int - VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.Int declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> - FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.MyList>>) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.MyList>?> [fake_override] - overridden: - public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of kotlin.collections.List?> declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> - 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.collections.List - $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.collections.List - $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.collections.List - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some.MyList>>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.MyList>> [fake_override] - overridden: - public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of kotlin.collections.List> declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some.MyList>> - FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some.MyList>>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.MyList>> [fake_override] - overridden: - public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of kotlin.collections.List> declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some.MyList>> - FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.Some.MyList>>, p0:@[FlexibleNullability] java.util.function.Consumer.Some.MyList>?>?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.Some.MyList>> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.Some.MyList>?>? + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Some.Some> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Some' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Some(" + CONST String type=kotlin.String value="value=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null + receiver: GET_VAR ': .Some.Some> declared in .Some.toString' type=.Some.Some> origin=null + CONST String type=kotlin.String value=")" CLASS CLASS name:SomeList modality:OPEN visibility:public superTypes:[.MyList.SomeList>; java.util.ArrayList<.Some.SomeList>>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SomeList.SomeList> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -196,6 +296,36 @@ FILE fqName: fileName:/MultiList.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in java.util.ArrayList' : .Some.SomeList> INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SomeList modality:OPEN visibility:public superTypes:[.MyList.SomeList>; java.util.ArrayList<.Some.SomeList>>]' + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] .Some.SomeList>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun add (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] .Some.SomeList> + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int, p1:@[EnhancedNullability] .Some.SomeList>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun add (p0: kotlin.Int, p1: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] .Some.SomeList> + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] kotlin.collections.Collection.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (p0: @[EnhancedNullability] kotlin.collections.Collection): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.collections.Collection.Some.SomeList>> + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.collections.Collection.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (p0: kotlin.Int, p1: @[EnhancedNullability] kotlin.collections.Collection): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.collections.Collection.Some.SomeList>> + FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun clear (): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:@[EnhancedNullability] kotlin.Any [fake_override] + overridden: + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, element:.Some.SomeList>) returnType:kotlin.Boolean [fake_override,operator] overridden: public abstract fun contains (element: .Some.MyList>): kotlin.Boolean declared in .MyList @@ -208,12 +338,34 @@ FILE fqName: fileName:/MultiList.kt public open fun containsAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.Some.SomeList>> + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + 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 .MyList + public open fun equals (p0: kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.Some.SomeList>>, p0:@[FlexibleNullability] java.util.function.Consumer.Some.SomeList>?>?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer.Some.MyList>?>?): kotlin.Unit declared in .MyList + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.Some.SomeList>?>? FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, index:kotlin.Int) returnType:.Some.SomeList> [fake_override,operator] overridden: public abstract fun get (index: kotlin.Int): .Some.MyList> declared in .MyList public open fun get (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> VALUE_PARAMETER name:index index:0 type:kotlin.Int + 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 .MyList + public open fun hashCode (): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.Any FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, element:.Some.SomeList>) returnType:kotlin.Int [fake_override] overridden: public abstract fun indexOf (element: .Some.MyList>): kotlin.Int declared in .MyList @@ -247,6 +399,66 @@ FILE fqName: fileName:/MultiList.kt public open fun listIterator (p0: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some.SomeList>>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> [fake_override] + overridden: + public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.MyList>> declared in .MyList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some.SomeList>> + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] .Some.SomeList>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun remove (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] .Some.SomeList> + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>> + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int) returnType:@[EnhancedNullability] .Some.SomeList> [fake_override,operator] + overridden: + public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] java.util.function.Predicate.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate.Some.SomeList>> + FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some.SomeList>> + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun retainAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>> + FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int, p1:@[EnhancedNullability] .Some.SomeList>) returnType:@[EnhancedNullability] .Some.SomeList> [fake_override,operator] + overridden: + public open fun set (p0: kotlin.Int, p1: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] .Some.SomeList> + FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[FlexibleNullability] java.util.Comparator.Some.SomeList>?>?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator.Some.SomeList>?>? + FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.SomeList>?> [fake_override] + overridden: + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.MyList>?> declared in .MyList + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> + FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some.SomeList>>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> [fake_override] + overridden: + public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.MyList>> declared in .MyList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some.SomeList>> FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int, p1:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] .Some.SomeList>> [fake_override] overridden: public abstract fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.List<.Some.MyList>> declared in .MyList @@ -254,16 +466,6 @@ FILE fqName: fileName:/MultiList.kt $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> VALUE_PARAMETER name:p0 index:0 type:kotlin.Int VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public abstract size: kotlin.Int - public open size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public abstract fun (): kotlin.Int declared in .MyList - public open fun (): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? [fake_override] overridden: public open fun toArray (): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in java.util.ArrayList @@ -274,313 +476,111 @@ FILE fqName: fileName:/MultiList.kt TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.SomeList.toArray?>? - FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] .Some.SomeList>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun add (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] .Some.SomeList> - FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int, p1:@[EnhancedNullability] .Some.SomeList>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun add (p0: kotlin.Int, p1: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] .Some.SomeList> - FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] .Some.SomeList>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun remove (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] .Some.SomeList> - FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] kotlin.collections.Collection.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun addAll (p0: @[EnhancedNullability] kotlin.collections.Collection): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.collections.Collection.Some.SomeList>> - FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.collections.Collection.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun addAll (p0: kotlin.Int, p1: @[EnhancedNullability] kotlin.collections.Collection): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.collections.Collection.Some.SomeList>> - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>> - FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun retainAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>> - FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some.SomeList>> - FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[FlexibleNullability] java.util.Comparator.Some.SomeList>?>?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator.Some.SomeList>?>? - FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun clear (): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int, p1:@[EnhancedNullability] .Some.SomeList>) returnType:@[EnhancedNullability] .Some.SomeList> [fake_override,operator] - overridden: - public open fun set (p0: kotlin.Int, p1: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] .Some.SomeList> - FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.SomeList>?> [fake_override] - overridden: - public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.MyList>?> declared in .MyList - public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> - 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 .MyList - public open fun equals (p0: kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList - $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 .MyList - public open fun hashCode (): kotlin.Int declared in java.util.ArrayList - $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 .MyList public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] java.util.function.Predicate.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate.Some.SomeList>> - FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some.SomeList>>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> [fake_override] - overridden: - public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.MyList>> declared in .MyList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some.SomeList>> - FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some.SomeList>>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> [fake_override] - overridden: - public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.MyList>> declared in .MyList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some.SomeList>> - FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.Some.SomeList>>, p0:@[FlexibleNullability] java.util.function.Consumer.Some.SomeList>?>?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer.Some.MyList>?>?): kotlin.Unit declared in .MyList - public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.Some.SomeList>?>? FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:kotlin.Unit [fake_override] overridden: public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - overridden: - public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int) returnType:@[EnhancedNullability] .Some.SomeList> [fake_override,operator] - overridden: - public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - CLASS CLASS name:FinalList modality:FINAL visibility:public superTypes:[.SomeList] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FinalList - CONSTRUCTOR visibility:public <> () returnType:.FinalList [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .SomeList' - : kotlin.String - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FinalList modality:FINAL visibility:public superTypes:[.SomeList]' - FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, element:.Some) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun contains (element: .Some.SomeList>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - VALUE_PARAMETER name:element index:0 type:.Some - FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, elements:kotlin.collections.Collection<.Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun containsAll (elements: kotlin.collections.Collection<.Some.SomeList>>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.Some> - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, index:kotlin.Int) returnType:.Some [fake_override,operator] - overridden: - public open fun get (index: kotlin.Int): .Some.SomeList> declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, element:.Some) returnType:kotlin.Int [fake_override] - overridden: - public open fun indexOf (element: .Some.SomeList>): kotlin.Int declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - VALUE_PARAMETER name:element index:0 type:.Some - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun isEmpty (): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] .Some> [fake_override,operator] - overridden: - public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, element:.Some) returnType:kotlin.Int [fake_override] - overridden: - public open fun lastIndexOf (element: .Some.SomeList>): kotlin.Int declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - VALUE_PARAMETER name:element index:0 type:.Some - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some> [fake_override] - overridden: - public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some> [fake_override] - overridden: - public open fun listIterator (p0: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int, p1:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] .Some> [fake_override] - overridden: - public open fun subList (p0: kotlin.Int, p1: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:kotlin.Int PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] overridden: + public abstract size: kotlin.Int public open size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>) returnType:kotlin.Int [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>) returnType:kotlin.Int [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] overridden: - public open fun (): kotlin.Int declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? [fake_override] + public abstract fun (): kotlin.Int declared in .MyList + public open fun (): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> + CLASS INTERFACE name:MyList modality:ABSTRACT visibility:public superTypes:[kotlin.collections.List<.Some.MyList>>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList.MyList> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + FUN FAKE_OVERRIDE name:contains visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, element:.Some.MyList>) returnType:kotlin.Boolean [fake_override,operator] overridden: - public open fun toArray (): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList<.Some>, p0:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.FinalList.toArray?>?) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.FinalList.toArray?>? [fake_override] + public abstract fun contains (element: E of kotlin.collections.List): kotlin.Boolean declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> + VALUE_PARAMETER name:element index:0 type:.Some.MyList> + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, elements:kotlin.collections.Collection<.Some.MyList>>) returnType:kotlin.Boolean [fake_override] overridden: - public open fun toArray (p0: @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.SomeList.toArray?>?): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.SomeList.toArray?>? declared in .SomeList - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.FinalList.toArray?>? - FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] .Some) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun add (p0: @[EnhancedNullability] .Some.SomeList>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] .Some - FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int, p1:@[EnhancedNullability] .Some) returnType:kotlin.Unit [fake_override] - overridden: - public open fun add (p0: kotlin.Int, p1: @[EnhancedNullability] .Some.SomeList>): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] .Some - FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] .Some) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun remove (p0: @[EnhancedNullability] .Some.SomeList>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] .Some - FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] kotlin.collections.Collection.Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun addAll (p0: @[EnhancedNullability] kotlin.collections.Collection.Some.SomeList>>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.collections.Collection.Some> - FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.collections.Collection.Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun addAll (p0: kotlin.Int, p1: @[EnhancedNullability] kotlin.collections.Collection.Some.SomeList>>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.collections.Collection.Some> - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.collections.Collection<@[EnhancedNullability] .Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeAll (p0: kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some> - FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.collections.Collection<@[EnhancedNullability] .Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun retainAll (p0: kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some> - FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some.SomeList>>): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some> - FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[FlexibleNullability] java.util.Comparator.Some?>?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun sort (p0: @[FlexibleNullability] java.util.Comparator.Some.SomeList>?>?): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator.Some?>? - FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun clear (): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int, p1:@[EnhancedNullability] .Some) returnType:@[EnhancedNullability] .Some [fake_override,operator] - overridden: - public open fun set (p0: kotlin.Int, p1: @[EnhancedNullability] .Some.SomeList>): @[EnhancedNullability] .Some.SomeList> declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] .Some - FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some?> [fake_override] - overridden: - public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.SomeList>?> declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + public abstract fun containsAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.Some.MyList>> 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 .SomeList + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.List $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.Some.MyList>>, p0:@[FlexibleNullability] java.util.function.Consumer.Some.MyList>?>?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.Some.MyList>> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.Some.MyList>?>? + FUN FAKE_OVERRIDE name:get visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, index:kotlin.Int) returnType:.Some.MyList> [fake_override,operator] + overridden: + public abstract fun get (index: kotlin.Int): E of kotlin.collections.List declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> + VALUE_PARAMETER name:index index:0 type:kotlin.Int 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 .SomeList + public open fun hashCode (): kotlin.Int declared in kotlin.collections.List $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, element:.Some.MyList>) returnType:kotlin.Int [fake_override] + overridden: + public abstract fun indexOf (element: E of kotlin.collections.List): kotlin.Int declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> + VALUE_PARAMETER name:element index:0 type:.Some.MyList> + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> + FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>) returnType:kotlin.collections.Iterator<.Some.MyList>> [fake_override,operator] + overridden: + public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, element:.Some.MyList>) returnType:kotlin.Int [fake_override] + overridden: + public abstract fun lastIndexOf (element: E of kotlin.collections.List): kotlin.Int declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> + VALUE_PARAMETER name:element index:0 type:.Some.MyList> + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>) returnType:kotlin.collections.ListIterator<.Some.MyList>> [fake_override] + overridden: + public abstract fun listIterator (): kotlin.collections.ListIterator declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, index:kotlin.Int) returnType:kotlin.collections.ListIterator<.Some.MyList>> [fake_override] + overridden: + public abstract fun listIterator (index: kotlin.Int): kotlin.collections.ListIterator declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some.MyList>>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.MyList>> [fake_override] + overridden: + public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of kotlin.collections.List> declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some.MyList>> + FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.MyList>>) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.MyList>?> [fake_override] + overridden: + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of kotlin.collections.List?> declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> + FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some.MyList>>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.MyList>> [fake_override] + overridden: + public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of kotlin.collections.List> declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some.MyList>> + FUN FAKE_OVERRIDE name:subList visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:kotlin.collections.List<.Some.MyList>> [fake_override] + overridden: + public abstract fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.List declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> + VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int + VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int 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 .SomeList + public open fun toString (): kotlin.String declared in kotlin.collections.List $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] java.util.function.Predicate.Some>) returnType:kotlin.Boolean [fake_override] + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] overridden: - public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate.Some.SomeList>>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate.Some> - FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some> [fake_override] - overridden: - public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some> - FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some> [fake_override] - overridden: - public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some> - FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.Some>, p0:@[FlexibleNullability] java.util.function.Consumer.Some?>?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer.Some.SomeList>?>?): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.Some?>? - FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun trimToSize (): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - overridden: - public open fun clone (): @[EnhancedNullability] kotlin.Any declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int) returnType:@[EnhancedNullability] .Some [fake_override,operator] - overridden: - public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] .Some.SomeList> declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + public abstract size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.Int declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> diff --git a/compiler/testData/ir/irText/firProblems/MultiList.fir.kt.txt b/compiler/testData/ir/irText/firProblems/MultiList.fir.kt.txt index 3ab6c0280f6..9168de00f5c 100644 --- a/compiler/testData/ir/irText/firProblems/MultiList.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/MultiList.fir.kt.txt @@ -1,14 +1,23 @@ +class FinalList : SomeList { + constructor() /* primary */ { + super/*SomeList*/() + /* () */ + + } + +} + data class Some { + val value: T + field = value + get + constructor(value: T) /* primary */ { super/*Any*/() /* () */ } - val value: T - field = value - get - operator fun component1(): T { return .#value } @@ -17,17 +26,6 @@ data class Some { return Some(value = value) } - override fun toString(): String { - return "Some(" + "value=" + .#value + ")" - } - - override fun hashCode(): Int { - return when { - EQEQ(arg0 = .#value, arg1 = null) -> 0 - else -> .#value.hashCode() - } - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -42,12 +40,20 @@ data class Some { return true } + override fun hashCode(): Int { + return when { + EQEQ(arg0 = .#value, arg1 = null) -> 0 + else -> .#value.hashCode() + } + } + + override fun toString(): String { + return "Some(" + "value=" + .#value + ")" + } + } -interface MyList : List> { -} - -open class SomeList : MyList, ArrayList> { +open class SomeList : ArrayList>, MyList { constructor() /* primary */ { super/*ArrayList*/>() /* () */ @@ -56,12 +62,6 @@ open class SomeList : MyList, ArrayList> { } -class FinalList : SomeList { - constructor() /* primary */ { - super/*SomeList*/() - /* () */ - - } - +interface MyList : List> { } diff --git a/compiler/testData/ir/irText/firProblems/MultiList.ir.txt b/compiler/testData/ir/irText/firProblems/MultiList.ir.txt index 4a1e175761e..9466038c56f 100644 --- a/compiler/testData/ir/irText/firProblems/MultiList.ir.txt +++ b/compiler/testData/ir/irText/firProblems/MultiList.ir.txt @@ -1,12 +1,199 @@ FILE fqName: fileName:/MultiList.kt + CLASS CLASS name:FinalList modality:FINAL visibility:public superTypes:[.SomeList] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FinalList + CONSTRUCTOR visibility:public <> () returnType:.FinalList [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .SomeList' + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FinalList modality:FINAL visibility:public superTypes:[.SomeList]' + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, element:@[EnhancedNullability] .Some) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun add (element: @[EnhancedNullability] .Some.SomeList>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] .Some + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, index:kotlin.Int, element:@[EnhancedNullability] .Some) returnType:kotlin.Unit [fake_override] + overridden: + public open fun add (index: kotlin.Int, element: @[EnhancedNullability] .Some.SomeList>): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] .Some + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, elements:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (elements: @[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:elements index:0 type:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some> + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, index:kotlin.Int, elements:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (index: kotlin.Int, elements: @[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:elements index:1 type:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some> + FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun clear (): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[EnhancedNullability] kotlin.Any [fake_override] + overridden: + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, element:.Some) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun contains (element: .Some.SomeList>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + VALUE_PARAMETER name:element index:0 type:.Some + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, elements:kotlin.collections.Collection<.Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun containsAll (elements: kotlin.collections.Collection<.Some.SomeList>>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.Some> + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + 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 .SomeList + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.Some>, p0:@[FlexibleNullability] java.util.function.Consumer.Some?>?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer.Some.SomeList>?>?): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.Some?>? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, index:kotlin.Int) returnType:.Some [fake_override,operator] + overridden: + public open fun get (index: kotlin.Int): .Some.SomeList> declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + 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 .SomeList + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, element:.Some) returnType:kotlin.Int [fake_override] + overridden: + public open fun indexOf (element: .Some.SomeList>): kotlin.Int declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + VALUE_PARAMETER name:element index:0 type:.Some + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun isEmpty (): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] .Some> [fake_override,operator] + overridden: + public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, element:.Some) returnType:kotlin.Int [fake_override] + overridden: + public open fun lastIndexOf (element: .Some.SomeList>): kotlin.Int declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + VALUE_PARAMETER name:element index:0 type:.Some + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some> [fake_override] + overridden: + public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some> [fake_override] + overridden: + public open fun listIterator (index: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some> [fake_override] + overridden: + public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some> + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, element:@[EnhancedNullability] .Some) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun remove (element: @[EnhancedNullability] .Some.SomeList>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] .Some + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, elements:kotlin.collections.Collection<@[EnhancedNullability] .Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some> + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int) returnType:@[EnhancedNullability] .Some [fake_override] + overridden: + public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] .Some.SomeList> declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] java.util.function.Predicate.Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate.Some.SomeList>>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate.Some> + FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some.SomeList>>): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some> + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, elements:kotlin.collections.Collection<@[EnhancedNullability] .Some>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>): kotlin.Boolean declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some> + FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, index:kotlin.Int, element:@[EnhancedNullability] .Some) returnType:@[EnhancedNullability] .Some [fake_override,operator] + overridden: + public open fun set (index: kotlin.Int, element: @[EnhancedNullability] .Some.SomeList>): @[EnhancedNullability] .Some.SomeList> declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] .Some + FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[FlexibleNullability] java.util.Comparator.Some?>?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun sort (p0: @[FlexibleNullability] java.util.Comparator.Some.SomeList>?>?): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator.Some?>? + FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some?> [fake_override] + overridden: + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.SomeList>?> declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> + FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some> [fake_override] + overridden: + public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some> + FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] .Some> [fake_override] + overridden: + public open fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int + VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] + overridden: + public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList<.Some>, p0:@[FlexibleNullability] kotlin.Array.FinalList.toArray?>?) returnType:@[FlexibleNullability] kotlin.Array.FinalList.toArray?>? [fake_override] + overridden: + public open fun toArray (p0: @[FlexibleNullability] kotlin.Array.SomeList.toArray?>?): @[FlexibleNullability] kotlin.Array.SomeList.toArray?>? declared in .SomeList + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array.FinalList.toArray?>? + 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 .SomeList + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun trimToSize (): kotlin.Unit declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> + PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] + overridden: + protected/*protected and package*/ final modCount + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.Int declared in .SomeList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> CLASS CLASS name:Some modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Some.Some> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .Some) returnType:.Some.Some> [primary] - VALUE_PARAMETER name:value index:0 type:T of .Some - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final] EXPRESSION_BODY @@ -18,6 +205,11 @@ FILE fqName: fileName:/MultiList.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Some declared in .Some' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null receiver: GET_VAR ': .Some.Some> declared in .Some.' type=.Some.Some> origin=null + CONSTRUCTOR visibility:public <> (value:T of .Some) returnType:.Some.Some> [primary] + VALUE_PARAMETER name:value index:0 type:T of .Some + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Some.Some>) returnType:T of .Some [operator] $this: VALUE_PARAMETER name: type:.Some.Some> BLOCK_BODY @@ -35,36 +227,6 @@ FILE fqName: fileName:/MultiList.kt CONSTRUCTOR_CALL 'public constructor (value: T of .Some) declared in .Some' type=.Some.Some> origin=null : T of .Some value: GET_VAR 'value: T of .Some declared in .Some.copy' type=T of .Some origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Some.Some>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Some.Some> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Some' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Some(" - CONST String type=kotlin.String value="value=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null - receiver: GET_VAR ': .Some.Some> declared in .Some.toString' type=.Some.Some> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Some.Some>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Some.Some> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Some' - WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null - receiver: GET_VAR ': .Some.Some> declared in .Some.hashCode' type=.Some.Some> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null - receiver: GET_VAR ': .Some.Some> declared in .Some.hashCode' type=.Some.Some> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Some.Some>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -99,17 +261,251 @@ FILE fqName: fileName:/MultiList.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Some' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Some.Some>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Some.Some> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Some' + WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null + receiver: GET_VAR ': .Some.Some> declared in .Some.hashCode' type=.Some.Some> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null + receiver: GET_VAR ': .Some.Some> declared in .Some.hashCode' type=.Some.Some> origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Some.Some>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Some.Some> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Some' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Some(" + CONST String type=kotlin.String value="value=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null + receiver: GET_VAR ': .Some.Some> declared in .Some.toString' type=.Some.Some> origin=null + CONST String type=kotlin.String value=")" + CLASS CLASS name:SomeList modality:OPEN visibility:public superTypes:[.MyList.SomeList>; java.util.ArrayList<.Some.SomeList>>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SomeList.SomeList> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.SomeList.SomeList> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in java.util.ArrayList' + : @[FlexibleNullability] .Some.SomeList>? + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SomeList modality:OPEN visibility:public superTypes:[.MyList.SomeList>; java.util.ArrayList<.Some.SomeList>>]' + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, element:@[EnhancedNullability] .Some.SomeList>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun add (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] .Some.SomeList> + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, index:kotlin.Int, element:@[EnhancedNullability] .Some.SomeList>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun add (index: kotlin.Int, element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] .Some.SomeList> + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, elements:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (elements: @[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:elements index:0 type:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>> + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, index:kotlin.Int, elements:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (index: kotlin.Int, elements: @[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:elements index:1 type:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>> + FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun clear (): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:@[EnhancedNullability] kotlin.Any [fake_override] + overridden: + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, element:.Some.SomeList>) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public abstract fun contains (element: .Some.MyList>): kotlin.Boolean declared in .MyList + public open fun contains (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> + VALUE_PARAMETER name:element index:0 type:.Some.SomeList> + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, elements:kotlin.collections.Collection<.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public abstract fun containsAll (elements: kotlin.collections.Collection<.Some.MyList>>): kotlin.Boolean declared in .MyList + public open fun containsAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.Some.SomeList>> + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + 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 .MyList + public open fun equals (other: @[EnhancedNullability] kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.Some.SomeList>>, p0:@[FlexibleNullability] java.util.function.Consumer.Some.SomeList>?>?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer.Some.MyList>?>?): kotlin.Unit declared in .MyList + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.Some.SomeList>?>? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, index:kotlin.Int) returnType:.Some.SomeList> [fake_override,operator] + overridden: + public abstract fun get (index: kotlin.Int): .Some.MyList> declared in .MyList + public open fun get (index: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + 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 .MyList + public open fun hashCode (): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, element:.Some.SomeList>) returnType:kotlin.Int [fake_override] + overridden: + public abstract fun indexOf (element: .Some.MyList>): kotlin.Int declared in .MyList + public open fun indexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> + VALUE_PARAMETER name:element index:0 type:.Some.SomeList> + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public abstract fun isEmpty (): kotlin.Boolean declared in .MyList + public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] .Some.SomeList>> [fake_override,operator] + overridden: + public abstract fun iterator (): kotlin.collections.Iterator<.Some.MyList>> declared in .MyList + public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, element:.Some.SomeList>) returnType:kotlin.Int [fake_override] + overridden: + public abstract fun lastIndexOf (element: .Some.MyList>): kotlin.Int declared in .MyList + public open fun lastIndexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> + VALUE_PARAMETER name:element index:0 type:.Some.SomeList> + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some.SomeList>> [fake_override] + overridden: + public abstract fun listIterator (): kotlin.collections.ListIterator<.Some.MyList>> declared in .MyList + public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some.SomeList>> [fake_override] + overridden: + public abstract fun listIterator (index: kotlin.Int): kotlin.collections.ListIterator<.Some.MyList>> declared in .MyList + public open fun listIterator (index: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some.SomeList>>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> [fake_override] + overridden: + public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.MyList>> declared in .MyList + public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some.SomeList>> + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, element:@[EnhancedNullability] .Some.SomeList>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun remove (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] .Some.SomeList> + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, elements:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>> + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int) returnType:@[EnhancedNullability] .Some.SomeList> [fake_override] + overridden: + public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] java.util.function.Predicate.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate.Some.SomeList>> + FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some.SomeList>> + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, elements:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>> + FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, index:kotlin.Int, element:@[EnhancedNullability] .Some.SomeList>) returnType:@[EnhancedNullability] .Some.SomeList> [fake_override,operator] + overridden: + public open fun set (index: kotlin.Int, element: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] .Some.SomeList> + FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[FlexibleNullability] java.util.Comparator.Some.SomeList>?>?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator.Some.SomeList>?>? + FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.SomeList>?> [fake_override] + overridden: + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.MyList>?> declared in .MyList + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> + FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some.SomeList>>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> [fake_override] + overridden: + public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.MyList>> declared in .MyList + public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some.SomeList>> + FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] .Some.SomeList>> [fake_override] + overridden: + public abstract fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.List<.Some.MyList>> declared in .MyList + public open fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int + VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] + overridden: + public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[FlexibleNullability] kotlin.Array.SomeList.toArray?>?) returnType:@[FlexibleNullability] kotlin.Array.SomeList.toArray?>? [fake_override] + overridden: + public open fun toArray (p0: @[FlexibleNullability] kotlin.Array?): @[FlexibleNullability] kotlin.Array? declared in java.util.ArrayList + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array.SomeList.toArray?>? + 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 .MyList + public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> + PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] + overridden: + protected/*protected and package*/ final modCount: kotlin.Int + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public abstract size: kotlin.Int + public open size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public abstract fun (): kotlin.Int declared in .MyList + public open fun (): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> CLASS INTERFACE name:MyList modality:ABSTRACT visibility:public superTypes:[kotlin.collections.List<.Some.MyList>>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList.MyList> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.Int declared in kotlin.collections.List - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> FUN FAKE_OVERRIDE name:contains visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>, element:.Some.MyList>) returnType:kotlin.Boolean [fake_override,operator] overridden: public abstract fun contains (element: E of kotlin.collections.List): kotlin.Boolean declared in kotlin.collections.List @@ -188,407 +584,11 @@ FILE fqName: fileName:/MultiList.kt overridden: public open fun toString (): kotlin.String declared in kotlin.collections.List $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:SomeList modality:OPEN visibility:public superTypes:[.MyList.SomeList>; java.util.ArrayList<.Some.SomeList>>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SomeList.SomeList> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.SomeList.SomeList> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in java.util.ArrayList' - : @[FlexibleNullability] .Some.SomeList>? - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SomeList modality:OPEN visibility:public superTypes:[.MyList.SomeList>; java.util.ArrayList<.Some.SomeList>>]' - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] overridden: public abstract size: kotlin.Int - public open size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List<.Some.MyList>>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] overridden: - public abstract fun (): kotlin.Int declared in .MyList - public open fun (): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> - FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, element:.Some.SomeList>) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public abstract fun contains (element: .Some.MyList>): kotlin.Boolean declared in .MyList - public open fun contains (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> - VALUE_PARAMETER name:element index:0 type:.Some.SomeList> - FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, elements:kotlin.collections.Collection<.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public abstract fun containsAll (elements: kotlin.collections.Collection<.Some.MyList>>): kotlin.Boolean declared in .MyList - public open fun containsAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.Some.SomeList>> - 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 .MyList - public open fun equals (other: @[EnhancedNullability] kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.Some.SomeList>>, p0:@[FlexibleNullability] java.util.function.Consumer.Some.SomeList>?>?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer.Some.MyList>?>?): kotlin.Unit declared in .MyList - public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.Some.SomeList>?>? - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, index:kotlin.Int) returnType:.Some.SomeList> [fake_override,operator] - overridden: - public abstract fun get (index: kotlin.Int): .Some.MyList> declared in .MyList - public open fun get (index: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - 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 .MyList - public open fun hashCode (): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, element:.Some.SomeList>) returnType:kotlin.Int [fake_override] - overridden: - public abstract fun indexOf (element: .Some.MyList>): kotlin.Int declared in .MyList - public open fun indexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> - VALUE_PARAMETER name:element index:0 type:.Some.SomeList> - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public abstract fun isEmpty (): kotlin.Boolean declared in .MyList - public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> - FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] .Some.SomeList>> [fake_override,operator] - overridden: - public abstract fun iterator (): kotlin.collections.Iterator<.Some.MyList>> declared in .MyList - public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>, element:.Some.SomeList>) returnType:kotlin.Int [fake_override] - overridden: - public abstract fun lastIndexOf (element: .Some.MyList>): kotlin.Int declared in .MyList - public open fun lastIndexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> - VALUE_PARAMETER name:element index:0 type:.Some.SomeList> - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some.SomeList>> [fake_override] - overridden: - public abstract fun listIterator (): kotlin.collections.ListIterator<.Some.MyList>> declared in .MyList - public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some.SomeList>> [fake_override] - overridden: - public abstract fun listIterator (index: kotlin.Int): kotlin.collections.ListIterator<.Some.MyList>> declared in .MyList - public open fun listIterator (index: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some.SomeList>>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> [fake_override] - overridden: - public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.MyList>> declared in .MyList - public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some.SomeList>> - FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some.SomeList>>) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.SomeList>?> [fake_override] - overridden: - public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.MyList>?> declared in .MyList - public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.SomeList>> - FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some.SomeList>>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> [fake_override] - overridden: - public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.MyList>> declared in .MyList - public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some.SomeList>> - FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] .Some.SomeList>> [fake_override] - overridden: - public abstract fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.List<.Some.MyList>> declared in .MyList - public open fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int - VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int - 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 .MyList - public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, element:@[EnhancedNullability] .Some.SomeList>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun add (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] .Some.SomeList> - FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, index:kotlin.Int, element:@[EnhancedNullability] .Some.SomeList>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun add (index: kotlin.Int, element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] .Some.SomeList> - FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, elements:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun addAll (elements: @[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:elements index:0 type:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>> - FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, index:kotlin.Int, elements:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun addAll (index: kotlin.Int, elements: @[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:elements index:1 type:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>> - FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun clear (): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, element:@[EnhancedNullability] .Some.SomeList>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun remove (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] .Some.SomeList> - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, elements:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>> - FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, elements:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>> - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] - overridden: - public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[FlexibleNullability] kotlin.Array.SomeList.toArray?>?) returnType:@[FlexibleNullability] kotlin.Array.SomeList.toArray?>? [fake_override] - overridden: - public open fun toArray (p0: @[FlexibleNullability] kotlin.Array?): @[FlexibleNullability] kotlin.Array? declared in java.util.ArrayList - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array.SomeList.toArray?>? - FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] java.util.function.Predicate.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate.Some.SomeList>> - FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int) returnType:@[EnhancedNullability] .Some.SomeList> [fake_override] - overridden: - public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, index:kotlin.Int, element:@[EnhancedNullability] .Some.SomeList>) returnType:@[EnhancedNullability] .Some.SomeList> [fake_override,operator] - overridden: - public open fun set (index: kotlin.Int, element: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] .Some.SomeList> - FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some.SomeList>>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some.SomeList>> - FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:@[FlexibleNullability] java.util.Comparator.Some.SomeList>?>?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator.Some.SomeList>?>? - FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - overridden: - public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some.SomeList>>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some.SomeList>> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] - overridden: - protected/*protected and package*/ final modCount: kotlin.Int - CLASS CLASS name:FinalList modality:FINAL visibility:public superTypes:[.SomeList] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FinalList - CONSTRUCTOR visibility:public <> () returnType:.FinalList [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .SomeList' - : kotlin.String - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:FinalList modality:FINAL visibility:public superTypes:[.SomeList]' - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.Int declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, element:.Some) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun contains (element: .Some.SomeList>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - VALUE_PARAMETER name:element index:0 type:.Some - FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, elements:kotlin.collections.Collection<.Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun containsAll (elements: kotlin.collections.Collection<.Some.SomeList>>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.Some> - 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 .SomeList - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:kotlin.collections.Iterable<.Some>, p0:@[FlexibleNullability] java.util.function.Consumer.Some?>?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer.Some.SomeList>?>?): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.Iterable<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer.Some?>? - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, index:kotlin.Int) returnType:.Some [fake_override,operator] - overridden: - public open fun get (index: kotlin.Int): .Some.SomeList> declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - 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 .SomeList - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, element:.Some) returnType:kotlin.Int [fake_override] - overridden: - public open fun indexOf (element: .Some.SomeList>): kotlin.Int declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - VALUE_PARAMETER name:element index:0 type:.Some - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun isEmpty (): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] .Some> [fake_override,operator] - overridden: - public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>, element:.Some) returnType:kotlin.Int [fake_override] - overridden: - public open fun lastIndexOf (element: .Some.SomeList>): kotlin.Int declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - VALUE_PARAMETER name:element index:0 type:.Some - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some> [fake_override] - overridden: - public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some> [fake_override] - overridden: - public open fun listIterator (index: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some> [fake_override] - overridden: - public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some> - FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:kotlin.collections.List<.Some>) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some?> [fake_override] - overridden: - public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] .Some.SomeList>?> declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some> - FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<.Some>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some> [fake_override] - overridden: - public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<.Some> - FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] .Some> [fake_override] - overridden: - public open fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] .Some.SomeList>> declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int - VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int - 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 .SomeList - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, element:@[EnhancedNullability] .Some) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun add (element: @[EnhancedNullability] .Some.SomeList>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] .Some - FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, index:kotlin.Int, element:@[EnhancedNullability] .Some) returnType:kotlin.Unit [fake_override] - overridden: - public open fun add (index: kotlin.Int, element: @[EnhancedNullability] .Some.SomeList>): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] .Some - FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, elements:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun addAll (elements: @[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:elements index:0 type:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some> - FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, index:kotlin.Int, elements:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun addAll (index: kotlin.Int, elements: @[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:elements index:1 type:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] .Some> - FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun clear (): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, element:@[EnhancedNullability] .Some) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun remove (element: @[EnhancedNullability] .Some.SomeList>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] .Some - FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, elements:kotlin.collections.Collection<@[EnhancedNullability] .Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some> - FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, elements:kotlin.collections.Collection<@[EnhancedNullability] .Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] .Some.SomeList>>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] .Some> - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] - overridden: - public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList<.Some>, p0:@[FlexibleNullability] kotlin.Array.FinalList.toArray?>?) returnType:@[FlexibleNullability] kotlin.Array.FinalList.toArray?>? [fake_override] - overridden: - public open fun toArray (p0: @[FlexibleNullability] kotlin.Array.SomeList.toArray?>?): @[FlexibleNullability] kotlin.Array.SomeList.toArray?>? declared in .SomeList - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array.FinalList.toArray?>? - FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] java.util.function.Predicate.Some>) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate.Some.SomeList>>): kotlin.Boolean declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate.Some> - FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int) returnType:@[EnhancedNullability] .Some [fake_override] - overridden: - public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] .Some.SomeList> declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, index:kotlin.Int, element:@[EnhancedNullability] .Some) returnType:@[EnhancedNullability] .Some [fake_override,operator] - overridden: - public open fun set (index: kotlin.Int, element: @[EnhancedNullability] .Some.SomeList>): @[EnhancedNullability] .Some.SomeList> declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:index index:0 type:kotlin.Int - VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] .Some - FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some.SomeList>>): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] .Some> - FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:@[FlexibleNullability] java.util.Comparator.Some?>?) returnType:kotlin.Unit [fake_override] - overridden: - public open fun sort (p0: @[FlexibleNullability] java.util.Comparator.Some.SomeList>?>?): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator.Some?>? - FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - VALUE_PARAMETER name:p1 index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:@[EnhancedNullability] kotlin.Any [fake_override] - overridden: - public open fun clone (): @[EnhancedNullability] kotlin.Any declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>) returnType:kotlin.Unit [fake_override] - overridden: - public open fun trimToSize (): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList<.Some>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] - overridden: - public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in .SomeList - $this: VALUE_PARAMETER name: type:java.util.ArrayList<.Some> - VALUE_PARAMETER name:p0 index:0 type:kotlin.Int - PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] - overridden: - protected/*protected and package*/ final modCount + public abstract fun (): kotlin.Int declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List<.Some.MyList>> diff --git a/compiler/testData/ir/irText/firProblems/MultiList.kt.txt b/compiler/testData/ir/irText/firProblems/MultiList.kt.txt index 0a68081ef25..49dbce4459a 100644 --- a/compiler/testData/ir/irText/firProblems/MultiList.kt.txt +++ b/compiler/testData/ir/irText/firProblems/MultiList.kt.txt @@ -1,14 +1,23 @@ +class FinalList : SomeList { + constructor() /* primary */ { + super/*SomeList*/() + /* () */ + + } + +} + data class Some { + val value: T + field = value + get + constructor(value: T) /* primary */ { super/*Any*/() /* () */ } - val value: T - field = value - get - operator fun component1(): T { return .#value } @@ -17,17 +26,6 @@ data class Some { return Some(value = value) } - override fun toString(): String { - return "Some(" + "value=" + .#value + ")" - } - - override fun hashCode(): Int { - return when { - EQEQ(arg0 = .#value, arg1 = null) -> 0 - else -> .#value.hashCode() - } - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -42,12 +40,20 @@ data class Some { return true } + override fun hashCode(): Int { + return when { + EQEQ(arg0 = .#value, arg1 = null) -> 0 + else -> .#value.hashCode() + } + } + + override fun toString(): String { + return "Some(" + "value=" + .#value + ")" + } + } -interface MyList : List> { -} - -open class SomeList : MyList, ArrayList> { +open class SomeList : ArrayList>, MyList { constructor() /* primary */ { super/*ArrayList*/<@FlexibleNullability Some?>() /* () */ @@ -56,11 +62,6 @@ open class SomeList : MyList, ArrayList> { } -class FinalList : SomeList { - constructor() /* primary */ { - super/*SomeList*/() - /* () */ - - } - +interface MyList : List> { } + diff --git a/compiler/testData/ir/irText/firProblems/OutBox.fir.ir.txt b/compiler/testData/ir/irText/firProblems/OutBox.fir.ir.txt index 5b50228df19..b3d852f7036 100644 --- a/compiler/testData/ir/irText/firProblems/OutBox.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/OutBox.fir.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/Box.kt CLASS CLASS name:Box modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box.Box> TYPE_PARAMETER name:T index:0 variance:out superTypes:[.Foo] reified:false - CONSTRUCTOR visibility:public <> (foo:T of .Box) returnType:.Box.Box> [primary] - VALUE_PARAMETER name:foo index:0 type:T of .Box - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:foo visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:foo type:T of .Box visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,24 @@ FILE fqName: fileName:/Box.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Box declared in .Box' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:foo type:T of .Box visibility:private [final]' type=T of .Box origin=null receiver: GET_VAR ': .Box.Box> declared in .Box.' type=.Box.Box> origin=null + CONSTRUCTOR visibility:public <> (foo:T of .Box) returnType:.Box.Box> [primary] + VALUE_PARAMETER name:foo index:0 type:T of .Box + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box modality:FINAL visibility:public 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 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 PROPERTY name:str visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL <> ($this:.Box.Box>) returnType:kotlin.String correspondingProperty: PROPERTY name:str visibility:public modality:FINAL [val] @@ -38,16 +51,3 @@ FILE fqName: fileName:/Box.kt GET_VAR 'var foo: .Foo declared in .Box.' type=.Foo origin=null RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Box' CONST String type=kotlin.String value="" - 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/OutBox.fir.kt.txt b/compiler/testData/ir/irText/firProblems/OutBox.fir.kt.txt index 94902b131f3..ac38997fb94 100644 --- a/compiler/testData/ir/irText/firProblems/OutBox.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/OutBox.fir.kt.txt @@ -1,14 +1,14 @@ class Box { + val foo: T + field = foo + get + constructor(foo: T) /* primary */ { super/*Any*/() /* () */ } - val foo: T - field = foo - get - val str: String get(): String { var foo: Foo = .() diff --git a/compiler/testData/ir/irText/firProblems/OutBox.ir.txt b/compiler/testData/ir/irText/firProblems/OutBox.ir.txt index 5b50228df19..b3d852f7036 100644 --- a/compiler/testData/ir/irText/firProblems/OutBox.ir.txt +++ b/compiler/testData/ir/irText/firProblems/OutBox.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/Box.kt CLASS CLASS name:Box modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box.Box> TYPE_PARAMETER name:T index:0 variance:out superTypes:[.Foo] reified:false - CONSTRUCTOR visibility:public <> (foo:T of .Box) returnType:.Box.Box> [primary] - VALUE_PARAMETER name:foo index:0 type:T of .Box - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:foo visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:foo type:T of .Box visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,24 @@ FILE fqName: fileName:/Box.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Box declared in .Box' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:foo type:T of .Box visibility:private [final]' type=T of .Box origin=null receiver: GET_VAR ': .Box.Box> declared in .Box.' type=.Box.Box> origin=null + CONSTRUCTOR visibility:public <> (foo:T of .Box) returnType:.Box.Box> [primary] + VALUE_PARAMETER name:foo index:0 type:T of .Box + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box modality:FINAL visibility:public 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 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 PROPERTY name:str visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL <> ($this:.Box.Box>) returnType:kotlin.String correspondingProperty: PROPERTY name:str visibility:public modality:FINAL [val] @@ -38,16 +51,3 @@ FILE fqName: fileName:/Box.kt GET_VAR 'var foo: .Foo declared in .Box.' type=.Foo origin=null RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Box' CONST String type=kotlin.String value="" - 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/OutBox.kt.txt b/compiler/testData/ir/irText/firProblems/OutBox.kt.txt index 1cc3122e3ad..738c6de1d51 100644 --- a/compiler/testData/ir/irText/firProblems/OutBox.kt.txt +++ b/compiler/testData/ir/irText/firProblems/OutBox.kt.txt @@ -1,14 +1,14 @@ class Box { + val foo: T + field = foo + get + constructor(foo: T) /* primary */ { super/*Any*/() /* () */ } - val foo: T - field = foo - get - val str: String get(): String { var foo: Foo = .() diff --git a/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.ir.txt b/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.ir.txt index 72a295c0b61..d642ce78b1b 100644 --- a/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.ir.txt +++ b/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.ir.txt @@ -1,43 +1,16 @@ FILE fqName: fileName:/SafeLetWithReturn.kt - FUN name:foo visibility:public modality:FINAL <> (s:kotlin.String?) returnType:kotlin.String - VALUE_PARAMETER name:s index:0 type:kotlin.String? - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Nothing? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.String? [val] - GET_VAR 's: kotlin.String? declared in .foo' type=kotlin.String? 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.String? declared in .foo' type=kotlin.String? 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.let declared in kotlin' type=kotlin.Nothing origin=null - : kotlin.String - : kotlin.Nothing - $receiver: GET_VAR 'val tmp_0: kotlin.String? declared in .foo' type=kotlin.String? origin=null - block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA - 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 - RETURN type=kotlin.Nothing from='public final fun foo (s: kotlin.String?): kotlin.String declared in ' - GET_VAR 'it: kotlin.String declared in .foo.' type=kotlin.String origin=null - RETURN type=kotlin.Nothing from='public final fun foo (s: kotlin.String?): kotlin.String declared in ' - CONST String type=kotlin.String value="" FUN name:bar visibility:public modality:FINAL <> (s:kotlin.String?, t:kotlin.String?) returnType:kotlin.String VALUE_PARAMETER name:s index:0 type:kotlin.String? VALUE_PARAMETER name:t index:1 type:kotlin.String? BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Nothing? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.String? [val] GET_VAR 's: kotlin.String? declared in .bar' type=kotlin.String? 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.String? declared in .bar' type=kotlin.String? origin=null + arg0: GET_VAR 'val tmp_0: kotlin.String? declared in .bar' type=kotlin.String? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: CONST Null type=kotlin.Nothing? value=null BRANCH @@ -45,19 +18,19 @@ FILE fqName: fileName:/SafeLetWithReturn.kt then: CALL 'public final fun let (block: kotlin.Function1): R of kotlin.let declared in kotlin' type=kotlin.Nothing? origin=null : kotlin.String : kotlin.Nothing? - $receiver: GET_VAR 'val tmp_1: kotlin.String? declared in .bar' type=kotlin.String? origin=null + $receiver: GET_VAR 'val tmp_0: kotlin.String? declared in .bar' type=kotlin.String? origin=null block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA 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 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] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] GET_VAR 't: kotlin.String? declared in .bar' type=kotlin.String? 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_2: kotlin.String? declared in .bar.' type=kotlin.String? origin=null + arg0: GET_VAR 'val tmp_1: kotlin.String? declared in .bar.' type=kotlin.String? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: CONST Null type=kotlin.Nothing? value=null BRANCH @@ -65,7 +38,7 @@ FILE fqName: fileName:/SafeLetWithReturn.kt then: CALL 'public final fun let (block: kotlin.Function1): R of kotlin.let declared in kotlin' type=kotlin.Nothing origin=null : kotlin.String : kotlin.Nothing - $receiver: GET_VAR 'val tmp_2: kotlin.String? declared in .bar.' type=kotlin.String? origin=null + $receiver: GET_VAR 'val tmp_1: kotlin.String? declared in .bar.' type=kotlin.String? origin=null block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA 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 @@ -74,6 +47,33 @@ FILE fqName: fileName:/SafeLetWithReturn.kt GET_VAR 'it: kotlin.String declared in .bar..' type=kotlin.String origin=null RETURN type=kotlin.Nothing from='public final fun bar (s: kotlin.String?, t: kotlin.String?): kotlin.String declared in ' CONST String type=kotlin.String value="" + FUN name:foo visibility:public modality:FINAL <> (s:kotlin.String?) returnType:kotlin.String + VALUE_PARAMETER name:s index:0 type:kotlin.String? + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Nothing? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val] + GET_VAR 's: kotlin.String? declared in .foo' type=kotlin.String? 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_2: kotlin.String? declared in .foo' type=kotlin.String? 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.let declared in kotlin' type=kotlin.Nothing origin=null + : kotlin.String + : kotlin.Nothing + $receiver: GET_VAR 'val tmp_2: kotlin.String? declared in .foo' type=kotlin.String? origin=null + block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + 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 + RETURN type=kotlin.Nothing from='public final fun foo (s: kotlin.String?): kotlin.String declared in ' + GET_VAR 'it: kotlin.String declared in .foo.' type=kotlin.String origin=null + RETURN type=kotlin.Nothing from='public final fun foo (s: kotlin.String?): kotlin.String declared in ' + CONST String type=kotlin.String value="" PROPERTY name:baz visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String?) returnType:kotlin.String correspondingProperty: PROPERTY name:baz visibility:public modality:FINAL [val] diff --git a/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.kt.txt b/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.kt.txt index 8cf060e27fd..640424cf943 100644 --- a/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.kt.txt +++ b/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.kt.txt @@ -1,10 +1,19 @@ -fun foo(s: String?): String { +fun bar(s: String?, t: String?): String { { // BLOCK val tmp_0: String? = s when { EQEQ(arg0 = tmp_0, arg1 = null) -> null - else -> tmp_0.let(block = local fun (it: String): Nothing { - return it + else -> tmp_0.let(block = local fun (it: String): Nothing? { + return { // BLOCK + val tmp_1: String? = t + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> null + else -> tmp_1.let(block = local fun (it: String): Nothing { + return it + } +) + } + } } ) } @@ -12,22 +21,13 @@ fun foo(s: String?): String { return "" } -fun bar(s: String?, t: String?): String { +fun foo(s: String?): String { { // BLOCK - val tmp_1: String? = s + val tmp_2: String? = s when { - EQEQ(arg0 = tmp_1, arg1 = null) -> null - else -> tmp_1.let(block = local fun (it: String): Nothing? { - return { // BLOCK - val tmp_2: String? = t - when { - EQEQ(arg0 = tmp_2, arg1 = null) -> null - else -> tmp_2.let(block = local fun (it: String): Nothing { - return it - } -) - } - } + EQEQ(arg0 = tmp_2, arg1 = null) -> null + else -> tmp_2.let(block = local fun (it: String): Nothing { + return it } ) } @@ -49,3 +49,4 @@ val String?.baz: String } /*~> Unit */ return "" } + diff --git a/compiler/testData/ir/irText/firProblems/SignatureClash.ir.txt b/compiler/testData/ir/irText/firProblems/SignatureClash.ir.txt index bb4e83f43ce..b5ab6c014ca 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureClash.ir.txt +++ b/compiler/testData/ir/irText/firProblems/SignatureClash.ir.txt @@ -1,95 +1,6 @@ FILE fqName: fileName:/SignatureClash.kt - TYPEALIAS name:Some visibility:public expandedType:kotlin.Function1 - CLASS OBJECT name:Factory modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Factory - CONSTRUCTOR visibility:private <> () returnType:.Factory [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Factory modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Factory, a:kotlin.String) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Factory - VALUE_PARAMETER name:a index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.String): kotlin.String declared in .Factory' - CONST String type=kotlin.String value="Alpha" - FUN name:foo visibility:public modality:FINAL <> ($this:.Factory, a:kotlin.String, f:kotlin.Function1) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Factory - VALUE_PARAMETER name:a index:0 type:kotlin.String - VALUE_PARAMETER name:f index:1 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.String, f: kotlin.Function1): kotlin.String declared in .Factory' - CONST String type=kotlin.String value="Omega" - 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: 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 - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base - 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: 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 - CLASS INTERFACE name:Delegate modality:ABSTRACT visibility:public superTypes:[.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.Delegate) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Delegate - 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 .Base - $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 .Base - $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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Derived modality:ABSTRACT visibility:public superTypes:[.Delegate] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - FUN FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT <> ($this:.Delegate) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun bar (): kotlin.Unit declared in .Delegate - $this: VALUE_PARAMETER name: type:.Delegate - 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 .Delegate - $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 .Delegate - $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 .Delegate - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:DataClass modality:FINAL visibility:public [data] superTypes:[.Derived; .Delegate] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DataClass - CONSTRUCTOR visibility:public <> (delegate:.Delegate) returnType:.DataClass [primary] - VALUE_PARAMETER name:delegate index:0 type:.Delegate - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DataClass modality:FINAL visibility:public [data] superTypes:[.Derived; .Delegate]' PROPERTY name:delegate visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final] EXPRESSION_BODY @@ -101,6 +12,11 @@ FILE fqName: fileName:/SignatureClash.kt RETURN type=kotlin.Nothing from='public final fun (): .Delegate declared in .DataClass' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null receiver: GET_VAR ': .DataClass declared in .DataClass.' type=.DataClass origin=null + CONSTRUCTOR visibility:public <> (delegate:.Delegate) returnType:.DataClass [primary] + VALUE_PARAMETER name:delegate index:0 type:.Delegate + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DataClass modality:FINAL visibility:public [data] superTypes:[.Derived; .Delegate]' FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:.DataClass) returnType:kotlin.Unit overridden: public abstract fun bar (): kotlin.Unit declared in .Derived @@ -126,29 +42,6 @@ FILE fqName: fileName:/SignatureClash.kt RETURN type=kotlin.Nothing from='public final fun copy (delegate: .Delegate): .DataClass declared in .DataClass' CONSTRUCTOR_CALL 'public constructor (delegate: .Delegate) declared in .DataClass' type=.DataClass origin=null delegate: GET_VAR 'delegate: .Delegate declared in .DataClass.copy' type=.Delegate origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.DataClass) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in .Derived - public open fun toString (): kotlin.String declared in .Delegate - $this: VALUE_PARAMETER name: type:.DataClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .DataClass' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="DataClass(" - CONST String type=kotlin.String value="delegate=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - receiver: GET_VAR ': .DataClass declared in .DataClass.toString' type=.DataClass origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.DataClass) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in .Derived - public open fun hashCode (): kotlin.Int declared in .Delegate - $this: VALUE_PARAMETER name: type:.DataClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .DataClass' - CALL 'public open fun hashCode (): kotlin.Int declared in .Delegate' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - receiver: GET_VAR ': .DataClass declared in .DataClass.hashCode' type=.DataClass origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.DataClass, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Derived @@ -184,3 +77,110 @@ FILE fqName: fileName:/SignatureClash.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataClass' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.DataClass) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in .Derived + public open fun hashCode (): kotlin.Int declared in .Delegate + $this: VALUE_PARAMETER name: type:.DataClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .DataClass' + CALL 'public open fun hashCode (): kotlin.Int declared in .Delegate' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null + receiver: GET_VAR ': .DataClass declared in .DataClass.hashCode' type=.DataClass origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.DataClass) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in .Derived + public open fun toString (): kotlin.String declared in .Delegate + $this: VALUE_PARAMETER name: type:.DataClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .DataClass' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="DataClass(" + CONST String type=kotlin.String value="delegate=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null + receiver: GET_VAR ': .DataClass declared in .DataClass.toString' type=.DataClass origin=null + CONST String type=kotlin.String value=")" + CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base + 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: 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 + CLASS INTERFACE name:Delegate modality:ABSTRACT visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate + 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 .Base + $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 .Base + $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 .Base + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.Delegate) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Delegate + CLASS INTERFACE name:Derived modality:ABSTRACT visibility:public superTypes:[.Delegate] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived + FUN FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT <> ($this:.Delegate) returnType:kotlin.Unit [fake_override] + overridden: + public abstract fun bar (): kotlin.Unit declared in .Delegate + $this: VALUE_PARAMETER name: type:.Delegate + 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 .Delegate + $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 .Delegate + $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 .Delegate + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:Factory modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Factory + CONSTRUCTOR visibility:private <> () returnType:.Factory [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Factory modality:FINAL visibility:public 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 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:foo visibility:public modality:FINAL <> ($this:.Factory, a:kotlin.String) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Factory + VALUE_PARAMETER name:a index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.String): kotlin.String declared in .Factory' + CONST String type=kotlin.String value="Alpha" + FUN name:foo visibility:public modality:FINAL <> ($this:.Factory, a:kotlin.String, f:kotlin.Function1) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Factory + VALUE_PARAMETER name:a index:0 type:kotlin.String + VALUE_PARAMETER name:f index:1 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.String, f: kotlin.Function1): kotlin.String declared in .Factory' + CONST String type=kotlin.String value="Omega" + TYPEALIAS name:Some visibility:public expandedType:kotlin.Function1 diff --git a/compiler/testData/ir/irText/firProblems/SignatureClash.kt.txt b/compiler/testData/ir/irText/firProblems/SignatureClash.kt.txt index 9983ad70290..315c56f683f 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureClash.kt.txt +++ b/compiler/testData/ir/irText/firProblems/SignatureClash.kt.txt @@ -1,4 +1,61 @@ -typealias Some = Function1 +data class DataClass : Delegate, Derived { + val delegate: Delegate + field = delegate + get + + constructor(delegate: Delegate) /* primary */ { + super/*Any*/() + /* () */ + + } + + override fun bar() { + .#delegate.bar() + } + + operator fun component1(): Delegate { + return .#delegate + } + + fun copy(delegate: Delegate = .#delegate): DataClass { + return DataClass(delegate = delegate) + } + + override operator fun equals(other: Any?): Boolean { + when { + EQEQEQ(arg0 = , arg1 = other) -> return true + } + when { + other !is DataClass -> return false + } + val tmp_0: DataClass = other as DataClass + when { + EQEQ(arg0 = .#delegate, arg1 = tmp_0.#delegate).not() -> return false + } + return true + } + + override fun hashCode(): Int { + return .#delegate.hashCode() + } + + override fun toString(): String { + return "DataClass(" + "delegate=" + .#delegate + ")" + } + +} + +interface Base { +} + +interface Delegate : Base { + abstract fun bar() + +} + +interface Derived : Delegate { +} + object Factory { private constructor() /* primary */ { super/*Any*/() @@ -16,60 +73,4 @@ object Factory { } -interface Base { -} - -interface Delegate : Base { - abstract fun bar() - -} - -interface Derived : Delegate { -} - -data class DataClass : Derived, Delegate { - constructor(delegate: Delegate) /* primary */ { - super/*Any*/() - /* () */ - - } - - val delegate: Delegate - field = delegate - get - - override fun bar() { - .#delegate.bar() - } - - operator fun component1(): Delegate { - return .#delegate - } - - fun copy(delegate: Delegate = .#delegate): DataClass { - return DataClass(delegate = delegate) - } - - override fun toString(): String { - return "DataClass(" + "delegate=" + .#delegate + ")" - } - - override fun hashCode(): Int { - return .#delegate.hashCode() - } - - override operator fun equals(other: Any?): Boolean { - when { - EQEQEQ(arg0 = , arg1 = other) -> return true - } - when { - other !is DataClass -> return false - } - val tmp_0: DataClass = other as DataClass - when { - EQEQ(arg0 = .#delegate, arg1 = tmp_0.#delegate).not() -> return false - } - return true - } - -} +typealias Some = Function1 diff --git a/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.ir.txt b/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.ir.txt index 1307e7f20fd..5913d0fe293 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.ir.txt +++ b/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/test.kt CLASS CLASS name:Inv modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Inv.Inv> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T of .Inv) returnType:.Inv.Inv> [primary] - VALUE_PARAMETER name:x index:0 type:T of .Inv - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inv modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:T of .Inv visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,11 @@ FILE fqName: fileName:/test.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Inv declared in .Inv' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Inv visibility:private [final]' type=T of .Inv origin=null receiver: GET_VAR ': .Inv.Inv> declared in .Inv.' type=.Inv.Inv> origin=null + CONSTRUCTOR visibility:public <> (x:T of .Inv) returnType:.Inv.Inv> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Inv + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inv modality:FINAL visibility:public 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 declared in kotlin.Any @@ -34,12 +34,6 @@ FILE fqName: fileName:/test.kt CLASS CLASS name:Test_1 modality:FINAL visibility:public superTypes:[.JavaClass1.Test_1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test_1.Test_1> TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:TT of .Test_1) returnType:.Test_1.Test_1> [primary] - VALUE_PARAMETER name:x index:0 type:TT of .Test_1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JavaClass1' - : TT of .Test_1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test_1 modality:FINAL visibility:public superTypes:[.JavaClass1.Test_1>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:TT of .Test_1 visibility:private [final] EXPRESSION_BODY @@ -51,14 +45,12 @@ FILE fqName: fileName:/test.kt RETURN type=kotlin.Nothing from='public final fun (): TT of .Test_1 declared in .Test_1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:TT of .Test_1 visibility:private [final]' type=TT of .Test_1 origin=null receiver: GET_VAR ': .Test_1.Test_1> declared in .Test_1.' type=.Test_1.Test_1> origin=null - FUN name:test visibility:public modality:FINAL <> ($this:.Test_1.Test_1>, b:.JavaClass1.B.Test_1>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Test_1.Test_1> - VALUE_PARAMETER name:b index:0 type:.JavaClass1.B.Test_1> + CONSTRUCTOR visibility:public <> (x:TT of .Test_1) returnType:.Test_1.Test_1> [primary] + VALUE_PARAMETER name:x index:0 type:TT of .Test_1 BLOCK_BODY - CALL 'public open fun output (x: @[EnhancedNullability] T of .JavaClass1): kotlin.Unit declared in .JavaClass1.B' type=kotlin.Unit origin=null - $this: GET_VAR 'b: .JavaClass1.B.Test_1> declared in .Test_1.test' type=.JavaClass1.B.Test_1> origin=null - x: CALL 'public final fun (): TT of .Test_1 declared in .Test_1' type=TT of .Test_1 origin=GET_PROPERTY - $this: GET_VAR ': .Test_1.Test_1> declared in .Test_1.test' type=.Test_1.Test_1> origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .JavaClass1' + : TT of .Test_1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test_1 modality:FINAL visibility:public superTypes:[.JavaClass1.Test_1>]' 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 .JavaClass1 @@ -72,6 +64,14 @@ FILE fqName: fileName:/test.kt overridden: public open fun toString (): kotlin.String declared in .JavaClass1 $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> ($this:.Test_1.Test_1>, b:.JavaClass1.B.Test_1>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Test_1.Test_1> + VALUE_PARAMETER name:b index:0 type:.JavaClass1.B.Test_1> + BLOCK_BODY + CALL 'public open fun output (x: @[EnhancedNullability] T of .JavaClass1): kotlin.Unit declared in .JavaClass1.B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .JavaClass1.B.Test_1> declared in .Test_1.test' type=.JavaClass1.B.Test_1> origin=null + x: CALL 'public final fun (): TT of .Test_1 declared in .Test_1' type=TT of .Test_1 origin=GET_PROPERTY + $this: GET_VAR ': .Test_1.Test_1> declared in .Test_1.test' type=.Test_1.Test_1> origin=null CLASS CLASS name:Test_2 modality:FINAL visibility:public superTypes:[.JavaClass2.Test_2, .Inv.Test_2>>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test_2.Test_2> TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -81,16 +81,6 @@ FILE fqName: fileName:/test.kt : TT of .Test_2 : .Inv.Test_2> INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test_2 modality:FINAL visibility:public superTypes:[.JavaClass2.Test_2, .Inv.Test_2>>]' - FUN name:process visibility:public modality:FINAL <> ($this:.Test_2.Test_2>, b:.JavaClass2.B.Test_2, .Inv.Test_2>>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Test_2.Test_2> - VALUE_PARAMETER name:b index:0 type:.JavaClass2.B.Test_2, .Inv.Test_2>> - BLOCK_BODY - CALL 'public abstract fun output (output: @[EnhancedNullability] R of .JavaClass2): kotlin.Unit declared in .JavaClass2.B' type=kotlin.Unit origin=null - $this: GET_VAR 'b: .JavaClass2.B.Test_2, .Inv.Test_2>> declared in .Test_2.process' type=.JavaClass2.B.Test_2, .Inv.Test_2>> origin=null - output: CONSTRUCTOR_CALL 'public constructor (x: T of .Inv) declared in .Inv' type=.Inv.Test_2> origin=null - : TT of .Test_2 - x: CALL 'public abstract fun element (): @[EnhancedNullability] T of .JavaClass2 declared in .JavaClass2.B' type=@[EnhancedNullability] TT of .Test_2 origin=null - $this: GET_VAR 'b: .JavaClass2.B.Test_2, .Inv.Test_2>> declared in .Test_2.process' type=.JavaClass2.B.Test_2, .Inv.Test_2>> 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 .JavaClass2 @@ -104,6 +94,16 @@ FILE fqName: fileName:/test.kt overridden: public open fun toString (): kotlin.String declared in .JavaClass2 $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:process visibility:public modality:FINAL <> ($this:.Test_2.Test_2>, b:.JavaClass2.B.Test_2, .Inv.Test_2>>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Test_2.Test_2> + VALUE_PARAMETER name:b index:0 type:.JavaClass2.B.Test_2, .Inv.Test_2>> + BLOCK_BODY + CALL 'public abstract fun output (output: @[EnhancedNullability] R of .JavaClass2): kotlin.Unit declared in .JavaClass2.B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .JavaClass2.B.Test_2, .Inv.Test_2>> declared in .Test_2.process' type=.JavaClass2.B.Test_2, .Inv.Test_2>> origin=null + output: CONSTRUCTOR_CALL 'public constructor (x: T of .Inv) declared in .Inv' type=.Inv.Test_2> origin=null + : TT of .Test_2 + x: CALL 'public abstract fun element (): @[EnhancedNullability] T of .JavaClass2 declared in .JavaClass2.B' type=@[EnhancedNullability] TT of .Test_2 origin=null + $this: GET_VAR 'b: .JavaClass2.B.Test_2, .Inv.Test_2>> declared in .Test_2.process' type=.JavaClass2.B.Test_2, .Inv.Test_2>> origin=null FUN name:test_3 visibility:public modality:FINAL (jb:.JavaClass1.B.test_3>, r:R of .test_3) returnType:kotlin.Unit TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:jb index:0 type:.JavaClass1.B.test_3> diff --git a/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.kt.txt b/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.kt.txt index 689de653e47..0fd4db59fbe 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.kt.txt +++ b/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.kt.txt @@ -1,27 +1,27 @@ class Inv { + val x: T + field = x + get + constructor(x: T) /* primary */ { super/*Any*/() /* () */ } - val x: T - field = x - get - } class Test_1 : JavaClass1 { + val x: TT + field = x + get + constructor(x: TT) /* primary */ { super/*JavaClass1*/() /* () */ } - val x: TT - field = x - get - fun test(b: B) { b.output(x = .()) } @@ -44,3 +44,4 @@ class Test_2 : JavaClass2> { fun test_3(jb: B, r: R) { jb.output(x = r) } + diff --git a/compiler/testData/ir/irText/firProblems/SimpleTypeMarker.ir.txt b/compiler/testData/ir/irText/firProblems/SimpleTypeMarker.ir.txt index c788000f9fa..a1a2cdfb305 100644 --- a/compiler/testData/ir/irText/firProblems/SimpleTypeMarker.ir.txt +++ b/compiler/testData/ir/irText/firProblems/SimpleTypeMarker.ir.txt @@ -1,4 +1,58 @@ FILE fqName: fileName:/SimpleTypeMarker.kt + CLASS CLASS name:SimpleType modality:FINAL visibility:public superTypes:[.SimpleTypeMarker] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SimpleType + CONSTRUCTOR visibility:public <> () returnType:.SimpleType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SimpleType modality:FINAL visibility:public superTypes:[.SimpleTypeMarker]' + 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 .SimpleTypeMarker + $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 .SimpleTypeMarker + $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 .SimpleTypeMarker + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.SimpleType) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.SimpleType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .SimpleType' + CONST String type=kotlin.String value="OK" + CLASS CLASS name:UserImpl modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.UserImpl + CONSTRUCTOR visibility:public <> () returnType:.UserImpl [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:UserImpl modality:FINAL visibility:public 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 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:bar visibility:public modality:FINAL <> ($this:.UserImpl, $receiver:.SimpleTypeMarker) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.UserImpl + $receiver: VALUE_PARAMETER name: type:.SimpleTypeMarker + BLOCK_BODY + CALL 'public final fun require (value: kotlin.Boolean): kotlin.Unit declared in kotlin' type=kotlin.Unit origin=null + value: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.SimpleType + GET_VAR ': .SimpleTypeMarker declared in .UserImpl.bar' type=.SimpleTypeMarker origin=null + RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.String declared in .UserImpl' + CALL 'public final fun foo (): kotlin.String declared in .SimpleType' type=kotlin.String origin=null + $this: TYPE_OP type=.SimpleType origin=IMPLICIT_CAST typeOperand=.SimpleType + GET_VAR ': .SimpleTypeMarker declared in .UserImpl.bar' type=.SimpleTypeMarker origin=null CLASS INTERFACE name:SimpleTypeMarker modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SimpleTypeMarker FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -14,32 +68,21 @@ FILE fqName: fileName:/SimpleTypeMarker.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:SimpleType modality:FINAL visibility:public superTypes:[.SimpleTypeMarker] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SimpleType - CONSTRUCTOR visibility:public <> () returnType:.SimpleType [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SimpleType modality:FINAL visibility:public superTypes:[.SimpleTypeMarker]' - FUN name:foo visibility:public modality:FINAL <> ($this:.SimpleType) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.SimpleType - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .SimpleType' - CONST String type=kotlin.String value="OK" + CLASS INTERFACE name:User modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.User 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 .SimpleTypeMarker + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .SimpleTypeMarker + 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 .SimpleTypeMarker + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:User modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.User FUN name:bar visibility:public modality:OPEN <> ($this:.User, $receiver:.SimpleTypeMarker) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.User $receiver: VALUE_PARAMETER name: type:.SimpleTypeMarker @@ -51,46 +94,3 @@ FILE fqName: fileName:/SimpleTypeMarker.kt CALL 'public final fun foo (): kotlin.String declared in .SimpleType' type=kotlin.String origin=null $this: TYPE_OP type=.SimpleType origin=IMPLICIT_CAST typeOperand=.SimpleType GET_VAR ': .SimpleTypeMarker declared in .User.bar' type=.SimpleTypeMarker 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: 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 - CLASS CLASS name:UserImpl modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.UserImpl - CONSTRUCTOR visibility:public <> () returnType:.UserImpl [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:UserImpl modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:bar visibility:public modality:FINAL <> ($this:.UserImpl, $receiver:.SimpleTypeMarker) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.UserImpl - $receiver: VALUE_PARAMETER name: type:.SimpleTypeMarker - BLOCK_BODY - CALL 'public final fun require (value: kotlin.Boolean): kotlin.Unit declared in kotlin' type=kotlin.Unit origin=null - value: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.SimpleType - GET_VAR ': .SimpleTypeMarker declared in .UserImpl.bar' type=.SimpleTypeMarker origin=null - RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.String declared in .UserImpl' - CALL 'public final fun foo (): kotlin.String declared in .SimpleType' type=kotlin.String origin=null - $this: TYPE_OP type=.SimpleType origin=IMPLICIT_CAST typeOperand=.SimpleType - GET_VAR ': .SimpleTypeMarker declared in .UserImpl.bar' type=.SimpleTypeMarker 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/SimpleTypeMarker.kt.txt b/compiler/testData/ir/irText/firProblems/SimpleTypeMarker.kt.txt index 8c7093c7341..d256fb1b79b 100644 --- a/compiler/testData/ir/irText/firProblems/SimpleTypeMarker.kt.txt +++ b/compiler/testData/ir/irText/firProblems/SimpleTypeMarker.kt.txt @@ -1,6 +1,3 @@ -interface SimpleTypeMarker { -} - class SimpleType : SimpleTypeMarker { constructor() /* primary */ { super/*Any*/() @@ -14,14 +11,6 @@ class SimpleType : SimpleTypeMarker { } -interface User { - fun SimpleTypeMarker.bar(): String { - require(value = is SimpleType) - return /*as SimpleType */.foo() - } - -} - class UserImpl { constructor() /* primary */ { super/*Any*/() @@ -35,3 +24,15 @@ class UserImpl { } } + +interface SimpleTypeMarker { +} + +interface User { + fun SimpleTypeMarker.bar(): String { + require(value = is SimpleType) + return /*as SimpleType */.foo() + } + +} + diff --git a/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.ir.txt b/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.ir.txt index c1c7a61b3f4..10c6bdce8e3 100644 --- a/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.ir.txt +++ b/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.ir.txt @@ -1,66 +1,4 @@ FILE fqName: fileName:/TypeAliasConstructorParameterMapping.kt - CLASS CLASS name:Box1 modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box1.Box1> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Box1.Box1> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box1 modality:FINAL visibility:public 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 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 - CLASS CLASS name:Box2 modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box2.Box2, R of .Box2> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:R index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Box2.Box2, R of .Box2> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box2 modality:FINAL visibility:public 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 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 - TYPEALIAS name:OneToOne visibility:public expandedType:.Box1.OneToOne> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:OneToTwo visibility:public expandedType:.Box2.OneToTwo, A of .OneToTwo> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:TwoToTwo visibility:public expandedType:.Box2.TwoToTwo, B of .TwoToTwo> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:TwoToTwoReversed visibility:public expandedType:.Box2.TwoToTwoReversed, A of .TwoToTwoReversed> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:TwoToOne visibility:public expandedType:.Box1.TwoToOne> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:OneToOneTransitive visibility:public expandedType:.Box1.OneToOneTransitive> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:TwoToTwoTransitive visibility:public expandedType:.Box2.TwoToTwoTransitive, A of .TwoToTwoTransitive> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:TwoToTwoTransitive2 visibility:public expandedType:.Box2.TwoToTwoTransitive2, B of .TwoToTwoTransitive2> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:.Box1 visibility:private [final,static] EXPRESSION_BODY @@ -146,3 +84,65 @@ FILE fqName: fileName:/TypeAliasConstructorParameterMapping.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): .Box2 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:.Box2 visibility:private [final,static]' type=.Box2 origin=null + CLASS CLASS name:Box1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box1.Box1> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.Box1.Box1> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box1 modality:FINAL visibility:public 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 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 + CLASS CLASS name:Box2 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box2.Box2, R of .Box2> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:R index:1 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.Box2.Box2, R of .Box2> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box2 modality:FINAL visibility:public 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 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 + TYPEALIAS name:OneToOne visibility:public expandedType:.Box1.OneToOne> + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPEALIAS name:OneToOneTransitive visibility:public expandedType:.Box1.OneToOneTransitive> + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPEALIAS name:OneToTwo visibility:public expandedType:.Box2.OneToTwo, A of .OneToTwo> + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPEALIAS name:TwoToOne visibility:public expandedType:.Box1.TwoToOne> + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false + TYPEALIAS name:TwoToTwo visibility:public expandedType:.Box2.TwoToTwo, B of .TwoToTwo> + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false + TYPEALIAS name:TwoToTwoReversed visibility:public expandedType:.Box2.TwoToTwoReversed, A of .TwoToTwoReversed> + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false + TYPEALIAS name:TwoToTwoTransitive visibility:public expandedType:.Box2.TwoToTwoTransitive, A of .TwoToTwoTransitive> + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false + TYPEALIAS name:TwoToTwoTransitive2 visibility:public expandedType:.Box2.TwoToTwoTransitive2, B of .TwoToTwoTransitive2> + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false diff --git a/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.kt.txt b/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.kt.txt index 03fd82b3568..65f6874bef5 100644 --- a/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.kt.txt +++ b/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.kt.txt @@ -1,29 +1,3 @@ -class Box1 { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -class Box2 { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -typealias OneToOne = Box1 -typealias OneToTwo = Box2 -typealias TwoToTwo = Box2 -typealias TwoToTwoReversed = Box2 -typealias TwoToOne = Box1 -typealias OneToOneTransitive = Box1 -typealias TwoToTwoTransitive = Box2 -typealias TwoToTwoTransitive2 = Box2 val test1: Box1 field = Box1() get @@ -55,3 +29,30 @@ val test7: Box2 val test8: Box2 field = Box2() get + +class Box1 { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class Box2 { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +typealias OneToOne = Box1 +typealias OneToOneTransitive = Box1 +typealias OneToTwo = Box2 +typealias TwoToOne = Box1 +typealias TwoToTwo = Box2 +typealias TwoToTwoReversed = Box2 +typealias TwoToTwoTransitive = Box2 +typealias TwoToTwoTransitive2 = Box2 diff --git a/compiler/testData/ir/irText/firProblems/TypeParameterBounds.ir.txt b/compiler/testData/ir/irText/firProblems/TypeParameterBounds.ir.txt index 36564763d3c..e818eac52fb 100644 --- a/compiler/testData/ir/irText/firProblems/TypeParameterBounds.ir.txt +++ b/compiler/testData/ir/irText/firProblems/TypeParameterBounds.ir.txt @@ -3,11 +3,6 @@ FILE fqName: fileName:/TypeParameterBounds.kt annotations: Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPE' type=kotlin.annotation.AnnotationTarget]) $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TypeAnn - CONSTRUCTOR visibility:public <> (name:kotlin.String) returnType:.TypeAnn [primary] - VALUE_PARAMETER name:name index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TypeAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' PROPERTY name:name visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -19,6 +14,11 @@ FILE fqName: fileName:/TypeParameterBounds.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TypeAnn' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .TypeAnn declared in .TypeAnn.' type=.TypeAnn origin=null + CONSTRUCTOR visibility:public <> (name:kotlin.String) returnType:.TypeAnn [primary] + VALUE_PARAMETER name:name index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TypeAnn 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 declared in kotlin.Annotation @@ -75,27 +75,15 @@ FILE fqName: fileName:/TypeParameterBounds.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Annotation $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Simple modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Simple - 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: 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 - CLASS CLASS name:SimpleClass modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SimpleClass - CONSTRUCTOR visibility:public <> () returnType:.SimpleClass [primary] + CLASS CLASS name:ClassBound modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ClassBound.ClassBound> + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[TypeAnn(name = "Simple")] .SimpleClass] reified:false + annotations: + TypeParameterAnn + CONSTRUCTOR visibility:public <> () returnType:.ClassBound.ClassBound> [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SimpleClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClassBound modality:FINAL visibility:public 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 declared in kotlin.Any @@ -109,9 +97,13 @@ FILE fqName: fileName:/TypeParameterBounds.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Generic modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Generic.Generic> - TYPE_PARAMETER name:G index:0 variance: superTypes:[kotlin.Any?] reified:false + CLASS CLASS name:ClassBoundGeneric modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ClassBoundGeneric.ClassBoundGeneric> + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[TypeAnn(name = "GenericClass")] .GenericClass<@[TypeAnn(name = "SimpleClass")] .SimpleClass>] reified:false + CONSTRUCTOR visibility:public <> () returnType:.ClassBoundGeneric.ClassBoundGeneric> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClassBoundGeneric modality:FINAL visibility:public 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 declared in kotlin.Any @@ -145,6 +137,67 @@ FILE fqName: fileName:/TypeParameterBounds.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:InterfaceBound modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.InterfaceBound.InterfaceBound> + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[TypeAnn(name = "Simple")] .Simple] reified:false + annotations: + TypeParameterAnn + CONSTRUCTOR visibility:public <> () returnType:.InterfaceBound.InterfaceBound> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InterfaceBound modality:FINAL visibility:public 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 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 + CLASS CLASS name:InterfaceBoundGeneric modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.InterfaceBoundGeneric.InterfaceBoundGeneric> + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[TypeAnn(name = "Generic")] .Generic<@[TypeAnn(name = "Simple")] .Simple>] reified:false + CONSTRUCTOR visibility:public <> () returnType:.InterfaceBoundGeneric.InterfaceBoundGeneric> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InterfaceBoundGeneric modality:FINAL visibility:public 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 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 + CLASS CLASS name:SimpleClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SimpleClass + CONSTRUCTOR visibility:public <> () returnType:.SimpleClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SimpleClass modality:FINAL visibility:public 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 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 CLASS CLASS name:SimpleParameter modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SimpleParameter.SimpleParameter> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -168,90 +221,6 @@ FILE fqName: fileName:/TypeParameterBounds.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:InterfaceBound modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.InterfaceBound.InterfaceBound> - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[TypeAnn(name = "Simple")] .Simple] reified:false - annotations: - TypeParameterAnn - CONSTRUCTOR visibility:public <> () returnType:.InterfaceBound.InterfaceBound> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InterfaceBound modality:FINAL visibility:public 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 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 - CLASS CLASS name:ClassBound modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ClassBound.ClassBound> - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[TypeAnn(name = "Simple")] .SimpleClass] reified:false - annotations: - TypeParameterAnn - CONSTRUCTOR visibility:public <> () returnType:.ClassBound.ClassBound> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClassBound modality:FINAL visibility:public 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 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 - CLASS CLASS name:InterfaceBoundGeneric modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.InterfaceBoundGeneric.InterfaceBoundGeneric> - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[TypeAnn(name = "Generic")] .Generic<@[TypeAnn(name = "Simple")] .Simple>] reified:false - CONSTRUCTOR visibility:public <> () returnType:.InterfaceBoundGeneric.InterfaceBoundGeneric> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InterfaceBoundGeneric modality:FINAL visibility:public 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 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 - CLASS CLASS name:ClassBoundGeneric modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ClassBoundGeneric.ClassBoundGeneric> - TYPE_PARAMETER name:T index:0 variance: superTypes:[@[TypeAnn(name = "GenericClass")] .GenericClass<@[TypeAnn(name = "SimpleClass")] .SimpleClass>] reified:false - CONSTRUCTOR visibility:public <> () returnType:.ClassBoundGeneric.ClassBoundGeneric> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClassBoundGeneric modality:FINAL visibility:public 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 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 CLASS CLASS name:TypeParameterAsBound modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TypeParameterAsBound.TypeParameterAsBound, T of .TypeParameterAsBound> TYPE_PARAMETER name:Y index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -275,3 +244,34 @@ FILE fqName: fileName:/TypeParameterBounds.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Generic modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Generic.Generic> + TYPE_PARAMETER name:G index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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 + CLASS INTERFACE name:Simple modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Simple + 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt.txt b/compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt.txt index 37b25382ef6..b076521d79a 100644 --- a/compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt.txt +++ b/compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt.txt @@ -1,15 +1,15 @@ @Target(allowedTargets = [AnnotationTarget.TYPE]) open annotation class TypeAnn : Annotation { + val name: String + field = name + get + constructor(name: String) /* primary */ { super/*Any*/() /* () */ } - val name: String - field = name - get - } @Target(allowedTargets = [AnnotationTarget.TYPE_PARAMETER]) @@ -33,48 +33,6 @@ open annotation class TypeParameterAnnBinary : Annotation { } -interface Simple { -} - -class SimpleClass { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -interface Generic { -} - -class GenericClass { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -class SimpleParameter<@TypeParameterAnn @TypeParameterAnnBinary T : Any?> { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -class InterfaceBound<@TypeParameterAnn T : @TypeAnn(name = "Simple") Simple> { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - class ClassBound<@TypeParameterAnn T : @TypeAnn(name = "Simple") SimpleClass> { constructor() /* primary */ { super/*Any*/() @@ -84,15 +42,6 @@ class ClassBound<@TypeParameterAnn T : @TypeAnn(name = "Simple") SimpleClass> { } -class InterfaceBoundGeneric> { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - class ClassBoundGeneric> { constructor() /* primary */ { super/*Any*/() @@ -102,6 +51,51 @@ class ClassBoundGeneric { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class InterfaceBound<@TypeParameterAnn T : @TypeAnn(name = "Simple") Simple> { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class InterfaceBoundGeneric> { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class SimpleClass { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class SimpleParameter<@TypeParameterAnn @TypeParameterAnnBinary T : Any?> { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + class TypeParameterAsBound { constructor() /* primary */ { super/*Any*/() @@ -110,3 +104,10 @@ class TypeParameterAsBound (values:kotlin.LongArray, toArray:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:values index:0 type:kotlin.LongArray varargElementType:kotlin.Long [vararg] + VALUE_PARAMETER name:toArray index:1 type:@[ExtensionFunctionType] kotlin.Function1 + BLOCK_BODY + FUN name:shortArrayData visibility:public modality:FINAL <> (values:kotlin.ShortArray, toArray:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:values index:0 type:kotlin.ShortArray varargElementType:kotlin.Short [vararg] + VALUE_PARAMETER name:toArray index:1 type:@[ExtensionFunctionType] kotlin.Function1 + BLOCK_BODY diff --git a/compiler/testData/ir/irText/firProblems/VarargIntegerLiteral.kt.txt b/compiler/testData/ir/irText/firProblems/VarargIntegerLiteral.kt.txt index 0f3897a0136..5cbf60f0df8 100644 --- a/compiler/testData/ir/irText/firProblems/VarargIntegerLiteral.kt.txt +++ b/compiler/testData/ir/irText/firProblems/VarargIntegerLiteral.kt.txt @@ -4,12 +4,6 @@ fun > arrayData(vararg values: T, toArray: @ExtensionFunctionT fun arrayLongInheritedData(vararg values: T, toArray: @ExtensionFunctionType Function1, Unit>) { } -fun longArrayData(vararg values: Long, toArray: @ExtensionFunctionType Function1) { -} - -fun shortArrayData(vararg values: Short, toArray: @ExtensionFunctionType Function1) { -} - fun arrayOfLongData(vararg values: Long, toArray: @ExtensionFunctionType Function1, Unit>) { } @@ -43,3 +37,10 @@ fun box(): String { ) return "OK" } + +fun longArrayData(vararg values: Long, toArray: @ExtensionFunctionType Function1) { +} + +fun shortArrayData(vararg values: Short, toArray: @ExtensionFunctionType Function1) { +} + diff --git a/compiler/testData/ir/irText/firProblems/candidateSymbol.fir.ir.txt b/compiler/testData/ir/irText/firProblems/candidateSymbol.fir.ir.txt index ef6450c622e..82ac5d8b5b2 100644 --- a/compiler/testData/ir/irText/firProblems/candidateSymbol.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/candidateSymbol.fir.ir.txt @@ -1,42 +1,7 @@ FILE fqName: fileName:/candidateSymbol.kt - CLASS CLASS name:Candidate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Candidate - CONSTRUCTOR visibility:public <> (symbol:.AbstractFirBasedSymbol<*>) returnType:.Candidate [primary] - VALUE_PARAMETER name:symbol index:0 type:.AbstractFirBasedSymbol<*> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Candidate modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:symbol visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:symbol type:.AbstractFirBasedSymbol<*> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'symbol: .AbstractFirBasedSymbol<*> declared in .Candidate.' type=.AbstractFirBasedSymbol<*> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Candidate) returnType:.AbstractFirBasedSymbol<*> - correspondingProperty: PROPERTY name:symbol visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Candidate - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .AbstractFirBasedSymbol<*> declared in .Candidate' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:symbol type:.AbstractFirBasedSymbol<*> visibility:private [final]' type=.AbstractFirBasedSymbol<*> origin=null - receiver: GET_VAR ': .Candidate declared in .Candidate.' type=.Candidate 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: 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 CLASS CLASS name:AbstractFirBasedSymbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AbstractFirBasedSymbol.AbstractFirBasedSymbol> TYPE_PARAMETER name:E index:0 variance: superTypes:[.FirSymbolOwner.AbstractFirBasedSymbol>; .FirDeclaration] reified:false - CONSTRUCTOR visibility:public <> () returnType:.AbstractFirBasedSymbol.AbstractFirBasedSymbol> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AbstractFirBasedSymbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' PROPERTY name:fir visibility:public modality:FINAL [lateinit,var] FIELD PROPERTY_BACKING_FIELD name:fir type:E of .AbstractFirBasedSymbol visibility:public FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.AbstractFirBasedSymbol.AbstractFirBasedSymbol>) returnType:E of .AbstractFirBasedSymbol @@ -54,6 +19,10 @@ FILE fqName: fileName:/candidateSymbol.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fir type:E of .AbstractFirBasedSymbol visibility:public' type=kotlin.Unit origin=null receiver: GET_VAR ': .AbstractFirBasedSymbol.AbstractFirBasedSymbol> declared in .AbstractFirBasedSymbol.' type=.AbstractFirBasedSymbol.AbstractFirBasedSymbol> origin=null value: GET_VAR ': E of .AbstractFirBasedSymbol declared in .AbstractFirBasedSymbol.' type=E of .AbstractFirBasedSymbol origin=null + CONSTRUCTOR visibility:public <> () returnType:.AbstractFirBasedSymbol.AbstractFirBasedSymbol> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AbstractFirBasedSymbol modality:ABSTRACT visibility:public 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 declared in kotlin.Any @@ -67,6 +36,64 @@ FILE fqName: fileName:/candidateSymbol.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Candidate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Candidate + PROPERTY name:symbol visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:symbol type:.AbstractFirBasedSymbol<*> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'symbol: .AbstractFirBasedSymbol<*> declared in .Candidate.' type=.AbstractFirBasedSymbol<*> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Candidate) returnType:.AbstractFirBasedSymbol<*> + correspondingProperty: PROPERTY name:symbol visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Candidate + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .AbstractFirBasedSymbol<*> declared in .Candidate' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:symbol type:.AbstractFirBasedSymbol<*> visibility:private [final]' type=.AbstractFirBasedSymbol<*> origin=null + receiver: GET_VAR ': .Candidate declared in .Candidate.' type=.Candidate origin=null + CONSTRUCTOR visibility:public <> (symbol:.AbstractFirBasedSymbol<*>) returnType:.Candidate [primary] + VALUE_PARAMETER name:symbol index:0 type:.AbstractFirBasedSymbol<*> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Candidate modality:FINAL visibility:public 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 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 + CLASS INTERFACE name:FirCallableMemberDeclaration modality:ABSTRACT visibility:public superTypes:[.FirSymbolOwner.FirCallableMemberDeclaration>; .FirDeclaration] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirCallableMemberDeclaration.FirCallableMemberDeclaration> + TYPE_PARAMETER name:F index:0 variance: superTypes:[.FirCallableMemberDeclaration.FirCallableMemberDeclaration>] reified:false + 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 .FirSymbolOwner + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .FirDeclaration + $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 .FirSymbolOwner + public open fun hashCode (): kotlin.Int declared in .FirDeclaration + $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 .FirSymbolOwner + public open fun toString (): kotlin.String declared in .FirDeclaration + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:symbol visibility:public modality:ABSTRACT [val] + overridden: + public abstract symbol: .AbstractFirBasedSymbol.FirSymbolOwner> + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirCallableMemberDeclaration.FirCallableMemberDeclaration>) returnType:.AbstractFirBasedSymbol.FirCallableMemberDeclaration> + correspondingProperty: PROPERTY name:symbol visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): .AbstractFirBasedSymbol.FirSymbolOwner> declared in .FirSymbolOwner + $this: VALUE_PARAMETER name: type:.FirCallableMemberDeclaration.FirCallableMemberDeclaration> CLASS INTERFACE name:FirDeclaration modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirDeclaration FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -85,10 +112,6 @@ FILE fqName: fileName:/candidateSymbol.kt CLASS INTERFACE name:FirSymbolOwner modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirSymbolOwner.FirSymbolOwner> TYPE_PARAMETER name:E index:0 variance: superTypes:[.FirSymbolOwner.FirSymbolOwner>; .FirDeclaration] reified:false - PROPERTY name:symbol visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirSymbolOwner.FirSymbolOwner>) returnType:.AbstractFirBasedSymbol.FirSymbolOwner> - correspondingProperty: PROPERTY name:symbol visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.FirSymbolOwner.FirSymbolOwner> 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 @@ -102,33 +125,10 @@ FILE fqName: fileName:/candidateSymbol.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:FirCallableMemberDeclaration modality:ABSTRACT visibility:public superTypes:[.FirSymbolOwner.FirCallableMemberDeclaration>; .FirDeclaration] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirCallableMemberDeclaration.FirCallableMemberDeclaration> - TYPE_PARAMETER name:F index:0 variance: superTypes:[.FirCallableMemberDeclaration.FirCallableMemberDeclaration>] reified:false PROPERTY name:symbol visibility:public modality:ABSTRACT [val] - overridden: - public abstract symbol: .AbstractFirBasedSymbol.FirSymbolOwner> - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirCallableMemberDeclaration.FirCallableMemberDeclaration>) returnType:.AbstractFirBasedSymbol.FirCallableMemberDeclaration> + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirSymbolOwner.FirSymbolOwner>) returnType:.AbstractFirBasedSymbol.FirSymbolOwner> correspondingProperty: PROPERTY name:symbol visibility:public modality:ABSTRACT [val] - overridden: - public abstract fun (): .AbstractFirBasedSymbol.FirSymbolOwner> declared in .FirSymbolOwner - $this: VALUE_PARAMETER name: type:.FirCallableMemberDeclaration.FirCallableMemberDeclaration> - 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 .FirSymbolOwner - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .FirDeclaration - $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 .FirSymbolOwner - public open fun hashCode (): kotlin.Int declared in .FirDeclaration - $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 .FirSymbolOwner - public open fun toString (): kotlin.String declared in .FirDeclaration - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.FirSymbolOwner.FirSymbolOwner> FUN name:foo visibility:public modality:FINAL <> (candidate:.Candidate) returnType:kotlin.Unit VALUE_PARAMETER name:candidate index:0 type:.Candidate BLOCK_BODY diff --git a/compiler/testData/ir/irText/firProblems/candidateSymbol.fir.kt.txt b/compiler/testData/ir/irText/firProblems/candidateSymbol.fir.kt.txt index 4c048c37f4b..c9c8390fbc8 100644 --- a/compiler/testData/ir/irText/firProblems/candidateSymbol.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/candidateSymbol.fir.kt.txt @@ -1,44 +1,44 @@ -class Candidate { - constructor(symbol: AbstractFirBasedSymbol<*>) /* primary */ { - super/*Any*/() - /* () */ - - } - - val symbol: AbstractFirBasedSymbol<*> - field = symbol +abstract class AbstractFirBasedSymbol where E : FirDeclaration, E : FirSymbolOwner { + lateinit var fir: E get + set -} - -abstract class AbstractFirBasedSymbol where E : FirSymbolOwner, E : FirDeclaration { constructor() /* primary */ { super/*Any*/() /* () */ } - lateinit var fir: E +} + +class Candidate { + val symbol: AbstractFirBasedSymbol<*> + field = symbol get - set + + constructor(symbol: AbstractFirBasedSymbol<*>) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface FirCallableMemberDeclaration> : FirDeclaration, FirSymbolOwner { + abstract override val symbol: AbstractFirBasedSymbol + abstract override get } interface FirDeclaration { } -interface FirSymbolOwner where E : FirSymbolOwner, E : FirDeclaration { +interface FirSymbolOwner where E : FirDeclaration, E : FirSymbolOwner { abstract val symbol: AbstractFirBasedSymbol abstract get } -interface FirCallableMemberDeclaration> : FirSymbolOwner, FirDeclaration { - abstract override val symbol: AbstractFirBasedSymbol - abstract override get - -} - fun foo(candidate: Candidate) { val me: Any = candidate.().() when { diff --git a/compiler/testData/ir/irText/firProblems/candidateSymbol.ir.txt b/compiler/testData/ir/irText/firProblems/candidateSymbol.ir.txt index 405494a2848..8d08579d696 100644 --- a/compiler/testData/ir/irText/firProblems/candidateSymbol.ir.txt +++ b/compiler/testData/ir/irText/firProblems/candidateSymbol.ir.txt @@ -1,42 +1,7 @@ FILE fqName: fileName:/candidateSymbol.kt - CLASS CLASS name:Candidate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Candidate - CONSTRUCTOR visibility:public <> (symbol:.AbstractFirBasedSymbol<*>) returnType:.Candidate [primary] - VALUE_PARAMETER name:symbol index:0 type:.AbstractFirBasedSymbol<*> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Candidate modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:symbol visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:symbol type:.AbstractFirBasedSymbol<*> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'symbol: .AbstractFirBasedSymbol<*> declared in .Candidate.' type=.AbstractFirBasedSymbol<*> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Candidate) returnType:.AbstractFirBasedSymbol<*> - correspondingProperty: PROPERTY name:symbol visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Candidate - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .AbstractFirBasedSymbol<*> declared in .Candidate' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:symbol type:.AbstractFirBasedSymbol<*> visibility:private [final]' type=.AbstractFirBasedSymbol<*> origin=null - receiver: GET_VAR ': .Candidate declared in .Candidate.' type=.Candidate 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: 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 CLASS CLASS name:AbstractFirBasedSymbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AbstractFirBasedSymbol.AbstractFirBasedSymbol> TYPE_PARAMETER name:E index:0 variance: superTypes:[.FirSymbolOwner.AbstractFirBasedSymbol>; .FirDeclaration] reified:false - CONSTRUCTOR visibility:public <> () returnType:.AbstractFirBasedSymbol.AbstractFirBasedSymbol> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AbstractFirBasedSymbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' PROPERTY name:fir visibility:public modality:FINAL [lateinit,var] FIELD PROPERTY_BACKING_FIELD name:fir type:E of .AbstractFirBasedSymbol visibility:public FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.AbstractFirBasedSymbol.AbstractFirBasedSymbol>) returnType:E of .AbstractFirBasedSymbol @@ -54,6 +19,10 @@ FILE fqName: fileName:/candidateSymbol.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fir type:E of .AbstractFirBasedSymbol visibility:public' type=kotlin.Unit origin=null receiver: GET_VAR ': .AbstractFirBasedSymbol.AbstractFirBasedSymbol> declared in .AbstractFirBasedSymbol.' type=.AbstractFirBasedSymbol.AbstractFirBasedSymbol> origin=null value: GET_VAR ': E of .AbstractFirBasedSymbol declared in .AbstractFirBasedSymbol.' type=E of .AbstractFirBasedSymbol origin=null + CONSTRUCTOR visibility:public <> () returnType:.AbstractFirBasedSymbol.AbstractFirBasedSymbol> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AbstractFirBasedSymbol modality:ABSTRACT visibility:public 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 declared in kotlin.Any @@ -67,6 +36,64 @@ FILE fqName: fileName:/candidateSymbol.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Candidate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Candidate + PROPERTY name:symbol visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:symbol type:.AbstractFirBasedSymbol<*> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'symbol: .AbstractFirBasedSymbol<*> declared in .Candidate.' type=.AbstractFirBasedSymbol<*> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Candidate) returnType:.AbstractFirBasedSymbol<*> + correspondingProperty: PROPERTY name:symbol visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Candidate + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .AbstractFirBasedSymbol<*> declared in .Candidate' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:symbol type:.AbstractFirBasedSymbol<*> visibility:private [final]' type=.AbstractFirBasedSymbol<*> origin=null + receiver: GET_VAR ': .Candidate declared in .Candidate.' type=.Candidate origin=null + CONSTRUCTOR visibility:public <> (symbol:.AbstractFirBasedSymbol<*>) returnType:.Candidate [primary] + VALUE_PARAMETER name:symbol index:0 type:.AbstractFirBasedSymbol<*> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Candidate modality:FINAL visibility:public 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 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 + CLASS INTERFACE name:FirCallableMemberDeclaration modality:ABSTRACT visibility:public superTypes:[.FirSymbolOwner.FirCallableMemberDeclaration>; .FirDeclaration] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirCallableMemberDeclaration.FirCallableMemberDeclaration> + TYPE_PARAMETER name:F index:0 variance: superTypes:[.FirCallableMemberDeclaration.FirCallableMemberDeclaration>] reified:false + 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 .FirSymbolOwner + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .FirDeclaration + $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 .FirSymbolOwner + public open fun hashCode (): kotlin.Int declared in .FirDeclaration + $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 .FirSymbolOwner + public open fun toString (): kotlin.String declared in .FirDeclaration + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:symbol visibility:public modality:ABSTRACT [val] + overridden: + public abstract symbol: .AbstractFirBasedSymbol.FirSymbolOwner> + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirCallableMemberDeclaration.FirCallableMemberDeclaration>) returnType:.AbstractFirBasedSymbol.FirCallableMemberDeclaration> + correspondingProperty: PROPERTY name:symbol visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): .AbstractFirBasedSymbol.FirSymbolOwner> declared in .FirSymbolOwner + $this: VALUE_PARAMETER name: type:.FirCallableMemberDeclaration.FirCallableMemberDeclaration> CLASS INTERFACE name:FirDeclaration modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirDeclaration FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -85,10 +112,6 @@ FILE fqName: fileName:/candidateSymbol.kt CLASS INTERFACE name:FirSymbolOwner modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirSymbolOwner.FirSymbolOwner> TYPE_PARAMETER name:E index:0 variance: superTypes:[.FirSymbolOwner.FirSymbolOwner>; .FirDeclaration] reified:false - PROPERTY name:symbol visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirSymbolOwner.FirSymbolOwner>) returnType:.AbstractFirBasedSymbol.FirSymbolOwner> - correspondingProperty: PROPERTY name:symbol visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.FirSymbolOwner.FirSymbolOwner> 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 @@ -102,33 +125,10 @@ FILE fqName: fileName:/candidateSymbol.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:FirCallableMemberDeclaration modality:ABSTRACT visibility:public superTypes:[.FirSymbolOwner.FirCallableMemberDeclaration>; .FirDeclaration] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirCallableMemberDeclaration.FirCallableMemberDeclaration> - TYPE_PARAMETER name:F index:0 variance: superTypes:[.FirCallableMemberDeclaration.FirCallableMemberDeclaration>] reified:false PROPERTY name:symbol visibility:public modality:ABSTRACT [val] - overridden: - public abstract symbol: .AbstractFirBasedSymbol.FirSymbolOwner> - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirCallableMemberDeclaration.FirCallableMemberDeclaration>) returnType:.AbstractFirBasedSymbol.FirCallableMemberDeclaration> + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.FirSymbolOwner.FirSymbolOwner>) returnType:.AbstractFirBasedSymbol.FirSymbolOwner> correspondingProperty: PROPERTY name:symbol visibility:public modality:ABSTRACT [val] - overridden: - public abstract fun (): .AbstractFirBasedSymbol.FirSymbolOwner> declared in .FirSymbolOwner - $this: VALUE_PARAMETER name: type:.FirCallableMemberDeclaration.FirCallableMemberDeclaration> - 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 .FirSymbolOwner - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .FirDeclaration - $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 .FirSymbolOwner - public open fun hashCode (): kotlin.Int declared in .FirDeclaration - $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 .FirSymbolOwner - public open fun toString (): kotlin.String declared in .FirDeclaration - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.FirSymbolOwner.FirSymbolOwner> FUN name:foo visibility:public modality:FINAL <> (candidate:.Candidate) returnType:kotlin.Unit VALUE_PARAMETER name:candidate index:0 type:.Candidate BLOCK_BODY diff --git a/compiler/testData/ir/irText/firProblems/candidateSymbol.kt.txt b/compiler/testData/ir/irText/firProblems/candidateSymbol.kt.txt index 91ebb64f170..dd14e67f80f 100644 --- a/compiler/testData/ir/irText/firProblems/candidateSymbol.kt.txt +++ b/compiler/testData/ir/irText/firProblems/candidateSymbol.kt.txt @@ -1,44 +1,44 @@ -class Candidate { - constructor(symbol: AbstractFirBasedSymbol<*>) /* primary */ { - super/*Any*/() - /* () */ - - } - - val symbol: AbstractFirBasedSymbol<*> - field = symbol +abstract class AbstractFirBasedSymbol where E : FirDeclaration, E : FirSymbolOwner { + lateinit var fir: E get + set -} - -abstract class AbstractFirBasedSymbol where E : FirSymbolOwner, E : FirDeclaration { constructor() /* primary */ { super/*Any*/() /* () */ } - lateinit var fir: E +} + +class Candidate { + val symbol: AbstractFirBasedSymbol<*> + field = symbol get - set + + constructor(symbol: AbstractFirBasedSymbol<*>) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface FirCallableMemberDeclaration> : FirDeclaration, FirSymbolOwner { + abstract override val symbol: AbstractFirBasedSymbol + abstract override get } interface FirDeclaration { } -interface FirSymbolOwner where E : FirSymbolOwner, E : FirDeclaration { +interface FirSymbolOwner where E : FirDeclaration, E : FirSymbolOwner { abstract val symbol: AbstractFirBasedSymbol abstract get } -interface FirCallableMemberDeclaration> : FirSymbolOwner, FirDeclaration { - abstract override val symbol: AbstractFirBasedSymbol - abstract override get - -} - fun foo(candidate: Candidate) { val me: FirSymbolOwner<*> = candidate.().() when { @@ -49,3 +49,4 @@ fun foo(candidate: Candidate) { } } } + diff --git a/compiler/testData/ir/irText/firProblems/cannotCastToFunction.fir.ir.txt b/compiler/testData/ir/irText/firProblems/cannotCastToFunction.fir.ir.txt index 1737758047e..b054b9db48c 100644 --- a/compiler/testData/ir/irText/firProblems/cannotCastToFunction.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/cannotCastToFunction.fir.ir.txt @@ -18,14 +18,6 @@ FILE fqName: fileName:/cannotCastToFunction.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:dumpKotlinLike visibility:public modality:FINAL <> ($receiver:.IrElement, options:kotlin.String) returnType:kotlin.String - $receiver: VALUE_PARAMETER name: type:.IrElement - VALUE_PARAMETER name:options index:0 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun dumpKotlinLike (options: kotlin.String): kotlin.String declared in ' - CONST String type=kotlin.String value="O" FUN name:dump visibility:public modality:FINAL <> ($receiver:.IrElement, normalizeNames:kotlin.Boolean, stableOrder:kotlin.Boolean) returnType:kotlin.String $receiver: VALUE_PARAMETER name: type:.IrElement VALUE_PARAMETER name:normalizeNames index:0 type:kotlin.Boolean @@ -69,3 +61,11 @@ FILE fqName: fileName:/cannotCastToFunction.kt CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE $this: GET_VAR 'val dump: @[ExtensionFunctionType] kotlin.Function1<.IrElement, kotlin.String> declared in .dump' type=@[ExtensionFunctionType] kotlin.Function1<.IrElement, kotlin.String> origin=VARIABLE_AS_FUNCTION p1: GET_VAR 'data: .IrElement declared in .dump' type=.IrElement origin=null + FUN name:dumpKotlinLike visibility:public modality:FINAL <> ($receiver:.IrElement, options:kotlin.String) returnType:kotlin.String + $receiver: VALUE_PARAMETER name: type:.IrElement + VALUE_PARAMETER name:options index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun dumpKotlinLike (options: kotlin.String): kotlin.String declared in ' + CONST String type=kotlin.String value="O" diff --git a/compiler/testData/ir/irText/firProblems/cannotCastToFunction.fir.kt.txt b/compiler/testData/ir/irText/firProblems/cannotCastToFunction.fir.kt.txt index fcf50400cf6..ab4ecb54fa1 100644 --- a/compiler/testData/ir/irText/firProblems/cannotCastToFunction.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/cannotCastToFunction.fir.kt.txt @@ -7,10 +7,6 @@ open class IrElement { } -fun IrElement.dumpKotlinLike(options: String = ""): String { - return "O" -} - fun IrElement.dump(normalizeNames: Boolean = false, stableOrder: Boolean = false): String { return "K" } @@ -35,3 +31,7 @@ fun dump(data: IrElement, dumpStrategy: String): String { return dump.invoke(p1 = data) } +fun IrElement.dumpKotlinLike(options: String = ""): String { + return "O" +} + diff --git a/compiler/testData/ir/irText/firProblems/cannotCastToFunction.ir.txt b/compiler/testData/ir/irText/firProblems/cannotCastToFunction.ir.txt index 0b821b5b421..aeae167d7c4 100644 --- a/compiler/testData/ir/irText/firProblems/cannotCastToFunction.ir.txt +++ b/compiler/testData/ir/irText/firProblems/cannotCastToFunction.ir.txt @@ -18,14 +18,6 @@ FILE fqName: fileName:/cannotCastToFunction.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:dumpKotlinLike visibility:public modality:FINAL <> ($receiver:.IrElement, options:kotlin.String) returnType:kotlin.String - $receiver: VALUE_PARAMETER name: type:.IrElement - VALUE_PARAMETER name:options index:0 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="" - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun dumpKotlinLike (options: kotlin.String): kotlin.String declared in ' - CONST String type=kotlin.String value="O" FUN name:dump visibility:public modality:FINAL <> ($receiver:.IrElement, normalizeNames:kotlin.Boolean, stableOrder:kotlin.Boolean) returnType:kotlin.String $receiver: VALUE_PARAMETER name: type:.IrElement VALUE_PARAMETER name:normalizeNames index:0 type:kotlin.Boolean @@ -69,3 +61,11 @@ FILE fqName: fileName:/cannotCastToFunction.kt CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=INVOKE $this: GET_VAR 'val dump: @[ExtensionFunctionType] kotlin.Function1<.IrElement, kotlin.String> declared in .dump' type=@[ExtensionFunctionType] kotlin.Function1<.IrElement, kotlin.String> origin=VARIABLE_AS_FUNCTION p1: GET_VAR 'data: .IrElement declared in .dump' type=.IrElement origin=null + FUN name:dumpKotlinLike visibility:public modality:FINAL <> ($receiver:.IrElement, options:kotlin.String) returnType:kotlin.String + $receiver: VALUE_PARAMETER name: type:.IrElement + VALUE_PARAMETER name:options index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun dumpKotlinLike (options: kotlin.String): kotlin.String declared in ' + CONST String type=kotlin.String value="O" diff --git a/compiler/testData/ir/irText/firProblems/cannotCastToFunction.kt.txt b/compiler/testData/ir/irText/firProblems/cannotCastToFunction.kt.txt index 4f229f18e0e..ab4ecb54fa1 100644 --- a/compiler/testData/ir/irText/firProblems/cannotCastToFunction.kt.txt +++ b/compiler/testData/ir/irText/firProblems/cannotCastToFunction.kt.txt @@ -7,10 +7,6 @@ open class IrElement { } -fun IrElement.dumpKotlinLike(options: String = ""): String { - return "O" -} - fun IrElement.dump(normalizeNames: Boolean = false, stableOrder: Boolean = false): String { return "K" } @@ -34,3 +30,8 @@ fun dump(data: IrElement, dumpStrategy: String): String { } return dump.invoke(p1 = data) } + +fun IrElement.dumpKotlinLike(options: String = ""): String { + return "O" +} + diff --git a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.ir.txt b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.ir.txt index 3ba76730c07..791d0626738 100644 --- a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.ir.txt @@ -1,41 +1,4 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt - PROPERTY name:BACKSLASH visibility:private modality:FINAL [const,val] - FIELD PROPERTY_BACKING_FIELD name:BACKSLASH type:kotlin.Char visibility:private [final,static] - EXPRESSION_BODY - CONST Char type=kotlin.Char value='\\' - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> () returnType:kotlin.Char - correspondingProperty: PROPERTY name:BACKSLASH visibility:private modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Char declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:BACKSLASH type:kotlin.Char visibility:private [final,static]' type=kotlin.Char origin=null - FUN name:nextChar visibility:private modality:FINAL <> ($receiver:java.io.Reader) returnType:kotlin.Char? - $receiver: VALUE_PARAMETER name: type:java.io.Reader - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun nextChar (): kotlin.Char? declared in ' - BLOCK type=kotlin.Char? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int? [val] - CALL 'public final fun takeUnless (predicate: kotlin.Function1): T of kotlin.takeUnless? declared in kotlin' type=kotlin.Int? origin=null - : kotlin.Int - $receiver: CALL 'public open fun read (): kotlin.Int declared in java.io.Reader' type=kotlin.Int origin=null - $this: GET_VAR ': java.io.Reader declared in .nextChar' type=java.io.Reader origin=null - predicate: FUN_EXPR type=kotlin.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Boolean - VALUE_PARAMETER name:it index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Boolean declared in .nextChar' - 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 'it: kotlin.Int declared in .nextChar.' type=kotlin.Int origin=null - arg1: CONST Int type=kotlin.Int value=-1 - WHEN type=kotlin.Char? 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.Int? declared in .nextChar' type=kotlin.Int? 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 open fun toChar (): kotlin.Char declared in kotlin.Int' type=kotlin.Char origin=null - $this: GET_VAR 'val tmp_0: kotlin.Int? declared in .nextChar' type=kotlin.Int? origin=null FUN name:consumeRestOfQuotedSequence visibility:public modality:FINAL <> ($receiver:java.io.Reader, sb:java.lang.StringBuilder, quote:kotlin.Char) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:java.io.Reader VALUE_PARAMETER name:sb index:0 type:java.lang.StringBuilder @@ -66,13 +29,13 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt arg0: GET_VAR 'var ch: kotlin.Char? declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null arg1: CONST Char type=kotlin.Char value='\\' then: BLOCK type=@[FlexibleNullability] java.lang.StringBuilder? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Char? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Char? [val] CALL 'private final fun nextChar (): kotlin.Char? declared in ' type=kotlin.Char? origin=null $receiver: GET_VAR ': java.io.Reader declared in .consumeRestOfQuotedSequence' type=java.io.Reader origin=null WHEN type=@[FlexibleNullability] java.lang.StringBuilder? 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.Char? declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Char? declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: CONST Null type=kotlin.Nothing? value=null BRANCH @@ -80,7 +43,7 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt then: CALL 'public final fun let (block: kotlin.Function1): R of kotlin.let declared in kotlin' type=@[FlexibleNullability] java.lang.StringBuilder? origin=null : kotlin.Char : @[FlexibleNullability] java.lang.StringBuilder? - $receiver: GET_VAR 'val tmp_1: kotlin.Char? declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null + $receiver: GET_VAR 'val tmp_0: kotlin.Char? declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Char) returnType:@[FlexibleNullability] java.lang.StringBuilder? VALUE_PARAMETER name:it index:0 type:kotlin.Char @@ -97,3 +60,40 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt SET_VAR 'var ch: kotlin.Char? declared in .consumeRestOfQuotedSequence' type=kotlin.Unit origin=EQ CALL 'private final fun nextChar (): kotlin.Char? declared in ' type=kotlin.Char? origin=null $receiver: GET_VAR ': java.io.Reader declared in .consumeRestOfQuotedSequence' type=java.io.Reader origin=null + FUN name:nextChar visibility:private modality:FINAL <> ($receiver:java.io.Reader) returnType:kotlin.Char? + $receiver: VALUE_PARAMETER name: type:java.io.Reader + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun nextChar (): kotlin.Char? declared in ' + BLOCK type=kotlin.Char? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int? [val] + CALL 'public final fun takeUnless (predicate: kotlin.Function1): T of kotlin.takeUnless? declared in kotlin' type=kotlin.Int? origin=null + : kotlin.Int + $receiver: CALL 'public open fun read (): kotlin.Int declared in java.io.Reader' type=kotlin.Int origin=null + $this: GET_VAR ': java.io.Reader declared in .nextChar' type=java.io.Reader origin=null + predicate: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Boolean + VALUE_PARAMETER name:it index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Boolean declared in .nextChar' + 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 'it: kotlin.Int declared in .nextChar.' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=-1 + WHEN type=kotlin.Char? 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.Int? declared in .nextChar' type=kotlin.Int? 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 open fun toChar (): kotlin.Char declared in kotlin.Int' type=kotlin.Char origin=null + $this: GET_VAR 'val tmp_1: kotlin.Int? declared in .nextChar' type=kotlin.Int? origin=null + PROPERTY name:BACKSLASH visibility:private modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:BACKSLASH type:kotlin.Char visibility:private [final,static] + EXPRESSION_BODY + CONST Char type=kotlin.Char value='\\' + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> () returnType:kotlin.Char + correspondingProperty: PROPERTY name:BACKSLASH visibility:private modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Char declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:BACKSLASH type:kotlin.Char visibility:private [final,static]' type=kotlin.Char origin=null diff --git a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.kt.txt b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.kt.txt index ac9ab9722b9..e4d1f4041ef 100644 --- a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.kt.txt @@ -1,20 +1,3 @@ -private const val BACKSLASH: Char - field = '\\' - private get - -private fun Reader.nextChar(): Char? { - return { // BLOCK - val tmp_0: Int? = .read().takeUnless(predicate = local fun (it: Int): Boolean { - return EQEQ(arg0 = it, arg1 = -1) - } -) - when { - EQEQ(arg0 = tmp_0, arg1 = null) -> null - else -> tmp_0.toChar() - } - } -} - fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) { var ch: Char? = .nextChar() while (when { @@ -23,10 +6,10 @@ fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) { }) { // BLOCK when { EQEQ(arg0 = ch, arg1 = '\\') -> { // BLOCK - val tmp_1: Char? = .nextChar() + val tmp_0: Char? = .nextChar() when { - EQEQ(arg0 = tmp_1, arg1 = null) -> null - else -> tmp_1.let(block = local fun (it: Char): @FlexibleNullability StringBuilder? { + EQEQ(arg0 = tmp_0, arg1 = null) -> null + else -> tmp_0.let(block = local fun (it: Char): @FlexibleNullability StringBuilder? { return sb.append(p0 = it) } ) @@ -37,3 +20,21 @@ fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) { ch = .nextChar() } } + +private fun Reader.nextChar(): Char? { + return { // BLOCK + val tmp_1: Int? = .read().takeUnless(predicate = local fun (it: Int): Boolean { + return EQEQ(arg0 = it, arg1 = -1) + } +) + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> null + else -> tmp_1.toChar() + } + } +} + +private const val BACKSLASH: Char + field = '\\' + private get + diff --git a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.ir.txt b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.ir.txt index 6697a91cb9a..85f03456ab7 100644 --- a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.ir.txt +++ b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.ir.txt @@ -1,41 +1,4 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt - PROPERTY name:BACKSLASH visibility:private modality:FINAL [const,val] - FIELD PROPERTY_BACKING_FIELD name:BACKSLASH type:kotlin.Char visibility:private [final,static] - EXPRESSION_BODY - CONST Char type=kotlin.Char value='\\' - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> () returnType:kotlin.Char - correspondingProperty: PROPERTY name:BACKSLASH visibility:private modality:FINAL [const,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Char declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:BACKSLASH type:kotlin.Char visibility:private [final,static]' type=kotlin.Char origin=null - FUN name:nextChar visibility:private modality:FINAL <> ($receiver:java.io.Reader) returnType:kotlin.Char? - $receiver: VALUE_PARAMETER name: type:java.io.Reader - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun nextChar (): kotlin.Char? declared in ' - BLOCK type=kotlin.Char? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int? [val] - CALL 'public final fun takeUnless (predicate: kotlin.Function1): T of kotlin.takeUnless? declared in kotlin' type=kotlin.Int? origin=null - : kotlin.Int - $receiver: CALL 'public open fun read (): kotlin.Int declared in java.io.Reader' type=kotlin.Int origin=null - $this: GET_VAR ': java.io.Reader declared in .nextChar' type=java.io.Reader origin=null - predicate: FUN_EXPR type=kotlin.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Boolean - VALUE_PARAMETER name:it index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Boolean declared in .nextChar' - 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 'it: kotlin.Int declared in .nextChar.' type=kotlin.Int origin=null - arg1: CONST Int type=kotlin.Int value=-1 - WHEN type=kotlin.Char? 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.Int? declared in .nextChar' type=kotlin.Int? 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 open fun toChar (): kotlin.Char declared in kotlin.Int' type=kotlin.Char origin=null - $this: GET_VAR 'val tmp_0: kotlin.Int? declared in .nextChar' type=kotlin.Int? origin=null FUN name:consumeRestOfQuotedSequence visibility:public modality:FINAL <> ($receiver:java.io.Reader, sb:java.lang.StringBuilder, quote:kotlin.Char) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:java.io.Reader VALUE_PARAMETER name:sb index:0 type:java.lang.StringBuilder @@ -66,13 +29,13 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt arg1: CALL 'private final fun (): kotlin.Char declared in ' type=kotlin.Char origin=GET_PROPERTY then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=@[FlexibleNullability] java.lang.StringBuilder? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Char? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Char? [val] CALL 'private final fun nextChar (): kotlin.Char? declared in ' type=kotlin.Char? origin=null $receiver: GET_VAR ': java.io.Reader declared in .consumeRestOfQuotedSequence' type=java.io.Reader origin=null WHEN type=@[FlexibleNullability] java.lang.StringBuilder? 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.Char? declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null + arg0: GET_VAR 'val tmp_0: kotlin.Char? declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: CONST Null type=kotlin.Nothing? value=null BRANCH @@ -80,7 +43,7 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt then: CALL 'public final fun let (block: kotlin.Function1): R of kotlin.let declared in kotlin' type=@[FlexibleNullability] java.lang.StringBuilder? origin=null : kotlin.Char : @[FlexibleNullability] java.lang.StringBuilder? - $receiver: GET_VAR 'val tmp_1: kotlin.Char? declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null + $receiver: GET_VAR 'val tmp_0: kotlin.Char? declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Char) returnType:@[FlexibleNullability] java.lang.StringBuilder? VALUE_PARAMETER name:it index:0 type:kotlin.Char @@ -98,3 +61,40 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt SET_VAR 'var ch: kotlin.Char? declared in .consumeRestOfQuotedSequence' type=kotlin.Unit origin=EQ CALL 'private final fun nextChar (): kotlin.Char? declared in ' type=kotlin.Char? origin=null $receiver: GET_VAR ': java.io.Reader declared in .consumeRestOfQuotedSequence' type=java.io.Reader origin=null + FUN name:nextChar visibility:private modality:FINAL <> ($receiver:java.io.Reader) returnType:kotlin.Char? + $receiver: VALUE_PARAMETER name: type:java.io.Reader + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun nextChar (): kotlin.Char? declared in ' + BLOCK type=kotlin.Char? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int? [val] + CALL 'public final fun takeUnless (predicate: kotlin.Function1): T of kotlin.takeUnless? declared in kotlin' type=kotlin.Int? origin=null + : kotlin.Int + $receiver: CALL 'public open fun read (): kotlin.Int declared in java.io.Reader' type=kotlin.Int origin=null + $this: GET_VAR ': java.io.Reader declared in .nextChar' type=java.io.Reader origin=null + predicate: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Boolean + VALUE_PARAMETER name:it index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Boolean declared in .nextChar' + 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 'it: kotlin.Int declared in .nextChar.' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=-1 + WHEN type=kotlin.Char? 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.Int? declared in .nextChar' type=kotlin.Int? 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 open fun toChar (): kotlin.Char declared in kotlin.Int' type=kotlin.Char origin=null + $this: GET_VAR 'val tmp_1: kotlin.Int? declared in .nextChar' type=kotlin.Int? origin=null + PROPERTY name:BACKSLASH visibility:private modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:BACKSLASH type:kotlin.Char visibility:private [final,static] + EXPRESSION_BODY + CONST Char type=kotlin.Char value='\\' + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> () returnType:kotlin.Char + correspondingProperty: PROPERTY name:BACKSLASH visibility:private modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Char declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:BACKSLASH type:kotlin.Char visibility:private [final,static]' type=kotlin.Char origin=null diff --git a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.kt.txt b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.kt.txt index 66bbe8830b6..efd8c8b4d64 100644 --- a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.kt.txt +++ b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.kt.txt @@ -1,20 +1,3 @@ -private const val BACKSLASH: Char - field = '\\' - private get - -private fun Reader.nextChar(): Char? { - return { // BLOCK - val tmp_0: Int? = .read().takeUnless(predicate = local fun (it: Int): Boolean { - return EQEQ(arg0 = it, arg1 = -1) - } -) - when { - EQEQ(arg0 = tmp_0, arg1 = null) -> null - else -> tmp_0.toChar() - } - } -} - fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) { var ch: Char? = .nextChar() while (when { @@ -23,10 +6,10 @@ fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) { }) { // BLOCK when { EQEQ(arg0 = ch, arg1 = ()) -> { // BLOCK - val tmp_1: Char? = .nextChar() + val tmp_0: Char? = .nextChar() when { - EQEQ(arg0 = tmp_1, arg1 = null) -> null - else -> tmp_1.let(block = local fun (it: Char): @FlexibleNullability StringBuilder? { + EQEQ(arg0 = tmp_0, arg1 = null) -> null + else -> tmp_0.let(block = local fun (it: Char): @FlexibleNullability StringBuilder? { return sb.append(p0 = it) } ) @@ -37,3 +20,21 @@ fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) { ch = .nextChar() } } + +private fun Reader.nextChar(): Char? { + return { // BLOCK + val tmp_1: Int? = .read().takeUnless(predicate = local fun (it: Int): Boolean { + return EQEQ(arg0 = it, arg1 = -1) + } +) + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> null + else -> tmp_1.toChar() + } + } +} + +private const val BACKSLASH: Char + field = '\\' + private get + diff --git a/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.ir.txt b/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.ir.txt index e726af76573..3b63c5234fa 100644 --- a/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.ir.txt +++ b/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.ir.txt @@ -16,10 +16,6 @@ FILE fqName: fileName:/delegatedSetterShouldBeSpecialized.kt value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyClass - CONSTRUCTOR visibility:public <> () returnType:.MyClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:delegatedToTopLevel visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:delegatedToTopLevel$delegate type:kotlin.reflect.KMutableProperty0 visibility:private [final] EXPRESSION_BODY @@ -48,6 +44,10 @@ FILE fqName: fileName:/delegatedSetterShouldBeSpecialized.kt thisRef: GET_VAR ': .MyClass declared in .MyClass.' type=.MyClass origin=null property: PROPERTY_REFERENCE 'public final delegatedToTopLevel: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in .MyClass' setter='public final fun (: kotlin.Int): kotlin.Unit declared in .MyClass' type=kotlin.reflect.KMutableProperty1<.MyClass, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.Int declared in .MyClass.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.MyClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt.txt b/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt.txt index 3ece1629e89..eccdc269a3c 100644 --- a/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt.txt +++ b/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt.txt @@ -4,12 +4,6 @@ var topLevelInt: Int set class MyClass { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - var delegatedToTopLevel: Int /* by */ field = ::topLevelInt get(): Int { @@ -19,4 +13,11 @@ class MyClass { return .#delegatedToTopLevel$delegate.setValue(thisRef = , property = MyClass::delegatedToTopLevel, value = ) } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/firProblems/deprecated.ir.txt b/compiler/testData/ir/irText/firProblems/deprecated.ir.txt index 84806addecf..053e499b67b 100644 --- a/compiler/testData/ir/irText/firProblems/deprecated.ir.txt +++ b/compiler/testData/ir/irText/firProblems/deprecated.ir.txt @@ -3,13 +3,6 @@ FILE fqName: fileName:/deprecated.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun create (): kotlin.String declared in ' CONST String type=kotlin.String value="OK" - FUN name:create visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.String - annotations: - Deprecated(message = "Use create() instead()", replaceWith = ReplaceWith(expression = "create()", imports = []), level = ) - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun create (s: kotlin.String): kotlin.String declared in ' - CALL 'public final fun create (): kotlin.String declared in ' type=kotlin.String origin=null FUN name:create visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.String annotations: Deprecated(message = "Use create() instead()", replaceWith = , level = ) @@ -17,3 +10,10 @@ FILE fqName: fileName:/deprecated.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun create (b: kotlin.Boolean): kotlin.String declared in ' CALL 'public final fun create (): kotlin.String declared in ' type=kotlin.String origin=null + FUN name:create visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.String + annotations: + Deprecated(message = "Use create() instead()", replaceWith = ReplaceWith(expression = "create()", imports = []), level = ) + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun create (s: kotlin.String): kotlin.String declared in ' + CALL 'public final fun create (): kotlin.String declared in ' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/firProblems/deprecated.kt.txt b/compiler/testData/ir/irText/firProblems/deprecated.kt.txt index 652aa6a071a..5e8b8d939c9 100644 --- a/compiler/testData/ir/irText/firProblems/deprecated.kt.txt +++ b/compiler/testData/ir/irText/firProblems/deprecated.kt.txt @@ -2,12 +2,13 @@ fun create(): String { return "OK" } +@Deprecated(message = "Use create() instead()") +fun create(b: Boolean): String { + return create() +} + @Deprecated(message = "Use create() instead()", replaceWith = ReplaceWith(expression = "create()", imports = [])) fun create(s: String): String { return create() } -@Deprecated(message = "Use create() instead()") -fun create(b: Boolean): String { - return create() -} diff --git a/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.fir.ir.txt b/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.fir.ir.txt index 8f2a23189c4..d3ada205c3b 100644 --- a/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.fir.ir.txt @@ -1,10 +1,25 @@ FILE fqName: fileName:/elvisOnBackingFieldInGetter.kt - CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test - CONSTRUCTOR visibility:public <> () returnType:.Test [primary] + CLASS CLASS name:ResourceTable modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ResourceTable + CONSTRUCTOR visibility:public <> () returnType:.ResourceTable [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ResourceTable modality:FINAL visibility:public 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 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 + CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test PROPERTY name:resourceTable visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:resourceTable type:.ResourceTable? visibility:private EXPRESSION_BODY @@ -59,40 +74,25 @@ FILE fqName: fileName:/elvisOnBackingFieldInGetter.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resourceTable type:.ResourceTable? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null value: GET_VAR ': .ResourceTable? declared in .Test.' type=.ResourceTable? origin=null + CONSTRUCTOR visibility:public <> () returnType:.Test [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public 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 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:getFileData visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.String? $this: VALUE_PARAMETER name: type:.Test BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun getFileData (): kotlin.String? declared in .Test' CONST String type=kotlin.String value="" - 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: 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 - CLASS CLASS name:ResourceTable modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ResourceTable - CONSTRUCTOR visibility:public <> () returnType:.ResourceTable [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ResourceTable modality:FINAL visibility:public 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 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 diff --git a/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.fir.kt.txt b/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.fir.kt.txt index 64a8b71db11..cfe18577043 100644 --- a/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.fir.kt.txt @@ -1,10 +1,13 @@ -class Test { +class ResourceTable { constructor() /* primary */ { super/*Any*/() /* () */ } +} + +class Test { var resourceTable: ResourceTable? field = null get(): ResourceTable? { @@ -29,17 +32,15 @@ class Test { } set - fun getFileData(): String? { - return "" - } - -} - -class ResourceTable { constructor() /* primary */ { super/*Any*/() /* () */ } + fun getFileData(): String? { + return "" + } + } + diff --git a/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.ir.txt b/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.ir.txt index 4f22b3efd22..aedbe7d0b91 100644 --- a/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.ir.txt +++ b/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.ir.txt @@ -1,10 +1,25 @@ FILE fqName: fileName:/elvisOnBackingFieldInGetter.kt - CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test - CONSTRUCTOR visibility:public <> () returnType:.Test [primary] + CLASS CLASS name:ResourceTable modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ResourceTable + CONSTRUCTOR visibility:public <> () returnType:.ResourceTable [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ResourceTable modality:FINAL visibility:public 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 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 + CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test PROPERTY name:resourceTable visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:resourceTable type:.ResourceTable? visibility:private EXPRESSION_BODY @@ -59,40 +74,25 @@ FILE fqName: fileName:/elvisOnBackingFieldInGetter.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resourceTable type:.ResourceTable? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null value: GET_VAR ': .ResourceTable? declared in .Test.' type=.ResourceTable? origin=null + CONSTRUCTOR visibility:public <> () returnType:.Test [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public 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 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:getFileData visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.String? $this: VALUE_PARAMETER name: type:.Test BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun getFileData (): kotlin.String? declared in .Test' CONST String type=kotlin.String value="" - 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: 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 - CLASS CLASS name:ResourceTable modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ResourceTable - CONSTRUCTOR visibility:public <> () returnType:.ResourceTable [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ResourceTable modality:FINAL visibility:public 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 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 diff --git a/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.kt.txt b/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.kt.txt index 64a8b71db11..cfe18577043 100644 --- a/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.kt.txt +++ b/compiler/testData/ir/irText/firProblems/elvisOnBackingFieldInGetter.kt.txt @@ -1,10 +1,13 @@ -class Test { +class ResourceTable { constructor() /* primary */ { super/*Any*/() /* () */ } +} + +class Test { var resourceTable: ResourceTable? field = null get(): ResourceTable? { @@ -29,17 +32,15 @@ class Test { } set - fun getFileData(): String? { - return "" - } - -} - -class ResourceTable { constructor() /* primary */ { super/*Any*/() /* () */ } + fun getFileData(): String? { + return "" + } + } + diff --git a/compiler/testData/ir/irText/firProblems/explicitIncrement.ir.txt b/compiler/testData/ir/irText/firProblems/explicitIncrement.ir.txt index be1e56bc097..22bec26f7de 100644 --- a/compiler/testData/ir/irText/firProblems/explicitIncrement.ir.txt +++ b/compiler/testData/ir/irText/firProblems/explicitIncrement.ir.txt @@ -1,4 +1,6 @@ FILE fqName: fileName:/explicitIncrement.kt + FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:i type:kotlin.Int [var] @@ -12,5 +14,3 @@ FILE fqName: fileName:/explicitIncrement.kt SET_VAR 'var i: kotlin.Int declared in .foo' type=kotlin.Unit origin=EQ CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'var i: kotlin.Int declared in .foo' type=kotlin.Int origin=null - FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY diff --git a/compiler/testData/ir/irText/firProblems/explicitIncrement.kt.txt b/compiler/testData/ir/irText/firProblems/explicitIncrement.kt.txt index a286738409e..cda01f3033b 100644 --- a/compiler/testData/ir/irText/firProblems/explicitIncrement.kt.txt +++ b/compiler/testData/ir/irText/firProblems/explicitIncrement.kt.txt @@ -1,3 +1,6 @@ +fun bar() { +} + fun foo() { var i: Int = 1 while (less(arg0 = i, arg1 = 10)) { // BLOCK @@ -6,6 +9,3 @@ fun foo() { } } -fun bar() { -} - diff --git a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.ir.txt b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.ir.txt index e58e1ecb8f8..515022a69a6 100644 --- a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/inapplicableCollectionSet.kt CLASS CLASS name:Flaf modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Flaf - CONSTRUCTOR visibility:public <> (javaName:kotlin.String) returnType:.Flaf [primary] - VALUE_PARAMETER name:javaName index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Flaf modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:javaName visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:javaName type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -30,6 +25,24 @@ FILE fqName: fileName:/inapplicableCollectionSet.kt RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.MutableMap.Flaf> declared in .Flaf' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:INSTANCES type:kotlin.collections.MutableMap.Flaf> visibility:private [final]' type=kotlin.collections.MutableMap.Flaf> origin=null receiver: GET_VAR ': .Flaf declared in .Flaf.' type=.Flaf origin=null + CONSTRUCTOR visibility:public <> (javaName:kotlin.String) returnType:.Flaf [primary] + VALUE_PARAMETER name:javaName index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Flaf modality:FINAL visibility:public 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 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:forJavaName visibility:public modality:FINAL <> ($this:.Flaf, javaName:kotlin.String) returnType:.Flaf $this: VALUE_PARAMETER name: type:.Flaf VALUE_PARAMETER name:javaName index:0 type:kotlin.String @@ -70,16 +83,3 @@ FILE fqName: fileName:/inapplicableCollectionSet.kt value: GET_VAR 'var result: .Flaf? declared in .Flaf.forJavaName' type=.Flaf? origin=null RETURN type=kotlin.Nothing from='public final fun forJavaName (javaName: kotlin.String): .Flaf declared in .Flaf' GET_VAR 'var result: .Flaf? declared in .Flaf.forJavaName' type=.Flaf? 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.kt.txt b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.kt.txt index 678b6459f08..870ad5ce824 100644 --- a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.kt.txt @@ -1,10 +1,4 @@ class Flaf { - constructor(javaName: String) /* primary */ { - super/*Any*/() - /* () */ - - } - val javaName: String field = javaName get @@ -13,6 +7,12 @@ class Flaf { field = mutableMapOf() private get + constructor(javaName: String) /* primary */ { + super/*Any*/() + /* () */ + + } + fun forJavaName(javaName: String): Flaf { var result: Flaf? = .().get(key = javaName) when { @@ -30,3 +30,4 @@ class Flaf { } } + diff --git a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.ir.txt b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.ir.txt index 76c97809453..2854680641b 100644 --- a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.ir.txt +++ b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/inapplicableCollectionSet.kt CLASS CLASS name:Flaf modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Flaf - CONSTRUCTOR visibility:public <> (javaName:kotlin.String) returnType:.Flaf [primary] - VALUE_PARAMETER name:javaName index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Flaf modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:javaName visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:javaName type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -30,6 +25,24 @@ FILE fqName: fileName:/inapplicableCollectionSet.kt RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.MutableMap.Flaf> declared in .Flaf' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:INSTANCES type:kotlin.collections.MutableMap.Flaf> visibility:private [final]' type=kotlin.collections.MutableMap.Flaf> origin=null receiver: GET_VAR ': .Flaf declared in .Flaf.' type=.Flaf origin=null + CONSTRUCTOR visibility:public <> (javaName:kotlin.String) returnType:.Flaf [primary] + VALUE_PARAMETER name:javaName index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Flaf modality:FINAL visibility:public 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 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:forJavaName visibility:public modality:FINAL <> ($this:.Flaf, javaName:kotlin.String) returnType:.Flaf $this: VALUE_PARAMETER name: type:.Flaf VALUE_PARAMETER name:javaName index:0 type:kotlin.String @@ -70,16 +83,3 @@ FILE fqName: fileName:/inapplicableCollectionSet.kt value: GET_VAR 'var result: .Flaf? declared in .Flaf.forJavaName' type=.Flaf? origin=null RETURN type=kotlin.Nothing from='public final fun forJavaName (javaName: kotlin.String): .Flaf declared in .Flaf' GET_VAR 'var result: .Flaf? declared in .Flaf.forJavaName' type=.Flaf? 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.kt.txt b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.kt.txt index 678b6459f08..870ad5ce824 100644 --- a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.kt.txt +++ b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.kt.txt @@ -1,10 +1,4 @@ class Flaf { - constructor(javaName: String) /* primary */ { - super/*Any*/() - /* () */ - - } - val javaName: String field = javaName get @@ -13,6 +7,12 @@ class Flaf { field = mutableMapOf() private get + constructor(javaName: String) /* primary */ { + super/*Any*/() + /* () */ + + } + fun forJavaName(javaName: String): Flaf { var result: Flaf? = .().get(key = javaName) when { @@ -30,3 +30,4 @@ class Flaf { } } + diff --git a/compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.ir.txt b/compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.ir.txt index 57af48119e7..64ee8687347 100644 --- a/compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.ir.txt +++ b/compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.ir.txt @@ -1,5 +1,9 @@ FILE fqName: fileName:/integerLiteralWithExpectedTypealiasType.kt - TYPEALIAS name:MyLong visibility:public expandedType:kotlin.Long + 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 ' + CALL 'public final fun foo (l: kotlin.Long): kotlin.String declared in ' type=kotlin.String origin=null + l: CONST Long type=kotlin.Long value=0 FUN name:foo visibility:public modality:FINAL <> (l:kotlin.Long) returnType:kotlin.String VALUE_PARAMETER name:l index:0 type:kotlin.Long BLOCK_BODY @@ -13,8 +17,4 @@ FILE fqName: fileName:/integerLiteralWithExpectedTypealiasType.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST String type=kotlin.String value="fail" - 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 ' - CALL 'public final fun foo (l: kotlin.Long): kotlin.String declared in ' type=kotlin.String origin=null - l: CONST Long type=kotlin.Long value=0 + TYPEALIAS name:MyLong visibility:public expandedType:kotlin.Long diff --git a/compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.kt.txt b/compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.kt.txt index cba78f4a034..90be5633f35 100644 --- a/compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.kt.txt +++ b/compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.kt.txt @@ -1,4 +1,7 @@ -typealias MyLong = Long +fun box(): String { + return foo(l = 0L) +} + fun foo(l: Long): String { return when { EQEQ(arg0 = l, arg1 = 0L) -> "OK" @@ -6,6 +9,4 @@ fun foo(l: Long): String { } } -fun box(): String { - return foo(l = 0L) -} +typealias MyLong = Long diff --git a/compiler/testData/ir/irText/firProblems/internalPotentialFakeOverride.ir.txt b/compiler/testData/ir/irText/firProblems/internalPotentialFakeOverride.ir.txt index 659367250c2..2c63b7c1f8f 100644 --- a/compiler/testData/ir/irText/firProblems/internalPotentialFakeOverride.ir.txt +++ b/compiler/testData/ir/irText/firProblems/internalPotentialFakeOverride.ir.txt @@ -2,15 +2,6 @@ Module: m1 FILE fqName: fileName:/A.kt CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:internal modality:OPEN <> ($this:.A) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='internal open fun foo (): kotlin.Int declared in .A' - CONST Int type=kotlin.Int value=1 PROPERTY name:bar visibility:internal modality:OPEN [val] FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -22,6 +13,10 @@ FILE fqName: fileName:/A.kt RETURN type=kotlin.Nothing from='internal open fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public 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 declared in kotlin.Any @@ -35,6 +30,11 @@ FILE fqName: fileName:/A.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:internal modality:OPEN <> ($this:.A) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='internal open fun foo (): kotlin.Int declared in .A' + CONST Int type=kotlin.Int value=1 Module: m2 FILE fqName: fileName:/B.kt CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A] diff --git a/compiler/testData/ir/irText/firProblems/internalPotentialFakeOverride.kt.txt b/compiler/testData/ir/irText/firProblems/internalPotentialFakeOverride.kt.txt index fd0664a9919..6433008a937 100644 --- a/compiler/testData/ir/irText/firProblems/internalPotentialFakeOverride.kt.txt +++ b/compiler/testData/ir/irText/firProblems/internalPotentialFakeOverride.kt.txt @@ -2,6 +2,10 @@ // FILE: A.kt open class A { + internal open val bar: Int + field = 1 + internal open get + constructor() /* primary */ { super/*Any*/() /* () */ @@ -12,10 +16,6 @@ open class A { return 1 } - internal open val bar: Int - field = 1 - internal open get - } // MODULE: m2 @@ -29,3 +29,4 @@ class B : A { } } + diff --git a/compiler/testData/ir/irText/firProblems/internalPotentialOverride.ir.txt b/compiler/testData/ir/irText/firProblems/internalPotentialOverride.ir.txt index c9cab4e763d..fe429ba6200 100644 --- a/compiler/testData/ir/irText/firProblems/internalPotentialOverride.ir.txt +++ b/compiler/testData/ir/irText/firProblems/internalPotentialOverride.ir.txt @@ -2,15 +2,6 @@ Module: m1 FILE fqName: fileName:/A.kt CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:internal modality:OPEN <> ($this:.A) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='internal open fun foo (): kotlin.Int declared in .A' - CONST Int type=kotlin.Int value=1 PROPERTY name:bar visibility:internal modality:OPEN [val] FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -22,6 +13,10 @@ FILE fqName: fileName:/A.kt RETURN type=kotlin.Nothing from='internal open fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public 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 declared in kotlin.Any @@ -35,19 +30,15 @@ FILE fqName: fileName:/A.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:internal modality:OPEN <> ($this:.A) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='internal open fun foo (): kotlin.Int declared in .A' + CONST Int type=kotlin.Int value=1 Module: m2 FILE fqName: fileName:/B.kt CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - CONSTRUCTOR visibility:public <> () returnType:.B [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A]' - FUN name:foo visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .B' - CONST String type=kotlin.String value="OK" PROPERTY name:bar visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -59,6 +50,10 @@ FILE fqName: fileName:/B.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .B' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .B declared in .B.' type=.B origin=null + CONSTRUCTOR visibility:public <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A]' 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 .A @@ -72,3 +67,8 @@ FILE fqName: fileName:/B.kt overridden: public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .B' + CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/firProblems/internalPotentialOverride.kt.txt b/compiler/testData/ir/irText/firProblems/internalPotentialOverride.kt.txt index 626c45b09ba..605f9f49dfe 100644 --- a/compiler/testData/ir/irText/firProblems/internalPotentialOverride.kt.txt +++ b/compiler/testData/ir/irText/firProblems/internalPotentialOverride.kt.txt @@ -2,6 +2,10 @@ // FILE: A.kt open class A { + internal open val bar: Int + field = 1 + internal open get + constructor() /* primary */ { super/*Any*/() /* () */ @@ -12,16 +16,16 @@ open class A { return 1 } - internal open val bar: Int - field = 1 - internal open get - } // MODULE: m2 // FILE: B.kt class B : A { + val bar: Int + field = 2 + get + constructor() /* primary */ { super/*A*/() /* () */ @@ -32,8 +36,5 @@ class B : A { return "OK" } - val bar: Int - field = 2 - get - } + diff --git a/compiler/testData/ir/irText/firProblems/kt43342.fir.ir.txt b/compiler/testData/ir/irText/firProblems/kt43342.fir.ir.txt deleted file mode 100644 index d8a25933ecb..00000000000 --- a/compiler/testData/ir/irText/firProblems/kt43342.fir.ir.txt +++ /dev/null @@ -1,220 +0,0 @@ -FILE fqName: fileName:/kt43342.kt - CLASS CLASS name:ControlFlowInfo modality:OPEN visibility:public superTypes:[kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - TYPE_PARAMETER name:K index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:V index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (map:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo>) returnType:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> [primary] - VALUE_PARAMETER name:map index:0 type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ControlFlowInfo modality:OPEN visibility:public superTypes:[kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo>]' - PROPERTY name:map visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'map: kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> - correspondingProperty: PROPERTY name:map visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - FUN DELEGATED_MEMBER name:containsKey visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>, key:K of .ControlFlowInfo) returnType:kotlin.Boolean - overridden: - public abstract fun containsKey (key: K of kotlin.collections.Map): kotlin.Boolean declared in kotlin.collections.Map - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - VALUE_PARAMETER name:key index:0 type:K of .ControlFlowInfo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun containsKey (key: K of .ControlFlowInfo): kotlin.Boolean declared in .ControlFlowInfo' - CALL 'public abstract fun containsKey (key: K of kotlin.collections.Map): kotlin.Boolean declared in kotlin.collections.Map' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.containsKey' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - key: GET_VAR 'key: K of .ControlFlowInfo declared in .ControlFlowInfo.containsKey' type=K of .ControlFlowInfo origin=null - FUN DELEGATED_MEMBER name:containsValue visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>, value:V of .ControlFlowInfo) returnType:kotlin.Boolean - overridden: - public abstract fun containsValue (value: V of kotlin.collections.Map): kotlin.Boolean declared in kotlin.collections.Map - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - VALUE_PARAMETER name:value index:0 type:V of .ControlFlowInfo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun containsValue (value: V of .ControlFlowInfo): kotlin.Boolean declared in .ControlFlowInfo' - CALL 'public abstract fun containsValue (value: V of kotlin.collections.Map): kotlin.Boolean declared in kotlin.collections.Map' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.containsValue' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - value: GET_VAR 'value: V of .ControlFlowInfo declared in .ControlFlowInfo.containsValue' type=V of .ControlFlowInfo origin=null - FUN DELEGATED_MEMBER name:get visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>, key:K of .ControlFlowInfo) returnType:V of .ControlFlowInfo? [operator] - overridden: - public abstract fun get (key: K of kotlin.collections.Map): V of kotlin.collections.Map? declared in kotlin.collections.Map - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - VALUE_PARAMETER name:key index:0 type:K of .ControlFlowInfo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun get (key: K of .ControlFlowInfo): V of .ControlFlowInfo? declared in .ControlFlowInfo' - CALL 'public abstract fun get (key: K of kotlin.collections.Map): V of kotlin.collections.Map? declared in kotlin.collections.Map' type=V of .ControlFlowInfo? origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.get' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - key: GET_VAR 'key: K of .ControlFlowInfo declared in .ControlFlowInfo.get' type=K of .ControlFlowInfo origin=null - FUN DELEGATED_MEMBER name:isEmpty visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.Boolean - overridden: - public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.Map - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun isEmpty (): kotlin.Boolean declared in .ControlFlowInfo' - CALL 'public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.Map' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.isEmpty' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - PROPERTY DELEGATED_MEMBER name:entries visibility:public modality:OPEN [val] - overridden: - public abstract entries: kotlin.collections.Set> - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> - correspondingProperty: PROPERTY DELEGATED_MEMBER name:entries visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.collections.Set> declared in kotlin.collections.Map - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> declared in .ControlFlowInfo' - CALL 'public abstract fun (): kotlin.collections.Set> declared in kotlin.collections.Map' type=kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - PROPERTY DELEGATED_MEMBER name:keys visibility:public modality:OPEN [val] - overridden: - public abstract keys: kotlin.collections.Set - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.collections.Set.ControlFlowInfo> - correspondingProperty: PROPERTY DELEGATED_MEMBER name:keys visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.collections.Set declared in kotlin.collections.Map - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Set.ControlFlowInfo> declared in .ControlFlowInfo' - CALL 'public abstract fun (): kotlin.collections.Set declared in kotlin.collections.Map' type=kotlin.collections.Set.ControlFlowInfo> origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] - overridden: - public abstract size: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in kotlin.collections.Map - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .ControlFlowInfo' - CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.Map' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - PROPERTY DELEGATED_MEMBER name:values visibility:public modality:OPEN [val] - overridden: - public abstract values: kotlin.collections.Collection - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.collections.Collection.ControlFlowInfo> - correspondingProperty: PROPERTY DELEGATED_MEMBER name:values visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.collections.Collection declared in kotlin.collections.Map - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Collection.ControlFlowInfo> declared in .ControlFlowInfo' - CALL 'public abstract fun (): kotlin.collections.Collection declared in kotlin.collections.Map' type=kotlin.collections.Collection.ControlFlowInfo> origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> 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.collections.Map - $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.collections.Map - $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.collections.Map - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:StringFlowInfo modality:FINAL visibility:public superTypes:[.ControlFlowInfo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.StringFlowInfo - CONSTRUCTOR visibility:public <> (map:kotlin.collections.Map) returnType:.StringFlowInfo [primary] - VALUE_PARAMETER name:map index:0 type:kotlin.collections.Map - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (map: kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo>) declared in .ControlFlowInfo' - : kotlin.String - : kotlin.String - map: GET_VAR 'map: kotlin.collections.Map declared in .StringFlowInfo.' type=kotlin.collections.Map origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:StringFlowInfo modality:FINAL visibility:public superTypes:[.ControlFlowInfo]' - FUN name:foo visibility:public modality:FINAL <> ($this:.StringFlowInfo, info:.StringFlowInfo) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.StringFlowInfo - VALUE_PARAMETER name:info index:0 type:.StringFlowInfo - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public open fun (): kotlin.collections.Set declared in .StringFlowInfo' type=kotlin.collections.Set origin=GET_PROPERTY - $this: GET_VAR ': .StringFlowInfo declared in .StringFlowInfo.foo' type=.StringFlowInfo origin=null - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public open fun (): kotlin.collections.Set declared in .StringFlowInfo' type=kotlin.collections.Set origin=GET_PROPERTY - $this: GET_VAR 'info: .StringFlowInfo declared in .StringFlowInfo.foo' type=.StringFlowInfo origin=null - PROPERTY FAKE_OVERRIDE name:map visibility:public modality:FINAL [fake_override,val] - overridden: - public final map: kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.ControlFlowInfo) returnType:kotlin.collections.Map [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:map visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - FUN FAKE_OVERRIDE name:containsKey visibility:public modality:OPEN <> ($this:.ControlFlowInfo, key:kotlin.String) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun containsKey (key: K of .ControlFlowInfo): kotlin.Boolean declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - VALUE_PARAMETER name:key index:0 type:kotlin.String - FUN FAKE_OVERRIDE name:containsValue visibility:public modality:OPEN <> ($this:.ControlFlowInfo, value:kotlin.String) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun containsValue (value: V of .ControlFlowInfo): kotlin.Boolean declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - VALUE_PARAMETER name:value index:0 type:kotlin.String - FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:.ControlFlowInfo, key:kotlin.String) returnType:kotlin.String? [fake_override,operator] - overridden: - public open fun get (key: K of .ControlFlowInfo): V of .ControlFlowInfo? declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - VALUE_PARAMETER name:key index:0 type:kotlin.String - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.Boolean [fake_override] - overridden: - public open fun isEmpty (): kotlin.Boolean declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - PROPERTY FAKE_OVERRIDE name:entries visibility:public modality:OPEN [fake_override,val] - overridden: - public open entries: kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.collections.Set> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:entries visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] - overridden: - public open keys: kotlin.collections.Set.ControlFlowInfo> - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.collections.Set [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.Set.ControlFlowInfo> declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.Int declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] - overridden: - public open values: kotlin.collections.Collection.ControlFlowInfo> - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.collections.Collection [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.Collection.ControlFlowInfo> declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - 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 .ControlFlowInfo - $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 .ControlFlowInfo - $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 .ControlFlowInfo - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/kt43342.fir.kt.txt b/compiler/testData/ir/irText/firProblems/kt43342.fir.kt.txt deleted file mode 100644 index 65a62c7531c..00000000000 --- a/compiler/testData/ir/irText/firProblems/kt43342.fir.kt.txt +++ /dev/null @@ -1,62 +0,0 @@ -open class ControlFlowInfo : Map { - constructor(map: Map) /* primary */ { - super/*Any*/() - /* () */ - - } - - val map: Map - field = map - get - - override fun containsKey(key: K): Boolean { - return .#map.containsKey(key = key) - } - - override fun containsValue(value: V): Boolean { - return .#map.containsValue(value = value) - } - - override operator fun get(key: K): V? { - return .#map.get(key = key) - } - - override fun isEmpty(): Boolean { - return .#map.isEmpty() - } - - override val entries: Set> - override get(): Set> { - return .#map.() - } - - override val keys: Set - override get(): Set { - return .#map.() - } - - override val size: Int - override get(): Int { - return .#map.() - } - - override val values: Collection - override get(): Collection { - return .#map.() - } - -} - -class StringFlowInfo : ControlFlowInfo { - constructor(map: Map) /* primary */ { - super/*ControlFlowInfo*/(map = map) - /* () */ - - } - - fun foo(info: StringFlowInfo) { - .() /*~> Unit */ - info.() /*~> Unit */ - } - -} diff --git a/compiler/testData/ir/irText/firProblems/kt43342.ir.txt b/compiler/testData/ir/irText/firProblems/kt43342.ir.txt index 17b4192ae6b..496800ac187 100644 --- a/compiler/testData/ir/irText/firProblems/kt43342.ir.txt +++ b/compiler/testData/ir/irText/firProblems/kt43342.ir.txt @@ -3,11 +3,6 @@ FILE fqName: fileName:/kt43342.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> TYPE_PARAMETER name:K index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:V index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (map:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo>) returnType:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> [primary] - VALUE_PARAMETER name:map index:0 type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ControlFlowInfo modality:OPEN visibility:public superTypes:[kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo>]' PROPERTY name:map visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final] EXPRESSION_BODY @@ -19,58 +14,11 @@ FILE fqName: fileName:/kt43342.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - PROPERTY DELEGATED_MEMBER name:entries visibility:public modality:OPEN [val] - overridden: - public abstract entries: kotlin.collections.Set> - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> - correspondingProperty: PROPERTY DELEGATED_MEMBER name:entries visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.collections.Set> declared in kotlin.collections.Map - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> declared in .ControlFlowInfo' - CALL 'public abstract fun (): kotlin.collections.Set> declared in kotlin.collections.Map' type=kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - PROPERTY DELEGATED_MEMBER name:keys visibility:public modality:OPEN [val] - overridden: - public abstract keys: kotlin.collections.Set - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.collections.Set.ControlFlowInfo> - correspondingProperty: PROPERTY DELEGATED_MEMBER name:keys visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.collections.Set declared in kotlin.collections.Map - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Set.ControlFlowInfo> declared in .ControlFlowInfo' - CALL 'public abstract fun (): kotlin.collections.Set declared in kotlin.collections.Map' type=kotlin.collections.Set.ControlFlowInfo> origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] - overridden: - public abstract size: kotlin.Int - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in kotlin.collections.Map - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .ControlFlowInfo' - CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.Map' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - PROPERTY DELEGATED_MEMBER name:values visibility:public modality:OPEN [val] - overridden: - public abstract values: kotlin.collections.Collection - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.collections.Collection.ControlFlowInfo> - correspondingProperty: PROPERTY DELEGATED_MEMBER name:values visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.collections.Collection declared in kotlin.collections.Map - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Collection.ControlFlowInfo> declared in .ControlFlowInfo' - CALL 'public abstract fun (): kotlin.collections.Collection declared in kotlin.collections.Map' type=kotlin.collections.Collection.ControlFlowInfo> origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null + CONSTRUCTOR visibility:public <> (map:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo>) returnType:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> [primary] + VALUE_PARAMETER name:map index:0 type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ControlFlowInfo modality:OPEN visibility:public superTypes:[kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo>]' FUN DELEGATED_MEMBER name:containsKey visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>, key:K of .ControlFlowInfo) returnType:kotlin.Boolean overridden: public abstract fun containsKey (key: K of kotlin.collections.Map): kotlin.Boolean declared in kotlin.collections.Map @@ -126,6 +74,58 @@ FILE fqName: fileName:/kt43342.kt overridden: public open fun toString (): kotlin.String declared in kotlin.collections.Map $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY DELEGATED_MEMBER name:entries visibility:public modality:OPEN [val] + overridden: + public abstract entries: kotlin.collections.Set> + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> + correspondingProperty: PROPERTY DELEGATED_MEMBER name:entries visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.collections.Set> declared in kotlin.collections.Map + $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> declared in .ControlFlowInfo' + CALL 'public abstract fun (): kotlin.collections.Set> declared in kotlin.collections.Map' type=kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null + receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null + PROPERTY DELEGATED_MEMBER name:keys visibility:public modality:OPEN [val] + overridden: + public abstract keys: kotlin.collections.Set + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.collections.Set.ControlFlowInfo> + correspondingProperty: PROPERTY DELEGATED_MEMBER name:keys visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.collections.Set declared in kotlin.collections.Map + $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Set.ControlFlowInfo> declared in .ControlFlowInfo' + CALL 'public abstract fun (): kotlin.collections.Set declared in kotlin.collections.Map' type=kotlin.collections.Set.ControlFlowInfo> origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null + receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null + PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] + overridden: + public abstract size: kotlin.Int + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.Int + correspondingProperty: PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in kotlin.collections.Map + $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .ControlFlowInfo' + CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.Map' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null + receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null + PROPERTY DELEGATED_MEMBER name:values visibility:public modality:OPEN [val] + overridden: + public abstract values: kotlin.collections.Collection + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.collections.Collection.ControlFlowInfo> + correspondingProperty: PROPERTY DELEGATED_MEMBER name:values visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.collections.Collection declared in kotlin.collections.Map + $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Collection.ControlFlowInfo> declared in .ControlFlowInfo' + CALL 'public abstract fun (): kotlin.collections.Collection declared in kotlin.collections.Map' type=kotlin.collections.Collection.ControlFlowInfo> origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null + receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null CLASS CLASS name:StringFlowInfo modality:FINAL visibility:public superTypes:[.ControlFlowInfo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.StringFlowInfo CONSTRUCTOR visibility:public <> (map:kotlin.collections.Map) returnType:.StringFlowInfo [primary] @@ -136,56 +136,6 @@ FILE fqName: fileName:/kt43342.kt : kotlin.String map: GET_VAR 'map: kotlin.collections.Map declared in .StringFlowInfo.' type=kotlin.collections.Map origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:StringFlowInfo modality:FINAL visibility:public superTypes:[.ControlFlowInfo]' - FUN name:foo visibility:public modality:FINAL <> ($this:.StringFlowInfo, info:.StringFlowInfo) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.StringFlowInfo - VALUE_PARAMETER name:info index:0 type:.StringFlowInfo - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public open fun (): kotlin.collections.Set declared in .StringFlowInfo' type=kotlin.collections.Set origin=GET_PROPERTY - $this: GET_VAR ': .StringFlowInfo declared in .StringFlowInfo.foo' type=.StringFlowInfo origin=null - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public open fun (): kotlin.collections.Set declared in .StringFlowInfo' type=kotlin.collections.Set origin=GET_PROPERTY - $this: GET_VAR 'info: .StringFlowInfo declared in .StringFlowInfo.foo' type=.StringFlowInfo origin=null - PROPERTY FAKE_OVERRIDE name:map visibility:public modality:FINAL [fake_override,val] - overridden: - public final map: kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.ControlFlowInfo) returnType:kotlin.collections.Map [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:map visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - PROPERTY FAKE_OVERRIDE name:entries visibility:public modality:OPEN [fake_override,val] - overridden: - public open entries: kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.collections.Set> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:entries visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] - overridden: - public open keys: kotlin.collections.Set.ControlFlowInfo> - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.collections.Set [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.Set.ControlFlowInfo> declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open size: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.Int declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo - PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] - overridden: - public open values: kotlin.collections.Collection.ControlFlowInfo> - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.collections.Collection [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.collections.Collection.ControlFlowInfo> declared in .ControlFlowInfo - $this: VALUE_PARAMETER name: type:.ControlFlowInfo FUN FAKE_OVERRIDE name:containsKey visibility:public modality:OPEN <> ($this:.ControlFlowInfo, key:kotlin.String) returnType:kotlin.Boolean [fake_override] overridden: public open fun containsKey (key: K of .ControlFlowInfo): kotlin.Boolean declared in .ControlFlowInfo @@ -218,3 +168,53 @@ FILE fqName: fileName:/kt43342.kt overridden: public open fun toString (): kotlin.String declared in .ControlFlowInfo $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:.StringFlowInfo, info:.StringFlowInfo) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.StringFlowInfo + VALUE_PARAMETER name:info index:0 type:.StringFlowInfo + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun (): kotlin.collections.Set declared in .StringFlowInfo' type=kotlin.collections.Set origin=GET_PROPERTY + $this: GET_VAR ': .StringFlowInfo declared in .StringFlowInfo.foo' type=.StringFlowInfo origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun (): kotlin.collections.Set declared in .StringFlowInfo' type=kotlin.collections.Set origin=GET_PROPERTY + $this: GET_VAR 'info: .StringFlowInfo declared in .StringFlowInfo.foo' type=.StringFlowInfo origin=null + PROPERTY FAKE_OVERRIDE name:entries visibility:public modality:OPEN [fake_override,val] + overridden: + public open entries: kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.collections.Set> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:entries visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> declared in .ControlFlowInfo + $this: VALUE_PARAMETER name: type:.ControlFlowInfo + PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] + overridden: + public open keys: kotlin.collections.Set.ControlFlowInfo> + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.collections.Set [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:keys visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.collections.Set.ControlFlowInfo> declared in .ControlFlowInfo + $this: VALUE_PARAMETER name: type:.ControlFlowInfo + PROPERTY FAKE_OVERRIDE name:map visibility:public modality:FINAL [fake_override,val] + overridden: + public final map: kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.ControlFlowInfo) returnType:kotlin.collections.Map [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:map visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo + $this: VALUE_PARAMETER name: type:.ControlFlowInfo + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.Int declared in .ControlFlowInfo + $this: VALUE_PARAMETER name: type:.ControlFlowInfo + PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] + overridden: + public open values: kotlin.collections.Collection.ControlFlowInfo> + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.ControlFlowInfo) returnType:kotlin.collections.Collection [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:values visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.collections.Collection.ControlFlowInfo> declared in .ControlFlowInfo + $this: VALUE_PARAMETER name: type:.ControlFlowInfo diff --git a/compiler/testData/ir/irText/firProblems/kt43342.kt b/compiler/testData/ir/irText/firProblems/kt43342.kt index 158687b6f92..669e23ff073 100644 --- a/compiler/testData/ir/irText/firProblems/kt43342.kt +++ b/compiler/testData/ir/irText/firProblems/kt43342.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB // IGNORE_BACKEND_K1: JS_IR, JS_IR_ES6 // ^ Map has js specific methods diff --git a/compiler/testData/ir/irText/firProblems/kt43342.kt.txt b/compiler/testData/ir/irText/firProblems/kt43342.kt.txt index eeb4c818051..dc467ac3009 100644 --- a/compiler/testData/ir/irText/firProblems/kt43342.kt.txt +++ b/compiler/testData/ir/irText/firProblems/kt43342.kt.txt @@ -1,13 +1,29 @@ open class ControlFlowInfo : Map { + val map: Map + field = map + get + constructor(map: Map) /* primary */ { super/*Any*/() /* () */ } - val map: Map - field = map - get + override fun containsKey(key: K): Boolean { + return .#map.containsKey(key = key) + } + + override fun containsValue(value: V): Boolean { + return .#map.containsValue(value = value) + } + + override operator fun get(key: K): V? { + return .#map.get(key = key) + } + + override fun isEmpty(): Boolean { + return .#map.isEmpty() + } override val entries: Set> override get(): Set> { @@ -29,22 +45,6 @@ open class ControlFlowInfo : Map { return .#map.() } - override fun containsKey(key: K): Boolean { - return .#map.containsKey(key = key) - } - - override fun containsValue(value: V): Boolean { - return .#map.containsValue(value = value) - } - - override operator fun get(key: K): V? { - return .#map.get(key = key) - } - - override fun isEmpty(): Boolean { - return .#map.isEmpty() - } - } class StringFlowInfo : ControlFlowInfo { @@ -60,3 +60,4 @@ class StringFlowInfo : ControlFlowInfo { } } + diff --git a/compiler/testData/ir/irText/firProblems/kt59102.ir.txt b/compiler/testData/ir/irText/firProblems/kt59102.ir.txt index ceb588e9344..3eaa411cdf3 100644 --- a/compiler/testData/ir/irText/firProblems/kt59102.ir.txt +++ b/compiler/testData/ir/irText/firProblems/kt59102.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/kt59102.kt CLASS CLASS name:XAlign modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.XAlign - CONSTRUCTOR visibility:public <> (bits:kotlin.Long) returnType:.XAlign [primary] - VALUE_PARAMETER name:bits index:0 type:kotlin.Long - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:XAlign modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:bits visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:bits type:kotlin.Long visibility:private [final] EXPRESSION_BODY @@ -24,6 +19,11 @@ FILE fqName: fileName:/kt59102.kt $this: CALL 'public final fun shl (bitCount: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: CONST Int type=kotlin.Int value=1 bitCount: CONST Int type=kotlin.Int value=1 + CONSTRUCTOR visibility:public <> (bits:kotlin.Long) returnType:.XAlign [primary] + VALUE_PARAMETER name:bits index:0 type:kotlin.Long + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:XAlign modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/kt59102.kt.txt b/compiler/testData/ir/irText/firProblems/kt59102.kt.txt index c7b6025330f..987cd8ae482 100644 --- a/compiler/testData/ir/irText/firProblems/kt59102.kt.txt +++ b/compiler/testData/ir/irText/firProblems/kt59102.kt.txt @@ -1,10 +1,4 @@ class XAlign { - constructor(bits: Long) /* primary */ { - super/*Any*/() - /* () */ - - } - val bits: Long field = bits get @@ -13,4 +7,11 @@ class XAlign { this/*XAlign*/(bits = 1.shl(bitCount = 1).toLong()) } + constructor(bits: Long) /* primary */ { + super/*Any*/() + /* () */ + + } + } + diff --git a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.fir.ir.txt b/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.fir.ir.txt deleted file mode 100644 index b1c48e97794..00000000000 --- a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.fir.ir.txt +++ /dev/null @@ -1,113 +0,0 @@ -FILE fqName: fileName:/lambdaInEnumEntryConstructorCall.kt - CLASS CLASS name:Wrapper modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Wrapper - CONSTRUCTOR visibility:public <> (baseUrl:kotlin.String) returnType:.Wrapper [primary] - VALUE_PARAMETER name:baseUrl index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Wrapper modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:baseUrl visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:baseUrl type:kotlin.String visibility:private - EXPRESSION_BODY - GET_VAR 'baseUrl: kotlin.String declared in .Wrapper.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Wrapper) returnType:kotlin.String - correspondingProperty: PROPERTY name:baseUrl visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Wrapper - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Wrapper' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:baseUrl type:kotlin.String visibility:private' type=kotlin.String origin=null - receiver: GET_VAR ': .Wrapper declared in .Wrapper.' type=.Wrapper origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Wrapper, :kotlin.String) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:baseUrl visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Wrapper - VALUE_PARAMETER name: index:0 type:kotlin.String - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:baseUrl type:kotlin.String visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Wrapper declared in .Wrapper.' type=.Wrapper origin=null - value: GET_VAR ': kotlin.String declared in .Wrapper.' type=kotlin.String 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: 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 - CLASS ENUM_CLASS name:ConfigurationParameter modality:FINAL visibility:public superTypes:[kotlin.Enum<.ConfigurationParameter>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ConfigurationParameter - ENUM_ENTRY name:BASE_URL - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (apply: kotlin.Function2.Wrapper, kotlin.Unit>) declared in .ConfigurationParameter' - apply: FUN_EXPR type=kotlin.Function2.Wrapper, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (value:kotlin.String, nc:.Wrapper) returnType:kotlin.Unit - VALUE_PARAMETER name:value index:0 type:kotlin.String - VALUE_PARAMETER name:nc index:1 type:.Wrapper - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null - message: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS - $this: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS - $this: CONST String type=kotlin.String value="Base url updated from config parameters " - other: CALL 'public final fun (): kotlin.String declared in .Wrapper' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR 'nc: .Wrapper declared in .ConfigurationParameter.' type=.Wrapper origin=null - other: CONST String type=kotlin.String value=" -> " - other: GET_VAR 'value: kotlin.String declared in .ConfigurationParameter.' type=kotlin.String origin=null - CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .Wrapper' type=kotlin.Unit origin=EQ - $this: GET_VAR 'nc: .Wrapper declared in .ConfigurationParameter.' type=.Wrapper origin=null - : GET_VAR 'value: kotlin.String declared in .ConfigurationParameter.' type=kotlin.String origin=null - CONSTRUCTOR visibility:private <> (apply:kotlin.Function2.Wrapper, kotlin.Unit>) returnType:.ConfigurationParameter - VALUE_PARAMETER name:apply index:0 type:kotlin.Function2.Wrapper, kotlin.Unit> - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .ConfigurationParameter - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:ConfigurationParameter modality:FINAL visibility:public superTypes:[kotlin.Enum<.ConfigurationParameter>]' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.ConfigurationParameter> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.ConfigurationParameter - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.ConfigurationParameter> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.ConfigurationParameter>, other:.ConfigurationParameter) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.ConfigurationParameter> - VALUE_PARAMETER name:other index:0 type:.ConfigurationParameter - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.ConfigurationParameter>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.ConfigurationParameter> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.ConfigurationParameter>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.ConfigurationParameter> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.ConfigurationParameter>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.ConfigurationParameter> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.ConfigurationParameter>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.ConfigurationParameter> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.ConfigurationParameter>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.ConfigurationParameter> diff --git a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.fir.kt.txt b/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.fir.kt.txt deleted file mode 100644 index 374ed665423..00000000000 --- a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.fir.kt.txt +++ /dev/null @@ -1,36 +0,0 @@ -class Wrapper { - constructor(baseUrl: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - var baseUrl: String - field = baseUrl - get - set - -} - -enum class ConfigurationParameter : Enum { - BASE_URL = ConfigurationParameter(apply = local fun (value: String, nc: Wrapper) { - println(message = "Base url updated from config parameters ".plus(other = nc.()).plus(other = " -> ").plus(other = value)) - nc.( = value) - } -) - - private constructor(apply: Function2) { - super/*Enum*/() - /* () */ - - } - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): ConfigurationParameter /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} - diff --git a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.ir.txt b/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.ir.txt index 12482390901..a3156973182 100644 --- a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.ir.txt +++ b/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/lambdaInEnumEntryConstructorCall.kt CLASS CLASS name:Wrapper modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Wrapper - CONSTRUCTOR visibility:public <> (baseUrl:kotlin.String) returnType:.Wrapper [primary] - VALUE_PARAMETER name:baseUrl index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Wrapper modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:baseUrl visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:baseUrl type:kotlin.String visibility:private EXPRESSION_BODY @@ -25,6 +20,11 @@ FILE fqName: fileName:/lambdaInEnumEntryConstructorCall.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:baseUrl type:kotlin.String visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Wrapper declared in .Wrapper.' type=.Wrapper origin=null value: GET_VAR ': kotlin.String declared in .Wrapper.' type=kotlin.String origin=null + CONSTRUCTOR visibility:public <> (baseUrl:kotlin.String) returnType:.Wrapper [primary] + VALUE_PARAMETER name:baseUrl index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Wrapper modality:FINAL visibility:public 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 declared in kotlin.Any @@ -66,24 +66,11 @@ FILE fqName: fileName:/lambdaInEnumEntryConstructorCall.kt ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' : .ConfigurationParameter INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:ConfigurationParameter modality:FINAL visibility:public superTypes:[kotlin.Enum<.ConfigurationParameter>]' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.ConfigurationParameter>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.ConfigurationParameter> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.ConfigurationParameter>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.ConfigurationParameter> + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.ConfigurationParameter + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.ConfigurationParameter> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.ConfigurationParameter>, other:.ConfigurationParameter) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -102,12 +89,25 @@ FILE fqName: fileName:/lambdaInEnumEntryConstructorCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.ConfigurationParameter> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.ConfigurationParameter> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.ConfigurationParameter - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.ConfigurationParameter> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.ConfigurationParameter>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.ConfigurationParameter> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.ConfigurationParameter>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.ConfigurationParameter> diff --git a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt b/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt index 1762962a3f7..70b652de341 100644 --- a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt +++ b/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB class Wrapper(var baseUrl: String) diff --git a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt.txt b/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt.txt index 374ed665423..3cdfa240902 100644 --- a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt.txt +++ b/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt.txt @@ -1,15 +1,15 @@ class Wrapper { + var baseUrl: String + field = baseUrl + get + set + constructor(baseUrl: String) /* primary */ { super/*Any*/() /* () */ } - var baseUrl: String - field = baseUrl - get - set - } enum class ConfigurationParameter : Enum { @@ -25,10 +25,10 @@ enum class ConfigurationParameter : Enum { } - fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): ConfigurationParameter /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ diff --git a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.ir.txt b/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.ir.txt index c6a50b99436..baceae12894 100644 --- a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.ir.txt +++ b/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.ir.txt @@ -7,10 +7,6 @@ FILE fqName: fileName:/localClassUsedBeforeDeclaration.kt $this: BLOCK type=.box. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box. - CONSTRUCTOR visibility:public <> () returnType:.box. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:.box..A visibility:private [final] EXPRESSION_BODY @@ -26,12 +22,6 @@ FILE fqName: fileName:/localClassUsedBeforeDeclaration.kt receiver: GET_VAR ': .box. declared in .box..' type=.box. origin=null CLASS CLASS name:A modality:FINAL visibility:local [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box..A - CONSTRUCTOR visibility:public <> ($this:.box., ok:kotlin.String) returnType:.box..A [primary] - $outer: VALUE_PARAMETER name: type:.box. - VALUE_PARAMETER name:ok index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:local [inner] superTypes:[kotlin.Any]' PROPERTY name:ok visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -43,6 +33,12 @@ FILE fqName: fileName:/localClassUsedBeforeDeclaration.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .box..A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .box..A declared in .box..A.' type=.box..A origin=null + CONSTRUCTOR visibility:public <> ($this:.box., ok:kotlin.String) returnType:.box..A [primary] + $outer: VALUE_PARAMETER name: type:.box. + VALUE_PARAMETER name:ok index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:local [inner] 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 declared in kotlin.Any @@ -56,6 +52,10 @@ FILE fqName: fileName:/localClassUsedBeforeDeclaration.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:.box. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.kt.txt b/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.kt.txt index 9ee2b9779ab..7b30943d8f1 100644 --- a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.kt.txt +++ b/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.kt.txt @@ -1,26 +1,26 @@ fun box(): String { return { // BLOCK local class { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val a: A field = .A(ok = "OK") get local inner class A { + val ok: String + field = ok + get + constructor(ok: String) /* primary */ { super/*Any*/() /* () */ } - val ok: String - field = ok - get + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ } @@ -29,3 +29,4 @@ fun box(): String { () }.().() } + diff --git a/compiler/testData/ir/irText/firProblems/localCompanion.ir.txt b/compiler/testData/ir/irText/firProblems/localCompanion.ir.txt index 17a729fc6f1..34a49e5e63f 100644 --- a/compiler/testData/ir/irText/firProblems/localCompanion.ir.txt +++ b/compiler/testData/ir/irText/firProblems/localCompanion.ir.txt @@ -3,10 +3,6 @@ FILE fqName: fileName:/localCompanion.kt BLOCK_BODY CLASS CLASS name:Foo modality:FINAL visibility:local superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.runMe.Foo - CONSTRUCTOR visibility:public <> () returnType:.runMe.Foo [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:local superTypes:[kotlin.Any]' CLASS OBJECT name:Companion modality:FINAL visibility:local [companion] superTypes:[kotlin.Any] annotations: Suppress(names = ["WRONG_MODIFIER_CONTAINING_DECLARATION"]) @@ -15,9 +11,6 @@ FILE fqName: fileName:/localCompanion.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:local [companion] superTypes:[kotlin.Any]' - FUN name:bar visibility:public modality:FINAL <> ($this:.runMe.Foo.Companion) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.runMe.Foo.Companion - BLOCK_BODY 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 @@ -31,6 +24,13 @@ FILE fqName: fileName:/localCompanion.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> ($this:.runMe.Foo.Companion) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.runMe.Foo.Companion + BLOCK_BODY + CONSTRUCTOR visibility:public <> () returnType:.runMe.Foo [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:local 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/localCompanion.kt.txt b/compiler/testData/ir/irText/firProblems/localCompanion.kt.txt index fe405b97eab..73a5cbe3059 100644 --- a/compiler/testData/ir/irText/firProblems/localCompanion.kt.txt +++ b/compiler/testData/ir/irText/firProblems/localCompanion.kt.txt @@ -1,11 +1,5 @@ fun runMe() { local class Foo { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - @Suppress(names = ["WRONG_MODIFIER_CONTAINING_DECLARATION"]) local companion object Companion { private constructor() /* primary */ { @@ -19,7 +13,14 @@ fun runMe() { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } Companion.bar() } + diff --git a/compiler/testData/ir/irText/firProblems/noErrorTypeAfterCaptureApproximation.ir.txt b/compiler/testData/ir/irText/firProblems/noErrorTypeAfterCaptureApproximation.ir.txt index da6af5090b7..9f2eaaf1d6f 100644 --- a/compiler/testData/ir/irText/firProblems/noErrorTypeAfterCaptureApproximation.ir.txt +++ b/compiler/testData/ir/irText/firProblems/noErrorTypeAfterCaptureApproximation.ir.txt @@ -39,6 +39,18 @@ FILE fqName: fileName:/noErrorTypeAfterCaptureApproximation.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getSelectOptions visibility:private modality:FINAL (options:.Inv1.getSelectOptions>) returnType:.Inv1.Inv2.getSelectOptions>> + TYPE_PARAMETER name:G index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:options index:0 type:.Inv1.getSelectOptions> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun getSelectOptions (options: .Inv1.getSelectOptions>): .Inv1.Inv2.getSelectOptions>> declared in ' + CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null + FUN name:myRun visibility:public modality:FINAL (callback:kotlin.Function0.myRun>) returnType:T of .myRun + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:callback index:0 type:kotlin.Function0.myRun> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun myRun (callback: kotlin.Function0.myRun>): T of .myRun declared in ' + CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null FUN name:useSelectOptions visibility:internal modality:FINAL (options:.Inv1.useSelectOptions>) returnType:.Inv1.Inv2.useSelectOptions>> TYPE_PARAMETER name:F index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:options index:0 type:.Inv1.useSelectOptions> @@ -53,15 +65,3 @@ FILE fqName: fileName:/noErrorTypeAfterCaptureApproximation.kt CALL 'private final fun getSelectOptions (options: .Inv1.getSelectOptions>): .Inv1.Inv2.getSelectOptions>> declared in ' type=.Inv1.Inv2.useSelectOptions>> origin=null : F of .useSelectOptions options: GET_VAR 'options: .Inv1.useSelectOptions> declared in .useSelectOptions' type=.Inv1.useSelectOptions> origin=null - FUN name:getSelectOptions visibility:private modality:FINAL (options:.Inv1.getSelectOptions>) returnType:.Inv1.Inv2.getSelectOptions>> - TYPE_PARAMETER name:G index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:options index:0 type:.Inv1.getSelectOptions> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun getSelectOptions (options: .Inv1.getSelectOptions>): .Inv1.Inv2.getSelectOptions>> declared in ' - CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null - FUN name:myRun visibility:public modality:FINAL (callback:kotlin.Function0.myRun>) returnType:T of .myRun - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:callback index:0 type:kotlin.Function0.myRun> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun myRun (callback: kotlin.Function0.myRun>): T of .myRun declared in ' - CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null diff --git a/compiler/testData/ir/irText/firProblems/noErrorTypeAfterCaptureApproximation.kt.txt b/compiler/testData/ir/irText/firProblems/noErrorTypeAfterCaptureApproximation.kt.txt index ee55ff01db7..9d32fa940da 100644 --- a/compiler/testData/ir/irText/firProblems/noErrorTypeAfterCaptureApproximation.kt.txt +++ b/compiler/testData/ir/irText/firProblems/noErrorTypeAfterCaptureApproximation.kt.txt @@ -16,13 +16,6 @@ class Inv2 { } -internal fun useSelectOptions(options: Inv1): Inv1> { - return myRun>>(callback = local fun (): Inv1> { - return getSelectOptions(options = options) - } -) -} - private fun getSelectOptions(options: Inv1): Inv1> { return TODO() } @@ -30,3 +23,11 @@ private fun getSelectOptions(options: Inv1): Inv1> fun myRun(callback: Function0): T { return TODO() } + +internal fun useSelectOptions(options: Inv1): Inv1> { + return myRun>>(callback = local fun (): Inv1> { + return getSelectOptions(options = options) + } +) +} + diff --git a/compiler/testData/ir/irText/firProblems/putIfAbsent.fir.ir.txt b/compiler/testData/ir/irText/firProblems/putIfAbsent.fir.ir.txt index 125bec6f4fe..5b58d2bd212 100644 --- a/compiler/testData/ir/irText/firProblems/putIfAbsent.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/putIfAbsent.fir.ir.txt @@ -5,6 +5,19 @@ FILE fqName: fileName:/putIfAbsent.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Owner modality:FINAL visibility:public 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 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:foo visibility:public modality:FINAL ($this:.Owner, x:T of .Owner.foo, y:T of .Owner.foo) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:.Owner @@ -20,16 +33,3 @@ FILE fqName: fileName:/putIfAbsent.kt $this: GET_VAR 'val map: kotlin.collections.MutableMap.Owner.foo, T of .Owner.foo> declared in .Owner.foo' type=kotlin.collections.MutableMap.Owner.foo, T of .Owner.foo> origin=null p0: GET_VAR 'x: T of .Owner.foo declared in .Owner.foo' type=T of .Owner.foo origin=null p1: GET_VAR 'y: T of .Owner.foo declared in .Owner.foo' type=T of .Owner.foo 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/putIfAbsent.ir.txt b/compiler/testData/ir/irText/firProblems/putIfAbsent.ir.txt index 84021f5786c..a9ee7104a95 100644 --- a/compiler/testData/ir/irText/firProblems/putIfAbsent.ir.txt +++ b/compiler/testData/ir/irText/firProblems/putIfAbsent.ir.txt @@ -5,6 +5,19 @@ FILE fqName: fileName:/putIfAbsent.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Owner modality:FINAL visibility:public 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 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:foo visibility:public modality:FINAL ($this:.Owner, x:T of .Owner.foo, y:T of .Owner.foo) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:.Owner @@ -20,16 +33,3 @@ FILE fqName: fileName:/putIfAbsent.kt $this: GET_VAR 'val map: kotlin.collections.MutableMap.Owner.foo, T of .Owner.foo> declared in .Owner.foo' type=kotlin.collections.MutableMap.Owner.foo, T of .Owner.foo> origin=null p0: GET_VAR 'x: T of .Owner.foo declared in .Owner.foo' type=T of .Owner.foo origin=null p1: GET_VAR 'y: T of .Owner.foo declared in .Owner.foo' type=T of .Owner.foo 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.ir.txt b/compiler/testData/ir/irText/firProblems/readWriteProperty.ir.txt index ff1a0b65422..edd82bae133 100644 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.ir.txt +++ b/compiler/testData/ir/irText/firProblems/readWriteProperty.ir.txt @@ -1,23 +1,47 @@ FILE fqName: fileName:/readWriteProperty.kt - CLASS CLASS name:SettingType modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SettingType.SettingType> - TYPE_PARAMETER name:V index:0 variance:out superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:public <> (type:kotlin.reflect.KClass.SettingType>) returnType:.SettingType.SettingType> [primary] - VALUE_PARAMETER name:type index:0 type:kotlin.reflect.KClass.SettingType> + CLASS CLASS name:IdeWizard modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IdeWizard + PROPERTY name:projectTemplate visibility:public modality:FINAL [delegated,var] + FIELD PROPERTY_DELEGATE name:projectTemplate$delegate type:.IdeWizard.setting..SettingType> visibility:private [final] + EXPRESSION_BODY + CALL 'private final fun setting (reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting>): .IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard' type=.IdeWizard.setting..SettingType> origin=null + : kotlin.Int + : .SettingType + $this: GET_VAR ': .IdeWizard declared in .IdeWizard' type=.IdeWizard origin=null + reference: CONSTRUCTOR_CALL 'public constructor (t: T of .SettingReference, v: V of .SettingReference) declared in .SettingReference' type=.SettingReference.SettingType> origin=null + : kotlin.Int + : .SettingType + t: CONSTRUCTOR_CALL 'public constructor (type: kotlin.reflect.KClass.SettingType>) declared in .SettingType' type=.SettingType origin=null + : kotlin.Int + type: GET_CLASS type=kotlin.reflect.KClass + CONST Int type=kotlin.Int value=42 + v: CONST Int type=kotlin.Int value=42 + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IdeWizard) returnType:kotlin.Int? + correspondingProperty: PROPERTY name:projectTemplate visibility:public modality:FINAL [delegated,var] + $this: VALUE_PARAMETER name: type:.IdeWizard + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int? declared in .IdeWizard' + CALL 'public open fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V of .IdeWizard.setting? declared in .IdeWizard.setting.' type=kotlin.Int? origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:projectTemplate$delegate type:.IdeWizard.setting..SettingType> visibility:private [final]' type=.IdeWizard.setting..SettingType> origin=null + receiver: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null + thisRef: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null + property: PROPERTY_REFERENCE 'public final projectTemplate: kotlin.Int?' field=null getter='public final fun (): kotlin.Int? declared in .IdeWizard' setter='public final fun (: kotlin.Int?): kotlin.Unit declared in .IdeWizard' type=kotlin.reflect.KMutableProperty1<.IdeWizard, kotlin.Int?> origin=PROPERTY_REFERENCE_FOR_DELEGATE + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IdeWizard, :kotlin.Int?) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:projectTemplate visibility:public modality:FINAL [delegated,var] + $this: VALUE_PARAMETER name: type:.IdeWizard + VALUE_PARAMETER name: index:0 type:kotlin.Int? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int?): kotlin.Unit declared in .IdeWizard' + CALL 'public open fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of .IdeWizard.setting?): kotlin.Unit declared in .IdeWizard.setting.' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:projectTemplate$delegate type:.IdeWizard.setting..SettingType> visibility:private [final]' type=.IdeWizard.setting..SettingType> origin=null + receiver: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null + thisRef: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null + property: PROPERTY_REFERENCE 'public final projectTemplate: kotlin.Int?' field=null getter='public final fun (): kotlin.Int? declared in .IdeWizard' setter='public final fun (: kotlin.Int?): kotlin.Unit declared in .IdeWizard' type=kotlin.reflect.KMutableProperty1<.IdeWizard, kotlin.Int?> origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': kotlin.Int? declared in .IdeWizard.' type=kotlin.Int? origin=null + CONSTRUCTOR visibility:public <> () returnType:.IdeWizard [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SettingType modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:type visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:type type:kotlin.reflect.KClass.SettingType> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'type: kotlin.reflect.KClass.SettingType> declared in .SettingType.' type=kotlin.reflect.KClass.SettingType> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.SettingType.SettingType>) returnType:kotlin.reflect.KClass.SettingType> - correspondingProperty: PROPERTY name:type visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.SettingType.SettingType> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass.SettingType> declared in .SettingType' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:type type:kotlin.reflect.KClass.SettingType> visibility:private [final]' type=kotlin.reflect.KClass.SettingType> origin=null - receiver: GET_VAR ': .SettingType.SettingType> declared in .SettingType.' type=.SettingType.SettingType> origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IdeWizard modality:FINAL visibility:public 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 declared in kotlin.Any @@ -31,16 +55,73 @@ FILE fqName: fileName:/readWriteProperty.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:setting visibility:private modality:FINAL ($this:.IdeWizard, reference:.SettingReference.IdeWizard.setting, T of .IdeWizard.setting>) returnType:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> + TYPE_PARAMETER name:V index:0 variance: superTypes:[kotlin.Any] reified:false + TYPE_PARAMETER name:T index:1 variance: superTypes:[.SettingType.IdeWizard.setting>] reified:false + $this: VALUE_PARAMETER name: type:.IdeWizard + VALUE_PARAMETER name:reference index:0 type:.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun setting (reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting>): .IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard' + BLOCK type=.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.properties.ReadWriteProperty.IdeWizard.setting?>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> + CONSTRUCTOR visibility:public <> () returnType:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.properties.ReadWriteProperty.IdeWizard.setting?>]' + 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.properties.ReadWriteProperty + $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.properties.ReadWriteProperty + $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.properties.ReadWriteProperty + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:OPEN <> ($this:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting>, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:V of .IdeWizard.setting? [operator] + overridden: + public abstract fun getValue (thisRef: T of kotlin.properties.ReadWriteProperty, property: kotlin.reflect.KProperty<*>): V of kotlin.properties.ReadWriteProperty declared in kotlin.properties.ReadWriteProperty + $this: VALUE_PARAMETER name: type:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V of .IdeWizard.setting? declared in .IdeWizard.setting.' + CALL 'public final fun (): V of .SettingReference declared in .SettingReference' type=V of .IdeWizard.setting origin=GET_PROPERTY + $this: GET_VAR 'reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard.setting' type=.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> origin=null + FUN name:setValue visibility:public modality:OPEN <> ($this:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting>, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>, value:V of .IdeWizard.setting?) returnType:kotlin.Unit [operator] + overridden: + public abstract fun setValue (thisRef: T of kotlin.properties.ReadWriteProperty, property: kotlin.reflect.KProperty<*>, value: V of kotlin.properties.ReadWriteProperty): kotlin.Unit declared in kotlin.properties.ReadWriteProperty + $this: VALUE_PARAMETER name: type:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.reflect.KProperty<*> + VALUE_PARAMETER name:value index:2 type:V of .IdeWizard.setting? + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + 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 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: RETURN type=kotlin.Nothing from='public open fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of .IdeWizard.setting?): kotlin.Unit declared in .IdeWizard.setting.' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + CALL 'public final fun (: T of .SettingReference): kotlin.Unit declared in .SettingReference' type=kotlin.Unit origin=EQ + $this: GET_VAR 'reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard.setting' type=.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> origin=null + : TYPE_OP type=T of .IdeWizard.setting origin=CAST typeOperand=T of .IdeWizard.setting + CONSTRUCTOR_CALL 'public constructor (type: kotlin.reflect.KClass.SettingType>) declared in .SettingType' type=.SettingType.IdeWizard.setting> origin=null + : V of .IdeWizard.setting + type: GET_CLASS type=kotlin.reflect.KClass.IdeWizard.setting> + GET_VAR 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null + CALL 'public final fun (: V of .SettingReference): kotlin.Unit declared in .SettingReference' type=kotlin.Unit origin=EQ + $this: GET_VAR 'reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard.setting' type=.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> origin=null + : GET_VAR 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .IdeWizard.setting.' type=.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> origin=OBJECT_LITERAL CLASS CLASS name:SettingReference modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SettingReference.SettingReference, T of .SettingReference> TYPE_PARAMETER name:V index:0 variance: superTypes:[kotlin.Any] reified:false TYPE_PARAMETER name:T index:1 variance: superTypes:[.SettingType.SettingReference>] reified:false - CONSTRUCTOR visibility:public <> (t:T of .SettingReference, v:V of .SettingReference) returnType:.SettingReference.SettingReference, T of .SettingReference> [primary] - VALUE_PARAMETER name:t index:0 type:T of .SettingReference - VALUE_PARAMETER name:v index:1 type:V of .SettingReference - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SettingReference modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:t visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:t type:T of .SettingReference visibility:private EXPRESSION_BODY @@ -79,125 +160,44 @@ FILE fqName: fileName:/readWriteProperty.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:v type:V of .SettingReference visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .SettingReference.SettingReference, T of .SettingReference> declared in .SettingReference.' type=.SettingReference.SettingReference, T of .SettingReference> origin=null value: GET_VAR ': V of .SettingReference declared in .SettingReference.' type=V of .SettingReference 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: 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 - CLASS CLASS name:IdeWizard modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IdeWizard - CONSTRUCTOR visibility:public <> () returnType:.IdeWizard [primary] + CONSTRUCTOR visibility:public <> (t:T of .SettingReference, v:V of .SettingReference) returnType:.SettingReference.SettingReference, T of .SettingReference> [primary] + VALUE_PARAMETER name:t index:0 type:T of .SettingReference + VALUE_PARAMETER name:v index:1 type:V of .SettingReference BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IdeWizard modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:projectTemplate visibility:public modality:FINAL [delegated,var] - FIELD PROPERTY_DELEGATE name:projectTemplate$delegate type:.IdeWizard.setting..SettingType> visibility:private [final] - EXPRESSION_BODY - CALL 'private final fun setting (reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting>): .IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard' type=.IdeWizard.setting..SettingType> origin=null - : kotlin.Int - : .SettingType - $this: GET_VAR ': .IdeWizard declared in .IdeWizard' type=.IdeWizard origin=null - reference: CONSTRUCTOR_CALL 'public constructor (t: T of .SettingReference, v: V of .SettingReference) declared in .SettingReference' type=.SettingReference.SettingType> origin=null - : kotlin.Int - : .SettingType - t: CONSTRUCTOR_CALL 'public constructor (type: kotlin.reflect.KClass.SettingType>) declared in .SettingType' type=.SettingType origin=null - : kotlin.Int - type: GET_CLASS type=kotlin.reflect.KClass - CONST Int type=kotlin.Int value=42 - v: CONST Int type=kotlin.Int value=42 - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IdeWizard) returnType:kotlin.Int? - correspondingProperty: PROPERTY name:projectTemplate visibility:public modality:FINAL [delegated,var] - $this: VALUE_PARAMETER name: type:.IdeWizard - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int? declared in .IdeWizard' - CALL 'public open fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V of .IdeWizard.setting? declared in .IdeWizard.setting.' type=kotlin.Int? origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:projectTemplate$delegate type:.IdeWizard.setting..SettingType> visibility:private [final]' type=.IdeWizard.setting..SettingType> origin=null - receiver: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null - thisRef: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null - property: PROPERTY_REFERENCE 'public final projectTemplate: kotlin.Int?' field=null getter='public final fun (): kotlin.Int? declared in .IdeWizard' setter='public final fun (: kotlin.Int?): kotlin.Unit declared in .IdeWizard' type=kotlin.reflect.KMutableProperty1<.IdeWizard, kotlin.Int?> origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IdeWizard, :kotlin.Int?) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:projectTemplate visibility:public modality:FINAL [delegated,var] - $this: VALUE_PARAMETER name: type:.IdeWizard - VALUE_PARAMETER name: index:0 type:kotlin.Int? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int?): kotlin.Unit declared in .IdeWizard' - CALL 'public open fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of .IdeWizard.setting?): kotlin.Unit declared in .IdeWizard.setting.' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:projectTemplate$delegate type:.IdeWizard.setting..SettingType> visibility:private [final]' type=.IdeWizard.setting..SettingType> origin=null - receiver: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null - thisRef: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null - property: PROPERTY_REFERENCE 'public final projectTemplate: kotlin.Int?' field=null getter='public final fun (): kotlin.Int? declared in .IdeWizard' setter='public final fun (: kotlin.Int?): kotlin.Unit declared in .IdeWizard' type=kotlin.reflect.KMutableProperty1<.IdeWizard, kotlin.Int?> origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Int? declared in .IdeWizard.' type=kotlin.Int? origin=null - FUN name:setting visibility:private modality:FINAL ($this:.IdeWizard, reference:.SettingReference.IdeWizard.setting, T of .IdeWizard.setting>) returnType:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> - TYPE_PARAMETER name:V index:0 variance: superTypes:[kotlin.Any] reified:false - TYPE_PARAMETER name:T index:1 variance: superTypes:[.SettingType.IdeWizard.setting>] reified:false - $this: VALUE_PARAMETER name: type:.IdeWizard - VALUE_PARAMETER name:reference index:0 type:.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun setting (reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting>): .IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard' - BLOCK type=.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.properties.ReadWriteProperty.IdeWizard.setting?>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> - CONSTRUCTOR visibility:public <> () returnType:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.properties.ReadWriteProperty.IdeWizard.setting?>]' - FUN name:setValue visibility:public modality:OPEN <> ($this:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting>, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>, value:V of .IdeWizard.setting?) returnType:kotlin.Unit [operator] - overridden: - public abstract fun setValue (thisRef: T of kotlin.properties.ReadWriteProperty, property: kotlin.reflect.KProperty<*>, value: V of kotlin.properties.ReadWriteProperty): kotlin.Unit declared in kotlin.properties.ReadWriteProperty - $this: VALUE_PARAMETER name: type:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.reflect.KProperty<*> - VALUE_PARAMETER name:value index:2 type:V of .IdeWizard.setting? - BLOCK_BODY - WHEN type=kotlin.Unit origin=IF - 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 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: RETURN type=kotlin.Nothing from='public open fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of .IdeWizard.setting?): kotlin.Unit declared in .IdeWizard.setting.' - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - CALL 'public final fun (: T of .SettingReference): kotlin.Unit declared in .SettingReference' type=kotlin.Unit origin=EQ - $this: GET_VAR 'reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard.setting' type=.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> origin=null - : TYPE_OP type=T of .IdeWizard.setting origin=CAST typeOperand=T of .IdeWizard.setting - CONSTRUCTOR_CALL 'public constructor (type: kotlin.reflect.KClass.SettingType>) declared in .SettingType' type=.SettingType.IdeWizard.setting> origin=null - : V of .IdeWizard.setting - type: GET_CLASS type=kotlin.reflect.KClass.IdeWizard.setting> - GET_VAR 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null - CALL 'public final fun (: V of .SettingReference): kotlin.Unit declared in .SettingReference' type=kotlin.Unit origin=EQ - $this: GET_VAR 'reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard.setting' type=.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> origin=null - : GET_VAR 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null - FUN name:getValue visibility:public modality:OPEN <> ($this:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting>, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:V of .IdeWizard.setting? [operator] - overridden: - public abstract fun getValue (thisRef: T of kotlin.properties.ReadWriteProperty, property: kotlin.reflect.KProperty<*>): V of kotlin.properties.ReadWriteProperty declared in kotlin.properties.ReadWriteProperty - $this: VALUE_PARAMETER name: type:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.reflect.KProperty<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V of .IdeWizard.setting? declared in .IdeWizard.setting.' - CALL 'public final fun (): V of .SettingReference declared in .SettingReference' type=V of .IdeWizard.setting origin=GET_PROPERTY - $this: GET_VAR 'reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard.setting' type=.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> 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.properties.ReadWriteProperty - $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.properties.ReadWriteProperty - $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.properties.ReadWriteProperty - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .IdeWizard.setting.' type=.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> origin=OBJECT_LITERAL + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SettingReference modality:FINAL visibility:public 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 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 + CLASS CLASS name:SettingType modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SettingType.SettingType> + TYPE_PARAMETER name:V index:0 variance:out superTypes:[kotlin.Any] reified:false + PROPERTY name:type visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:type type:kotlin.reflect.KClass.SettingType> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'type: kotlin.reflect.KClass.SettingType> declared in .SettingType.' type=kotlin.reflect.KClass.SettingType> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.SettingType.SettingType>) returnType:kotlin.reflect.KClass.SettingType> + correspondingProperty: PROPERTY name:type visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.SettingType.SettingType> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass.SettingType> declared in .SettingType' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:type type:kotlin.reflect.KClass.SettingType> visibility:private [final]' type=kotlin.reflect.KClass.SettingType> origin=null + receiver: GET_VAR ': .SettingType.SettingType> declared in .SettingType.' type=.SettingType.SettingType> origin=null + CONSTRUCTOR visibility:public <> (type:kotlin.reflect.KClass.SettingType>) returnType:.SettingType.SettingType> [primary] + VALUE_PARAMETER name:type index:0 type:kotlin.reflect.KClass.SettingType> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SettingType modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.kt.txt b/compiler/testData/ir/irText/firProblems/readWriteProperty.kt.txt index 895e9c43fc1..027f23feb2a 100644 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.kt.txt +++ b/compiler/testData/ir/irText/firProblems/readWriteProperty.kt.txt @@ -1,42 +1,4 @@ -class SettingType { - constructor(type: KClass) /* primary */ { - super/*Any*/() - /* () */ - - } - - val type: KClass - field = type - get - -} - -class SettingReference> { - constructor(t: T, v: V) /* primary */ { - super/*Any*/() - /* () */ - - } - - var t: T - field = t - get - set - - var v: V - field = v - get - set - -} - class IdeWizard { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - var projectTemplate: Int? /* by */ field = .setting>(reference = SettingReference>(t = SettingType(type = 42::class), v = 42)) get(): Int? { @@ -46,6 +8,12 @@ class IdeWizard { return .#projectTemplate$delegate.setValue(thisRef = , property = IdeWizard::projectTemplate, value = ) } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + private fun > setting(reference: SettingReference): { return { // BLOCK local class : ReadWriteProperty { @@ -55,6 +23,10 @@ class IdeWizard { } + override operator fun getValue(thisRef: Any?, property: KProperty<*>): V? { + return reference.() + } + override operator fun setValue(thisRef: Any?, property: KProperty<*>, value: V?) { when { EQEQ(arg0 = value, arg1 = null) -> return Unit @@ -63,10 +35,6 @@ class IdeWizard { reference.( = value) } - override operator fun getValue(thisRef: Any?, property: KProperty<*>): V? { - return reference.() - } - } () @@ -74,3 +42,36 @@ class IdeWizard { } } + +class SettingReference> { + var t: T + field = t + get + set + + var v: V + field = v + get + set + + constructor(t: T, v: V) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class SettingType { + val type: KClass + field = type + get + + constructor(type: KClass) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + diff --git a/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.fir.ir.txt b/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.fir.ir.txt index 94bb06c7178..8cedf3c459d 100644 --- a/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.fir.ir.txt @@ -1,4 +1,56 @@ FILE fqName: fileName:/recursiveCapturedTypeInPropertyReference.kt + CLASS CLASS name:AbstractSymbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AbstractSymbol.AbstractSymbol> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.Recursive.AbstractSymbol>; .Something] reified:false + CONSTRUCTOR visibility:public <> () returnType:.AbstractSymbol.AbstractSymbol> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AbstractSymbol modality:ABSTRACT visibility:public 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 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:foo visibility:public modality:FINAL <> ($this:.AbstractSymbol.AbstractSymbol>, list:kotlin.collections.List) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.AbstractSymbol.AbstractSymbol> + VALUE_PARAMETER name:list index:0 type:kotlin.collections.List + BLOCK_BODY + VAR name:result type:kotlin.collections.List<.AbstractSymbol<*>> [val] + CALL 'public final fun map (transform: kotlin.Function1): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.AbstractSymbol<*>> origin=null + : .Recursive<*> + : .AbstractSymbol<*> + $receiver: CALL 'public final fun filterIsInstance (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.Recursive<*>> origin=null + : .Recursive<*> + $receiver: GET_VAR 'list: kotlin.collections.List declared in .AbstractSymbol.foo' type=kotlin.collections.List origin=null + transform: PROPERTY_REFERENCE 'public abstract symbol: .AbstractSymbol.Recursive>' field=null getter='public abstract fun (): .AbstractSymbol.Recursive> declared in .Recursive' setter=null type=kotlin.reflect.KProperty1<.Recursive<*>, .AbstractSymbol> origin=null + CLASS INTERFACE name:Recursive modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Recursive.Recursive> + TYPE_PARAMETER name:R index:0 variance: superTypes:[.Recursive.Recursive>; .Something] reified:false + 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: 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 + PROPERTY name:symbol visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Recursive.Recursive>) returnType:.AbstractSymbol.Recursive> + correspondingProperty: PROPERTY name:symbol visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.Recursive.Recursive> CLASS INTERFACE name:Something modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Something FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -14,55 +66,3 @@ FILE fqName: fileName:/recursiveCapturedTypeInPropertyReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Recursive modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Recursive.Recursive> - TYPE_PARAMETER name:R index:0 variance: superTypes:[.Recursive.Recursive>; .Something] reified:false - PROPERTY name:symbol visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Recursive.Recursive>) returnType:.AbstractSymbol.Recursive> - correspondingProperty: PROPERTY name:symbol visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Recursive.Recursive> - 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: 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 - CLASS CLASS name:AbstractSymbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AbstractSymbol.AbstractSymbol> - TYPE_PARAMETER name:E index:0 variance: superTypes:[.Recursive.AbstractSymbol>; .Something] reified:false - CONSTRUCTOR visibility:public <> () returnType:.AbstractSymbol.AbstractSymbol> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AbstractSymbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.AbstractSymbol.AbstractSymbol>, list:kotlin.collections.List) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.AbstractSymbol.AbstractSymbol> - VALUE_PARAMETER name:list index:0 type:kotlin.collections.List - BLOCK_BODY - VAR name:result type:kotlin.collections.List<.AbstractSymbol<*>> [val] - CALL 'public final fun map (transform: kotlin.Function1): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.AbstractSymbol<*>> origin=null - : .Recursive<*> - : .AbstractSymbol<*> - $receiver: CALL 'public final fun filterIsInstance (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.Recursive<*>> origin=null - : .Recursive<*> - $receiver: GET_VAR 'list: kotlin.collections.List declared in .AbstractSymbol.foo' type=kotlin.collections.List origin=null - transform: PROPERTY_REFERENCE 'public abstract symbol: .AbstractSymbol.Recursive>' field=null getter='public abstract fun (): .AbstractSymbol.Recursive> declared in .Recursive' setter=null type=kotlin.reflect.KProperty1<.Recursive<*>, .AbstractSymbol> 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.fir.kt.txt b/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.fir.kt.txt index efdd48eb694..a7aed04961d 100644 --- a/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.fir.kt.txt @@ -1,12 +1,3 @@ -interface Something { -} - -interface Recursive where R : Recursive, R : Something { - abstract val symbol: AbstractSymbol - abstract get - -} - abstract class AbstractSymbol where E : Recursive, E : Something { constructor() /* primary */ { super/*Any*/() @@ -19,3 +10,13 @@ abstract class AbstractSymbol where E : Recursive, E : Something { } } + +interface Recursive where R : Recursive, R : Something { + abstract val symbol: AbstractSymbol + abstract get + +} + +interface Something { +} + diff --git a/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.ir.txt b/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.ir.txt index d892da23a9f..86a9a73335b 100644 --- a/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.ir.txt +++ b/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.ir.txt @@ -1,4 +1,56 @@ FILE fqName: fileName:/recursiveCapturedTypeInPropertyReference.kt + CLASS CLASS name:AbstractSymbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AbstractSymbol.AbstractSymbol> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.Recursive.AbstractSymbol>; .Something] reified:false + CONSTRUCTOR visibility:public <> () returnType:.AbstractSymbol.AbstractSymbol> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AbstractSymbol modality:ABSTRACT visibility:public 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 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:foo visibility:public modality:FINAL <> ($this:.AbstractSymbol.AbstractSymbol>, list:kotlin.collections.List) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.AbstractSymbol.AbstractSymbol> + VALUE_PARAMETER name:list index:0 type:kotlin.collections.List + BLOCK_BODY + VAR name:result type:kotlin.collections.List<.AbstractSymbol.Recursive<*>>> [val] + CALL 'public final fun map (transform: kotlin.Function1): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.AbstractSymbol.Recursive<*>>> origin=null + : .Recursive<*> + : .AbstractSymbol.Recursive<*>> + $receiver: CALL 'public final fun filterIsInstance (): kotlin.collections.List<@[NoInfer] R of kotlin.collections.filterIsInstance> declared in kotlin.collections' type=kotlin.collections.List<@[NoInfer] .Recursive<*>> origin=null + : .Recursive<*> + $receiver: GET_VAR 'list: kotlin.collections.List declared in .AbstractSymbol.foo' type=kotlin.collections.List origin=null + transform: PROPERTY_REFERENCE 'public abstract symbol: .AbstractSymbol.Recursive>' field=null getter='public abstract fun (): .AbstractSymbol.Recursive> declared in .Recursive' setter=null type=kotlin.reflect.KProperty1<.Recursive<*>, .AbstractSymbol.Recursive<*>>> origin=null + CLASS INTERFACE name:Recursive modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Recursive.Recursive> + TYPE_PARAMETER name:R index:0 variance: superTypes:[.Recursive.Recursive>; .Something] reified:false + 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: 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 + PROPERTY name:symbol visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Recursive.Recursive>) returnType:.AbstractSymbol.Recursive> + correspondingProperty: PROPERTY name:symbol visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.Recursive.Recursive> CLASS INTERFACE name:Something modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Something FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -14,55 +66,3 @@ FILE fqName: fileName:/recursiveCapturedTypeInPropertyReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Recursive modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Recursive.Recursive> - TYPE_PARAMETER name:R index:0 variance: superTypes:[.Recursive.Recursive>; .Something] reified:false - PROPERTY name:symbol visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Recursive.Recursive>) returnType:.AbstractSymbol.Recursive> - correspondingProperty: PROPERTY name:symbol visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Recursive.Recursive> - 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: 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 - CLASS CLASS name:AbstractSymbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AbstractSymbol.AbstractSymbol> - TYPE_PARAMETER name:E index:0 variance: superTypes:[.Recursive.AbstractSymbol>; .Something] reified:false - CONSTRUCTOR visibility:public <> () returnType:.AbstractSymbol.AbstractSymbol> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AbstractSymbol modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.AbstractSymbol.AbstractSymbol>, list:kotlin.collections.List) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.AbstractSymbol.AbstractSymbol> - VALUE_PARAMETER name:list index:0 type:kotlin.collections.List - BLOCK_BODY - VAR name:result type:kotlin.collections.List<.AbstractSymbol.Recursive<*>>> [val] - CALL 'public final fun map (transform: kotlin.Function1): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.AbstractSymbol.Recursive<*>>> origin=null - : .Recursive<*> - : .AbstractSymbol.Recursive<*>> - $receiver: CALL 'public final fun filterIsInstance (): kotlin.collections.List<@[NoInfer] R of kotlin.collections.filterIsInstance> declared in kotlin.collections' type=kotlin.collections.List<@[NoInfer] .Recursive<*>> origin=null - : .Recursive<*> - $receiver: GET_VAR 'list: kotlin.collections.List declared in .AbstractSymbol.foo' type=kotlin.collections.List origin=null - transform: PROPERTY_REFERENCE 'public abstract symbol: .AbstractSymbol.Recursive>' field=null getter='public abstract fun (): .AbstractSymbol.Recursive> declared in .Recursive' setter=null type=kotlin.reflect.KProperty1<.Recursive<*>, .AbstractSymbol.Recursive<*>>> 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.kt.txt b/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.kt.txt index 0c44d3d3292..0e325df81a3 100644 --- a/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.kt.txt +++ b/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.kt.txt @@ -1,12 +1,3 @@ -interface Something { -} - -interface Recursive where R : Recursive, R : Something { - abstract val symbol: AbstractSymbol - abstract get - -} - abstract class AbstractSymbol where E : Recursive, E : Something { constructor() /* primary */ { super/*Any*/() @@ -19,3 +10,13 @@ abstract class AbstractSymbol where E : Recursive, E : Something { } } + +interface Recursive where R : Recursive, R : Something { + abstract val symbol: AbstractSymbol + abstract get + +} + +interface Something { +} + diff --git a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.ir.txt b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.ir.txt index 0bec149c4d9..664e868061e 100644 --- a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.ir.txt @@ -1,4 +1,44 @@ FILE fqName: fileName:/reflectFindAnnotationOnDefaultMethodParameter.kt + CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann + CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I + 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: 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:m visibility:public modality:OPEN <> ($this:.I, s:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.I + VALUE_PARAMETER name:s index:0 type:kotlin.String + annotations: + Ann + BLOCK_BODY FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:impl type:.box. [val] @@ -9,13 +49,6 @@ FILE fqName: fileName:/reflectFindAnnotationOnDefaultMethodParameter.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.I]' - FUN FAKE_OVERRIDE name:m visibility:public modality:OPEN <> ($this:.I, s:kotlin.String) returnType:kotlin.Unit [fake_override] - overridden: - public open fun m (s: kotlin.String): kotlin.Unit declared in .I - $this: VALUE_PARAMETER name: type:.I - VALUE_PARAMETER name:s index:0 type:kotlin.String - annotations: - Ann 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 .I @@ -25,6 +58,13 @@ FILE fqName: fileName:/reflectFindAnnotationOnDefaultMethodParameter.kt overridden: public open fun hashCode (): kotlin.Int declared in .I $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:m visibility:public modality:OPEN <> ($this:.I, s:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public open fun m (s: kotlin.String): kotlin.Unit declared in .I + $this: VALUE_PARAMETER name: type:.I + VALUE_PARAMETER name:s index:0 type:kotlin.String + annotations: + Ann 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 .I @@ -60,43 +100,3 @@ FILE fqName: fileName:/reflectFindAnnotationOnDefaultMethodParameter.kt STRING_CONCATENATION type=kotlin.String CONST String type=kotlin.String value="ERR: " GET_VAR 'val size: kotlin.Int declared in .box' type=kotlin.Int origin=null - CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann - CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I - FUN name:m visibility:public modality:OPEN <> ($this:.I, s:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.I - VALUE_PARAMETER name:s index:0 type:kotlin.String - annotations: - Ann - BLOCK_BODY - 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.kt.txt b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.kt.txt index 0a692360576..18a75401f0a 100644 --- a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.kt.txt @@ -1,3 +1,18 @@ +open annotation class Ann : Annotation { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface I { + fun m(@Ann s: String) { + } + +} + fun box(): String { val impl: = { // BLOCK local class : I { @@ -20,17 +35,3 @@ fun box(): String { return "ERR: " + size } -open annotation class Ann : Annotation { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -interface I { - fun m(@Ann s: String) { - } - -} diff --git a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.ir.txt b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.ir.txt index 51b5d4e380a..cb69a483b77 100644 --- a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.ir.txt +++ b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.ir.txt @@ -1,4 +1,44 @@ FILE fqName: fileName:/reflectFindAnnotationOnDefaultMethodParameter.kt + CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann + CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann 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 declared in kotlin.Annotation + $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.Annotation + $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.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I + 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: 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:m visibility:public modality:OPEN <> ($this:.I, s:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.I + VALUE_PARAMETER name:s index:0 type:kotlin.String + annotations: + Ann + BLOCK_BODY FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:impl type:.box. [val] @@ -9,13 +49,6 @@ FILE fqName: fileName:/reflectFindAnnotationOnDefaultMethodParameter.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.I]' - FUN FAKE_OVERRIDE name:m visibility:public modality:OPEN <> ($this:.I, s:kotlin.String) returnType:kotlin.Unit [fake_override] - overridden: - public open fun m (s: kotlin.String): kotlin.Unit declared in .I - $this: VALUE_PARAMETER name: type:.I - VALUE_PARAMETER name:s index:0 type:kotlin.String - annotations: - Ann 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 .I @@ -25,6 +58,13 @@ FILE fqName: fileName:/reflectFindAnnotationOnDefaultMethodParameter.kt overridden: public open fun hashCode (): kotlin.Int declared in .I $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:m visibility:public modality:OPEN <> ($this:.I, s:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public open fun m (s: kotlin.String): kotlin.Unit declared in .I + $this: VALUE_PARAMETER name: type:.I + VALUE_PARAMETER name:s index:0 type:kotlin.String + annotations: + Ann 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 .I @@ -66,43 +106,3 @@ FILE fqName: fileName:/reflectFindAnnotationOnDefaultMethodParameter.kt STRING_CONCATENATION type=kotlin.String CONST String type=kotlin.String value="ERR: " GET_VAR 'val size: kotlin.Int declared in .box' type=kotlin.Int origin=null - CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann - CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann 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 declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I - FUN name:m visibility:public modality:OPEN <> ($this:.I, s:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.I - VALUE_PARAMETER name:s index:0 type:kotlin.String - annotations: - Ann - BLOCK_BODY - 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.kt.txt b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.kt.txt index 2af8d94831c..aeef94335df 100644 --- a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.kt.txt +++ b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.kt.txt @@ -1,3 +1,18 @@ +open annotation class Ann : Annotation { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface I { + fun m(@Ann s: String) { + } + +} + fun box(): String { val impl: = { // BLOCK local class : I { @@ -20,17 +35,3 @@ fun box(): String { return "ERR: " + size } -open annotation class Ann : Annotation { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -interface I { - fun m(@Ann s: String) { - } - -} diff --git a/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.ir.txt b/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.ir.txt index 9bbdb1031bd..d4b10082e58 100644 --- a/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.ir.txt +++ b/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.ir.txt @@ -1,6 +1,34 @@ FILE fqName: fileName:/reflectGetOnNullableTypeAlias.kt - TYPEALIAS name:PropAlias visibility:private expandedType:kotlin.reflect.KProperty1.PropAlias, kotlin.Any?>? - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo + PROPERTY name:bar visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="OK" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Foo) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Foo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Foo' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Foo declared in .Foo.' type=.Foo origin=null + CONSTRUCTOR visibility:public <> () returnType:.Foo [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public 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 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:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:backRefProp type:kotlin.reflect.KProperty1<.Foo, kotlin.Any?>? [val] @@ -19,33 +47,5 @@ FILE fqName: fileName:/reflectGetOnNullableTypeAlias.kt receiver: CONSTRUCTOR_CALL 'public constructor () declared in .Foo' type=.Foo origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CONST String type=kotlin.String value="FAIL" - CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo - CONSTRUCTOR visibility:public <> () returnType:.Foo [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:bar visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final] - EXPRESSION_BODY - CONST String type=kotlin.String value="OK" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Foo) returnType:kotlin.String - correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Foo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Foo' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Foo declared in .Foo.' type=.Foo 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: 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 + TYPEALIAS name:PropAlias visibility:private expandedType:kotlin.reflect.KProperty1.PropAlias, kotlin.Any?>? + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false diff --git a/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.kt.txt b/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.kt.txt index 46c4468832b..fb343437116 100644 --- a/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.kt.txt +++ b/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.kt.txt @@ -1,4 +1,16 @@ -private typealias PropAlias = KProperty1? +class Foo { + val bar: String + field = "OK" + get + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + fun box(): String { val backRefProp: KProperty1? = Foo::bar when { @@ -9,15 +21,4 @@ fun box(): String { return "FAIL" } -class Foo { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - val bar: String - field = "OK" - get - -} +private typealias PropAlias = KProperty1? diff --git a/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.ir.txt b/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.ir.txt index 1360af5f40a..40d5ccde373 100644 --- a/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.ir.txt @@ -1,49 +1,43 @@ FILE fqName: fileName:/substitutionOverrideWithDelegate.kt - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Unit declared in ' - CALL 'public open fun invoke (): kotlin.Unit declared in .DelegatedB' type=kotlin.Unit origin=null - $this: CONSTRUCTOR_CALL 'public constructor () declared in .DelegatedB' type=.DelegatedB origin=null - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - FUN name:invoke visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.A + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.B.C>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> + TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.C.C> [primary] BLOCK_BODY - FUN name:invoke visibility:public modality:OPEN <> ($this:.A, value:kotlin.String) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun invoke (value: kotlin.String): kotlin.Unit declared in .A' - CALL 'public final fun bar (value: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR ': .A declared in .A.invoke' type=.A origin=null - value: GET_VAR 'value: kotlin.String declared in .A.invoke' type=kotlin.String origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.B.C>]' 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 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B $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 + public open fun hashCode (): kotlin.Int declared in .B $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override,operator] + overridden: + public open fun invoke (): kotlin.Unit declared in .B + $this: VALUE_PARAMETER name: type:.A + FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A, value:kotlin.String) returnType:kotlin.Unit [fake_override,operator] + overridden: + public open fun invoke (value: kotlin.String): kotlin.Unit declared in .B + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:value index:0 type:kotlin.String 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 + public open fun toString (): kotlin.String declared in .B $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:bar visibility:public modality:FINAL <> ($receiver:.A, value:kotlin.String) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY CLASS CLASS name:DelegatedB modality:OPEN visibility:public superTypes:[.B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DelegatedB - CONSTRUCTOR visibility:public <> () returnType:.DelegatedB [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegatedB modality:OPEN visibility:public superTypes:[.B]' FIELD DELEGATE name:$$delegate_0 type:.C visibility:private [final] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null : kotlin.String + CONSTRUCTOR visibility:public <> () returnType:.DelegatedB [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegatedB modality:OPEN visibility:public superTypes:[.B]' FUN DELEGATED_MEMBER name:invoke visibility:public modality:OPEN <> ($this:.DelegatedB) returnType:kotlin.Unit [operator] overridden: public open fun invoke (): kotlin.Unit declared in .B @@ -75,18 +69,35 @@ FILE fqName: fileName:/substitutionOverrideWithDelegate.kt overridden: public open fun toString (): kotlin.String declared in .B $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + 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: 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:invoke visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + FUN name:invoke visibility:public modality:OPEN <> ($this:.A, value:kotlin.String) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun invoke (value: kotlin.String): kotlin.Unit declared in .A' + CALL 'public final fun bar (value: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $receiver: GET_VAR ': .A declared in .A.invoke' type=.A origin=null + value: GET_VAR 'value: kotlin.String declared in .A.invoke' type=kotlin.String origin=null CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B.B> TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false - FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override,operator] - overridden: - public open fun invoke (): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.A - FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A, value:kotlin.String) returnType:kotlin.Unit [fake_override,operator] - overridden: - public open fun invoke (value: kotlin.String): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:value index:0 type:kotlin.String 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 .A @@ -96,36 +107,25 @@ FILE fqName: fileName:/substitutionOverrideWithDelegate.kt overridden: public open fun hashCode (): kotlin.Int declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override,operator] + overridden: + public open fun invoke (): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.A + FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A, value:kotlin.String) returnType:kotlin.Unit [fake_override,operator] + overridden: + public open fun invoke (value: kotlin.String): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:value index:0 type:kotlin.String 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 .A $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.B.C>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> - TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.C.C> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.B.C>]' - FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override,operator] - overridden: - public open fun invoke (): kotlin.Unit declared in .B - $this: VALUE_PARAMETER name: type:.A - FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A, value:kotlin.String) returnType:kotlin.Unit [fake_override,operator] - overridden: - public open fun invoke (value: kotlin.String): kotlin.Unit declared in .B - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:value index:0 type:kotlin.String - 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 .B - $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 .B - $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 .B - $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> ($receiver:.A, value:kotlin.String) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Unit declared in ' + CALL 'public open fun invoke (): kotlin.Unit declared in .DelegatedB' type=kotlin.Unit origin=null + $this: CONSTRUCTOR_CALL 'public constructor () declared in .DelegatedB' type=.DelegatedB origin=null diff --git a/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.kt.txt b/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.kt.txt index 97052cc8939..40c69be8efd 100644 --- a/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.kt.txt @@ -1,5 +1,28 @@ -fun foo() { - return DelegatedB().invoke() +class C : B { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +open class DelegatedB : B { + private /* final field */ val $$delegate_0: C = C() + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override operator fun invoke() { + .#$$delegate_0.invoke() + } + + override operator fun invoke(value: String) { + .#$$delegate_0.invoke(value = value) + } + } interface A { @@ -12,36 +35,13 @@ interface A { } -fun A.bar(value: String) { -} - -open class DelegatedB : B { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: C = C() - override operator fun invoke() { - .#$$delegate_0.invoke() - } - - override operator fun invoke(value: String) { - .#$$delegate_0.invoke(value = value) - } - -} - interface B : A { } -class C : B { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - +fun A.bar(value: String) { +} + +fun foo() { + return DelegatedB().invoke() } diff --git a/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.ir.txt b/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.ir.txt index 73b9be947fb..4feae38dd14 100644 --- a/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.ir.txt +++ b/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.ir.txt @@ -1,49 +1,43 @@ FILE fqName: fileName:/substitutionOverrideWithDelegate.kt - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Unit declared in ' - CALL 'public open fun invoke (): kotlin.Unit declared in .DelegatedB' type=kotlin.Unit origin=INVOKE - $this: CONSTRUCTOR_CALL 'public constructor () declared in .DelegatedB' type=.DelegatedB origin=null - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - FUN name:invoke visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.A + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.B.C>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> + TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.C.C> [primary] BLOCK_BODY - FUN name:invoke visibility:public modality:OPEN <> ($this:.A, value:kotlin.String) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun invoke (value: kotlin.String): kotlin.Unit declared in .A' - CALL 'public final fun bar (value: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR ': .A declared in .A.invoke' type=.A origin=null - value: GET_VAR 'value: kotlin.String declared in .A.invoke' type=kotlin.String origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.B.C>]' 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 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B $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 + public open fun hashCode (): kotlin.Int declared in .B $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override,operator] + overridden: + public open fun invoke (): kotlin.Unit declared in .B + $this: VALUE_PARAMETER name: type:.A + FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A, value:kotlin.String) returnType:kotlin.Unit [fake_override,operator] + overridden: + public open fun invoke (value: kotlin.String): kotlin.Unit declared in .B + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:value index:0 type:kotlin.String 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 + public open fun toString (): kotlin.String declared in .B $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:bar visibility:public modality:FINAL <> ($receiver:.A, value:kotlin.String) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY CLASS CLASS name:DelegatedB modality:OPEN visibility:public superTypes:[.B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DelegatedB - CONSTRUCTOR visibility:public <> () returnType:.DelegatedB [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegatedB modality:OPEN visibility:public superTypes:[.B]' FIELD DELEGATE name:$$delegate_0 type:.C visibility:private [final] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null : kotlin.String + CONSTRUCTOR visibility:public <> () returnType:.DelegatedB [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegatedB modality:OPEN visibility:public superTypes:[.B]' FUN DELEGATED_MEMBER name:invoke visibility:public modality:OPEN <> ($this:.DelegatedB) returnType:kotlin.Unit [operator] overridden: public open fun invoke (): kotlin.Unit declared in .B @@ -75,18 +69,35 @@ FILE fqName: fileName:/substitutionOverrideWithDelegate.kt overridden: public open fun toString (): kotlin.String declared in .B $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + 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: 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:invoke visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + FUN name:invoke visibility:public modality:OPEN <> ($this:.A, value:kotlin.String) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun invoke (value: kotlin.String): kotlin.Unit declared in .A' + CALL 'public final fun bar (value: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $receiver: GET_VAR ': .A declared in .A.invoke' type=.A origin=null + value: GET_VAR 'value: kotlin.String declared in .A.invoke' type=kotlin.String origin=null CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B.B> TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false - FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override,operator] - overridden: - public open fun invoke (): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.A - FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A, value:kotlin.String) returnType:kotlin.Unit [fake_override,operator] - overridden: - public open fun invoke (value: kotlin.String): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:value index:0 type:kotlin.String 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 .A @@ -96,36 +107,25 @@ FILE fqName: fileName:/substitutionOverrideWithDelegate.kt overridden: public open fun hashCode (): kotlin.Int declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override,operator] + overridden: + public open fun invoke (): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.A + FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A, value:kotlin.String) returnType:kotlin.Unit [fake_override,operator] + overridden: + public open fun invoke (value: kotlin.String): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:value index:0 type:kotlin.String 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 .A $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.B.C>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> - TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.C.C> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.B.C>]' - FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override,operator] - overridden: - public open fun invoke (): kotlin.Unit declared in .B - $this: VALUE_PARAMETER name: type:.A - FUN FAKE_OVERRIDE name:invoke visibility:public modality:OPEN <> ($this:.A, value:kotlin.String) returnType:kotlin.Unit [fake_override,operator] - overridden: - public open fun invoke (value: kotlin.String): kotlin.Unit declared in .B - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:value index:0 type:kotlin.String - 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 .B - $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 .B - $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 .B - $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> ($receiver:.A, value:kotlin.String) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Unit declared in ' + CALL 'public open fun invoke (): kotlin.Unit declared in .DelegatedB' type=kotlin.Unit origin=INVOKE + $this: CONSTRUCTOR_CALL 'public constructor () declared in .DelegatedB' type=.DelegatedB origin=null diff --git a/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.kt.txt b/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.kt.txt index b36cf6e79f1..40c69be8efd 100644 --- a/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.kt.txt +++ b/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.kt.txt @@ -1,5 +1,28 @@ -fun foo() { - return DelegatedB().invoke() +class C : B { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +open class DelegatedB : B { + private /* final field */ val $$delegate_0: C = C() + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override operator fun invoke() { + .#$$delegate_0.invoke() + } + + override operator fun invoke(value: String) { + .#$$delegate_0.invoke(value = value) + } + } interface A { @@ -12,35 +35,13 @@ interface A { } -fun A.bar(value: String) { -} - -open class DelegatedB : B { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: C = C() - override operator fun invoke() { - .#$$delegate_0.invoke() - } - - override operator fun invoke(value: String) { - .#$$delegate_0.invoke(value = value) - } - -} - interface B : A { } -class C : B { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - +fun A.bar(value: String) { } + +fun foo() { + return DelegatedB().invoke() +} + diff --git a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.fir.ir.txt b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.fir.ir.txt deleted file mode 100644 index a827b6ffd79..00000000000 --- a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.fir.ir.txt +++ /dev/null @@ -1,72 +0,0 @@ -FILE fqName: fileName:/thisInEnumConstructor.kt - CLASS ENUM_CLASS name:EE modality:FINAL visibility:public superTypes:[kotlin.Enum<.EE>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.EE - CONSTRUCTOR visibility:private <> (myName:kotlin.String) returnType:.EE [primary] - VALUE_PARAMETER name:myName index:0 type:kotlin.String - EXPRESSION_BODY - CALL 'public final fun lowercase (): kotlin.String declared in kotlin.text' type=kotlin.String origin=null - $receiver: CALL 'public open fun toString (): kotlin.String declared in kotlin.Enum.Companion' type=kotlin.String origin=null - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=kotlin.Enum.Companion - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .EE - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:EE modality:FINAL visibility:public superTypes:[kotlin.Enum<.EE>]' - PROPERTY name:myName visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:myName type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'myName: kotlin.String declared in .EE.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.EE) returnType:kotlin.String - correspondingProperty: PROPERTY name:myName visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.EE - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .EE' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:myName type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .EE declared in .EE.' type=.EE origin=null - ENUM_ENTRY name:ENTRY - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (myName: kotlin.String) declared in .EE' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.EE> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.EE - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.EE> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.EE>, other:.EE) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.EE> - VALUE_PARAMETER name:other index:0 type:.EE - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.EE>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.EE> - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.EE>) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.EE> - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.EE>) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.EE> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.EE>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.EE> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.EE>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.EE> diff --git a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.fir.kt.txt b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.fir.kt.txt deleted file mode 100644 index 4ca6b1fb93f..00000000000 --- a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.fir.kt.txt +++ /dev/null @@ -1,22 +0,0 @@ -enum class EE : Enum { - private constructor(myName: String = Companion.toString().lowercase()) /* primary */ { - super/*Enum*/() - /* () */ - - } - - val myName: String - field = myName - get - - ENTRY = EE() - - fun values(): Array /* Synthetic body for ENUM_VALUES */ - - fun valueOf(value: String): EE /* Synthetic body for ENUM_VALUEOF */ - - val entries: EnumEntries - get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ - -} - diff --git a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.ir.txt b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.ir.txt index 1951b4841ec..df9f3fc3f9d 100644 --- a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.ir.txt +++ b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.ir.txt @@ -1,16 +1,6 @@ FILE fqName: fileName:/thisInEnumConstructor.kt CLASS ENUM_CLASS name:EE modality:FINAL visibility:public superTypes:[kotlin.Enum<.EE>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.EE - CONSTRUCTOR visibility:private <> (myName:kotlin.String) returnType:.EE [primary] - VALUE_PARAMETER name:myName index:0 type:kotlin.String - EXPRESSION_BODY - CALL 'public final fun lowercase (): kotlin.String declared in kotlin.text' type=kotlin.String origin=null - $receiver: CALL 'public open fun toString (): kotlin.String declared in kotlin.Enum.Companion' type=kotlin.String origin=null - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=kotlin.Enum.Companion - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .EE - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:EE modality:FINAL visibility:public superTypes:[kotlin.Enum<.EE>]' PROPERTY name:myName visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:myName type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -25,24 +15,21 @@ FILE fqName: fileName:/thisInEnumConstructor.kt ENUM_ENTRY name:ENTRY init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor (myName: kotlin.String) declared in .EE' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.EE>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.EE> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.EE>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.EE> + CONSTRUCTOR visibility:private <> (myName:kotlin.String) returnType:.EE [primary] + VALUE_PARAMETER name:myName index:0 type:kotlin.String + EXPRESSION_BODY + CALL 'public final fun lowercase (): kotlin.String declared in kotlin.text' type=kotlin.String origin=null + $receiver: CALL 'public open fun toString (): kotlin.String declared in kotlin.Enum.Companion' type=kotlin.String origin=null + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=kotlin.Enum.Companion + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .EE + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:EE modality:FINAL visibility:public superTypes:[kotlin.Enum<.EE>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.EE + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.EE> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.EE>, other:.EE) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -61,12 +48,25 @@ FILE fqName: fileName:/thisInEnumConstructor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.EE> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.EE> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.EE - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.EE> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.EE>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.EE> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.EE>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.EE> diff --git a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt index 84cac19ce8d..92eb1e82903 100644 --- a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt +++ b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB enum class EE(val myName: String = this.toString().lowercase()) { diff --git a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt.txt b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt.txt index 4ca6b1fb93f..20e5aa3b280 100644 --- a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt.txt +++ b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt.txt @@ -1,20 +1,20 @@ enum class EE : Enum { - private constructor(myName: String = Companion.toString().lowercase()) /* primary */ { - super/*Enum*/() - /* () */ - - } - val myName: String field = myName get ENTRY = EE() - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor(myName: String = Companion.toString().lowercase()) /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): EE /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ diff --git a/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.ir.txt b/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.ir.txt index 7af7efe9fa8..746b5978087 100644 --- a/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.ir.txt @@ -1,4 +1,121 @@ FILE fqName: fileName:/timesInBuilder.kt + PROPERTY name:spentTime visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:spentTime type:.Column visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun integer (name: kotlin.String): .Column declared in ' type=.Column origin=null + name: CONST String type=kotlin.String value="spentTime" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Column + correspondingProperty: PROPERTY name:spentTime visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .Column declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:spentTime type:.Column visibility:private [final,static]' type=.Column origin=null + CLASS CLASS name:ArgumentsBuilder modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArgumentsBuilder + PROPERTY name:arguments visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:arguments type:kotlin.collections.MutableList<.Expression> visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun mutableListOf (): kotlin.collections.MutableList declared in kotlin.collections' type=kotlin.collections.MutableList<.Expression> origin=null + : .Expression + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.ArgumentsBuilder) returnType:kotlin.collections.MutableList<.Expression> + correspondingProperty: PROPERTY name:arguments visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.ArgumentsBuilder + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.MutableList<.Expression> declared in .ArgumentsBuilder' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:arguments type:kotlin.collections.MutableList<.Expression> visibility:private [final]' type=kotlin.collections.MutableList<.Expression> origin=null + receiver: GET_VAR ': .ArgumentsBuilder declared in .ArgumentsBuilder.' type=.ArgumentsBuilder origin=null + CONSTRUCTOR visibility:public <> () returnType:.ArgumentsBuilder [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ArgumentsBuilder modality:FINAL visibility:public 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 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:unaryPlus visibility:public modality:FINAL <> ($this:.ArgumentsBuilder, $receiver:.Expression) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.ArgumentsBuilder + $receiver: VALUE_PARAMETER name: type:.Expression + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null + $this: CALL 'public final fun (): kotlin.collections.MutableList<.Expression> declared in .ArgumentsBuilder' type=kotlin.collections.MutableList<.Expression> origin=GET_PROPERTY + $this: GET_VAR ': .ArgumentsBuilder declared in .ArgumentsBuilder.unaryPlus' type=.ArgumentsBuilder origin=null + element: GET_VAR ': .Expression declared in .ArgumentsBuilder.unaryPlus' type=.Expression origin=null + CLASS CLASS name:Column modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Column + CONSTRUCTOR visibility:public <> () returnType:.Column [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Column modality:FINAL visibility:public 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 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 + CLASS CLASS name:Expression modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expression + CONSTRUCTOR visibility:public <> () returnType:.Expression [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Expression modality:FINAL visibility:public 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 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:countIssues visibility:private modality:FINAL <> (restrictionsBuilder:@[ExtensionFunctionType] kotlin.Function1<.ArgumentsBuilder, kotlin.Unit>) returnType:kotlin.Unit + VALUE_PARAMETER name:restrictionsBuilder index:0 type:@[ExtensionFunctionType] kotlin.Function1<.ArgumentsBuilder, kotlin.Unit> + BLOCK_BODY + FUN name:id visibility:public modality:FINAL (arg:I of .id) returnType:I of .id + TYPE_PARAMETER name:I index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:arg index:0 type:I of .id + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun id (arg: I of .id): I of .id declared in ' + GET_VAR 'arg: I of .id declared in .id' type=I of .id origin=null + FUN name:integer visibility:public modality:FINAL <> (name:kotlin.String) returnType:.Column + VALUE_PARAMETER name:name index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun integer (name: kotlin.String): .Column declared in ' + CONSTRUCTOR_CALL 'public constructor () declared in .Column' type=.Column origin=null + FUN name:lessEq visibility:public modality:FINAL ($receiver:.Column, t:T of .lessEq) returnType:.Expression [infix] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Comparable.lessEq>] reified:false + $receiver: VALUE_PARAMETER name: type:.Column + VALUE_PARAMETER name:t index:0 type:T of .lessEq + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun lessEq (t: T of .lessEq): .Expression declared in ' + CONSTRUCTOR_CALL 'public constructor () declared in .Expression' type=.Expression origin=null + FUN name:select visibility:public modality:FINAL ($receiver:.Column, t:T of .select, r:T of .select) returnType:.Expression + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Comparable.select>] reified:false + $receiver: VALUE_PARAMETER name: type:.Column + VALUE_PARAMETER name:t index:0 type:T of .select + VALUE_PARAMETER name:r index:1 type:T of .select + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun select (t: T of .select, r: T of .select): .Expression declared in ' + CONSTRUCTOR_CALL 'public constructor () declared in .Expression' type=.Expression origin=null FUN name:test visibility:private modality:FINAL <> (x:kotlin.Long) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Long BLOCK_BODY @@ -36,120 +153,3 @@ FILE fqName: fileName:/timesInBuilder.kt $this: CONST Int type=kotlin.Int value=2 other: CONST Int type=kotlin.Int value=60 r: GET_VAR 'x: kotlin.Long declared in .test' type=kotlin.Long origin=null - PROPERTY name:spentTime visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:spentTime type:.Column visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun integer (name: kotlin.String): .Column declared in ' type=.Column origin=null - name: CONST String type=kotlin.String value="spentTime" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Column - correspondingProperty: PROPERTY name:spentTime visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .Column declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:spentTime type:.Column visibility:private [final,static]' type=.Column origin=null - FUN name:integer visibility:public modality:FINAL <> (name:kotlin.String) returnType:.Column - VALUE_PARAMETER name:name index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun integer (name: kotlin.String): .Column declared in ' - CONSTRUCTOR_CALL 'public constructor () declared in .Column' type=.Column origin=null - FUN name:id visibility:public modality:FINAL (arg:I of .id) returnType:I of .id - TYPE_PARAMETER name:I index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:arg index:0 type:I of .id - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun id (arg: I of .id): I of .id declared in ' - GET_VAR 'arg: I of .id declared in .id' type=I of .id origin=null - FUN name:lessEq visibility:public modality:FINAL ($receiver:.Column, t:T of .lessEq) returnType:.Expression [infix] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Comparable.lessEq>] reified:false - $receiver: VALUE_PARAMETER name: type:.Column - VALUE_PARAMETER name:t index:0 type:T of .lessEq - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun lessEq (t: T of .lessEq): .Expression declared in ' - CONSTRUCTOR_CALL 'public constructor () declared in .Expression' type=.Expression origin=null - FUN name:select visibility:public modality:FINAL ($receiver:.Column, t:T of .select, r:T of .select) returnType:.Expression - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Comparable.select>] reified:false - $receiver: VALUE_PARAMETER name: type:.Column - VALUE_PARAMETER name:t index:0 type:T of .select - VALUE_PARAMETER name:r index:1 type:T of .select - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun select (t: T of .select, r: T of .select): .Expression declared in ' - CONSTRUCTOR_CALL 'public constructor () declared in .Expression' type=.Expression origin=null - CLASS CLASS name:Expression modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expression - CONSTRUCTOR visibility:public <> () returnType:.Expression [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Expression modality:FINAL visibility:public 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 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 - CLASS CLASS name:Column modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Column - CONSTRUCTOR visibility:public <> () returnType:.Column [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Column modality:FINAL visibility:public 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 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 - CLASS CLASS name:ArgumentsBuilder modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArgumentsBuilder - CONSTRUCTOR visibility:public <> () returnType:.ArgumentsBuilder [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ArgumentsBuilder modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:arguments visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:arguments type:kotlin.collections.MutableList<.Expression> visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun mutableListOf (): kotlin.collections.MutableList declared in kotlin.collections' type=kotlin.collections.MutableList<.Expression> origin=null - : .Expression - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.ArgumentsBuilder) returnType:kotlin.collections.MutableList<.Expression> - correspondingProperty: PROPERTY name:arguments visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.ArgumentsBuilder - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.MutableList<.Expression> declared in .ArgumentsBuilder' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:arguments type:kotlin.collections.MutableList<.Expression> visibility:private [final]' type=kotlin.collections.MutableList<.Expression> origin=null - receiver: GET_VAR ': .ArgumentsBuilder declared in .ArgumentsBuilder.' type=.ArgumentsBuilder origin=null - FUN name:unaryPlus visibility:public modality:FINAL <> ($this:.ArgumentsBuilder, $receiver:.Expression) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.ArgumentsBuilder - $receiver: VALUE_PARAMETER name: type:.Expression - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null - $this: CALL 'public final fun (): kotlin.collections.MutableList<.Expression> declared in .ArgumentsBuilder' type=kotlin.collections.MutableList<.Expression> origin=GET_PROPERTY - $this: GET_VAR ': .ArgumentsBuilder declared in .ArgumentsBuilder.unaryPlus' type=.ArgumentsBuilder origin=null - element: GET_VAR ': .Expression declared in .ArgumentsBuilder.unaryPlus' type=.Expression 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: 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:countIssues visibility:private modality:FINAL <> (restrictionsBuilder:@[ExtensionFunctionType] kotlin.Function1<.ArgumentsBuilder, kotlin.Unit>) returnType:kotlin.Unit - VALUE_PARAMETER name:restrictionsBuilder index:0 type:@[ExtensionFunctionType] kotlin.Function1<.ArgumentsBuilder, kotlin.Unit> - BLOCK_BODY diff --git a/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.kt.txt b/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.kt.txt index 324b8e1547b..53dbab97df8 100644 --- a/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.kt.txt @@ -1,39 +1,22 @@ -private fun test(x: Long) { - return countIssues(restrictionsBuilder = local fun ArgumentsBuilder.() { - ($this$countIssues, ().lessEq(t = 2.times(other = 60))).unaryPlus() - ($this$countIssues, ().lessEq(t = id(arg = 2.times(other = 60)))).unaryPlus() - ($this$countIssues, ().select(t = 2.times(other = 60).toLong(), r = x)).unaryPlus() - } -) -} - val spentTime: Column field = integer(name = "spentTime") get -fun integer(name: String): Column { - return Column() -} +class ArgumentsBuilder { + val arguments: MutableList + field = mutableListOf() + get -fun id(arg: I): I { - return arg -} - -infix fun > Column.lessEq(t: T): Expression { - return Expression() -} - -fun > Column.select(t: T, r: T): Expression { - return Expression() -} - -class Expression { constructor() /* primary */ { super/*Any*/() /* () */ } + operator fun Expression.unaryPlus() { + .().add(element = ) /*~> Unit */ + } + } class Column { @@ -45,22 +28,40 @@ class Column { } -class ArgumentsBuilder { +class Expression { constructor() /* primary */ { super/*Any*/() /* () */ } - val arguments: MutableList - field = mutableListOf() - get - - operator fun Expression.unaryPlus() { - .().add(element = ) /*~> Unit */ - } - } private fun countIssues(restrictionsBuilder: @ExtensionFunctionType Function1) { } + +fun id(arg: I): I { + return arg +} + +fun integer(name: String): Column { + return Column() +} + +infix fun > Column.lessEq(t: T): Expression { + return Expression() +} + +fun > Column.select(t: T, r: T): Expression { + return Expression() +} + +private fun test(x: Long) { + return countIssues(restrictionsBuilder = local fun ArgumentsBuilder.() { + ($this$countIssues, ().lessEq(t = 2.times(other = 60))).unaryPlus() + ($this$countIssues, ().lessEq(t = id(arg = 2.times(other = 60)))).unaryPlus() + ($this$countIssues, ().select(t = 2.times(other = 60).toLong(), r = x)).unaryPlus() + } +) +} + diff --git a/compiler/testData/ir/irText/firProblems/timesInBuilder.ir.txt b/compiler/testData/ir/irText/firProblems/timesInBuilder.ir.txt index b8f9a05e58e..31380015fc5 100644 --- a/compiler/testData/ir/irText/firProblems/timesInBuilder.ir.txt +++ b/compiler/testData/ir/irText/firProblems/timesInBuilder.ir.txt @@ -1,4 +1,121 @@ FILE fqName: fileName:/timesInBuilder.kt + PROPERTY name:spentTime visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:spentTime type:.Column visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun integer (name: kotlin.String): .Column declared in ' type=.Column origin=null + name: CONST String type=kotlin.String value="spentTime" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Column + correspondingProperty: PROPERTY name:spentTime visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .Column declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:spentTime type:.Column visibility:private [final,static]' type=.Column origin=null + CLASS CLASS name:ArgumentsBuilder modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArgumentsBuilder + PROPERTY name:arguments visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:arguments type:kotlin.collections.MutableList<.Expression> visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun mutableListOf (): kotlin.collections.MutableList declared in kotlin.collections' type=kotlin.collections.MutableList<.Expression> origin=null + : .Expression + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.ArgumentsBuilder) returnType:kotlin.collections.MutableList<.Expression> + correspondingProperty: PROPERTY name:arguments visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.ArgumentsBuilder + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.MutableList<.Expression> declared in .ArgumentsBuilder' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:arguments type:kotlin.collections.MutableList<.Expression> visibility:private [final]' type=kotlin.collections.MutableList<.Expression> origin=null + receiver: GET_VAR ': .ArgumentsBuilder declared in .ArgumentsBuilder.' type=.ArgumentsBuilder origin=null + CONSTRUCTOR visibility:public <> () returnType:.ArgumentsBuilder [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ArgumentsBuilder modality:FINAL visibility:public 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 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:unaryPlus visibility:public modality:FINAL <> ($this:.ArgumentsBuilder, $receiver:.Expression) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.ArgumentsBuilder + $receiver: VALUE_PARAMETER name: type:.Expression + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null + $this: CALL 'public final fun (): kotlin.collections.MutableList<.Expression> declared in .ArgumentsBuilder' type=kotlin.collections.MutableList<.Expression> origin=GET_PROPERTY + $this: GET_VAR ': .ArgumentsBuilder declared in .ArgumentsBuilder.unaryPlus' type=.ArgumentsBuilder origin=null + element: GET_VAR ': .Expression declared in .ArgumentsBuilder.unaryPlus' type=.Expression origin=null + CLASS CLASS name:Column modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Column + CONSTRUCTOR visibility:public <> () returnType:.Column [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Column modality:FINAL visibility:public 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 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 + CLASS CLASS name:Expression modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expression + CONSTRUCTOR visibility:public <> () returnType:.Expression [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Expression modality:FINAL visibility:public 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 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:countIssues visibility:private modality:FINAL <> (restrictionsBuilder:@[ExtensionFunctionType] kotlin.Function1<.ArgumentsBuilder, kotlin.Unit>) returnType:kotlin.Unit + VALUE_PARAMETER name:restrictionsBuilder index:0 type:@[ExtensionFunctionType] kotlin.Function1<.ArgumentsBuilder, kotlin.Unit> + BLOCK_BODY + FUN name:id visibility:public modality:FINAL (arg:I of .id) returnType:I of .id + TYPE_PARAMETER name:I index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:arg index:0 type:I of .id + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun id (arg: I of .id): I of .id declared in ' + GET_VAR 'arg: I of .id declared in .id' type=I of .id origin=null + FUN name:integer visibility:public modality:FINAL <> (name:kotlin.String) returnType:.Column + VALUE_PARAMETER name:name index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun integer (name: kotlin.String): .Column declared in ' + CONSTRUCTOR_CALL 'public constructor () declared in .Column' type=.Column origin=null + FUN name:lessEq visibility:public modality:FINAL ($receiver:.Column, t:T of .lessEq) returnType:.Expression [infix] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Comparable.lessEq>] reified:false + $receiver: VALUE_PARAMETER name: type:.Column + VALUE_PARAMETER name:t index:0 type:T of .lessEq + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun lessEq (t: T of .lessEq): .Expression declared in ' + CONSTRUCTOR_CALL 'public constructor () declared in .Expression' type=.Expression origin=null + FUN name:select visibility:public modality:FINAL ($receiver:.Column, t:T of .select, r:T of .select) returnType:.Expression + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Comparable.select>] reified:false + $receiver: VALUE_PARAMETER name: type:.Column + VALUE_PARAMETER name:t index:0 type:T of .select + VALUE_PARAMETER name:r index:1 type:T of .select + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun select (t: T of .select, r: T of .select): .Expression declared in ' + CONSTRUCTOR_CALL 'public constructor () declared in .Expression' type=.Expression origin=null FUN name:test visibility:private modality:FINAL <> (x:kotlin.Long) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Long BLOCK_BODY @@ -36,120 +153,3 @@ FILE fqName: fileName:/timesInBuilder.kt $this: CONST Int type=kotlin.Int value=2 other: CONST Int type=kotlin.Int value=60 r: GET_VAR 'x: kotlin.Long declared in .test' type=kotlin.Long origin=null - PROPERTY name:spentTime visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:spentTime type:.Column visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun integer (name: kotlin.String): .Column declared in ' type=.Column origin=null - name: CONST String type=kotlin.String value="spentTime" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Column - correspondingProperty: PROPERTY name:spentTime visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .Column declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:spentTime type:.Column visibility:private [final,static]' type=.Column origin=null - FUN name:integer visibility:public modality:FINAL <> (name:kotlin.String) returnType:.Column - VALUE_PARAMETER name:name index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun integer (name: kotlin.String): .Column declared in ' - CONSTRUCTOR_CALL 'public constructor () declared in .Column' type=.Column origin=null - FUN name:id visibility:public modality:FINAL (arg:I of .id) returnType:I of .id - TYPE_PARAMETER name:I index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:arg index:0 type:I of .id - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun id (arg: I of .id): I of .id declared in ' - GET_VAR 'arg: I of .id declared in .id' type=I of .id origin=null - FUN name:lessEq visibility:public modality:FINAL ($receiver:.Column, t:T of .lessEq) returnType:.Expression [infix] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Comparable.lessEq>] reified:false - $receiver: VALUE_PARAMETER name: type:.Column - VALUE_PARAMETER name:t index:0 type:T of .lessEq - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun lessEq (t: T of .lessEq): .Expression declared in ' - CONSTRUCTOR_CALL 'public constructor () declared in .Expression' type=.Expression origin=null - FUN name:select visibility:public modality:FINAL ($receiver:.Column, t:T of .select, r:T of .select) returnType:.Expression - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Comparable.select>] reified:false - $receiver: VALUE_PARAMETER name: type:.Column - VALUE_PARAMETER name:t index:0 type:T of .select - VALUE_PARAMETER name:r index:1 type:T of .select - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun select (t: T of .select, r: T of .select): .Expression declared in ' - CONSTRUCTOR_CALL 'public constructor () declared in .Expression' type=.Expression origin=null - CLASS CLASS name:Expression modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expression - CONSTRUCTOR visibility:public <> () returnType:.Expression [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Expression modality:FINAL visibility:public 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 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 - CLASS CLASS name:Column modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Column - CONSTRUCTOR visibility:public <> () returnType:.Column [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Column modality:FINAL visibility:public 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 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 - CLASS CLASS name:ArgumentsBuilder modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArgumentsBuilder - CONSTRUCTOR visibility:public <> () returnType:.ArgumentsBuilder [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ArgumentsBuilder modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:arguments visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:arguments type:kotlin.collections.MutableList<.Expression> visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun mutableListOf (): kotlin.collections.MutableList declared in kotlin.collections' type=kotlin.collections.MutableList<.Expression> origin=null - : .Expression - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.ArgumentsBuilder) returnType:kotlin.collections.MutableList<.Expression> - correspondingProperty: PROPERTY name:arguments visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.ArgumentsBuilder - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.MutableList<.Expression> declared in .ArgumentsBuilder' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:arguments type:kotlin.collections.MutableList<.Expression> visibility:private [final]' type=kotlin.collections.MutableList<.Expression> origin=null - receiver: GET_VAR ': .ArgumentsBuilder declared in .ArgumentsBuilder.' type=.ArgumentsBuilder origin=null - FUN name:unaryPlus visibility:public modality:FINAL <> ($this:.ArgumentsBuilder, $receiver:.Expression) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.ArgumentsBuilder - $receiver: VALUE_PARAMETER name: type:.Expression - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null - $this: CALL 'public final fun (): kotlin.collections.MutableList<.Expression> declared in .ArgumentsBuilder' type=kotlin.collections.MutableList<.Expression> origin=GET_PROPERTY - $this: GET_VAR ': .ArgumentsBuilder declared in .ArgumentsBuilder.unaryPlus' type=.ArgumentsBuilder origin=null - element: GET_VAR ': .Expression declared in .ArgumentsBuilder.unaryPlus' type=.Expression 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: 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:countIssues visibility:private modality:FINAL <> (restrictionsBuilder:@[ExtensionFunctionType] kotlin.Function1<.ArgumentsBuilder, kotlin.Unit>) returnType:kotlin.Unit - VALUE_PARAMETER name:restrictionsBuilder index:0 type:@[ExtensionFunctionType] kotlin.Function1<.ArgumentsBuilder, kotlin.Unit> - BLOCK_BODY diff --git a/compiler/testData/ir/irText/firProblems/timesInBuilder.kt.txt b/compiler/testData/ir/irText/firProblems/timesInBuilder.kt.txt index 324b8e1547b..53dbab97df8 100644 --- a/compiler/testData/ir/irText/firProblems/timesInBuilder.kt.txt +++ b/compiler/testData/ir/irText/firProblems/timesInBuilder.kt.txt @@ -1,39 +1,22 @@ -private fun test(x: Long) { - return countIssues(restrictionsBuilder = local fun ArgumentsBuilder.() { - ($this$countIssues, ().lessEq(t = 2.times(other = 60))).unaryPlus() - ($this$countIssues, ().lessEq(t = id(arg = 2.times(other = 60)))).unaryPlus() - ($this$countIssues, ().select(t = 2.times(other = 60).toLong(), r = x)).unaryPlus() - } -) -} - val spentTime: Column field = integer(name = "spentTime") get -fun integer(name: String): Column { - return Column() -} +class ArgumentsBuilder { + val arguments: MutableList + field = mutableListOf() + get -fun id(arg: I): I { - return arg -} - -infix fun > Column.lessEq(t: T): Expression { - return Expression() -} - -fun > Column.select(t: T, r: T): Expression { - return Expression() -} - -class Expression { constructor() /* primary */ { super/*Any*/() /* () */ } + operator fun Expression.unaryPlus() { + .().add(element = ) /*~> Unit */ + } + } class Column { @@ -45,22 +28,40 @@ class Column { } -class ArgumentsBuilder { +class Expression { constructor() /* primary */ { super/*Any*/() /* () */ } - val arguments: MutableList - field = mutableListOf() - get - - operator fun Expression.unaryPlus() { - .().add(element = ) /*~> Unit */ - } - } private fun countIssues(restrictionsBuilder: @ExtensionFunctionType Function1) { } + +fun id(arg: I): I { + return arg +} + +fun integer(name: String): Column { + return Column() +} + +infix fun > Column.lessEq(t: T): Expression { + return Expression() +} + +fun > Column.select(t: T, r: T): Expression { + return Expression() +} + +private fun test(x: Long) { + return countIssues(restrictionsBuilder = local fun ArgumentsBuilder.() { + ($this$countIssues, ().lessEq(t = 2.times(other = 60))).unaryPlus() + ($this$countIssues, ().lessEq(t = id(arg = 2.times(other = 60)))).unaryPlus() + ($this$countIssues, ().select(t = 2.times(other = 60).toLong(), r = x)).unaryPlus() + } +) +} + diff --git a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.ir.txt b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.ir.txt deleted file mode 100644 index 923311c210b..00000000000 --- a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.ir.txt +++ /dev/null @@ -1,671 +0,0 @@ -FILE fqName: fileName:/typeVariableAfterBuildMap.kt - CLASS CLASS name:Visibility modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibility - CONSTRUCTOR visibility:public <> (name:kotlin.String, isPublicAPI:kotlin.Boolean) returnType:.Visibility [primary] - VALUE_PARAMETER name:name index:0 type:kotlin.String - VALUE_PARAMETER name:isPublicAPI index:1 type:kotlin.Boolean - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Visibility modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - PROPERTY name:name visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'name: kotlin.String declared in .Visibility.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String - correspondingProperty: PROPERTY name:name visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Visibility - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Visibility' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Visibility declared in .Visibility.' type=.Visibility origin=null - PROPERTY name:isPublicAPI visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:isPublicAPI type:kotlin.Boolean visibility:private [final] - EXPRESSION_BODY - GET_VAR 'isPublicAPI: kotlin.Boolean declared in .Visibility.' type=kotlin.Boolean origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean - correspondingProperty: PROPERTY name:isPublicAPI visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Visibility - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Boolean declared in .Visibility' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:isPublicAPI type:kotlin.Boolean visibility:private [final]' type=kotlin.Boolean origin=null - receiver: GET_VAR ': .Visibility declared in .Visibility.' type=.Visibility origin=null - PROPERTY name:internalDisplayName visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String - correspondingProperty: PROPERTY name:internalDisplayName visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.Visibility - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Visibility' - CALL 'public final fun (): kotlin.String declared in .Visibility' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .Visibility declared in .Visibility.' type=.Visibility origin=null - PROPERTY name:externalDisplayName visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String - correspondingProperty: PROPERTY name:externalDisplayName visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.Visibility - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Visibility' - CALL 'public open fun (): kotlin.String declared in .Visibility' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .Visibility declared in .Visibility.' type=.Visibility origin=null - FUN name:mustCheckInImports visibility:public modality:ABSTRACT <> ($this:.Visibility) returnType:kotlin.Boolean - $this: VALUE_PARAMETER name: type:.Visibility - 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: 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 - CLASS OBJECT name:Visibilities modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities - CONSTRUCTOR visibility:private <> () returnType:.Visibilities [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Visibilities modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS OBJECT name:Private modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Private - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Private [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="private" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Private modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Private) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Private - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Private' - CONST Boolean type=kotlin.Boolean value=true - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:PrivateToThis modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.PrivateToThis - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.PrivateToThis [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="private_to_this" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:PrivateToThis modality:FINAL visibility:public superTypes:[.Visibility]' - PROPERTY name:internalDisplayName visibility:public modality:OPEN [val] - overridden: - public open internalDisplayName: kotlin.String - FUN name: visibility:public modality:OPEN <> ($this:.Visibilities.PrivateToThis) returnType:kotlin.String - correspondingProperty: PROPERTY name:internalDisplayName visibility:public modality:OPEN [val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.PrivateToThis - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Visibilities.PrivateToThis' - CONST String type=kotlin.String value="private/*private to this*/" - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.PrivateToThis) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.PrivateToThis - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.PrivateToThis' - CONST Boolean type=kotlin.Boolean value=true - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Protected modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Protected - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Protected [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="protected" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=true - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Protected modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Protected) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Protected - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Protected' - CONST Boolean type=kotlin.Boolean value=false - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Internal modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Internal - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Internal [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="internal" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Internal modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Internal) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Internal - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Internal' - CONST Boolean type=kotlin.Boolean value=true - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Public modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Public - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Public [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="public" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=true - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Public modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Public) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Public - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Public' - CONST Boolean type=kotlin.Boolean value=false - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Local modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Local - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Local [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="local" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Local modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Local) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Local - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Local' - CONST Boolean type=kotlin.Boolean value=true - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Inherited modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Inherited - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Inherited [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="inherited" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Inherited modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Inherited) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Inherited - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor (p0: @[FlexibleNullability] kotlin.String?) declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null - p0: CONST String type=kotlin.String value="This method shouldn't be invoked for INHERITED visibility" - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:InvisibleFake modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.InvisibleFake - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.InvisibleFake [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="invisible_fake" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:InvisibleFake modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.InvisibleFake) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.InvisibleFake - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.InvisibleFake' - CONST Boolean type=kotlin.Boolean value=true - PROPERTY name:externalDisplayName visibility:public modality:OPEN [val] - overridden: - public open externalDisplayName: kotlin.String - FUN name: visibility:public modality:OPEN <> ($this:.Visibilities.InvisibleFake) returnType:kotlin.String - correspondingProperty: PROPERTY name:externalDisplayName visibility:public modality:OPEN [val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.InvisibleFake - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Visibilities.InvisibleFake' - CONST String type=kotlin.String value="invisible (private in a supertype)" - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Unknown modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Unknown - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Unknown [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="unknown" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Unknown modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Unknown) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Unknown - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor (p0: @[FlexibleNullability] kotlin.String?) declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null - p0: CONST String type=kotlin.String value="This method shouldn't be invoked for UNKNOWN visibility" - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:ORDERED_VISIBILITIES visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:ORDERED_VISIBILITIES type:kotlin.collections.Map<.Visibility, kotlin.Int> visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun buildMap (builderAction: @[ExtensionFunctionType] kotlin.Function1, kotlin.Unit>): kotlin.collections.Map declared in kotlin.collections' type=kotlin.collections.Map<.Visibility, kotlin.Int> origin=null - : .Visibility - : kotlin.Int - builderAction: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1.Visibility, kotlin.Int>, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlin.collections.MutableMap<.Visibility, kotlin.Int>) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name:$this$buildMap type:kotlin.collections.MutableMap<.Visibility, kotlin.Int> - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun put (key: K of kotlin.collections.MutableMap, value: V of kotlin.collections.MutableMap): V of kotlin.collections.MutableMap? declared in kotlin.collections.MutableMap' type=kotlin.Int? origin=null - $this: GET_VAR '$this$buildMap: kotlin.collections.MutableMap<.Visibility, kotlin.Int> declared in .Visibilities.ORDERED_VISIBILITIES.' type=kotlin.collections.MutableMap<.Visibility, kotlin.Int> origin=null - key: GET_OBJECT 'CLASS OBJECT name:PrivateToThis modality:FINAL visibility:public superTypes:[.Visibility]' type=.Visibilities.PrivateToThis - value: CONST Int type=kotlin.Int value=0 - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun put (key: K of kotlin.collections.MutableMap, value: V of kotlin.collections.MutableMap): V of kotlin.collections.MutableMap? declared in kotlin.collections.MutableMap' type=kotlin.Int? origin=null - $this: GET_VAR '$this$buildMap: kotlin.collections.MutableMap<.Visibility, kotlin.Int> declared in .Visibilities.ORDERED_VISIBILITIES.' type=kotlin.collections.MutableMap<.Visibility, kotlin.Int> origin=null - key: GET_OBJECT 'CLASS OBJECT name:Private modality:FINAL visibility:public superTypes:[.Visibility]' type=.Visibilities.Private - value: CONST Int type=kotlin.Int value=0 - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun put (key: K of kotlin.collections.MutableMap, value: V of kotlin.collections.MutableMap): V of kotlin.collections.MutableMap? declared in kotlin.collections.MutableMap' type=kotlin.Int? origin=null - $this: GET_VAR '$this$buildMap: kotlin.collections.MutableMap<.Visibility, kotlin.Int> declared in .Visibilities.ORDERED_VISIBILITIES.' type=kotlin.collections.MutableMap<.Visibility, kotlin.Int> origin=null - key: GET_OBJECT 'CLASS OBJECT name:Internal modality:FINAL visibility:public superTypes:[.Visibility]' type=.Visibilities.Internal - value: CONST Int type=kotlin.Int value=1 - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun put (key: K of kotlin.collections.MutableMap, value: V of kotlin.collections.MutableMap): V of kotlin.collections.MutableMap? declared in kotlin.collections.MutableMap' type=kotlin.Int? origin=null - $this: GET_VAR '$this$buildMap: kotlin.collections.MutableMap<.Visibility, kotlin.Int> declared in .Visibilities.ORDERED_VISIBILITIES.' type=kotlin.collections.MutableMap<.Visibility, kotlin.Int> origin=null - key: GET_OBJECT 'CLASS OBJECT name:Protected modality:FINAL visibility:public superTypes:[.Visibility]' type=.Visibilities.Protected - value: CONST Int type=kotlin.Int value=1 - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun put (key: K of kotlin.collections.MutableMap, value: V of kotlin.collections.MutableMap): V of kotlin.collections.MutableMap? declared in kotlin.collections.MutableMap' type=kotlin.Int? origin=null - $this: GET_VAR '$this$buildMap: kotlin.collections.MutableMap<.Visibility, kotlin.Int> declared in .Visibilities.ORDERED_VISIBILITIES.' type=kotlin.collections.MutableMap<.Visibility, kotlin.Int> origin=null - key: GET_OBJECT 'CLASS OBJECT name:Public modality:FINAL visibility:public superTypes:[.Visibility]' type=.Visibilities.Public - value: CONST Int type=kotlin.Int value=2 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Visibilities) returnType:kotlin.collections.Map<.Visibility, kotlin.Int> - correspondingProperty: PROPERTY name:ORDERED_VISIBILITIES visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Visibilities - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.Map<.Visibility, kotlin.Int> declared in .Visibilities' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ORDERED_VISIBILITIES type:kotlin.collections.Map<.Visibility, kotlin.Int> visibility:private [final]' type=kotlin.collections.Map<.Visibility, kotlin.Int> origin=null - receiver: GET_VAR ': .Visibilities declared in .Visibilities.' type=.Visibilities 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: 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 diff --git a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.kt.txt b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.kt.txt deleted file mode 100644 index bf26d2c54dd..00000000000 --- a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.kt.txt +++ /dev/null @@ -1,175 +0,0 @@ -abstract class Visibility { - constructor(name: String, isPublicAPI: Boolean) /* primary */ { - super/*Any*/() - /* () */ - - } - - val name: String - field = name - get - - val isPublicAPI: Boolean - field = isPublicAPI - get - - open val internalDisplayName: String - open get(): String { - return .() - } - - open val externalDisplayName: String - open get(): String { - return .() - } - - abstract fun mustCheckInImports(): Boolean - -} - -object Visibilities { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - object Private : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "private", isPublicAPI = false) - /* () */ - - } - - override fun mustCheckInImports(): Boolean { - return true - } - - } - - object PrivateToThis : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "private_to_this", isPublicAPI = false) - /* () */ - - } - - override val internalDisplayName: String - override get(): String { - return "private/*private to this*/" - } - - override fun mustCheckInImports(): Boolean { - return true - } - - } - - object Protected : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "protected", isPublicAPI = true) - /* () */ - - } - - override fun mustCheckInImports(): Boolean { - return false - } - - } - - object Internal : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "internal", isPublicAPI = false) - /* () */ - - } - - override fun mustCheckInImports(): Boolean { - return true - } - - } - - object Public : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "public", isPublicAPI = true) - /* () */ - - } - - override fun mustCheckInImports(): Boolean { - return false - } - - } - - object Local : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "local", isPublicAPI = false) - /* () */ - - } - - override fun mustCheckInImports(): Boolean { - return true - } - - } - - object Inherited : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "inherited", isPublicAPI = false) - /* () */ - - } - - override fun mustCheckInImports(): Boolean { - throw IllegalStateException(p0 = "This method shouldn't be invoked for INHERITED visibility") - } - - } - - object InvisibleFake : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "invisible_fake", isPublicAPI = false) - /* () */ - - } - - override fun mustCheckInImports(): Boolean { - return true - } - - override val externalDisplayName: String - override get(): String { - return "invisible (private in a supertype)" - } - - } - - object Unknown : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "unknown", isPublicAPI = false) - /* () */ - - } - - override fun mustCheckInImports(): Boolean { - throw IllegalStateException(p0 = "This method shouldn't be invoked for UNKNOWN visibility") - } - - } - - private val ORDERED_VISIBILITIES: Map - field = buildMap(builderAction = local fun MutableMap.() { - $this$buildMap.put(key = PrivateToThis, value = 0) /*~> Unit */ - $this$buildMap.put(key = Private, value = 0) /*~> Unit */ - $this$buildMap.put(key = Internal, value = 1) /*~> Unit */ - $this$buildMap.put(key = Protected, value = 1) /*~> Unit */ - $this$buildMap.put(key = Public, value = 2) /*~> Unit */ - } -) - private get - -} diff --git a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.ir.txt b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.ir.txt index 326fdbacd86..4eb43416071 100644 --- a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.ir.txt +++ b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.ir.txt @@ -1,12 +1,6 @@ FILE fqName: fileName:/typeVariableAfterBuildMap.kt CLASS CLASS name:Visibility modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibility - CONSTRUCTOR visibility:public <> (name:kotlin.String, isPublicAPI:kotlin.Boolean) returnType:.Visibility [primary] - VALUE_PARAMETER name:name index:0 type:kotlin.String - VALUE_PARAMETER name:isPublicAPI index:1 type:kotlin.Boolean - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Visibility modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' PROPERTY name:name visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -29,24 +23,12 @@ FILE fqName: fileName:/typeVariableAfterBuildMap.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Boolean declared in .Visibility' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:isPublicAPI type:kotlin.Boolean visibility:private [final]' type=kotlin.Boolean origin=null receiver: GET_VAR ': .Visibility declared in .Visibility.' type=.Visibility origin=null - PROPERTY name:internalDisplayName visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String - correspondingProperty: PROPERTY name:internalDisplayName visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.Visibility - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Visibility' - CALL 'public final fun (): kotlin.String declared in .Visibility' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .Visibility declared in .Visibility.' type=.Visibility origin=null - PROPERTY name:externalDisplayName visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String - correspondingProperty: PROPERTY name:externalDisplayName visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.Visibility - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Visibility' - CALL 'public open fun (): kotlin.String declared in .Visibility' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .Visibility declared in .Visibility.' type=.Visibility origin=null - FUN name:mustCheckInImports visibility:public modality:ABSTRACT <> ($this:.Visibility) returnType:kotlin.Boolean - $this: VALUE_PARAMETER name: type:.Visibility + CONSTRUCTOR visibility:public <> (name:kotlin.String, isPublicAPI:kotlin.Boolean) returnType:.Visibility [primary] + VALUE_PARAMETER name:name index:0 type:kotlin.String + VALUE_PARAMETER name:isPublicAPI index:1 type:kotlin.Boolean + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Visibility modality:ABSTRACT visibility:public 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 declared in kotlin.Any @@ -60,560 +42,26 @@ FILE fqName: fileName:/typeVariableAfterBuildMap.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:mustCheckInImports visibility:public modality:ABSTRACT <> ($this:.Visibility) returnType:kotlin.Boolean + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY name:externalDisplayName visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String + correspondingProperty: PROPERTY name:externalDisplayName visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.Visibility + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Visibility' + CALL 'public open fun (): kotlin.String declared in .Visibility' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .Visibility declared in .Visibility.' type=.Visibility origin=null + PROPERTY name:internalDisplayName visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String + correspondingProperty: PROPERTY name:internalDisplayName visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.Visibility + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Visibility' + CALL 'public final fun (): kotlin.String declared in .Visibility' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR ': .Visibility declared in .Visibility.' type=.Visibility origin=null CLASS OBJECT name:Visibilities modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities - CONSTRUCTOR visibility:private <> () returnType:.Visibilities [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Visibilities modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS OBJECT name:Private modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Private - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Private [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="private" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Private modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Private) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Private - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Private' - CONST Boolean type=kotlin.Boolean value=true - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:PrivateToThis modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.PrivateToThis - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.PrivateToThis [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="private_to_this" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:PrivateToThis modality:FINAL visibility:public superTypes:[.Visibility]' - PROPERTY name:internalDisplayName visibility:public modality:OPEN [val] - overridden: - public open internalDisplayName: kotlin.String - FUN name: visibility:public modality:OPEN <> ($this:.Visibilities.PrivateToThis) returnType:kotlin.String - correspondingProperty: PROPERTY name:internalDisplayName visibility:public modality:OPEN [val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.PrivateToThis - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Visibilities.PrivateToThis' - CONST String type=kotlin.String value="private/*private to this*/" - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.PrivateToThis) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.PrivateToThis - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.PrivateToThis' - CONST Boolean type=kotlin.Boolean value=true - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Protected modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Protected - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Protected [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="protected" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=true - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Protected modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Protected) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Protected - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Protected' - CONST Boolean type=kotlin.Boolean value=false - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Internal modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Internal - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Internal [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="internal" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Internal modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Internal) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Internal - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Internal' - CONST Boolean type=kotlin.Boolean value=true - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Public modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Public - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Public [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="public" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=true - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Public modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Public) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Public - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Public' - CONST Boolean type=kotlin.Boolean value=false - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Local modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Local - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Local [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="local" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Local modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Local) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Local - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Local' - CONST Boolean type=kotlin.Boolean value=true - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Inherited modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Inherited - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Inherited [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="inherited" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Inherited modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Inherited) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Inherited - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor (p0: @[FlexibleNullability] kotlin.String?) declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null - p0: CONST String type=kotlin.String value="This method shouldn't be invoked for INHERITED visibility" - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:InvisibleFake modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.InvisibleFake - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.InvisibleFake [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="invisible_fake" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:InvisibleFake modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.InvisibleFake) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.InvisibleFake - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.InvisibleFake' - CONST Boolean type=kotlin.Boolean value=true - PROPERTY name:externalDisplayName visibility:public modality:OPEN [val] - overridden: - public open externalDisplayName: kotlin.String - FUN name: visibility:public modality:OPEN <> ($this:.Visibilities.InvisibleFake) returnType:kotlin.String - correspondingProperty: PROPERTY name:externalDisplayName visibility:public modality:OPEN [val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.InvisibleFake - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Visibilities.InvisibleFake' - CONST String type=kotlin.String value="invisible (private in a supertype)" - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Unknown modality:FINAL visibility:public superTypes:[.Visibility] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Unknown - CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Unknown [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' - name: CONST String type=kotlin.String value="unknown" - isPublicAPI: CONST Boolean type=kotlin.Boolean value=false - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Unknown modality:FINAL visibility:public superTypes:[.Visibility]' - FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Unknown) returnType:kotlin.Boolean - overridden: - public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibilities.Unknown - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor (p0: @[FlexibleNullability] kotlin.String?) declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null - p0: CONST String type=kotlin.String value="This method shouldn't be invoked for UNKNOWN visibility" - PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open internalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open externalDisplayName: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final isPublicAPI: kotlin.Boolean - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Boolean declared in .Visibility - $this: VALUE_PARAMETER name: type:.Visibility - 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 .Visibility - $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 .Visibility - $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 .Visibility - $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:ORDERED_VISIBILITIES visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ORDERED_VISIBILITIES type:kotlin.collections.Map<.Visibility, kotlin.Int> visibility:private [final] EXPRESSION_BODY @@ -656,6 +104,558 @@ FILE fqName: fileName:/typeVariableAfterBuildMap.kt RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.Map<.Visibility, kotlin.Int> declared in .Visibilities' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ORDERED_VISIBILITIES type:kotlin.collections.Map<.Visibility, kotlin.Int> visibility:private [final]' type=kotlin.collections.Map<.Visibility, kotlin.Int> origin=null receiver: GET_VAR ': .Visibilities declared in .Visibilities.' type=.Visibilities origin=null + CLASS OBJECT name:Inherited modality:FINAL visibility:public superTypes:[.Visibility] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Inherited + CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Inherited [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' + name: CONST String type=kotlin.String value="inherited" + isPublicAPI: CONST Boolean type=kotlin.Boolean value=false + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Inherited modality:FINAL visibility:public superTypes:[.Visibility]' + 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 .Visibility + $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 .Visibility + $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 .Visibility + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Inherited) returnType:kotlin.Boolean + overridden: + public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibilities.Inherited + BLOCK_BODY + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor (p0: @[FlexibleNullability] kotlin.String?) declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null + p0: CONST String type=kotlin.String value="This method shouldn't be invoked for INHERITED visibility" + PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open externalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open internalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final isPublicAPI: kotlin.Boolean + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + CLASS OBJECT name:Internal modality:FINAL visibility:public superTypes:[.Visibility] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Internal + CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Internal [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' + name: CONST String type=kotlin.String value="internal" + isPublicAPI: CONST Boolean type=kotlin.Boolean value=false + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Internal modality:FINAL visibility:public superTypes:[.Visibility]' + 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 .Visibility + $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 .Visibility + $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 .Visibility + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Internal) returnType:kotlin.Boolean + overridden: + public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibilities.Internal + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Internal' + CONST Boolean type=kotlin.Boolean value=true + PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open externalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open internalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final isPublicAPI: kotlin.Boolean + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + CLASS OBJECT name:InvisibleFake modality:FINAL visibility:public superTypes:[.Visibility] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.InvisibleFake + CONSTRUCTOR visibility:private <> () returnType:.Visibilities.InvisibleFake [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' + name: CONST String type=kotlin.String value="invisible_fake" + isPublicAPI: CONST Boolean type=kotlin.Boolean value=false + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:InvisibleFake modality:FINAL visibility:public superTypes:[.Visibility]' + 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 .Visibility + $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 .Visibility + $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 .Visibility + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.InvisibleFake) returnType:kotlin.Boolean + overridden: + public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibilities.InvisibleFake + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.InvisibleFake' + CONST Boolean type=kotlin.Boolean value=true + PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open internalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final isPublicAPI: kotlin.Boolean + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY name:externalDisplayName visibility:public modality:OPEN [val] + overridden: + public open externalDisplayName: kotlin.String + FUN name: visibility:public modality:OPEN <> ($this:.Visibilities.InvisibleFake) returnType:kotlin.String + correspondingProperty: PROPERTY name:externalDisplayName visibility:public modality:OPEN [val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibilities.InvisibleFake + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Visibilities.InvisibleFake' + CONST String type=kotlin.String value="invisible (private in a supertype)" + CLASS OBJECT name:Local modality:FINAL visibility:public superTypes:[.Visibility] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Local + CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Local [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' + name: CONST String type=kotlin.String value="local" + isPublicAPI: CONST Boolean type=kotlin.Boolean value=false + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Local modality:FINAL visibility:public superTypes:[.Visibility]' + 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 .Visibility + $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 .Visibility + $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 .Visibility + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Local) returnType:kotlin.Boolean + overridden: + public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibilities.Local + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Local' + CONST Boolean type=kotlin.Boolean value=true + PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open externalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open internalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final isPublicAPI: kotlin.Boolean + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + CLASS OBJECT name:Private modality:FINAL visibility:public superTypes:[.Visibility] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Private + CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Private [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' + name: CONST String type=kotlin.String value="private" + isPublicAPI: CONST Boolean type=kotlin.Boolean value=false + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Private modality:FINAL visibility:public superTypes:[.Visibility]' + 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 .Visibility + $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 .Visibility + $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 .Visibility + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Private) returnType:kotlin.Boolean + overridden: + public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibilities.Private + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Private' + CONST Boolean type=kotlin.Boolean value=true + PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open externalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open internalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final isPublicAPI: kotlin.Boolean + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + CLASS OBJECT name:PrivateToThis modality:FINAL visibility:public superTypes:[.Visibility] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.PrivateToThis + CONSTRUCTOR visibility:private <> () returnType:.Visibilities.PrivateToThis [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' + name: CONST String type=kotlin.String value="private_to_this" + isPublicAPI: CONST Boolean type=kotlin.Boolean value=false + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:PrivateToThis modality:FINAL visibility:public superTypes:[.Visibility]' + 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 .Visibility + $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 .Visibility + $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 .Visibility + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.PrivateToThis) returnType:kotlin.Boolean + overridden: + public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibilities.PrivateToThis + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.PrivateToThis' + CONST Boolean type=kotlin.Boolean value=true + PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open externalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final isPublicAPI: kotlin.Boolean + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY name:internalDisplayName visibility:public modality:OPEN [val] + overridden: + public open internalDisplayName: kotlin.String + FUN name: visibility:public modality:OPEN <> ($this:.Visibilities.PrivateToThis) returnType:kotlin.String + correspondingProperty: PROPERTY name:internalDisplayName visibility:public modality:OPEN [val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibilities.PrivateToThis + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Visibilities.PrivateToThis' + CONST String type=kotlin.String value="private/*private to this*/" + CLASS OBJECT name:Protected modality:FINAL visibility:public superTypes:[.Visibility] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Protected + CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Protected [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' + name: CONST String type=kotlin.String value="protected" + isPublicAPI: CONST Boolean type=kotlin.Boolean value=true + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Protected modality:FINAL visibility:public superTypes:[.Visibility]' + 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 .Visibility + $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 .Visibility + $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 .Visibility + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Protected) returnType:kotlin.Boolean + overridden: + public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibilities.Protected + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Protected' + CONST Boolean type=kotlin.Boolean value=false + PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open externalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open internalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final isPublicAPI: kotlin.Boolean + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + CLASS OBJECT name:Public modality:FINAL visibility:public superTypes:[.Visibility] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Public + CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Public [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' + name: CONST String type=kotlin.String value="public" + isPublicAPI: CONST Boolean type=kotlin.Boolean value=true + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Public modality:FINAL visibility:public superTypes:[.Visibility]' + 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 .Visibility + $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 .Visibility + $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 .Visibility + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Public) returnType:kotlin.Boolean + overridden: + public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibilities.Public + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun mustCheckInImports (): kotlin.Boolean declared in .Visibilities.Public' + CONST Boolean type=kotlin.Boolean value=false + PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open externalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open internalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final isPublicAPI: kotlin.Boolean + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + CLASS OBJECT name:Unknown modality:FINAL visibility:public superTypes:[.Visibility] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Visibilities.Unknown + CONSTRUCTOR visibility:private <> () returnType:.Visibilities.Unknown [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, isPublicAPI: kotlin.Boolean) declared in .Visibility' + name: CONST String type=kotlin.String value="unknown" + isPublicAPI: CONST Boolean type=kotlin.Boolean value=false + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Unknown modality:FINAL visibility:public superTypes:[.Visibility]' + 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 .Visibility + $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 .Visibility + $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 .Visibility + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:mustCheckInImports visibility:public modality:OPEN <> ($this:.Visibilities.Unknown) returnType:kotlin.Boolean + overridden: + public abstract fun mustCheckInImports (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibilities.Unknown + BLOCK_BODY + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor (p0: @[FlexibleNullability] kotlin.String?) declared in java.lang.IllegalStateException' type=java.lang.IllegalStateException origin=null + p0: CONST String type=kotlin.String value="This method shouldn't be invoked for UNKNOWN visibility" + PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open externalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:externalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open internalDisplayName: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:internalDisplayName visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final isPublicAPI: kotlin.Boolean + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.Boolean [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:isPublicAPI visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Boolean declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Visibility) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .Visibility + $this: VALUE_PARAMETER name: type:.Visibility + CONSTRUCTOR visibility:private <> () returnType:.Visibilities [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Visibilities modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt index dc92b1943c5..cef4f1b6612 100644 --- a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt +++ b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB // IGNORE_BACKEND: JS_IR diff --git a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt.txt b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt.txt index bf26d2c54dd..8716d2f5849 100644 --- a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt.txt +++ b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt.txt @@ -1,10 +1,4 @@ abstract class Visibility { - constructor(name: String, isPublicAPI: Boolean) /* primary */ { - super/*Any*/() - /* () */ - - } - val name: String field = name get @@ -13,24 +7,92 @@ abstract class Visibility { field = isPublicAPI get - open val internalDisplayName: String - open get(): String { - return .() - } + constructor(name: String, isPublicAPI: Boolean) /* primary */ { + super/*Any*/() + /* () */ + + } + + abstract fun mustCheckInImports(): Boolean open val externalDisplayName: String open get(): String { return .() } - abstract fun mustCheckInImports(): Boolean + open val internalDisplayName: String + open get(): String { + return .() + } } object Visibilities { - private constructor() /* primary */ { - super/*Any*/() - /* () */ + private val ORDERED_VISIBILITIES: Map + field = buildMap(builderAction = local fun MutableMap.() { + $this$buildMap.put(key = PrivateToThis, value = 0) /*~> Unit */ + $this$buildMap.put(key = Private, value = 0) /*~> Unit */ + $this$buildMap.put(key = Internal, value = 1) /*~> Unit */ + $this$buildMap.put(key = Protected, value = 1) /*~> Unit */ + $this$buildMap.put(key = Public, value = 2) /*~> Unit */ + } +) + private get + + object Inherited : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "inherited", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + throw IllegalStateException(p0 = "This method shouldn't be invoked for INHERITED visibility") + } + + } + + object Internal : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "internal", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return true + } + + } + + object InvisibleFake : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "invisible_fake", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return true + } + + override val externalDisplayName: String + override get(): String { + return "invisible (private in a supertype)" + } + + } + + object Local : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "local", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return true + } } @@ -54,15 +116,15 @@ object Visibilities { } + override fun mustCheckInImports(): Boolean { + return true + } + override val internalDisplayName: String override get(): String { return "private/*private to this*/" } - override fun mustCheckInImports(): Boolean { - return true - } - } object Protected : Visibility { @@ -78,19 +140,6 @@ object Visibilities { } - object Internal : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "internal", isPublicAPI = false) - /* () */ - - } - - override fun mustCheckInImports(): Boolean { - return true - } - - } - object Public : Visibility { private constructor() /* primary */ { super/*Visibility*/(name = "public", isPublicAPI = true) @@ -104,50 +153,6 @@ object Visibilities { } - object Local : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "local", isPublicAPI = false) - /* () */ - - } - - override fun mustCheckInImports(): Boolean { - return true - } - - } - - object Inherited : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "inherited", isPublicAPI = false) - /* () */ - - } - - override fun mustCheckInImports(): Boolean { - throw IllegalStateException(p0 = "This method shouldn't be invoked for INHERITED visibility") - } - - } - - object InvisibleFake : Visibility { - private constructor() /* primary */ { - super/*Visibility*/(name = "invisible_fake", isPublicAPI = false) - /* () */ - - } - - override fun mustCheckInImports(): Boolean { - return true - } - - override val externalDisplayName: String - override get(): String { - return "invisible (private in a supertype)" - } - - } - object Unknown : Visibility { private constructor() /* primary */ { super/*Visibility*/(name = "unknown", isPublicAPI = false) @@ -161,15 +166,11 @@ object Visibilities { } - private val ORDERED_VISIBILITIES: Map - field = buildMap(builderAction = local fun MutableMap.() { - $this$buildMap.put(key = PrivateToThis, value = 0) /*~> Unit */ - $this$buildMap.put(key = Private, value = 0) /*~> Unit */ - $this$buildMap.put(key = Internal, value = 1) /*~> Unit */ - $this$buildMap.put(key = Protected, value = 1) /*~> Unit */ - $this$buildMap.put(key = Public, value = 2) /*~> Unit */ - } -) - private get + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } } + diff --git a/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.ir.txt b/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.ir.txt index 8eee5270434..4ab7d3f67de 100644 --- a/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.ir.txt @@ -1,13 +1,17 @@ FILE fqName: fileName:/valueClassEquals.kt + PROPERTY name:equals visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:equals type:kotlin.reflect.KFunction2<.Z, kotlin.Any?, kotlin.Boolean> visibility:private [final,static] + EXPRESSION_BODY + FUNCTION_REFERENCE 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Z' type=kotlin.reflect.KFunction2<.Z, kotlin.Any?, kotlin.Boolean> origin=null reflectionTarget= + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction2<.Z, kotlin.Any?, kotlin.Boolean> + correspondingProperty: PROPERTY name:equals visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KFunction2<.Z, kotlin.Any?, kotlin.Boolean> declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:equals type:kotlin.reflect.KFunction2<.Z, kotlin.Any?, kotlin.Boolean> visibility:private [final,static]' type=kotlin.reflect.KFunction2<.Z, kotlin.Any?, kotlin.Boolean> origin=null CLASS CLASS name:Z modality:FINAL visibility:public [value] superTypes:[kotlin.Any] annotations: JvmInline $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.Z [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Z modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -19,27 +23,11 @@ FILE fqName: fileName:/valueClassEquals.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Z' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Z declared in .Z.' type=.Z origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Z) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Z + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.Z [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Z' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Z(" - CONST String type=kotlin.String value="s=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Z declared in .Z.toString' type=.Z origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Z) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Z - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Z' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Z declared in .Z.hashCode' type=.Z origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Z modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Z, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -67,12 +55,24 @@ FILE fqName: fileName:/valueClassEquals.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Z' CONST Boolean type=kotlin.Boolean value=true - PROPERTY name:equals visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:equals type:kotlin.reflect.KFunction2<.Z, kotlin.Any?, kotlin.Boolean> visibility:private [final,static] - EXPRESSION_BODY - FUNCTION_REFERENCE 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Z' type=kotlin.reflect.KFunction2<.Z, kotlin.Any?, kotlin.Boolean> origin=null reflectionTarget= - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction2<.Z, kotlin.Any?, kotlin.Boolean> - correspondingProperty: PROPERTY name:equals visibility:public modality:FINAL [val] + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Z) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Z BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KFunction2<.Z, kotlin.Any?, kotlin.Boolean> declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:equals type:kotlin.reflect.KFunction2<.Z, kotlin.Any?, kotlin.Boolean> visibility:private [final,static]' type=kotlin.reflect.KFunction2<.Z, kotlin.Any?, kotlin.Boolean> origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Z' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Z declared in .Z.hashCode' type=.Z origin=null + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Z) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Z' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Z(" + CONST String type=kotlin.String value="s=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Z declared in .Z.toString' type=.Z origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.kt.txt b/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.kt.txt index e0996b6c51d..41656062436 100644 --- a/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.kt.txt @@ -1,21 +1,17 @@ +val equals: KFunction2 + field = Z::equals + get + @JvmInline value class Z { - constructor(s: String) /* primary */ { - super/*Any*/() - /* () */ - - } - val s: String field = s get - override fun toString(): String { - return "Z(" + "s=" + .#s + ")" - } + constructor(s: String) /* primary */ { + super/*Any*/() + /* () */ - override fun hashCode(): Int { - return .#s.hashCode() } override operator fun equals(other: Any?): Boolean { @@ -29,9 +25,13 @@ value class Z { return true } + override fun hashCode(): Int { + return .#s.hashCode() + } + + override fun toString(): String { + return "Z(" + "s=" + .#s + ")" + } + } -val equals: KFunction2 - field = Z::equals - get - diff --git a/compiler/testData/ir/irText/firProblems/valueClassEquals.ir.txt b/compiler/testData/ir/irText/firProblems/valueClassEquals.ir.txt index 028777d3c2f..a9b23614045 100644 --- a/compiler/testData/ir/irText/firProblems/valueClassEquals.ir.txt +++ b/compiler/testData/ir/irText/firProblems/valueClassEquals.ir.txt @@ -1,13 +1,17 @@ FILE fqName: fileName:/valueClassEquals.kt + PROPERTY name:equals visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:equals type:kotlin.reflect.KFunction2<.Z, @[ParameterName(name = "other")] kotlin.Any?, kotlin.Boolean> visibility:private [final,static] + EXPRESSION_BODY + FUNCTION_REFERENCE 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Z' type=kotlin.reflect.KFunction2<.Z, @[ParameterName(name = "other")] kotlin.Any?, kotlin.Boolean> origin=null reflectionTarget= + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction2<.Z, @[ParameterName(name = "other")] kotlin.Any?, kotlin.Boolean> + correspondingProperty: PROPERTY name:equals visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KFunction2<.Z, @[ParameterName(name = "other")] kotlin.Any?, kotlin.Boolean> declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:equals type:kotlin.reflect.KFunction2<.Z, @[ParameterName(name = "other")] kotlin.Any?, kotlin.Boolean> visibility:private [final,static]' type=kotlin.reflect.KFunction2<.Z, @[ParameterName(name = "other")] kotlin.Any?, kotlin.Boolean> origin=null CLASS CLASS name:Z modality:FINAL visibility:public [value] superTypes:[kotlin.Any] annotations: JvmInline $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.Z [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Z modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -19,27 +23,11 @@ FILE fqName: fileName:/valueClassEquals.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Z' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Z declared in .Z.' type=.Z origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Z) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Z + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.Z [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Z' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Z(" - CONST String type=kotlin.String value="s=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Z declared in .Z.toString' type=.Z origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Z) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Z - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Z' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Z declared in .Z.hashCode' type=.Z origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Z modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Z, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -67,12 +55,24 @@ FILE fqName: fileName:/valueClassEquals.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Z' CONST Boolean type=kotlin.Boolean value=true - PROPERTY name:equals visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:equals type:kotlin.reflect.KFunction2<.Z, @[ParameterName(name = "other")] kotlin.Any?, kotlin.Boolean> visibility:private [final,static] - EXPRESSION_BODY - FUNCTION_REFERENCE 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Z' type=kotlin.reflect.KFunction2<.Z, @[ParameterName(name = "other")] kotlin.Any?, kotlin.Boolean> origin=null reflectionTarget= - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction2<.Z, @[ParameterName(name = "other")] kotlin.Any?, kotlin.Boolean> - correspondingProperty: PROPERTY name:equals visibility:public modality:FINAL [val] + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Z) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Z BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KFunction2<.Z, @[ParameterName(name = "other")] kotlin.Any?, kotlin.Boolean> declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:equals type:kotlin.reflect.KFunction2<.Z, @[ParameterName(name = "other")] kotlin.Any?, kotlin.Boolean> visibility:private [final,static]' type=kotlin.reflect.KFunction2<.Z, @[ParameterName(name = "other")] kotlin.Any?, kotlin.Boolean> origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Z' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Z declared in .Z.hashCode' type=.Z origin=null + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Z) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Z' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Z(" + CONST String type=kotlin.String value="s=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Z declared in .Z.toString' type=.Z origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/firProblems/valueClassEquals.kt.txt b/compiler/testData/ir/irText/firProblems/valueClassEquals.kt.txt index 5456f123bc7..95027e8966e 100644 --- a/compiler/testData/ir/irText/firProblems/valueClassEquals.kt.txt +++ b/compiler/testData/ir/irText/firProblems/valueClassEquals.kt.txt @@ -1,21 +1,17 @@ +val equals: KFunction2 + field = Z::equals + get + @JvmInline value class Z { - constructor(s: String) /* primary */ { - super/*Any*/() - /* () */ - - } - val s: String field = s get - override fun toString(): String { - return "Z(" + "s=" + .#s + ")" - } + constructor(s: String) /* primary */ { + super/*Any*/() + /* () */ - override fun hashCode(): Int { - return .#s.hashCode() } override operator fun equals(other: Any?): Boolean { @@ -29,8 +25,13 @@ value class Z { return true } + override fun hashCode(): Int { + return .#s.hashCode() + } + + override fun toString(): String { + return "Z(" + "s=" + .#s + ")" + } + } -val equals: KFunction2 - field = Z::equals - get diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.ir.txt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.ir.txt index e653e552ccf..ba8e18599e4 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.ir.txt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.ir.txt @@ -6,13 +6,6 @@ FILE fqName: fileName:/dynamicBinaryEqualityOperator.kt DYN_OP operator=EQEQ type=kotlin.Boolean receiver: GET_VAR 'd: dynamic declared in .testEqeq' type=dynamic origin=null 0: CONST Int type=kotlin.Int value=3 - FUN name:testExclEq visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Boolean - VALUE_PARAMETER name:d index:0 type:dynamic - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testExclEq (d: dynamic): kotlin.Boolean declared in ' - DYN_OP operator=EXCLEQ type=kotlin.Boolean - receiver: GET_VAR 'd: dynamic declared in .testExclEq' type=dynamic origin=null - 0: CONST Int type=kotlin.Int value=3 FUN name:testEqeqeq visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Boolean VALUE_PARAMETER name:d index:0 type:dynamic BLOCK_BODY @@ -20,6 +13,13 @@ FILE fqName: fileName:/dynamicBinaryEqualityOperator.kt DYN_OP operator=EQEQEQ type=kotlin.Boolean receiver: GET_VAR 'd: dynamic declared in .testEqeqeq' type=dynamic origin=null 0: CONST Int type=kotlin.Int value=3 + FUN name:testExclEq visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Boolean + VALUE_PARAMETER name:d index:0 type:dynamic + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testExclEq (d: dynamic): kotlin.Boolean declared in ' + DYN_OP operator=EXCLEQ type=kotlin.Boolean + receiver: GET_VAR 'd: dynamic declared in .testExclEq' type=dynamic origin=null + 0: CONST Int type=kotlin.Int value=3 FUN name:testExclEqeq visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Boolean VALUE_PARAMETER name:d index:0 type:dynamic BLOCK_BODY diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.kt.txt index cfec12a5b0b..29e3a2f05fb 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.kt.txt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.kt.txt @@ -2,14 +2,14 @@ fun testEqeq(d: dynamic): Boolean { return d == 3 } -fun testExclEq(d: dynamic): Boolean { - return d != 3 -} - fun testEqeqeq(d: dynamic): Boolean { return d === 3 } +fun testExclEq(d: dynamic): Boolean { + return d != 3 +} + fun testExclEqeq(d: dynamic): Boolean { return d !== 3 } diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.ir.txt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.ir.txt index cd8195fd4fa..111dc281154 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.ir.txt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.ir.txt @@ -1,11 +1,4 @@ FILE fqName: fileName:/dynamicBinaryOperator.kt - FUN name:testBinaryPlus visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic - VALUE_PARAMETER name:d index:0 type:dynamic - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testBinaryPlus (d: dynamic): dynamic declared in ' - DYN_OP operator=BINARY_PLUS type=dynamic - receiver: GET_VAR 'd: dynamic declared in .testBinaryPlus' type=dynamic origin=null - 0: CONST Int type=kotlin.Int value=1 FUN name:testBinaryMinus visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic VALUE_PARAMETER name:d index:0 type:dynamic BLOCK_BODY @@ -13,13 +6,13 @@ FILE fqName: fileName:/dynamicBinaryOperator.kt DYN_OP operator=BINARY_MINUS type=dynamic receiver: GET_VAR 'd: dynamic declared in .testBinaryMinus' type=dynamic origin=null 0: CONST Int type=kotlin.Int value=1 - FUN name:testMul visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic + FUN name:testBinaryPlus visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic VALUE_PARAMETER name:d index:0 type:dynamic BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testMul (d: dynamic): dynamic declared in ' - DYN_OP operator=MUL type=dynamic - receiver: GET_VAR 'd: dynamic declared in .testMul' type=dynamic origin=null - 0: CONST Int type=kotlin.Int value=2 + RETURN type=kotlin.Nothing from='public final fun testBinaryPlus (d: dynamic): dynamic declared in ' + DYN_OP operator=BINARY_PLUS type=dynamic + receiver: GET_VAR 'd: dynamic declared in .testBinaryPlus' type=dynamic origin=null + 0: CONST Int type=kotlin.Int value=1 FUN name:testDiv visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic VALUE_PARAMETER name:d index:0 type:dynamic BLOCK_BODY @@ -34,3 +27,10 @@ FILE fqName: fileName:/dynamicBinaryOperator.kt DYN_OP operator=MOD type=dynamic receiver: GET_VAR 'd: dynamic declared in .testMod' type=dynamic origin=null 0: CONST Int type=kotlin.Int value=2 + FUN name:testMul visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic + VALUE_PARAMETER name:d index:0 type:dynamic + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testMul (d: dynamic): dynamic declared in ' + DYN_OP operator=MUL type=dynamic + receiver: GET_VAR 'd: dynamic declared in .testMul' type=dynamic origin=null + 0: CONST Int type=kotlin.Int value=2 diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.kt.txt index a401a3f656a..ca6f837a340 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.kt.txt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.kt.txt @@ -1,13 +1,9 @@ -fun testBinaryPlus(d: dynamic): dynamic { - return d + 1 -} - fun testBinaryMinus(d: dynamic): dynamic { return d - 1 } -fun testMul(d: dynamic): dynamic { - return d * 2 +fun testBinaryPlus(d: dynamic): dynamic { + return d + 1 } fun testDiv(d: dynamic): dynamic { @@ -18,3 +14,7 @@ fun testMod(d: dynamic): dynamic { return d % 2 } +fun testMul(d: dynamic): dynamic { + return d * 2 +} + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.ir.txt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.ir.txt index 18df105dad6..6c9dbaeb975 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.ir.txt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.ir.txt @@ -1,18 +1,4 @@ FILE fqName: fileName:/dynamicBinaryRelationalOperator.kt - FUN name:testLess visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Boolean - VALUE_PARAMETER name:d index:0 type:dynamic - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testLess (d: dynamic): kotlin.Boolean declared in ' - DYN_OP operator=LT type=kotlin.Boolean - receiver: GET_VAR 'd: dynamic declared in .testLess' type=dynamic origin=null - 0: CONST Int type=kotlin.Int value=2 - FUN name:testLessOrEqual visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Boolean - VALUE_PARAMETER name:d index:0 type:dynamic - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testLessOrEqual (d: dynamic): kotlin.Boolean declared in ' - DYN_OP operator=LE type=kotlin.Boolean - receiver: GET_VAR 'd: dynamic declared in .testLessOrEqual' type=dynamic origin=null - 0: CONST Int type=kotlin.Int value=2 FUN name:testGreater visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Boolean VALUE_PARAMETER name:d index:0 type:dynamic BLOCK_BODY @@ -27,3 +13,17 @@ FILE fqName: fileName:/dynamicBinaryRelationalOperator.kt DYN_OP operator=GE type=kotlin.Boolean receiver: GET_VAR 'd: dynamic declared in .testGreaterOrEqual' type=dynamic origin=null 0: CONST Int type=kotlin.Int value=2 + FUN name:testLess visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Boolean + VALUE_PARAMETER name:d index:0 type:dynamic + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testLess (d: dynamic): kotlin.Boolean declared in ' + DYN_OP operator=LT type=kotlin.Boolean + receiver: GET_VAR 'd: dynamic declared in .testLess' type=dynamic origin=null + 0: CONST Int type=kotlin.Int value=2 + FUN name:testLessOrEqual visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Boolean + VALUE_PARAMETER name:d index:0 type:dynamic + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testLessOrEqual (d: dynamic): kotlin.Boolean declared in ' + DYN_OP operator=LE type=kotlin.Boolean + receiver: GET_VAR 'd: dynamic declared in .testLessOrEqual' type=dynamic origin=null + 0: CONST Int type=kotlin.Int value=2 diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.kt.txt index ae79535199e..e9f808bc836 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.kt.txt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.kt.txt @@ -1,11 +1,3 @@ -fun testLess(d: dynamic): Boolean { - return d < 2 -} - -fun testLessOrEqual(d: dynamic): Boolean { - return d <= 2 -} - fun testGreater(d: dynamic): Boolean { return d > 2 } @@ -14,3 +6,11 @@ fun testGreaterOrEqual(d: dynamic): Boolean { return d >= 2 } +fun testLess(d: dynamic): Boolean { + return d < 2 +} + +fun testLessOrEqual(d: dynamic): Boolean { + return d <= 2 +} + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.fir.ir.txt b/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.fir.ir.txt index 8d12bd042df..48bf79ee997 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.fir.ir.txt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.fir.ir.txt @@ -1,12 +1,6 @@ FILE fqName: fileName:/dynamicInDataClass.kt CLASS CLASS name:Some modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Some - CONSTRUCTOR visibility:public <> (a:kotlin.String, b:dynamic) returnType:.Some [primary] - VALUE_PARAMETER name:a index:0 type:kotlin.String - VALUE_PARAMETER name:b index:1 type:dynamic - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -29,6 +23,12 @@ FILE fqName: fileName:/dynamicInDataClass.kt RETURN type=kotlin.Nothing from='public final fun (): dynamic declared in .Some' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null receiver: GET_VAR ': .Some declared in .Some.' type=.Some origin=null + CONSTRUCTOR visibility:public <> (a:kotlin.String, b:dynamic) returnType:.Some [primary] + VALUE_PARAMETER name:a index:0 type:kotlin.String + VALUE_PARAMETER name:b index:1 type:dynamic + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Some) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.Some BLOCK_BODY @@ -56,50 +56,6 @@ FILE fqName: fileName:/dynamicInDataClass.kt CONSTRUCTOR_CALL 'public constructor (a: kotlin.String, b: dynamic) declared in .Some' type=.Some origin=null a: GET_VAR 'a: kotlin.String declared in .Some.copy' type=kotlin.String origin=null b: GET_VAR 'b: dynamic declared in .Some.copy' type=dynamic origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Some) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Some - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Some' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Some(" - CONST String type=kotlin.String value="a=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Some declared in .Some.toString' type=.Some origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="b=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null - receiver: GET_VAR ': .Some declared in .Some.toString' type=.Some origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Some) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Some - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Some declared in .Some.hashCode' type=.Some origin=null - SET_VAR 'var result: kotlin.Int declared in .Some.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Some.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null - receiver: GET_VAR ': .Some declared in .Some.hashCode' type=.Some origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null - receiver: GET_VAR ': .Some declared in .Some.hashCode' type=.Some origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Some' - GET_VAR 'var result: kotlin.Int declared in .Some.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Some, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -144,6 +100,50 @@ FILE fqName: fileName:/dynamicInDataClass.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Some' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Some) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Some + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Some declared in .Some.hashCode' type=.Some origin=null + SET_VAR 'var result: kotlin.Int declared in .Some.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Some.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null + receiver: GET_VAR ': .Some declared in .Some.hashCode' type=.Some origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null + receiver: GET_VAR ': .Some declared in .Some.hashCode' type=.Some origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Some' + GET_VAR 'var result: kotlin.Int declared in .Some.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Some) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Some + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Some' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Some(" + CONST String type=kotlin.String value="a=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Some declared in .Some.toString' type=.Some origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="b=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null + receiver: GET_VAR ': .Some declared in .Some.toString' type=.Some origin=null + CONST String type=kotlin.String value=")" FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:event type:.Some [val] diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.fir.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.fir.kt.txt index 565b3fa909b..5a869ec3b3a 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.fir.kt.txt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.fir.kt.txt @@ -1,10 +1,4 @@ data class Some { - constructor(a: String, b: dynamic) /* primary */ { - super/*Any*/() - /* () */ - - } - val a: String field = a get @@ -13,6 +7,12 @@ data class Some { field = b get + constructor(a: String, b: dynamic) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): String { return .#a } @@ -25,19 +25,6 @@ data class Some { return Some(a = a, b = b) } - override fun toString(): String { - return "Some(" + "a=" + .#a + ", " + "b=" + .#b + ")" - } - - override fun hashCode(): Int { - var result: Int = .#a.hashCode() - result = result.times(other = 31).plus(other = when { - EQEQ(arg0 = .#b, arg1 = null) -> 0 - else -> .#b.hashCode() - }) - return result - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -55,6 +42,19 @@ data class Some { return true } + override fun hashCode(): Int { + var result: Int = .#a.hashCode() + result = result.times(other = 31).plus(other = when { + EQEQ(arg0 = .#b, arg1 = null) -> 0 + else -> .#b.hashCode() + }) + return result + } + + override fun toString(): String { + return "Some(" + "a=" + .#a + ", " + "b=" + .#b + ")" + } + } fun box(): String { @@ -62,3 +62,4 @@ fun box(): String { event.hashCode() /*~> Unit */ return "OK" } + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.ir.txt b/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.ir.txt index f7b9f44d04b..eade8dde503 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.ir.txt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.ir.txt @@ -1,12 +1,6 @@ FILE fqName: fileName:/dynamicInDataClass.kt CLASS CLASS name:Some modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Some - CONSTRUCTOR visibility:public <> (a:kotlin.String, b:dynamic) returnType:.Some [primary] - VALUE_PARAMETER name:a index:0 type:kotlin.String - VALUE_PARAMETER name:b index:1 type:dynamic - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -29,6 +23,12 @@ FILE fqName: fileName:/dynamicInDataClass.kt RETURN type=kotlin.Nothing from='public final fun (): dynamic declared in .Some' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null receiver: GET_VAR ': .Some declared in .Some.' type=.Some origin=null + CONSTRUCTOR visibility:public <> (a:kotlin.String, b:dynamic) returnType:.Some [primary] + VALUE_PARAMETER name:a index:0 type:kotlin.String + VALUE_PARAMETER name:b index:1 type:dynamic + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Some) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.Some BLOCK_BODY @@ -56,51 +56,6 @@ FILE fqName: fileName:/dynamicInDataClass.kt CONSTRUCTOR_CALL 'public constructor (a: kotlin.String, b: dynamic) declared in .Some' type=.Some origin=null a: GET_VAR 'a: kotlin.String declared in .Some.copy' type=kotlin.String origin=null b: GET_VAR 'b: dynamic declared in .Some.copy' type=dynamic origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Some) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Some - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Some' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Some(" - CONST String type=kotlin.String value="a=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Some declared in .Some.toString' type=.Some origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="b=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null - receiver: GET_VAR ': .Some declared in .Some.toString' type=.Some origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Some) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Some - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Some declared in .Some.hashCode' type=.Some origin=null - SET_VAR 'var result: kotlin.Int declared in .Some.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .Some.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null - receiver: GET_VAR ': .Some declared in .Some.hashCode' type=.Some origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: TYPE_OP type=kotlin.Any origin=IMPLICIT_DYNAMIC_CAST typeOperand=kotlin.Any - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null - receiver: GET_VAR ': .Some declared in .Some.hashCode' type=.Some origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Some' - GET_VAR 'var result: kotlin.Int declared in .Some.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Some, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -145,6 +100,51 @@ FILE fqName: fileName:/dynamicInDataClass.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Some' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Some) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Some + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Some declared in .Some.hashCode' type=.Some origin=null + SET_VAR 'var result: kotlin.Int declared in .Some.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .Some.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null + receiver: GET_VAR ': .Some declared in .Some.hashCode' type=.Some origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: TYPE_OP type=kotlin.Any origin=IMPLICIT_DYNAMIC_CAST typeOperand=kotlin.Any + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null + receiver: GET_VAR ': .Some declared in .Some.hashCode' type=.Some origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Some' + GET_VAR 'var result: kotlin.Int declared in .Some.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Some) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Some + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Some' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Some(" + CONST String type=kotlin.String value="a=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Some declared in .Some.toString' type=.Some origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="b=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:dynamic visibility:private [final]' type=dynamic origin=null + receiver: GET_VAR ': .Some declared in .Some.toString' type=.Some origin=null + CONST String type=kotlin.String value=")" FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:event type:.Some [val] diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.kt.txt index fa0152364a0..77ca546a638 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.kt.txt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicInDataClass.kt.txt @@ -1,10 +1,4 @@ data class Some { - constructor(a: String, b: dynamic) /* primary */ { - super/*Any*/() - /* () */ - - } - val a: String field = a get @@ -13,6 +7,12 @@ data class Some { field = b get + constructor(a: String, b: dynamic) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): String { return .#a } @@ -25,19 +25,6 @@ data class Some { return Some(a = a, b = b) } - override fun toString(): String { - return "Some(" + "a=" + .#a + ", " + "b=" + .#b + ")" - } - - override fun hashCode(): Int { - var result: Int = .#a.hashCode() - result = result.times(other = 31).plus(other = when { - EQEQ(arg0 = .#b, arg1 = null) -> 0 - else -> .#b /*~> Any */.hashCode() - }) - return result - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -55,6 +42,19 @@ data class Some { return true } + override fun hashCode(): Int { + var result: Int = .#a.hashCode() + result = result.times(other = 31).plus(other = when { + EQEQ(arg0 = .#b, arg1 = null) -> 0 + else -> .#b /*~> Any */.hashCode() + }) + return result + } + + override fun toString(): String { + return "Some(" + "a=" + .#a + ", " + "b=" + .#b + ")" + } + } fun box(): String { @@ -62,3 +62,4 @@ fun box(): String { event.hashCode() /*~> Unit */ return "OK" } + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.ir.txt b/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.ir.txt index a20103c524a..f694b16e986 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.ir.txt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.ir.txt @@ -1,4 +1,10 @@ FILE fqName: fileName:/dynamicUnaryOperator.kt + FUN name:testExcl visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic + VALUE_PARAMETER name:d index:0 type:dynamic + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testExcl (d: dynamic): dynamic declared in ' + DYN_OP operator=EXCL type=dynamic + receiver: GET_VAR 'd: dynamic declared in .testExcl' type=dynamic origin=null FUN name:testUnaryMinus visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic VALUE_PARAMETER name:d index:0 type:dynamic BLOCK_BODY @@ -11,9 +17,3 @@ FILE fqName: fileName:/dynamicUnaryOperator.kt RETURN type=kotlin.Nothing from='public final fun testUnaryPlus (d: dynamic): dynamic declared in ' DYN_OP operator=UNARY_PLUS type=dynamic receiver: GET_VAR 'd: dynamic declared in .testUnaryPlus' type=dynamic origin=null - FUN name:testExcl visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic - VALUE_PARAMETER name:d index:0 type:dynamic - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testExcl (d: dynamic): dynamic declared in ' - DYN_OP operator=EXCL type=dynamic - receiver: GET_VAR 'd: dynamic declared in .testExcl' type=dynamic origin=null diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.kt.txt index 9e62fa8c1d9..5dc89f461ea 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.kt.txt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.kt.txt @@ -1,3 +1,7 @@ +fun testExcl(d: dynamic): dynamic { + return !d +} + fun testUnaryMinus(d: dynamic): dynamic { return -d } @@ -6,7 +10,3 @@ fun testUnaryPlus(d: dynamic): dynamic { return +d } -fun testExcl(d: dynamic): dynamic { - return !d -} - diff --git a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.fir.ir.txt b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.fir.ir.txt index 31b4b58fd67..a01dfb72df6 100644 --- a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.fir.ir.txt +++ b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.fir.ir.txt @@ -32,11 +32,6 @@ FILE fqName: fileName:/implicitCastToDynamic.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d2 type:dynamic visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': dynamic declared in .' type=dynamic origin=null - FUN name:withDynamic visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic - VALUE_PARAMETER name:d index:0 type:dynamic - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withDynamic (d: dynamic): dynamic declared in ' - GET_VAR 'd: dynamic declared in .withDynamic' type=dynamic origin=null FUN name:test1 visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY @@ -77,3 +72,8 @@ FILE fqName: fileName:/implicitCastToDynamic.kt : GET_VAR 'na: kotlin.Any? declared in .test5' type=kotlin.Any? origin=null CALL 'public final fun (: dynamic): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : GET_VAR 's: kotlin.String declared in .test5' type=kotlin.String origin=null + FUN name:withDynamic visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic + VALUE_PARAMETER name:d index:0 type:dynamic + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun withDynamic (d: dynamic): dynamic declared in ' + GET_VAR 'd: dynamic declared in .withDynamic' type=dynamic origin=null diff --git a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.fir.kt.txt b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.fir.kt.txt index f6b20195db7..a4e6ea0958f 100644 --- a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.fir.kt.txt +++ b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.fir.kt.txt @@ -11,10 +11,6 @@ var d2: dynamic get set -fun withDynamic(d: dynamic): dynamic { - return d -} - fun test1(s: String) { withDynamic(d = s) /*~> Unit */ } @@ -40,3 +36,7 @@ fun test5(a: Any, s: String, na: Any?) { ( = s) } +fun withDynamic(d: dynamic): dynamic { + return d +} + diff --git a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.ir.txt b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.ir.txt index 1ec8e63e104..29f44c7bd51 100644 --- a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.ir.txt +++ b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.ir.txt @@ -32,11 +32,6 @@ FILE fqName: fileName:/implicitCastToDynamic.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d2 type:dynamic visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': dynamic declared in .' type=dynamic origin=null - FUN name:withDynamic visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic - VALUE_PARAMETER name:d index:0 type:dynamic - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withDynamic (d: dynamic): dynamic declared in ' - GET_VAR 'd: dynamic declared in .withDynamic' type=dynamic origin=null FUN name:test1 visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY @@ -76,3 +71,8 @@ FILE fqName: fileName:/implicitCastToDynamic.kt : GET_VAR 'na: kotlin.Any? declared in .test5' type=kotlin.Any? origin=null CALL 'public final fun (: dynamic): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : GET_VAR 's: kotlin.String declared in .test5' type=kotlin.String origin=null + FUN name:withDynamic visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic + VALUE_PARAMETER name:d index:0 type:dynamic + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun withDynamic (d: dynamic): dynamic declared in ' + GET_VAR 'd: dynamic declared in .withDynamic' type=dynamic origin=null diff --git a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.kt.txt b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.kt.txt index 1a0c49f7640..331a3404628 100644 --- a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.kt.txt +++ b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.kt.txt @@ -11,10 +11,6 @@ var d2: dynamic get set -fun withDynamic(d: dynamic): dynamic { - return d -} - fun test1(s: String) { withDynamic(d = s) } @@ -40,3 +36,7 @@ fun test5(a: Any, s: String, na: Any?) { ( = s) } +fun withDynamic(d: dynamic): dynamic { + return d +} + diff --git a/compiler/testData/ir/irText/js/external/kt38765.fir.ir.txt b/compiler/testData/ir/irText/js/external/kt38765.fir.ir.txt index bbce31c2cb8..0548d089f7b 100644 --- a/compiler/testData/ir/irText/js/external/kt38765.fir.ir.txt +++ b/compiler/testData/ir/irText/js/external/kt38765.fir.ir.txt @@ -1,10 +1,6 @@ FILE fqName:events fileName:/kt38765.kt CLASS CLASS name:internal modality:OPEN visibility:public [external] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:events.internal - CONSTRUCTOR visibility:public <> () returnType:events.internal [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:internal modality:OPEN visibility:public [external] superTypes:[kotlin.Any]' CLASS CLASS name:EventEmitterP modality:OPEN visibility:public superTypes:[events.internal] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:events.internal.EventEmitterP CONSTRUCTOR visibility:public <> () returnType:events.internal.EventEmitterP [primary] @@ -44,47 +40,24 @@ FILE fqName:events fileName:/kt38765.kt overridden: public open fun toString (): kotlin.String declared in events.internal $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:NestedExternalObject modality:FINAL visibility:public superTypes:[events.internal] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:events.internal.NestedExternalObject - CONSTRUCTOR visibility:private <> () returnType:events.internal.NestedExternalObject [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:NestedExternalObject modality:FINAL visibility:public superTypes:[events.internal]' - 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 events.internal - $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 events.internal - $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 events.internal - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ENUM_CLASS name:NestedExternalEnum modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:events.internal.NestedExternalEnum - CONSTRUCTOR visibility:private <> () returnType:events.internal.NestedExternalEnum [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : events.internal.NestedExternalEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:NestedExternalEnum modality:FINAL visibility:public superTypes:[kotlin.Enum]' ENUM_ENTRY name:A init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in events.internal.NestedExternalEnum' ENUM_ENTRY name:B init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in events.internal.NestedExternalEnum' - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> () returnType:events.internal.NestedExternalEnum [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : events.internal.NestedExternalEnum + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:NestedExternalEnum modality:FINAL visibility:public superTypes:[kotlin.Enum]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:events.internal.NestedExternalEnum VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:events.internal.NestedExternalEnum) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -103,6 +76,10 @@ FILE fqName:events fileName:/kt38765.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -136,6 +113,29 @@ FILE fqName:events fileName:/kt38765.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:NestedExternalObject modality:FINAL visibility:public superTypes:[events.internal] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:events.internal.NestedExternalObject + CONSTRUCTOR visibility:private <> () returnType:events.internal.NestedExternalObject [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:NestedExternalObject modality:FINAL visibility:public superTypes:[events.internal]' + 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 events.internal + $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 events.internal + $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 events.internal + $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:events.internal [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:internal modality:OPEN visibility:public [external] superTypes:[kotlin.Any]' FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [external,fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/js/external/kt38765.fir.kt.txt b/compiler/testData/ir/irText/js/external/kt38765.fir.kt.txt index 087fe78aeb6..4e336fc3c1f 100644 --- a/compiler/testData/ir/irText/js/external/kt38765.fir.kt.txt +++ b/compiler/testData/ir/irText/js/external/kt38765.fir.kt.txt @@ -1,12 +1,6 @@ package events open external class internal { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - open class EventEmitterP : internal { constructor() /* primary */ { super/*Any*/() @@ -25,30 +19,21 @@ open external class internal { } - object NestedExternalObject : internal { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - } - enum class NestedExternalEnum : Enum { + A = NestedExternalEnum() + + B = NestedExternalEnum() + private constructor() /* primary */ { super/*Enum*/() /* () */ } - A = NestedExternalEnum() - - B = NestedExternalEnum() + fun valueOf(value: String): NestedExternalEnum /* Synthetic body for ENUM_VALUEOF */ fun values(): Array /* Synthetic body for ENUM_VALUES */ - fun valueOf(value: String): NestedExternalEnum /* Synthetic body for ENUM_VALUEOF */ - val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ @@ -57,5 +42,20 @@ open external class internal { interface NestedExternalInterface { } + object NestedExternalObject : internal { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } diff --git a/compiler/testData/ir/irText/js/external/kt38765.ir.txt b/compiler/testData/ir/irText/js/external/kt38765.ir.txt index f075c6a4f45..9e9c4fc7d99 100644 --- a/compiler/testData/ir/irText/js/external/kt38765.ir.txt +++ b/compiler/testData/ir/irText/js/external/kt38765.ir.txt @@ -1,7 +1,6 @@ FILE fqName:events fileName:/kt38765.kt CLASS CLASS name:internal modality:OPEN visibility:public [external] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:events.internal - CONSTRUCTOR visibility:public <> () returnType:events.internal [external,primary] CLASS CLASS name:EventEmitterP modality:OPEN visibility:public [external] superTypes:[events.internal] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:events.internal.EventEmitterP CONSTRUCTOR visibility:public <> () returnType:events.internal.EventEmitterP [external,primary] @@ -35,49 +34,20 @@ FILE fqName:events fileName:/kt38765.kt overridden: public open fun toString (): kotlin.String declared in events.internal $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:NestedExternalObject modality:FINAL visibility:public [external] superTypes:[events.internal] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:events.internal.NestedExternalObject - CONSTRUCTOR visibility:private <> () returnType:events.internal.NestedExternalObject [external,primary] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [external,fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in events.internal - $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 [external,fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in events.internal - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [external,fake_override] - overridden: - public open fun toString (): kotlin.String declared in events.internal - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS ENUM_CLASS name:NestedExternalEnum modality:FINAL visibility:public [external] superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:events.internal.NestedExternalEnum - CONSTRUCTOR visibility:private <> () returnType:events.internal.NestedExternalEnum [external,primary] ENUM_ENTRY name:A init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in events.internal.NestedExternalEnum' ENUM_ENTRY name:B init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in events.internal.NestedExternalEnum' - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [external,fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [external,fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [external,fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [external,fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [external,fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [external,fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + CONSTRUCTOR visibility:private <> () returnType:events.internal.NestedExternalEnum [external,primary] + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:events.internal.NestedExternalEnum [external] + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array [external] + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:events.internal.NestedExternalEnum) returnType:kotlin.Int [external,fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -96,15 +66,28 @@ FILE fqName:events fileName:/kt38765.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array [external] - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:events.internal.NestedExternalEnum [external] - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [external,val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries [external] correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [external,val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [external,fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [external,fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [external,fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [external,fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [external,fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [external,fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum CLASS INTERFACE name:NestedExternalInterface modality:ABSTRACT visibility:public [external] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:events.internal.NestedExternalInterface FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [external,fake_override,operator] @@ -120,6 +103,23 @@ FILE fqName:events fileName:/kt38765.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:NestedExternalObject modality:FINAL visibility:public [external] superTypes:[events.internal] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:events.internal.NestedExternalObject + CONSTRUCTOR visibility:private <> () returnType:events.internal.NestedExternalObject [external,primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [external,fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in events.internal + $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 [external,fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in events.internal + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [external,fake_override] + overridden: + public open fun toString (): kotlin.String declared in events.internal + $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:public <> () returnType:events.internal [external,primary] FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [external,fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/js/external/kt38765.kt.txt b/compiler/testData/ir/irText/js/external/kt38765.kt.txt index 7aa452616a0..5c709064721 100644 --- a/compiler/testData/ir/irText/js/external/kt38765.kt.txt +++ b/compiler/testData/ir/irText/js/external/kt38765.kt.txt @@ -1,8 +1,6 @@ package events open external class internal { - external constructor() /* primary */ - open external class EventEmitterP : internal { external constructor() /* primary */ @@ -13,22 +11,17 @@ open external class internal { } - external object NestedExternalObject : internal { - private external constructor() /* primary */ - - } - external enum class NestedExternalEnum : Enum { - private external constructor() /* primary */ - A = NestedExternalEnum() B = NestedExternalEnum() - external fun values(): Array /* Synthetic body for ENUM_VALUES */ + private external constructor() /* primary */ external fun valueOf(value: String): NestedExternalEnum /* Synthetic body for ENUM_VALUEOF */ + external fun values(): Array /* Synthetic body for ENUM_VALUES */ + external val entries: EnumEntries external get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ @@ -37,5 +30,12 @@ open external class internal { external interface NestedExternalInterface { } + external object NestedExternalObject : internal { + private external constructor() /* primary */ + + } + + external constructor() /* primary */ + } diff --git a/compiler/testData/ir/irText/js/native/nativeNativeKotlin.fir.ir.txt b/compiler/testData/ir/irText/js/native/nativeNativeKotlin.fir.ir.txt index 84ec5c879f8..1c87cd2e391 100644 --- a/compiler/testData/ir/irText/js/native/nativeNativeKotlin.fir.ir.txt +++ b/compiler/testData/ir/irText/js/native/nativeNativeKotlin.fir.ir.txt @@ -5,8 +5,6 @@ FILE fqName:foo fileName:/nativeNativeKotlin.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public [external] superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:foo.A FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [external,fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -20,23 +18,23 @@ FILE fqName:foo fileName:/nativeNativeKotlin.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:foo.A CLASS CLASS name:B modality:OPEN visibility:public [external] superTypes:[foo.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.B CONSTRUCTOR visibility:public <> () returnType:foo.B [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public [external] superTypes:[foo.A]' - FUN name:bar visibility:public modality:FINAL <> ($this:foo.B) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:foo.B - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String [external,fake_override] - overridden: - public final fun foo (): kotlin.String declared in foo.A - $this: VALUE_PARAMETER name: type:foo.A FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [external,fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in foo.A $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String [external,fake_override] + overridden: + public final fun foo (): kotlin.String declared in foo.A + $this: VALUE_PARAMETER name: type:foo.A FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [external,fake_override] overridden: public open fun hashCode (): kotlin.Int declared in foo.A @@ -45,6 +43,8 @@ FILE fqName:foo fileName:/nativeNativeKotlin.kt overridden: public open fun toString (): kotlin.String declared in foo.A $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> ($this:foo.B) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:foo.B CLASS CLASS name:C modality:FINAL visibility:public superTypes:[foo.B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.C CONSTRUCTOR visibility:public <> () returnType:foo.C [primary] @@ -55,15 +55,15 @@ FILE fqName:foo fileName:/nativeNativeKotlin.kt overridden: public final fun bar (): kotlin.String declared in foo.B $this: VALUE_PARAMETER name: type:foo.B - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String [fake_override] - overridden: - public final fun foo (): kotlin.String declared in foo.B - $this: VALUE_PARAMETER name: type:foo.A 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 foo.B $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String [fake_override] + overridden: + public final fun foo (): kotlin.String declared in foo.B + $this: VALUE_PARAMETER name: type:foo.A 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 foo.B diff --git a/compiler/testData/ir/irText/js/native/nativeNativeKotlin.ir.txt b/compiler/testData/ir/irText/js/native/nativeNativeKotlin.ir.txt index e89cb7227f2..b89e1073dd2 100644 --- a/compiler/testData/ir/irText/js/native/nativeNativeKotlin.ir.txt +++ b/compiler/testData/ir/irText/js/native/nativeNativeKotlin.ir.txt @@ -2,8 +2,6 @@ FILE fqName:foo fileName:/nativeNativeKotlin.kt CLASS CLASS name:A modality:OPEN visibility:public [external] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.A CONSTRUCTOR visibility:public <> () returnType:foo.A [external,primary] - FUN name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String [external] - $this: VALUE_PARAMETER name: type:foo.A FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [external,fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -17,20 +15,20 @@ FILE fqName:foo fileName:/nativeNativeKotlin.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String [external] + $this: VALUE_PARAMETER name: type:foo.A CLASS CLASS name:B modality:OPEN visibility:public [external] superTypes:[foo.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.B CONSTRUCTOR visibility:public <> () returnType:foo.B [external,primary] - FUN name:bar visibility:public modality:FINAL <> ($this:foo.B) returnType:kotlin.String [external] - $this: VALUE_PARAMETER name: type:foo.B - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String [external,fake_override] - overridden: - public final fun foo (): kotlin.String declared in foo.A - $this: VALUE_PARAMETER name: type:foo.A FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [external,fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in foo.A $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String [external,fake_override] + overridden: + public final fun foo (): kotlin.String declared in foo.A + $this: VALUE_PARAMETER name: type:foo.A FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [external,fake_override] overridden: public open fun hashCode (): kotlin.Int declared in foo.A @@ -39,6 +37,8 @@ FILE fqName:foo fileName:/nativeNativeKotlin.kt overridden: public open fun toString (): kotlin.String declared in foo.A $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> ($this:foo.B) returnType:kotlin.String [external] + $this: VALUE_PARAMETER name: type:foo.B CLASS CLASS name:C modality:FINAL visibility:public superTypes:[foo.B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:foo.C CONSTRUCTOR visibility:public <> () returnType:foo.C [primary] @@ -49,15 +49,15 @@ FILE fqName:foo fileName:/nativeNativeKotlin.kt overridden: public final fun bar (): kotlin.String declared in foo.B $this: VALUE_PARAMETER name: type:foo.B - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String [fake_override] - overridden: - public final fun foo (): kotlin.String declared in foo.B - $this: VALUE_PARAMETER name: type:foo.A 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 foo.B $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String [fake_override] + overridden: + public final fun foo (): kotlin.String declared in foo.B + $this: VALUE_PARAMETER name: type:foo.A 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 foo.B diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.ir.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.ir.txt index 27a2a7e93c3..648e6b18845 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.ir.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.ir.txt @@ -1,12 +1,31 @@ FILE fqName: fileName:/destructuringInLambda.kt + PROPERTY name:fn visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:private [static] + EXPRESSION_BODY + FUN_EXPR type=kotlin.Function1<.A, kotlin.Int> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (:.A) returnType:kotlin.Int + VALUE_PARAMETER DESTRUCTURED_OBJECT_PARAMETER name: index:0 type:.A + BLOCK_BODY + VAR name:y type:kotlin.Int [val] + CALL 'public final fun component2 (): kotlin.Int declared in .A' type=kotlin.Int origin=COMPONENT_N(index=2) + $this: GET_VAR ': .A declared in .fn.' type=.A origin=null + RETURN type=kotlin.Nothing from='local final fun (: .A): kotlin.Int declared in .fn' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CONST Int type=kotlin.Int value=42 + other: GET_VAR 'val y: kotlin.Int declared in .fn.' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1<.A, kotlin.Int> + correspondingProperty: PROPERTY name:fn visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1<.A, kotlin.Int> declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:private [static]' type=kotlin.Function1<.A, kotlin.Int> origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Function1<.A, kotlin.Int>) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:fn visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Function1<.A, kotlin.Int> + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Function1<.A, kotlin.Int> declared in .' type=kotlin.Function1<.A, kotlin.Int> origin=null CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.A [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -29,6 +48,12 @@ FILE fqName: fileName:/destructuringInLambda.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.A BLOCK_BODY @@ -56,41 +81,6 @@ FILE fqName: fileName:/destructuringInLambda.kt CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int) declared in .A' type=.A origin=null x: GET_VAR 'x: kotlin.Int declared in .A.copy' type=kotlin.Int origin=null y: GET_VAR 'y: kotlin.Int declared in .A.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="A(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="y=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null - SET_VAR 'var result: kotlin.Int declared in .A.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .A.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' - GET_VAR 'var result: kotlin.Int declared in .A.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -135,28 +125,38 @@ FILE fqName: fileName:/destructuringInLambda.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' CONST Boolean type=kotlin.Boolean value=true - PROPERTY name:fn visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:private [static] - EXPRESSION_BODY - FUN_EXPR type=kotlin.Function1<.A, kotlin.Int> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (:.A) returnType:kotlin.Int - VALUE_PARAMETER DESTRUCTURED_OBJECT_PARAMETER name: index:0 type:.A - BLOCK_BODY - VAR name:y type:kotlin.Int [val] - CALL 'public final fun component2 (): kotlin.Int declared in .A' type=kotlin.Int origin=COMPONENT_N(index=2) - $this: GET_VAR ': .A declared in .fn.' type=.A origin=null - RETURN type=kotlin.Nothing from='local final fun (: .A): kotlin.Int declared in .fn' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CONST Int type=kotlin.Int value=42 - other: GET_VAR 'val y: kotlin.Int declared in .fn.' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1<.A, kotlin.Int> - correspondingProperty: PROPERTY name:fn visibility:public modality:FINAL [var] + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1<.A, kotlin.Int> declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:private [static]' type=kotlin.Function1<.A, kotlin.Int> origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Function1<.A, kotlin.Int>) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:fn visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Function1<.A, kotlin.Int> + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + SET_VAR 'var result: kotlin.Int declared in .A.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .A.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' + GET_VAR 'var result: kotlin.Int declared in .A.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Function1<.A, kotlin.Int> declared in .' type=kotlin.Function1<.A, kotlin.Int> origin=null + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="A(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="y=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.kt.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.kt.txt index 2f18b011fbc..d3b1be488a2 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.kt.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.kt.txt @@ -1,10 +1,13 @@ -data class A { - constructor(x: Int, y: Int) /* primary */ { - super/*Any*/() - /* () */ - +var fn: Function1 + field = local fun (: A): Int { + val y: Int = .component2() + return 42.plus(other = y) } + get + set + +data class A { val x: Int field = x get @@ -13,6 +16,12 @@ data class A { field = y get + constructor(x: Int, y: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): Int { return .#x } @@ -25,16 +34,6 @@ data class A { return A(x = x, y = y) } - override fun toString(): String { - return "A(" + "x=" + .#x + ", " + "y=" + .#y + ")" - } - - override fun hashCode(): Int { - var result: Int = .#x.hashCode() - result = result.times(other = 31).plus(other = .#y.hashCode()) - return result - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -52,14 +51,15 @@ data class A { return true } -} - -var fn: Function1 - field = local fun (: A): Int { - val y: Int = .component2() - return 42.plus(other = y) + override fun hashCode(): Int { + var result: Int = .#x.hashCode() + result = result.times(other = 31).plus(other = .#y.hashCode()) + return result } - get - set + override fun toString(): String { + return "A(" + "x=" + .#x + ", " + "y=" + .#y + ")" + } + +} diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.ir.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.ir.txt index 4bf7e97c8f0..51f705e9466 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.ir.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.ir.txt @@ -1,12 +1,31 @@ FILE fqName: fileName:/destructuringInLambda.kt + PROPERTY name:fn visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:private [static] + EXPRESSION_BODY + FUN_EXPR type=kotlin.Function1<.A, kotlin.Int> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (:.A) returnType:kotlin.Int + VALUE_PARAMETER DESTRUCTURED_OBJECT_PARAMETER name: index:0 type:.A + BLOCK_BODY + VAR name:y type:kotlin.Int [val] + CALL 'public final fun component2 (): kotlin.Int declared in .A' type=kotlin.Int origin=COMPONENT_N(index=2) + $this: GET_VAR ': .A declared in .fn.' type=.A origin=DESTRUCTURING_DECLARATION + RETURN type=kotlin.Nothing from='local final fun (: .A): kotlin.Int declared in .fn' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CONST Int type=kotlin.Int value=42 + other: GET_VAR 'val y: kotlin.Int declared in .fn.' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1<.A, kotlin.Int> + correspondingProperty: PROPERTY name:fn visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1<.A, kotlin.Int> declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:private [static]' type=kotlin.Function1<.A, kotlin.Int> origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Function1<.A, kotlin.Int>) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:fn visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Function1<.A, kotlin.Int> + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Function1<.A, kotlin.Int> declared in .' type=kotlin.Function1<.A, kotlin.Int> origin=null CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.A [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -29,6 +48,12 @@ FILE fqName: fileName:/destructuringInLambda.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.A BLOCK_BODY @@ -56,41 +81,6 @@ FILE fqName: fileName:/destructuringInLambda.kt CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int) declared in .A' type=.A origin=null x: GET_VAR 'x: kotlin.Int declared in .A.copy' type=kotlin.Int origin=null y: GET_VAR 'y: kotlin.Int declared in .A.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="A(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="y=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null - SET_VAR 'var result: kotlin.Int declared in .A.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .A.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' - GET_VAR 'var result: kotlin.Int declared in .A.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -135,28 +125,38 @@ FILE fqName: fileName:/destructuringInLambda.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' CONST Boolean type=kotlin.Boolean value=true - PROPERTY name:fn visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:private [static] - EXPRESSION_BODY - FUN_EXPR type=kotlin.Function1<.A, kotlin.Int> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (:.A) returnType:kotlin.Int - VALUE_PARAMETER DESTRUCTURED_OBJECT_PARAMETER name: index:0 type:.A - BLOCK_BODY - VAR name:y type:kotlin.Int [val] - CALL 'public final fun component2 (): kotlin.Int declared in .A' type=kotlin.Int origin=COMPONENT_N(index=2) - $this: GET_VAR ': .A declared in .fn.' type=.A origin=DESTRUCTURING_DECLARATION - RETURN type=kotlin.Nothing from='local final fun (: .A): kotlin.Int declared in .fn' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CONST Int type=kotlin.Int value=42 - other: GET_VAR 'val y: kotlin.Int declared in .fn.' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1<.A, kotlin.Int> - correspondingProperty: PROPERTY name:fn visibility:public modality:FINAL [var] + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1<.A, kotlin.Int> declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:private [static]' type=kotlin.Function1<.A, kotlin.Int> origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Function1<.A, kotlin.Int>) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:fn visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Function1<.A, kotlin.Int> + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + SET_VAR 'var result: kotlin.Int declared in .A.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .A.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' + GET_VAR 'var result: kotlin.Int declared in .A.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Function1<.A, kotlin.Int> declared in .' type=kotlin.Function1<.A, kotlin.Int> origin=null + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="A(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="y=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.kt.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.kt.txt index d50c571c8fd..fa1caccb19d 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.kt.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.kt.txt @@ -1,10 +1,13 @@ -data class A { - constructor(x: Int, y: Int) /* primary */ { - super/*Any*/() - /* () */ - +var fn: Function1 + field = local fun (: A): Int { + val y: Int = .component2() + return 42.plus(other = y) } + get + set + +data class A { val x: Int field = x get @@ -13,6 +16,12 @@ data class A { field = y get + constructor(x: Int, y: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): Int { return .#x } @@ -25,16 +34,6 @@ data class A { return A(x = x, y = y) } - override fun toString(): String { - return "A(" + "x=" + .#x + ", " + "y=" + .#y + ")" - } - - override fun hashCode(): Int { - var result: Int = .#x.hashCode() - result = result.times(other = 31).plus(other = .#y.hashCode()) - return result - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -52,13 +51,15 @@ data class A { return true } -} - -var fn: Function1 - field = local fun (: A): Int { - val y: Int = .component2() - return 42.plus(other = y) + override fun hashCode(): Int { + var result: Int = .#x.hashCode() + result = result.times(other = 31).plus(other = .#y.hashCode()) + return result } - get - set + override fun toString(): String { + return "A(" + "x=" + .#x + ", " + "y=" + .#y + ")" + } + +} + diff --git a/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.fir.ir.txt b/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.fir.ir.txt index 1f98c62cd38..70d5fd78f98 100644 --- a/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.fir.ir.txt +++ b/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.fir.ir.txt @@ -1,10 +1,4 @@ FILE fqName: fileName:/lambdaReturningUnit.kt - FUN name:flaf visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit [inline] - VALUE_PARAMETER name:block index:0 type:kotlin.Function0 - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any? origin=INVOKE - $this: GET_VAR 'block: kotlin.Function0 declared in .flaf' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.Unit [suspend] BLOCK_BODY CALL 'public final fun flaf (block: kotlin.Function0): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -13,3 +7,9 @@ FILE fqName: fileName:/lambdaReturningUnit.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Any? declared in .box' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUN name:flaf visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit [inline] + VALUE_PARAMETER name:block index:0 type:kotlin.Function0 + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any? origin=INVOKE + $this: GET_VAR 'block: kotlin.Function0 declared in .flaf' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.fir.kt.txt b/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.fir.kt.txt index 7f77b344a30..229b0ed8669 100644 --- a/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.fir.kt.txt +++ b/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.fir.kt.txt @@ -1,10 +1,11 @@ -inline fun flaf(block: Function0) { - block.invoke() /*~> Unit */ -} - suspend fun box() { flaf(block = local fun (): Any? { return Unit } ) } + +inline fun flaf(block: Function0) { + block.invoke() /*~> Unit */ +} + diff --git a/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.ir.txt b/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.ir.txt index bb826b048ff..cdebfa1aff6 100644 --- a/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.ir.txt +++ b/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.ir.txt @@ -1,10 +1,4 @@ FILE fqName: fileName:/lambdaReturningUnit.kt - FUN name:flaf visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit [inline] - VALUE_PARAMETER name:block index:0 type:kotlin.Function0 - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any? origin=INVOKE - $this: GET_VAR 'block: kotlin.Function0 declared in .flaf' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.Unit [suspend] BLOCK_BODY CALL 'public final fun flaf (block: kotlin.Function0): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -12,3 +6,9 @@ FILE fqName: fileName:/lambdaReturningUnit.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUN name:flaf visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit [inline] + VALUE_PARAMETER name:block index:0 type:kotlin.Function0 + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any? origin=INVOKE + $this: GET_VAR 'block: kotlin.Function0 declared in .flaf' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.kt.txt b/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.kt.txt index d1cd2937e7f..ef81f6d5197 100644 --- a/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.kt.txt +++ b/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.kt.txt @@ -1,10 +1,11 @@ -inline fun flaf(block: Function0) { - block.invoke() /*~> Unit */ -} - suspend fun box() { flaf(block = local fun () { Unit } ) } + +inline fun flaf(block: Function0) { + block.invoke() /*~> Unit */ +} + diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.ir.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.ir.txt index e8626e3fd6d..7c41e7d0008 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.ir.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.ir.txt @@ -1,4 +1,48 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + 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: 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 + PROPERTY name:foo visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:.A) returnType:.B + correspondingProperty: PROPERTY name:foo visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.IFoo + $receiver: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): .B declared in .IFoo' + GET_OBJECT 'CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.B + CLASS INTERFACE name:IInvoke modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IInvoke + 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: 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:invoke visibility:public modality:OPEN <> ($this:.IInvoke, $receiver:.B) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.IInvoke + $receiver: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun invoke (): kotlin.Int declared in .IInvoke' + CONST Int type=kotlin.Int value=42 CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A CONSTRUCTOR visibility:private <> () returnType:.A [primary] @@ -37,50 +81,6 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - PROPERTY name:foo visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:.A) returnType:.B - correspondingProperty: PROPERTY name:foo visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.IFoo - $receiver: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): .B declared in .IFoo' - GET_OBJECT 'CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.B - 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: 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 - CLASS INTERFACE name:IInvoke modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IInvoke - FUN name:invoke visibility:public modality:OPEN <> ($this:.IInvoke, $receiver:.B) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.IInvoke - $receiver: VALUE_PARAMETER name: type:.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun invoke (): kotlin.Int declared in .IInvoke' - CONST Int type=kotlin.Int value=42 - 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: 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:test visibility:public modality:FINAL <> (fooImpl:.IFoo, invokeImpl:.IInvoke) returnType:kotlin.Unit VALUE_PARAMETER name:fooImpl index:0 type:.IFoo VALUE_PARAMETER name:invokeImpl index:1 type:.IInvoke diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.kt.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.kt.txt index c44b81ee74d..c68034b5c57 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.kt.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.kt.txt @@ -1,3 +1,18 @@ +interface IFoo { + val A.foo: B + get(): B { + return B + } + +} + +interface IInvoke { + operator fun B.invoke(): Int { + return 42 + } + +} + object A { private constructor() /* primary */ { super/*Any*/() @@ -16,21 +31,6 @@ object B { } -interface IFoo { - val A.foo: B - get(): B { - return B - } - -} - -interface IInvoke { - operator fun B.invoke(): Int { - return 42 - } - -} - fun test(fooImpl: IFoo, invokeImpl: IInvoke) { with(receiver = A, block = local fun A.(): Int { return with(receiver = fooImpl, block = local fun IFoo.(): Int { diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.ir.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.ir.txt index 1a6f4763897..8d385f043d8 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.ir.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.ir.txt @@ -1,4 +1,48 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + 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: 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 + PROPERTY name:foo visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:.A) returnType:.B + correspondingProperty: PROPERTY name:foo visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.IFoo + $receiver: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): .B declared in .IFoo' + GET_OBJECT 'CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.B + CLASS INTERFACE name:IInvoke modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IInvoke + 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: 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:invoke visibility:public modality:OPEN <> ($this:.IInvoke, $receiver:.B) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.IInvoke + $receiver: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun invoke (): kotlin.Int declared in .IInvoke' + CONST Int type=kotlin.Int value=42 CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A CONSTRUCTOR visibility:private <> () returnType:.A [primary] @@ -37,50 +81,6 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - PROPERTY name:foo visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:.A) returnType:.B - correspondingProperty: PROPERTY name:foo visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.IFoo - $receiver: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): .B declared in .IFoo' - GET_OBJECT 'CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.B - 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: 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 - CLASS INTERFACE name:IInvoke modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IInvoke - FUN name:invoke visibility:public modality:OPEN <> ($this:.IInvoke, $receiver:.B) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.IInvoke - $receiver: VALUE_PARAMETER name: type:.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun invoke (): kotlin.Int declared in .IInvoke' - CONST Int type=kotlin.Int value=42 - 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: 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:test visibility:public modality:FINAL <> (fooImpl:.IFoo, invokeImpl:.IInvoke) returnType:kotlin.Unit VALUE_PARAMETER name:fooImpl index:0 type:.IFoo VALUE_PARAMETER name:invokeImpl index:1 type:.IInvoke diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.kt.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.kt.txt index d06c879ddf0..c68034b5c57 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.kt.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.kt.txt @@ -1,3 +1,18 @@ +interface IFoo { + val A.foo: B + get(): B { + return B + } + +} + +interface IInvoke { + operator fun B.invoke(): Int { + return 42 + } + +} + object A { private constructor() /* primary */ { super/*Any*/() @@ -16,21 +31,6 @@ object B { } -interface IFoo { - val A.foo: B - get(): B { - return B - } - -} - -interface IInvoke { - operator fun B.invoke(): Int { - return 42 - } - -} - fun test(fooImpl: IFoo, invokeImpl: IInvoke) { with(receiver = A, block = local fun A.(): Int { return with(receiver = fooImpl, block = local fun IFoo.(): Int { @@ -43,3 +43,4 @@ fun test(fooImpl: IFoo, invokeImpl: IInvoke) { } ) /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/properties/backingField/backingFieldVisibility.ir.txt b/compiler/testData/ir/irText/properties/backingField/backingFieldVisibility.ir.txt index 0de350d32b1..7691b16e06a 100644 --- a/compiler/testData/ir/irText/properties/backingField/backingFieldVisibility.ir.txt +++ b/compiler/testData/ir/irText/properties/backingField/backingFieldVisibility.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/backingFieldVisibility.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -55,19 +51,10 @@ FILE fqName: fileName:/backingFieldVisibility.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null - FUN name:rest visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] BLOCK_BODY - VAR name:aI type:kotlin.Int [val] - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun (): kotlin.Number declared in .A' type=kotlin.Int origin=GET_PROPERTY - $this: CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null - other: CONST Int type=kotlin.Int value=10 - VAR name:bI type:kotlin.Int [val] - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun (): kotlin.Number declared in .A' type=kotlin.Int origin=GET_PROPERTY - $this: CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null - other: CONST Int type=kotlin.Int value=20 + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -81,6 +68,19 @@ FILE fqName: fileName:/backingFieldVisibility.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:rest visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + VAR name:aI type:kotlin.Int [val] + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun (): kotlin.Number declared in .A' type=kotlin.Int origin=GET_PROPERTY + $this: CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null + other: CONST Int type=kotlin.Int value=10 + VAR name:bI type:kotlin.Int [val] + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun (): kotlin.Number declared in .A' type=kotlin.Int origin=GET_PROPERTY + $this: CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null + other: CONST Int type=kotlin.Int value=20 FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:bA type:kotlin.Int [val] diff --git a/compiler/testData/ir/irText/properties/backingField/backingFieldVisibility.kt.txt b/compiler/testData/ir/irText/properties/backingField/backingFieldVisibility.kt.txt index 3e2db1dd04a..1089556323b 100644 --- a/compiler/testData/ir/irText/properties/backingField/backingFieldVisibility.kt.txt +++ b/compiler/testData/ir/irText/properties/backingField/backingFieldVisibility.kt.txt @@ -1,10 +1,4 @@ class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val a: Int field = 1 get @@ -21,6 +15,12 @@ class A { field = .().plus(other = 2) get + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + fun rest() { val aI: Int = A().().plus(other = 10) val bI: Int = A().().plus(other = 20) diff --git a/compiler/testData/ir/irText/properties/backingField/explicitBackingFieldType.ir.txt b/compiler/testData/ir/irText/properties/backingField/explicitBackingFieldType.ir.txt index 0405a7ffca4..21f501134e5 100644 --- a/compiler/testData/ir/irText/properties/backingField/explicitBackingFieldType.ir.txt +++ b/compiler/testData/ir/irText/properties/backingField/explicitBackingFieldType.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/explicitBackingFieldType.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -68,6 +64,10 @@ FILE fqName: fileName:/explicitBackingFieldType.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/properties/backingField/explicitBackingFieldType.kt.txt b/compiler/testData/ir/irText/properties/backingField/explicitBackingFieldType.kt.txt index db86318dc83..dbbe7c794f6 100644 --- a/compiler/testData/ir/irText/properties/backingField/explicitBackingFieldType.kt.txt +++ b/compiler/testData/ir/irText/properties/backingField/explicitBackingFieldType.kt.txt @@ -1,10 +1,4 @@ class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val a: Int field = 20 get @@ -29,5 +23,11 @@ class A { return .#p } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } diff --git a/compiler/testData/ir/irText/properties/backingField/independentBackingFieldType.ir.txt b/compiler/testData/ir/irText/properties/backingField/independentBackingFieldType.ir.txt index 24f406d406a..eafd731c4e0 100644 --- a/compiler/testData/ir/irText/properties/backingField/independentBackingFieldType.ir.txt +++ b/compiler/testData/ir/irText/properties/backingField/independentBackingFieldType.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/independentBackingFieldType.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:it visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:it type:kotlin.Double visibility:private EXPRESSION_BODY @@ -30,6 +26,10 @@ FILE fqName: fileName:/independentBackingFieldType.kt $this: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUS $this: GET_VAR 'value: kotlin.Int declared in .A.' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=10 + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/properties/backingField/independentBackingFieldType.kt.txt b/compiler/testData/ir/irText/properties/backingField/independentBackingFieldType.kt.txt index 7182e37027b..78eaa6a2e0b 100644 --- a/compiler/testData/ir/irText/properties/backingField/independentBackingFieldType.kt.txt +++ b/compiler/testData/ir/irText/properties/backingField/independentBackingFieldType.kt.txt @@ -1,10 +1,4 @@ class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - var it: Double field = 3.14 get(): Int { @@ -14,6 +8,12 @@ class A { .#it = value.minus(other = 10).toDouble() } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + } fun test() { @@ -21,3 +21,4 @@ fun test() { val it: Int = A().().and(other = 10) a.(value = it) } + diff --git a/compiler/testData/ir/irText/properties/backingField/propertyTypeNarrowing.ir.txt b/compiler/testData/ir/irText/properties/backingField/propertyTypeNarrowing.ir.txt index 64be97c4d2f..a02782ea128 100644 --- a/compiler/testData/ir/irText/properties/backingField/propertyTypeNarrowing.ir.txt +++ b/compiler/testData/ir/irText/properties/backingField/propertyTypeNarrowing.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/propertyTypeNarrowing.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:it visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:it type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -16,14 +12,6 @@ FILE fqName: fileName:/propertyTypeNarrowing.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Number declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:it type:kotlin.Int visibility:private [final]' type=kotlin.Number origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null - FUN name:test visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test (): kotlin.Int declared in .A' - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun (): kotlin.Number declared in .A' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .A declared in .A.test' type=.A origin=null - other: CONST Int type=kotlin.Int value=3 PROPERTY name:p visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -35,6 +23,10 @@ FILE fqName: fileName:/propertyTypeNarrowing.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -48,6 +40,14 @@ FILE fqName: fileName:/propertyTypeNarrowing.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (): kotlin.Int declared in .A' + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CALL 'public final fun (): kotlin.Number declared in .A' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .A declared in .A.test' type=.A origin=null + other: CONST Int type=kotlin.Int value=3 FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:d type:kotlin.Unit [val] diff --git a/compiler/testData/ir/irText/properties/backingField/propertyTypeNarrowing.kt.txt b/compiler/testData/ir/irText/properties/backingField/propertyTypeNarrowing.kt.txt index 77083eb498e..a992beb3106 100644 --- a/compiler/testData/ir/irText/properties/backingField/propertyTypeNarrowing.kt.txt +++ b/compiler/testData/ir/irText/properties/backingField/propertyTypeNarrowing.kt.txt @@ -1,24 +1,24 @@ class A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - val it: Int field = 4 get - fun test(): Int { - return .().plus(other = 3) - } - val p: Int field = 5 get(): Int { return .#p } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun test(): Int { + return .().plus(other = 3) + } + } fun test() { diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.ir.txt b/compiler/testData/ir/irText/regressions/integerCoercionToT.ir.txt index bbe5eb2bee9..a9055123322 100644 --- a/compiler/testData/ir/irText/regressions/integerCoercionToT.ir.txt +++ b/compiler/testData/ir/irText/regressions/integerCoercionToT.ir.txt @@ -1,25 +1,4 @@ FILE fqName: fileName:/integerCoercionToT.kt - CLASS INTERFACE name:CPointed modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CPointed - 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: 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:reinterpret visibility:public modality:FINAL ($receiver:.CPointed) returnType:T of .reinterpret [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[.CPointed] reified:true - $receiver: VALUE_PARAMETER name: type:.CPointed - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun reinterpret (): T of .reinterpret declared in ' - CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' 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?] reified:false @@ -40,7 +19,67 @@ FILE fqName: fileName:/integerCoercionToT.kt overridden: public open fun toString (): kotlin.String declared in .CPointed $this: VALUE_PARAMETER name: type:kotlin.Any - TYPEALIAS name:CInt32Var visibility:public expandedType:.CInt32VarX + CLASS CLASS name:IdType modality:FINAL visibility:public superTypes:[.CPointed] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IdType + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.Int declared in .IdType.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IdType) returnType:kotlin.Int + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.IdType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .IdType' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .IdType declared in .IdType.' type=.IdType origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.IdType [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IdType modality:FINAL visibility:public superTypes:[.CPointed]' + 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 .CPointed + $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 .CPointed + $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 .CPointed + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:CPointed modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CPointed + 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: 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:foo visibility:public modality:FINAL <> (value:.IdType, cv:.CInt32VarX) returnType:kotlin.Unit + VALUE_PARAMETER name:value index:0 type:.IdType + VALUE_PARAMETER name:cv index:1 type:.CInt32VarX + BLOCK_BODY + CALL 'public final fun (value: T_INT of .): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : kotlin.Int + $receiver: GET_VAR 'cv: .CInt32VarX declared in .foo' type=.CInt32VarX origin=null + value: CALL 'public final fun (): kotlin.Int declared in .IdType' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'value: .IdType declared in .foo' type=.IdType origin=null + FUN name:reinterpret visibility:public modality:FINAL ($receiver:.CPointed) returnType:T of .reinterpret [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[.CPointed] reified:true + $receiver: VALUE_PARAMETER name: type:.CPointed + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun reinterpret (): T of .reinterpret declared in ' + CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null PROPERTY name:value visibility:public modality:FINAL [var] FUN name: visibility:public modality:FINAL ($receiver:.CInt32VarX.>) returnType:T_INT of . correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] @@ -55,43 +94,4 @@ FILE fqName: fileName:/integerCoercionToT.kt $receiver: VALUE_PARAMETER name: type:.CInt32VarX.> VALUE_PARAMETER name:value index:0 type:T_INT of . BLOCK_BODY - CLASS CLASS name:IdType modality:FINAL visibility:public superTypes:[.CPointed] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IdType - CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.IdType [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IdType modality:FINAL visibility:public superTypes:[.CPointed]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.Int declared in .IdType.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IdType) returnType:kotlin.Int - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.IdType - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .IdType' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .IdType declared in .IdType.' type=.IdType 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 .CPointed - $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 .CPointed - $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 .CPointed - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:foo visibility:public modality:FINAL <> (value:.IdType, cv:.CInt32VarX) returnType:kotlin.Unit - VALUE_PARAMETER name:value index:0 type:.IdType - VALUE_PARAMETER name:cv index:1 type:.CInt32VarX - BLOCK_BODY - CALL 'public final fun (value: T_INT of .): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : kotlin.Int - $receiver: GET_VAR 'cv: .CInt32VarX declared in .foo' type=.CInt32VarX origin=null - value: CALL 'public final fun (): kotlin.Int declared in .IdType' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'value: .IdType declared in .foo' type=.IdType origin=null + TYPEALIAS name:CInt32Var visibility:public expandedType:.CInt32VarX diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.kt.txt b/compiler/testData/ir/irText/regressions/integerCoercionToT.kt.txt index bbd5621b742..06b6506864f 100644 --- a/compiler/testData/ir/irText/regressions/integerCoercionToT.kt.txt +++ b/compiler/testData/ir/irText/regressions/integerCoercionToT.kt.txt @@ -1,10 +1,3 @@ -interface CPointed { -} - -inline fun CPointed.reinterpret(): T { - return TODO() -} - class CInt32VarX : CPointed { constructor() /* primary */ { super/*Any*/() @@ -14,7 +7,30 @@ class CInt32VarX : CPointed { } -typealias CInt32Var = CInt32VarX +class IdType : CPointed { + val value: Int + field = value + get + + constructor(value: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface CPointed { +} + +fun foo(value: IdType, cv: CInt32VarX) { + cv.(value = value.()) +} + +inline fun CPointed.reinterpret(): T { + return TODO() +} + var CInt32VarX.value: T_INT get(): T_INT { return TODO() @@ -22,19 +38,4 @@ var CInt32VarX.value: T_INT set(value: T_INT) { } -class IdType : CPointed { - constructor(value: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - - val value: Int - field = value - get - -} - -fun foo(value: IdType, cv: CInt32VarX) { - cv.(value = value.()) -} +typealias CInt32Var = CInt32VarX diff --git a/compiler/testData/ir/irText/regressions/kt24114.ir.txt b/compiler/testData/ir/irText/regressions/kt24114.ir.txt index a608644a446..b2c51b105df 100644 --- a/compiler/testData/ir/irText/regressions/kt24114.ir.txt +++ b/compiler/testData/ir/irText/regressions/kt24114.ir.txt @@ -3,10 +3,6 @@ FILE fqName: fileName:/kt24114.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun one (): kotlin.Int declared in ' CONST Int type=kotlin.Int value=1 - FUN name:two visibility:public modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun two (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=2 FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Int BLOCK_BODY WHILE label=null origin=WHILE_LOOP @@ -62,3 +58,7 @@ FILE fqName: fileName:/kt24114.kt if: CONST Boolean type=kotlin.Boolean value=true then: RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in ' CONST Int type=kotlin.Int value=3 + FUN name:two visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun two (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=2 diff --git a/compiler/testData/ir/irText/regressions/kt24114.kt.txt b/compiler/testData/ir/irText/regressions/kt24114.kt.txt index 37ec87fc19c..6ad57823108 100644 --- a/compiler/testData/ir/irText/regressions/kt24114.kt.txt +++ b/compiler/testData/ir/irText/regressions/kt24114.kt.txt @@ -2,10 +2,6 @@ fun one(): Int { return 1 } -fun two(): Int { - return 2 -} - fun test1(): Int { while (true) { // BLOCK { // BLOCK @@ -41,3 +37,8 @@ fun test2(): Int { } } } + +fun two(): Int { + return 2 +} + diff --git a/compiler/testData/ir/irText/regressions/kt44855.fir.ir.txt b/compiler/testData/ir/irText/regressions/kt44855.fir.ir.txt index 61315635f52..02ae977210c 100644 --- a/compiler/testData/ir/irText/regressions/kt44855.fir.ir.txt +++ b/compiler/testData/ir/irText/regressions/kt44855.fir.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/kt44855.kt CLASS CLASS name:Child modality:OPEN visibility:public superTypes:[.Parent] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Child - CONSTRUCTOR visibility:public <> (x:.Parent?) returnType:.Child [primary] - VALUE_PARAMETER name:x index:0 type:.Parent? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Parent' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Child modality:OPEN visibility:public superTypes:[.Parent]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:.Parent? visibility:private [final] EXPRESSION_BODY @@ -24,6 +19,19 @@ FILE fqName: fileName:/kt44855.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:QQQ modality:FINAL visibility:public [inner] 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 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:z visibility:public modality:FINAL <> ($this:.Child.QQQ) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Child.QQQ BLOCK_BODY @@ -43,28 +51,20 @@ FILE fqName: fileName:/kt44855.kt value: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS $this: GET_VAR 'val q: @[FlexibleNullability] kotlin.String? declared in .Child.QQQ.z' type=@[FlexibleNullability] kotlin.String? origin=null other: CONST String type=kotlin.String value="OK" - 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: 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 FAKE_OVERRIDE name:getQqq visibility:public modality:OPEN <> ($this:.Parent) returnType:@[FlexibleNullability] kotlin.String? [fake_override] - overridden: - public open fun getQqq (): @[FlexibleNullability] kotlin.String? declared in .Parent - $this: VALUE_PARAMETER name: type:.Parent + CONSTRUCTOR visibility:public <> (x:.Parent?) returnType:.Child [primary] + VALUE_PARAMETER name:x index:0 type:.Parent? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Parent' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Child modality:OPEN visibility:public superTypes:[.Parent]' 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 .Parent $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:getQqq visibility:public modality:OPEN <> ($this:.Parent) returnType:@[FlexibleNullability] kotlin.String? [fake_override] + overridden: + public open fun getQqq (): @[FlexibleNullability] kotlin.String? declared in .Parent + $this: VALUE_PARAMETER name: type:.Parent 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 .Parent diff --git a/compiler/testData/ir/irText/regressions/kt44855.ir.txt b/compiler/testData/ir/irText/regressions/kt44855.ir.txt index 435e3bb9a77..7e76f0221b9 100644 --- a/compiler/testData/ir/irText/regressions/kt44855.ir.txt +++ b/compiler/testData/ir/irText/regressions/kt44855.ir.txt @@ -1,11 +1,6 @@ FILE fqName: fileName:/kt44855.kt CLASS CLASS name:Child modality:OPEN visibility:public superTypes:[.Parent] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Child - CONSTRUCTOR visibility:public <> (x:.Parent?) returnType:.Child [primary] - VALUE_PARAMETER name:x index:0 type:.Parent? - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Parent' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Child modality:OPEN visibility:public superTypes:[.Parent]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:.Parent? visibility:private [final] EXPRESSION_BODY @@ -24,6 +19,19 @@ FILE fqName: fileName:/kt44855.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:QQQ modality:FINAL visibility:public [inner] 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 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:z visibility:public modality:FINAL <> ($this:.Child.QQQ) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Child.QQQ BLOCK_BODY @@ -44,24 +52,20 @@ FILE fqName: fileName:/kt44855.kt $this: TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String GET_VAR 'val q: @[FlexibleNullability] kotlin.String? declared in .Child.QQQ.z' type=@[FlexibleNullability] kotlin.String? origin=null other: CONST String type=kotlin.String value="OK" - 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: 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 + CONSTRUCTOR visibility:public <> (x:.Parent?) returnType:.Child [primary] + VALUE_PARAMETER name:x index:0 type:.Parent? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Parent' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Child modality:OPEN visibility:public superTypes:[.Parent]' 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 .Parent $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:getQqq visibility:public modality:OPEN <> ($this:.Parent) returnType:@[FlexibleNullability] kotlin.String? [fake_override] + overridden: + public open fun getQqq (): @[FlexibleNullability] kotlin.String? declared in .Parent + $this: VALUE_PARAMETER name: type:.Parent 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 .Parent @@ -70,10 +74,6 @@ FILE fqName: fileName:/kt44855.kt overridden: public open fun toString (): kotlin.String declared in .Parent $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:getQqq visibility:public modality:OPEN <> ($this:.Parent) returnType:@[FlexibleNullability] kotlin.String? [fake_override] - overridden: - public open fun getQqq (): @[FlexibleNullability] kotlin.String? declared in .Parent - $this: VALUE_PARAMETER name: type:.Parent PROPERTY FAKE_OVERRIDE name:qqq visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] overridden: protected/*protected and package*/ final qqq: @[FlexibleNullability] kotlin.String? diff --git a/compiler/testData/ir/irText/regressions/kt45236.fir.ir.txt b/compiler/testData/ir/irText/regressions/kt45236.fir.ir.txt index c841d75587b..de77b4dd147 100644 --- a/compiler/testData/ir/irText/regressions/kt45236.fir.ir.txt +++ b/compiler/testData/ir/irText/regressions/kt45236.fir.ir.txt @@ -4,26 +4,9 @@ FILE fqName: fileName:/kt45236.kt CLASS CLASS name:Error modality:FINAL visibility:public [data] superTypes:[.NetRequestStatus.NetRequestStatus.Error>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.NetRequestStatus.NetRequestStatus> TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:protected <> () returnType:.NetRequestStatus.NetRequestStatus> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:NetRequestStatus modality:SEALED visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.NetRequestStatus.NetRequestStatus>) returnType:T of .NetRequestStatus? - correspondingProperty: PROPERTY name:value visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.NetRequestStatus.NetRequestStatus> CLASS CLASS name:Error modality:FINAL visibility:public [data] superTypes:[.NetRequestStatus.NetRequestStatus.Error>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:public <> (error:kotlin.Throwable, value:T of .NetRequestStatus.Error?) returnType:.NetRequestStatus.Error.NetRequestStatus.Error> [primary] - VALUE_PARAMETER name:error index:0 type:kotlin.Throwable - VALUE_PARAMETER name:value index:1 type:T of .NetRequestStatus.Error? - EXPRESSION_BODY - CONST Null type=kotlin.Nothing? value=null - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .NetRequestStatus' - : T of .NetRequestStatus.Error - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Error modality:FINAL visibility:public [data] superTypes:[.NetRequestStatus.NetRequestStatus.Error>]' PROPERTY name:error visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:error type:kotlin.Throwable visibility:private [final] EXPRESSION_BODY @@ -50,6 +33,15 @@ FILE fqName: fileName:/kt45236.kt RETURN type=kotlin.Nothing from='public open fun (): T of .NetRequestStatus.Error? declared in .NetRequestStatus.Error' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null + CONSTRUCTOR visibility:public <> (error:kotlin.Throwable, value:T of .NetRequestStatus.Error?) returnType:.NetRequestStatus.Error.NetRequestStatus.Error> [primary] + VALUE_PARAMETER name:error index:0 type:kotlin.Throwable + VALUE_PARAMETER name:value index:1 type:T of .NetRequestStatus.Error? + EXPRESSION_BODY + CONST Null type=kotlin.Nothing? value=null + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .NetRequestStatus' + : T of .NetRequestStatus.Error + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Error modality:FINAL visibility:public [data] superTypes:[.NetRequestStatus.NetRequestStatus.Error>]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>) returnType:kotlin.Throwable [operator] $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> BLOCK_BODY @@ -78,50 +70,6 @@ FILE fqName: fileName:/kt45236.kt : T of .NetRequestStatus.Error error: GET_VAR 'error: kotlin.Throwable declared in .NetRequestStatus.Error.copy' type=kotlin.Throwable origin=null value: GET_VAR 'value: T of .NetRequestStatus.Error? declared in .NetRequestStatus.Error.copy' type=T of .NetRequestStatus.Error? origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .NetRequestStatus.Error' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Error(" - CONST String type=kotlin.String value="error=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:error type:kotlin.Throwable visibility:private [final]' type=kotlin.Throwable origin=null - receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.toString' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="value=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null - receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.toString' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Throwable' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:error type:kotlin.Throwable visibility:private [final]' type=kotlin.Throwable origin=null - receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.hashCode' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - SET_VAR 'var result: kotlin.Int declared in .NetRequestStatus.Error.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .NetRequestStatus.Error.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null - receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.hashCode' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null - receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.hashCode' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .NetRequestStatus.Error' - GET_VAR 'var result: kotlin.Int declared in .NetRequestStatus.Error.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -166,6 +114,54 @@ FILE fqName: fileName:/kt45236.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .NetRequestStatus.Error' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Throwable' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:error type:kotlin.Throwable visibility:private [final]' type=kotlin.Throwable origin=null + receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.hashCode' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null + SET_VAR 'var result: kotlin.Int declared in .NetRequestStatus.Error.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .NetRequestStatus.Error.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null + receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.hashCode' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null + receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.hashCode' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .NetRequestStatus.Error' + GET_VAR 'var result: kotlin.Int declared in .NetRequestStatus.Error.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .NetRequestStatus.Error' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Error(" + CONST String type=kotlin.String value="error=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:error type:kotlin.Throwable visibility:private [final]' type=kotlin.Throwable origin=null + receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.toString' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="value=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null + receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.toString' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null + CONST String type=kotlin.String value=")" + CONSTRUCTOR visibility:protected <> () returnType:.NetRequestStatus.NetRequestStatus> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:NetRequestStatus modality:SEALED visibility:public 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 declared in kotlin.Any @@ -179,6 +175,10 @@ FILE fqName: fileName:/kt45236.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:value visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.NetRequestStatus.NetRequestStatus>) returnType:T of .NetRequestStatus? + correspondingProperty: PROPERTY name:value visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.NetRequestStatus.NetRequestStatus> FUN name:isError visibility:public modality:FINAL ($receiver:.NetRequestStatus.isError>) returnType:kotlin.Boolean annotations: OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalContracts modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) diff --git a/compiler/testData/ir/irText/regressions/kt45236.ir.txt b/compiler/testData/ir/irText/regressions/kt45236.ir.txt index 3550c5f42b9..2818fa11736 100644 --- a/compiler/testData/ir/irText/regressions/kt45236.ir.txt +++ b/compiler/testData/ir/irText/regressions/kt45236.ir.txt @@ -4,26 +4,9 @@ FILE fqName: fileName:/kt45236.kt CLASS CLASS name:Error modality:FINAL visibility:public [data] superTypes:[.NetRequestStatus.NetRequestStatus.Error>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.NetRequestStatus.NetRequestStatus> TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:protected <> () returnType:.NetRequestStatus.NetRequestStatus> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:NetRequestStatus modality:SEALED visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.NetRequestStatus.NetRequestStatus>) returnType:T of .NetRequestStatus? - correspondingProperty: PROPERTY name:value visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.NetRequestStatus.NetRequestStatus> CLASS CLASS name:Error modality:FINAL visibility:public [data] superTypes:[.NetRequestStatus.NetRequestStatus.Error>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:public <> (error:kotlin.Throwable, value:T of .NetRequestStatus.Error?) returnType:.NetRequestStatus.Error.NetRequestStatus.Error> [primary] - VALUE_PARAMETER name:error index:0 type:kotlin.Throwable - VALUE_PARAMETER name:value index:1 type:T of .NetRequestStatus.Error? - EXPRESSION_BODY - CONST Null type=kotlin.Nothing? value=null - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .NetRequestStatus' - : T of .NetRequestStatus.Error - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Error modality:FINAL visibility:public [data] superTypes:[.NetRequestStatus.NetRequestStatus.Error>]' PROPERTY name:error visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:error type:kotlin.Throwable visibility:private [final] EXPRESSION_BODY @@ -50,6 +33,15 @@ FILE fqName: fileName:/kt45236.kt RETURN type=kotlin.Nothing from='public open fun (): T of .NetRequestStatus.Error? declared in .NetRequestStatus.Error' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null + CONSTRUCTOR visibility:public <> (error:kotlin.Throwable, value:T of .NetRequestStatus.Error?) returnType:.NetRequestStatus.Error.NetRequestStatus.Error> [primary] + VALUE_PARAMETER name:error index:0 type:kotlin.Throwable + VALUE_PARAMETER name:value index:1 type:T of .NetRequestStatus.Error? + EXPRESSION_BODY + CONST Null type=kotlin.Nothing? value=null + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .NetRequestStatus' + : T of .NetRequestStatus.Error + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Error modality:FINAL visibility:public [data] superTypes:[.NetRequestStatus.NetRequestStatus.Error>]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>) returnType:kotlin.Throwable [operator] $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> BLOCK_BODY @@ -78,50 +70,6 @@ FILE fqName: fileName:/kt45236.kt : T of .NetRequestStatus.Error error: GET_VAR 'error: kotlin.Throwable declared in .NetRequestStatus.Error.copy' type=kotlin.Throwable origin=null value: GET_VAR 'value: T of .NetRequestStatus.Error? declared in .NetRequestStatus.Error.copy' type=T of .NetRequestStatus.Error? origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in .NetRequestStatus - $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .NetRequestStatus.Error' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Error(" - CONST String type=kotlin.String value="error=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:error type:kotlin.Throwable visibility:private [final]' type=kotlin.Throwable origin=null - receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.toString' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="value=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null - receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.toString' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in .NetRequestStatus - $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Throwable' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:error type:kotlin.Throwable visibility:private [final]' type=kotlin.Throwable origin=null - receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.hashCode' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - SET_VAR 'var result: kotlin.Int declared in .NetRequestStatus.Error.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .NetRequestStatus.Error.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null - receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.hashCode' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null - receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.hashCode' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .NetRequestStatus.Error' - GET_VAR 'var result: kotlin.Int declared in .NetRequestStatus.Error.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .NetRequestStatus @@ -166,6 +114,54 @@ FILE fqName: fileName:/kt45236.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .NetRequestStatus.Error' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in .NetRequestStatus + $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Throwable' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:error type:kotlin.Throwable visibility:private [final]' type=kotlin.Throwable origin=null + receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.hashCode' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null + SET_VAR 'var result: kotlin.Int declared in .NetRequestStatus.Error.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .NetRequestStatus.Error.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: WHEN type=kotlin.Int 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null + receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.hashCode' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null + receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.hashCode' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .NetRequestStatus.Error' + GET_VAR 'var result: kotlin.Int declared in .NetRequestStatus.Error.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in .NetRequestStatus + $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .NetRequestStatus.Error' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Error(" + CONST String type=kotlin.String value="error=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:error type:kotlin.Throwable visibility:private [final]' type=kotlin.Throwable origin=null + receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.toString' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="value=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null + receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.toString' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null + CONST String type=kotlin.String value=")" + CONSTRUCTOR visibility:protected <> () returnType:.NetRequestStatus.NetRequestStatus> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:NetRequestStatus modality:SEALED visibility:public 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 declared in kotlin.Any @@ -179,6 +175,10 @@ FILE fqName: fileName:/kt45236.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:value visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.NetRequestStatus.NetRequestStatus>) returnType:T of .NetRequestStatus? + correspondingProperty: PROPERTY name:value visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.NetRequestStatus.NetRequestStatus> FUN name:isError visibility:public modality:FINAL ($receiver:.NetRequestStatus.isError>) returnType:kotlin.Boolean annotations: OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalContracts modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) diff --git a/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.ir.txt b/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.ir.txt index 2ddb7d44006..240887023d4 100644 --- a/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.ir.txt +++ b/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.ir.txt @@ -1,10 +1,4 @@ FILE fqName: fileName:/newInferenceFixationOrder1.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?] reified:false - TYPE_PARAMETER name:Y index:1 variance: superTypes:[kotlin.Any?] reified:false - 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 declared in kotlin' 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?] reified:false @@ -22,6 +16,12 @@ FILE fqName: fileName:/newInferenceFixationOrder1.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + 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" 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?] reified:false TYPE_PARAMETER name:R index:1 variance: superTypes:[kotlin.Any?] reified:false @@ -31,6 +31,12 @@ FILE fqName: fileName:/newInferenceFixationOrder1.kt 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 declared in kotlin' type=kotlin.Nothing origin=null + FUN name:foo visibility:public modality:FINAL () returnType:kotlin.Function1.foo, Y of .foo> + TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:Y index:1 variance: superTypes:[kotlin.Any?] reified:false + 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 declared in kotlin' 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 ' @@ -42,9 +48,3 @@ FILE fqName: fileName:/newInferenceFixationOrder1.kt 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/newInferenceFixationOrder1.kt.txt b/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.kt.txt index 48cb641587c..28b06e92f23 100644 --- a/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.kt.txt +++ b/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.kt.txt @@ -1,19 +1,20 @@ -fun foo(): Function1 { - return TODO() -} - interface Inv2 { } +fun box(): String { + val x: Inv2 = test() + return "OK" +} + fun check(x: T, y: R, f: Function1): Inv2 { return TODO() } +fun foo(): Function1 { + 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/noSyntheticTypeParameterLeftAfterPCLA.ir.txt b/compiler/testData/ir/irText/regressions/noSyntheticTypeParameterLeftAfterPCLA.ir.txt index 2523018edad..b4fbbaf39b2 100644 --- a/compiler/testData/ir/irText/regressions/noSyntheticTypeParameterLeftAfterPCLA.ir.txt +++ b/compiler/testData/ir/irText/regressions/noSyntheticTypeParameterLeftAfterPCLA.ir.txt @@ -1,4 +1,40 @@ FILE fqName: fileName:/noSyntheticTypeParameterLeftAfterPCLA.kt + CLASS INTERFACE name:Controller modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Controller.Controller> + TYPE_PARAMETER name:F index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:yield visibility:public modality:ABSTRACT <> ($this:.Controller.Controller>, t:F of .Controller) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Controller.Controller> + VALUE_PARAMETER name:t index:0 type:F of .Controller + CLASS INTERFACE name:Intf modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Intf + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.Intf) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Intf FUN name:box visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.Unit VALUE_PARAMETER name:b index:0 type:kotlin.Boolean BLOCK_BODY @@ -16,6 +52,19 @@ FILE fqName: fileName:/noSyntheticTypeParameterLeftAfterPCLA.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Intf]' + 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 .Intf + $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 .Intf + $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 .Intf + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:foo visibility:public modality:OPEN <> ($this:.box..) returnType:kotlin.Unit overridden: public abstract fun foo (): kotlin.Unit declared in .Intf @@ -32,63 +81,14 @@ FILE fqName: fileName:/noSyntheticTypeParameterLeftAfterPCLA.kt CALL 'public abstract fun yield (t: F of .Controller): kotlin.Unit declared in .Controller' type=kotlin.Unit origin=null $this: GET_VAR '$this$generate: .Controller declared in .box.' type=.Controller origin=null t: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - 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 .Intf - $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 .Intf - $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 .Intf - $this: VALUE_PARAMETER name: type:kotlin.Any CONSTRUCTOR_CALL 'public constructor () declared in .box..' type=.box.. origin=OBJECT_LITERAL CALL 'public final fun someUnit (): kotlin.Unit declared in ' type=kotlin.Unit origin=null FUN name:expectIntf visibility:public modality:FINAL <> (intf:.Intf) returnType:kotlin.Unit VALUE_PARAMETER name:intf index:0 type:.Intf BLOCK_BODY - FUN name:someUnit visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CLASS INTERFACE name:Intf modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Intf - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Intf) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Intf - 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: 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 - CLASS INTERFACE name:Controller modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Controller.Controller> - TYPE_PARAMETER name:F index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:yield visibility:public modality:ABSTRACT <> ($this:.Controller.Controller>, t:F of .Controller) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Controller.Controller> - VALUE_PARAMETER name:t index:0 type:F of .Controller - 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: 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:generate visibility:public modality:FINAL (g:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.Controller.generate>, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:g index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.Controller.generate>, kotlin.Unit> BLOCK_BODY + FUN name:someUnit visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/regressions/noSyntheticTypeParameterLeftAfterPCLA.kt.txt b/compiler/testData/ir/irText/regressions/noSyntheticTypeParameterLeftAfterPCLA.kt.txt index 457ccad870b..d83a0386731 100644 --- a/compiler/testData/ir/irText/regressions/noSyntheticTypeParameterLeftAfterPCLA.kt.txt +++ b/compiler/testData/ir/irText/regressions/noSyntheticTypeParameterLeftAfterPCLA.kt.txt @@ -1,3 +1,13 @@ +interface Controller { + abstract fun yield(t: F) + +} + +interface Intf { + abstract fun foo() + +} + fun box(b: Boolean) { generate(g = local suspend fun Controller.() { expectIntf(intf = { // BLOCK @@ -31,18 +41,9 @@ fun box(b: Boolean) { fun expectIntf(intf: Intf) { } +fun generate(g: @ExtensionFunctionType SuspendFunction1, Unit>) { +} + fun someUnit() { } -interface Intf { - abstract fun foo() - -} - -interface Controller { - abstract fun yield(t: F) - -} - -fun generate(g: @ExtensionFunctionType SuspendFunction1, Unit>) { -} diff --git a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.ir.txt b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.ir.txt index 34bc6dfb8d4..e88dac4b936 100644 --- a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.ir.txt +++ b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/typeAliasCtorForGenericClass.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> TYPE_PARAMETER name:Q index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (q:Q of .A) returnType:.A.A> [primary] - VALUE_PARAMETER name:q index:0 type:Q of .A - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:q visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:q type:Q of .A visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,11 @@ FILE fqName: fileName:/typeAliasCtorForGenericClass.kt RETURN type=kotlin.Nothing from='public final fun (): Q of .A declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:q type:Q of .A visibility:private [final]' type=Q of .A origin=null receiver: GET_VAR ': .A.A> declared in .A.' type=.A.A> origin=null + CONSTRUCTOR visibility:public <> (q:Q of .A) returnType:.A.A> [primary] + VALUE_PARAMETER name:q index:0 type:Q of .A + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -31,10 +31,6 @@ FILE fqName: fileName:/typeAliasCtorForGenericClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - TYPEALIAS name:B visibility:public expandedType:.A.B> - TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:B2 visibility:public expandedType:.A<.A.B2>> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:b type:.A [val] @@ -45,3 +41,7 @@ FILE fqName: fileName:/typeAliasCtorForGenericClass.kt CONSTRUCTOR_CALL 'public constructor (q: Q of .A) declared in .A' type=.A<.A> origin=null : .A q: GET_VAR 'val b: .A declared in .bar' type=.A origin=null + TYPEALIAS name:B visibility:public expandedType:.A.B> + TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPEALIAS name:B2 visibility:public expandedType:.A<.A.B2>> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false diff --git a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt.txt b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt.txt index 32bad893dcd..9343e424a79 100644 --- a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt.txt +++ b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt.txt @@ -1,19 +1,20 @@ class A { + val q: Q + field = q + get + constructor(q: Q) /* primary */ { super/*Any*/() /* () */ } - val q: Q - field = q - get - } -typealias B = A -typealias B2 = A> fun bar() { val b: A = A(q = 2) val b2: A> = A>(q = b) } + +typealias B = A +typealias B2 = A> diff --git a/compiler/testData/ir/irText/singletons/companion.ir.txt b/compiler/testData/ir/irText/singletons/companion.ir.txt index 7b5e4b47d1a..824d25b59b4 100644 --- a/compiler/testData/ir/irText/singletons/companion.ir.txt +++ b/compiler/testData/ir/irText/singletons/companion.ir.txt @@ -1,24 +1,12 @@ FILE fqName: fileName:/companion.kt CLASS CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z - CONSTRUCTOR visibility:public <> () returnType:.Z [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:test2 visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z - BLOCK_BODY - CALL 'public final fun test (): kotlin.Unit declared in .Z.Companion' type=kotlin.Unit origin=null - $this: GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.Z.Companion CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.Companion CONSTRUCTOR visibility:private <> () returnType:.Z.Companion [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' - FUN name:test visibility:public modality:FINAL <> ($this:.Z.Companion) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z.Companion - BLOCK_BODY 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 @@ -32,6 +20,13 @@ FILE fqName: fileName:/companion.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> ($this:.Z.Companion) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.Companion + BLOCK_BODY + CONSTRUCTOR visibility:public <> () returnType:.Z [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Z modality:FINAL visibility:public 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 declared in kotlin.Any @@ -45,3 +40,8 @@ FILE fqName: fileName:/companion.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test2 visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + CALL 'public final fun test (): kotlin.Unit declared in .Z.Companion' type=kotlin.Unit origin=null + $this: GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.Z.Companion diff --git a/compiler/testData/ir/irText/singletons/companion.kt.txt b/compiler/testData/ir/irText/singletons/companion.kt.txt index a246dc241a8..87142cc376d 100644 --- a/compiler/testData/ir/irText/singletons/companion.kt.txt +++ b/compiler/testData/ir/irText/singletons/companion.kt.txt @@ -1,14 +1,4 @@ class Z { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun test2() { - Companion.test() - } - companion object Companion { private constructor() /* primary */ { super/*Any*/() @@ -21,4 +11,15 @@ class Z { } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun test2() { + Companion.test() + } + } + diff --git a/compiler/testData/ir/irText/singletons/enumEntry.fir.ir.txt b/compiler/testData/ir/irText/singletons/enumEntry.fir.ir.txt index c7d632830a5..9c301b89964 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.fir.ir.txt +++ b/compiler/testData/ir/irText/singletons/enumEntry.fir.ir.txt @@ -1,23 +1,11 @@ FILE fqName: fileName:/enumEntry.kt CLASS ENUM_CLASS name:Z modality:OPEN visibility:public superTypes:[kotlin.Enum<.Z>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z - CONSTRUCTOR visibility:private <> () returnType:.Z [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .Z - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Z modality:OPEN visibility:public superTypes:[kotlin.Enum<.Z>]' ENUM_ENTRY name:ENTRY init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Z.ENTRY' class: CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[.Z] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.ENTRY - CONSTRUCTOR visibility:private <> () returnType:.Z.ENTRY [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Z' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[.Z]' - FUN name:test visibility:public modality:FINAL <> ($this:.Z.ENTRY) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z.ENTRY - BLOCK_BODY CLASS CLASS name:A modality:FINAL visibility:local [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.ENTRY.A CONSTRUCTOR visibility:public <> ($this:.Z.ENTRY) returnType:.Z.ENTRY.A [primary] @@ -25,11 +13,6 @@ FILE fqName: fileName:/enumEntry.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:local [inner] superTypes:[kotlin.Any]' - FUN name:test2 visibility:public modality:FINAL <> ($this:.Z.ENTRY.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z.ENTRY.A - BLOCK_BODY - CALL 'public final fun test (): kotlin.Unit declared in .Z.ENTRY' type=kotlin.Unit origin=null - $this: GET_VAR ': .Z.ENTRY declared in .Z.ENTRY' type=.Z.ENTRY 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 @@ -43,6 +26,15 @@ FILE fqName: fileName:/enumEntry.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test2 visibility:public modality:FINAL <> ($this:.Z.ENTRY.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.ENTRY.A + BLOCK_BODY + CALL 'public final fun test (): kotlin.Unit declared in .Z.ENTRY' type=kotlin.Unit origin=null + $this: GET_VAR ': .Z.ENTRY declared in .Z.ENTRY' type=.Z.ENTRY origin=null + CONSTRUCTOR visibility:private <> () returnType:.Z.ENTRY [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Z' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[.Z]' FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>, other:.Z) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .Z): kotlin.Int declared in .Z @@ -61,6 +53,9 @@ FILE fqName: fileName:/enumEntry.kt overridden: public open fun toString (): kotlin.String declared in .Z $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN name:test visibility:public modality:FINAL <> ($this:.Z.ENTRY) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.ENTRY + BLOCK_BODY PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation @@ -79,15 +74,16 @@ FILE fqName: fileName:/enumEntry.kt overridden: public final fun (): kotlin.Int declared in .Z $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Z> - SYNTHETIC_BODY kind=ENUM_VALUES + CONSTRUCTOR visibility:private <> () returnType:.Z [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .Z + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Z modality:OPEN visibility:public superTypes:[kotlin.Enum<.Z>]' FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Z VALUE_PARAMETER name:value index:0 type:kotlin.String SYNTHETIC_BODY kind=ENUM_VALUEOF - PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Z> - correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] - SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Z> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>, other:.Z) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -106,6 +102,10 @@ FILE fqName: fileName:/enumEntry.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Z> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] annotations: IntrinsicConstEvaluation diff --git a/compiler/testData/ir/irText/singletons/enumEntry.fir.kt.txt b/compiler/testData/ir/irText/singletons/enumEntry.fir.kt.txt index 4553ade18c5..0fe64b885d0 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.fir.kt.txt +++ b/compiler/testData/ir/irText/singletons/enumEntry.fir.kt.txt @@ -1,21 +1,7 @@ open enum class Z : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } ENTRY = ENTRY() private enum entry class ENTRY : Z { - private constructor() /* primary */ { - super/*Z*/() - /* () */ - - } - - fun test() { - } - local inner class A { constructor() /* primary */ { super/*Any*/() @@ -29,12 +15,27 @@ open enum class Z : Enum { } + private constructor() /* primary */ { + super/*Z*/() + /* () */ + + } + + fun test() { + } + } - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): Z /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ diff --git a/compiler/testData/ir/irText/singletons/enumEntry.ir.txt b/compiler/testData/ir/irText/singletons/enumEntry.ir.txt index df4cdfd7be8..610df4d439d 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.ir.txt +++ b/compiler/testData/ir/irText/singletons/enumEntry.ir.txt @@ -1,24 +1,11 @@ FILE fqName: fileName:/enumEntry.kt CLASS ENUM_CLASS name:Z modality:OPEN visibility:public superTypes:[kotlin.Enum<.Z>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z - CONSTRUCTOR visibility:private <> () returnType:.Z [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' - : .Z - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Z modality:OPEN visibility:public superTypes:[kotlin.Enum<.Z>]' ENUM_ENTRY name:ENTRY init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Z.ENTRY' class: CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[.Z] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.ENTRY - CONSTRUCTOR visibility:private <> () returnType:.Z.ENTRY [primary] - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Z' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[.Z]' - FUN name:test visibility:public modality:FINAL <> ($this:.Z.ENTRY) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z.ENTRY - BLOCK_BODY CLASS CLASS name:A modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.ENTRY.A CONSTRUCTOR visibility:public <> ($this:.Z.ENTRY) returnType:.Z.ENTRY.A [primary] @@ -26,11 +13,6 @@ FILE fqName: fileName:/enumEntry.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - FUN name:test2 visibility:public modality:FINAL <> ($this:.Z.ENTRY.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z.ENTRY.A - BLOCK_BODY - CALL 'public final fun test (): kotlin.Unit declared in .Z.ENTRY' type=kotlin.Unit origin=null - $this: GET_ENUM 'ENUM_ENTRY name:ENTRY' type=.Z.ENTRY 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 @@ -44,24 +26,16 @@ FILE fqName: fileName:/enumEntry.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .Z - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Z - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN name:test2 visibility:public modality:FINAL <> ($this:.Z.ENTRY.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.ENTRY.A + BLOCK_BODY + CALL 'public final fun test (): kotlin.Unit declared in .Z.ENTRY' type=kotlin.Unit origin=null + $this: GET_ENUM 'ENUM_ENTRY name:ENTRY' type=.Z.ENTRY + CONSTRUCTOR visibility:private <> () returnType:.Z.ENTRY [primary] + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Z' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[.Z]' FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>, other:.Z) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: .Z): kotlin.Int declared in .Z @@ -80,24 +54,37 @@ FILE fqName: fileName:/enumEntry.kt overridden: public open fun toString (): kotlin.String declared in .Z $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - annotations: - IntrinsicConstEvaluation - overridden: - public final name: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final ordinal: kotlin.Int - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN name:test visibility:public modality:FINAL <> ($this:.Z.ENTRY) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.ENTRY + BLOCK_BODY + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in .Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + CONSTRUCTOR visibility:private <> () returnType:.Z [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .Z + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Z modality:OPEN visibility:public superTypes:[kotlin.Enum<.Z>]' + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Z + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Z> + SYNTHETIC_BODY kind=ENUM_VALUES FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>, other:.Z) returnType:kotlin.Int [fake_override,operator] overridden: public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum @@ -116,12 +103,25 @@ FILE fqName: fileName:/enumEntry.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> - FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Z> - SYNTHETIC_BODY kind=ENUM_VALUES - FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Z - VALUE_PARAMETER name:value index:0 type:kotlin.String - SYNTHETIC_BODY kind=ENUM_VALUEOF PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Z> correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] SYNTHETIC_BODY kind=ENUM_ENTRIES + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> diff --git a/compiler/testData/ir/irText/singletons/enumEntry.kt.txt b/compiler/testData/ir/irText/singletons/enumEntry.kt.txt index d191dde51ce..ab70bf22766 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.kt.txt +++ b/compiler/testData/ir/irText/singletons/enumEntry.kt.txt @@ -1,21 +1,7 @@ open enum class Z : Enum { - private constructor() /* primary */ { - super/*Enum*/() - /* () */ - - } ENTRY = ENTRY() private enum entry class ENTRY : Z { - private constructor() /* primary */ { - super/*Z*/() /*~> Unit */ - /* () */ - - } - - fun test() { - } - inner class A { constructor() /* primary */ { super/*Any*/() @@ -29,13 +15,29 @@ open enum class Z : Enum { } + private constructor() /* primary */ { + super/*Z*/() /*~> Unit */ + /* () */ + + } + + fun test() { + } + } - fun values(): Array /* Synthetic body for ENUM_VALUES */ + private constructor() /* primary */ { + super/*Enum*/() + /* () */ + + } fun valueOf(value: String): Z /* Synthetic body for ENUM_VALUEOF */ + fun values(): Array /* Synthetic body for ENUM_VALUES */ + val entries: EnumEntries get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } + diff --git a/compiler/testData/ir/irText/singletons/object.ir.txt b/compiler/testData/ir/irText/singletons/object.ir.txt index 3ac1bb3286b..3dc634175a9 100644 --- a/compiler/testData/ir/irText/singletons/object.ir.txt +++ b/compiler/testData/ir/irText/singletons/object.ir.txt @@ -1,24 +1,12 @@ FILE fqName: fileName:/object.kt CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z - CONSTRUCTOR visibility:private <> () returnType:.Z [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:test visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z - BLOCK_BODY CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.A CONSTRUCTOR visibility:public <> () returnType:.Z.A [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:test2 visibility:public modality:FINAL <> ($this:.Z.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z.A - BLOCK_BODY - CALL 'public final fun test (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null - $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z 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 @@ -32,6 +20,15 @@ FILE fqName: fileName:/object.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test2 visibility:public modality:FINAL <> ($this:.Z.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.A + BLOCK_BODY + CALL 'public final fun test (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + CONSTRUCTOR visibility:private <> () returnType:.Z [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Z modality:FINAL visibility:public 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 declared in kotlin.Any @@ -45,3 +42,6 @@ FILE fqName: fileName:/object.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY diff --git a/compiler/testData/ir/irText/singletons/object.kt.txt b/compiler/testData/ir/irText/singletons/object.kt.txt index cb62b884ee0..072f87c3575 100644 --- a/compiler/testData/ir/irText/singletons/object.kt.txt +++ b/compiler/testData/ir/irText/singletons/object.kt.txt @@ -1,13 +1,4 @@ object Z { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun test() { - } - class A { constructor() /* primary */ { super/*Any*/() @@ -21,4 +12,14 @@ object Z { } + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun test() { + } + } + diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.fir.ir.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.fir.ir.txt index 6f07e8129b9..e62375cf9ef 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.fir.ir.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.fir.ir.txt @@ -3,11 +3,6 @@ FILE fqName: fileName:/genericClassInDifferentModule_m1.kt CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base.Base> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T of .Base) returnType:.Base.Base> [primary] - VALUE_PARAMETER name:x index:0 type:T of .Base - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:T of .Base visibility:private [final] EXPRESSION_BODY @@ -19,6 +14,24 @@ FILE fqName: fileName:/genericClassInDifferentModule_m1.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Base declared in .Base' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Base visibility:private [final]' type=T of .Base origin=null receiver: GET_VAR ': .Base.Base> declared in .Base.' type=.Base.Base> origin=null + CONSTRUCTOR visibility:public <> (x:T of .Base) returnType:.Base.Base> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Base + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:ABSTRACT visibility:public 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 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:foo visibility:public modality:ABSTRACT ($this:.Base.Base>, y:Y of .Base.foo) returnType:T of .Base TYPE_PARAMETER name:Y index:0 variance: superTypes:[kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:.Base.Base> @@ -43,41 +56,11 @@ FILE fqName: fileName:/genericClassInDifferentModule_m1.kt $this: VALUE_PARAMETER name: type:.Base.Base> $receiver: VALUE_PARAMETER name: type:Z of .Base. VALUE_PARAMETER name: index:0 type:T of .Base - 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: 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 Module: m2 FILE fqName: fileName:/genericClassInDifferentModule_m2.kt CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base.Derived1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived1.Derived1> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T of .Derived1) returnType:.Derived1.Derived1> [primary] - VALUE_PARAMETER name:x index:0 type:T of .Derived1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: T of .Base) declared in .Base' - : T of .Derived1 - x: GET_VAR 'x: T of .Derived1 declared in .Derived1.' type=T of .Derived1 origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base.Derived1>]' - FUN name:foo visibility:public modality:OPEN ($this:.Derived1.Derived1>, y:Y of .Derived1.foo) returnType:T of .Derived1 - overridden: - public abstract fun foo (y: Y of .Base.foo): T of .Base declared in .Base - TYPE_PARAMETER name:Y index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.Derived1.Derived1> - VALUE_PARAMETER name:y index:0 type:Y of .Derived1.foo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (y: Y of .Derived1.foo): T of .Derived1 declared in .Derived1' - CALL 'public final fun (): T of .Derived1 declared in .Derived1' type=T of .Derived1 origin=GET_PROPERTY - $this: GET_VAR ': .Derived1.Derived1> declared in .Derived1.foo' type=.Derived1.Derived1> origin=null PROPERTY name:bar visibility:public modality:OPEN [var] overridden: public abstract bar: T of .Base @@ -103,6 +86,44 @@ FILE fqName: fileName:/genericClassInDifferentModule_m2.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:T of .Derived1 visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Derived1.Derived1> declared in .Derived1.' type=.Derived1.Derived1> origin=null value: GET_VAR ': T of .Derived1 declared in .Derived1.' type=T of .Derived1 origin=null + CONSTRUCTOR visibility:public <> (x:T of .Derived1) returnType:.Derived1.Derived1> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Derived1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: T of .Base) declared in .Base' + : T of .Derived1 + x: GET_VAR 'x: T of .Derived1 declared in .Derived1.' type=T of .Derived1 origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base.Derived1>]' + 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 .Base + $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 .Base + $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 .Base + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN ($this:.Derived1.Derived1>, y:Y of .Derived1.foo) returnType:T of .Derived1 + overridden: + public abstract fun foo (y: Y of .Base.foo): T of .Base declared in .Base + TYPE_PARAMETER name:Y index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.Derived1.Derived1> + VALUE_PARAMETER name:y index:0 type:Y of .Derived1.foo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (y: Y of .Derived1.foo): T of .Derived1 declared in .Derived1' + CALL 'public final fun (): T of .Derived1 declared in .Derived1' type=T of .Derived1 origin=GET_PROPERTY + $this: GET_VAR ': .Derived1.Derived1> declared in .Derived1.foo' type=.Derived1.Derived1> origin=null + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: T of .Base + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base.Derived1>) returnType:T of .Derived1 [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): T of .Base declared in .Base + $this: VALUE_PARAMETER name: type:.Base.Derived1> PROPERTY name:exn visibility:public modality:OPEN [var] overridden: public abstract exn: T of .Base @@ -126,24 +147,3 @@ FILE fqName: fileName:/genericClassInDifferentModule_m2.kt $receiver: VALUE_PARAMETER name: type:Z of .Derived1. VALUE_PARAMETER name:value index:0 type:T of .Derived1 BLOCK_BODY - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: T of .Base - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base.Derived1>) returnType:T of .Derived1 [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): T of .Base declared in .Base - $this: VALUE_PARAMETER name: type:.Base.Derived1> - 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 .Base - $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 .Base - $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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.fir.kt.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.fir.kt.txt index b0ac1a5ef2d..e99f82f371d 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.fir.kt.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.fir.kt.txt @@ -2,16 +2,16 @@ // FILE: genericClassInDifferentModule_m1.kt abstract class Base { + val x: T + field = x + get + constructor(x: T) /* primary */ { super/*Any*/() /* () */ } - val x: T - field = x - get - abstract fun foo(y: Y): T abstract var bar: T @@ -28,6 +28,11 @@ abstract class Base { // FILE: genericClassInDifferentModule_m2.kt class Derived1 : Base { + override var bar: T + field = x + override get + override set + constructor(x: T) /* primary */ { super/*Base*/(x = x) /* () */ @@ -38,11 +43,6 @@ class Derived1 : Base { return .() } - override var bar: T - field = x - override get - override set - override var Z.exn: T override get(): T { return .() @@ -51,3 +51,4 @@ class Derived1 : Base { } } + diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.ir.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.ir.txt index 9f3196753eb..082a226806b 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.ir.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.ir.txt @@ -3,11 +3,6 @@ FILE fqName: fileName:/genericClassInDifferentModule_m1.kt CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base.Base> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T of .Base) returnType:.Base.Base> [primary] - VALUE_PARAMETER name:x index:0 type:T of .Base - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:T of .Base visibility:private [final] EXPRESSION_BODY @@ -19,6 +14,24 @@ FILE fqName: fileName:/genericClassInDifferentModule_m1.kt RETURN type=kotlin.Nothing from='public final fun (): T of .Base declared in .Base' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Base visibility:private [final]' type=T of .Base origin=null receiver: GET_VAR ': .Base.Base> declared in .Base.' type=.Base.Base> origin=null + CONSTRUCTOR visibility:public <> (x:T of .Base) returnType:.Base.Base> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Base + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:ABSTRACT visibility:public 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 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:foo visibility:public modality:ABSTRACT ($this:.Base.Base>, y:Y of .Base.foo) returnType:T of .Base TYPE_PARAMETER name:Y index:0 variance: superTypes:[kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:.Base.Base> @@ -43,41 +56,11 @@ FILE fqName: fileName:/genericClassInDifferentModule_m1.kt $this: VALUE_PARAMETER name: type:.Base.Base> $receiver: VALUE_PARAMETER name: type:Z of .Base. VALUE_PARAMETER name: index:0 type:T of .Base - 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: 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 Module: m2 FILE fqName: fileName:/genericClassInDifferentModule_m2.kt CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base.Derived1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived1.Derived1> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T of .Derived1) returnType:.Derived1.Derived1> [primary] - VALUE_PARAMETER name:x index:0 type:T of .Derived1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: T of .Base) declared in .Base' - : T of .Derived1 - x: GET_VAR 'x: T of .Derived1 declared in .Derived1.' type=T of .Derived1 origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base.Derived1>]' - FUN name:foo visibility:public modality:OPEN ($this:.Derived1.Derived1>, y:Y of .Derived1.foo) returnType:T of .Derived1 - overridden: - public abstract fun foo (y: Y of .Base.foo): T of .Base declared in .Base - TYPE_PARAMETER name:Y index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.Derived1.Derived1> - VALUE_PARAMETER name:y index:0 type:Y of .Derived1.foo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (y: Y of .Derived1.foo): T of .Derived1 declared in .Derived1' - CALL 'public final fun (): T of .Derived1 declared in .Derived1' type=T of .Derived1 origin=GET_PROPERTY - $this: GET_VAR ': .Derived1.Derived1> declared in .Derived1.foo' type=.Derived1.Derived1> origin=null PROPERTY name:bar visibility:public modality:OPEN [var] overridden: public abstract bar: T of .Base @@ -103,6 +86,44 @@ FILE fqName: fileName:/genericClassInDifferentModule_m2.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:T of .Derived1 visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Derived1.Derived1> declared in .Derived1.' type=.Derived1.Derived1> origin=null value: GET_VAR ': T of .Derived1 declared in .Derived1.' type=T of .Derived1 origin=null + CONSTRUCTOR visibility:public <> (x:T of .Derived1) returnType:.Derived1.Derived1> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Derived1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: T of .Base) declared in .Base' + : T of .Derived1 + x: GET_VAR 'x: T of .Derived1 declared in .Derived1.' type=T of .Derived1 origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base.Derived1>]' + 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 .Base + $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 .Base + $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 .Base + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN ($this:.Derived1.Derived1>, y:Y of .Derived1.foo) returnType:T of .Derived1 + overridden: + public abstract fun foo (y: Y of .Base.foo): T of .Base declared in .Base + TYPE_PARAMETER name:Y index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.Derived1.Derived1> + VALUE_PARAMETER name:y index:0 type:Y of .Derived1.foo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (y: Y of .Derived1.foo): T of .Derived1 declared in .Derived1' + CALL 'public final fun (): T of .Derived1 declared in .Derived1' type=T of .Derived1 origin=GET_PROPERTY + $this: GET_VAR ': .Derived1.Derived1> declared in .Derived1.foo' type=.Derived1.Derived1> origin=null + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final x: T of .Base + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base.Derived1>) returnType:T of .Derived1 [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): T of .Base declared in .Base + $this: VALUE_PARAMETER name: type:.Base.Derived1> PROPERTY name:exn visibility:public modality:OPEN [var] overridden: public abstract exn: T of .Base @@ -126,24 +147,3 @@ FILE fqName: fileName:/genericClassInDifferentModule_m2.kt $receiver: VALUE_PARAMETER name: type:Z of .Derived1. VALUE_PARAMETER name:value index:0 type:T of .Derived1 BLOCK_BODY - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: T of .Base - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base.Derived1>) returnType:T of .Derived1 [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): T of .Base declared in .Base - $this: VALUE_PARAMETER name: type:.Base.Derived1> - 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 .Base - $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 .Base - $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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt.txt index b0ac1a5ef2d..e99f82f371d 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt.txt @@ -2,16 +2,16 @@ // FILE: genericClassInDifferentModule_m1.kt abstract class Base { + val x: T + field = x + get + constructor(x: T) /* primary */ { super/*Any*/() /* () */ } - val x: T - field = x - get - abstract fun foo(y: Y): T abstract var bar: T @@ -28,6 +28,11 @@ abstract class Base { // FILE: genericClassInDifferentModule_m2.kt class Derived1 : Base { + override var bar: T + field = x + override get + override set + constructor(x: T) /* primary */ { super/*Base*/(x = x) /* () */ @@ -38,11 +43,6 @@ class Derived1 : Base { return .() } - override var bar: T - field = x - override get - override set - override var Z.exn: T override get(): T { return .() @@ -51,3 +51,4 @@ class Derived1 : Base { } } + diff --git a/compiler/testData/ir/irText/stubs/javaInnerClass.fir.ir.txt b/compiler/testData/ir/irText/stubs/javaInnerClass.fir.ir.txt index 7e81f6a86e1..31f65064366 100644 --- a/compiler/testData/ir/irText/stubs/javaInnerClass.fir.ir.txt +++ b/compiler/testData/ir/irText/stubs/javaInnerClass.fir.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/javaInnerClass.kt CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.J] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 - CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .J' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.J]' PROPERTY name:test visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test type:.J.JInner visibility:private [final] EXPRESSION_BODY @@ -17,6 +13,10 @@ FILE fqName: fileName:/javaInnerClass.kt RETURN type=kotlin.Nothing from='public final fun (): .J.JInner declared in .Test1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:.J.JInner visibility:private [final]' type=.J.JInner origin=null receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .J' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.J]' FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:.J) returnType:kotlin.Unit [fake_override] overridden: public open fun bar (): kotlin.Unit declared in .J diff --git a/compiler/testData/ir/irText/stubs/javaInnerClass.fir.kt.txt b/compiler/testData/ir/irText/stubs/javaInnerClass.fir.kt.txt index e2eb3738043..7d47affb3f0 100644 --- a/compiler/testData/ir/irText/stubs/javaInnerClass.fir.kt.txt +++ b/compiler/testData/ir/irText/stubs/javaInnerClass.fir.kt.txt @@ -1,12 +1,13 @@ class Test1 : J { + val test: JInner + field = .JInner() + get + constructor() /* primary */ { super/*J*/() /* () */ } - val test: JInner - field = .JInner() - get - } + diff --git a/compiler/testData/ir/irText/stubs/javaInnerClass.ir.txt b/compiler/testData/ir/irText/stubs/javaInnerClass.ir.txt index 99809ba0998..5ff920d2209 100644 --- a/compiler/testData/ir/irText/stubs/javaInnerClass.ir.txt +++ b/compiler/testData/ir/irText/stubs/javaInnerClass.ir.txt @@ -1,10 +1,6 @@ FILE fqName: fileName:/javaInnerClass.kt CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.J] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 - CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .J' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.J]' PROPERTY name:test visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test type:.J.JInner visibility:private [final] EXPRESSION_BODY @@ -17,6 +13,14 @@ FILE fqName: fileName:/javaInnerClass.kt RETURN type=kotlin.Nothing from='public final fun (): .J.JInner declared in .Test1' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:.J.JInner visibility:private [final]' type=.J.JInner origin=null receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .J' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.J]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:.J) returnType:kotlin.Unit [fake_override] + overridden: + public open fun bar (): kotlin.Unit declared in .J + $this: VALUE_PARAMETER name: type:.J 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 .J @@ -30,10 +34,6 @@ FILE fqName: fileName:/javaInnerClass.kt overridden: public open fun toString (): kotlin.String declared in .J $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:.J) returnType:kotlin.Unit [fake_override] - overridden: - public open fun bar (): kotlin.Unit declared in .J - $this: VALUE_PARAMETER name: type:.J PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,var] overridden: public final x: kotlin.Int diff --git a/compiler/testData/ir/irText/stubs/javaInnerClass.kt.txt b/compiler/testData/ir/irText/stubs/javaInnerClass.kt.txt index e2eb3738043..7d47affb3f0 100644 --- a/compiler/testData/ir/irText/stubs/javaInnerClass.kt.txt +++ b/compiler/testData/ir/irText/stubs/javaInnerClass.kt.txt @@ -1,12 +1,13 @@ class Test1 : J { + val test: JInner + field = .JInner() + get + constructor() /* primary */ { super/*J*/() /* () */ } - val test: JInner - field = .JInner() - get - } + diff --git a/compiler/testData/ir/irText/types/abbreviatedTypes.ir.txt b/compiler/testData/ir/irText/types/abbreviatedTypes.ir.txt index 8bb3290b60d..584d0709cca 100644 --- a/compiler/testData/ir/irText/types/abbreviatedTypes.ir.txt +++ b/compiler/testData/ir/irText/types/abbreviatedTypes.ir.txt @@ -1,7 +1,4 @@ FILE fqName: fileName:/abbreviatedTypes.kt - TYPEALIAS name:I visibility:public expandedType:kotlin.Int - TYPEALIAS name:L visibility:public expandedType:kotlin.collections.List.L> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.collections.List) returnType:kotlin.collections.List VALUE_PARAMETER name:x index:0 type:kotlin.collections.List BLOCK_BODY @@ -22,3 +19,6 @@ FILE fqName: fileName:/abbreviatedTypes.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test4 (x: kotlin.collections.List>): kotlin.collections.List> declared in ' GET_VAR 'x: kotlin.collections.List> declared in .test4' type=kotlin.collections.List> origin=null + TYPEALIAS name:I visibility:public expandedType:kotlin.Int + TYPEALIAS name:L visibility:public expandedType:kotlin.collections.List.L> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false diff --git a/compiler/testData/ir/irText/types/abbreviatedTypes.kt.txt b/compiler/testData/ir/irText/types/abbreviatedTypes.kt.txt index 4a01af01494..5aa4812e799 100644 --- a/compiler/testData/ir/irText/types/abbreviatedTypes.kt.txt +++ b/compiler/testData/ir/irText/types/abbreviatedTypes.kt.txt @@ -1,5 +1,3 @@ -typealias I = Int -typealias L = List fun test1(x: List): List { return x } @@ -15,3 +13,6 @@ fun test3(x: List>): List> { fun test4(x: List>): List> { return x } + +typealias I = Int +typealias L = List diff --git a/compiler/testData/ir/irText/types/asOnPlatformType.ir.txt b/compiler/testData/ir/irText/types/asOnPlatformType.ir.txt index 4cb95c637be..c117f5db9c3 100644 --- a/compiler/testData/ir/irText/types/asOnPlatformType.ir.txt +++ b/compiler/testData/ir/irText/types/asOnPlatformType.ir.txt @@ -1,4 +1,18 @@ FILE fqName: fileName:/asOnPlatformType.kt + FUN name:foo visibility:public modality:FINAL ($receiver:T of .foo) returnType:T of .foo [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true + $receiver: VALUE_PARAMETER name: type:T of .foo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): T of .foo declared in ' + TYPE_OP type=T of .foo origin=CAST typeOperand=T of .foo + GET_VAR ': T of .foo declared in .foo' type=T of .foo origin=null + FUN name:fooN visibility:public modality:FINAL ($receiver:T of .fooN) returnType:T of .fooN? [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true + $receiver: VALUE_PARAMETER name: type:T of .fooN + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun fooN (): T of .fooN? declared in ' + TYPE_OP type=T of .fooN? origin=CAST typeOperand=T of .fooN? + GET_VAR ': T of .fooN declared in .fooN' type=T of .fooN origin=null FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:nullStr type:@[FlexibleNullability] kotlin.String? [val] @@ -21,17 +35,3 @@ FILE fqName: fileName:/asOnPlatformType.kt CALL 'public final fun fooN (): T of .fooN? declared in ' type=kotlin.String? origin=null : @[FlexibleNullability] kotlin.String? $receiver: GET_VAR 'val nonnullStr: @[FlexibleNullability] kotlin.String? declared in .test' type=@[FlexibleNullability] kotlin.String? origin=null - FUN name:foo visibility:public modality:FINAL ($receiver:T of .foo) returnType:T of .foo [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true - $receiver: VALUE_PARAMETER name: type:T of .foo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): T of .foo declared in ' - TYPE_OP type=T of .foo origin=CAST typeOperand=T of .foo - GET_VAR ': T of .foo declared in .foo' type=T of .foo origin=null - FUN name:fooN visibility:public modality:FINAL ($receiver:T of .fooN) returnType:T of .fooN? [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true - $receiver: VALUE_PARAMETER name: type:T of .fooN - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun fooN (): T of .fooN? declared in ' - TYPE_OP type=T of .fooN? origin=CAST typeOperand=T of .fooN? - GET_VAR ': T of .fooN declared in .fooN' type=T of .fooN origin=null diff --git a/compiler/testData/ir/irText/types/asOnPlatformType.kt.txt b/compiler/testData/ir/irText/types/asOnPlatformType.kt.txt index 5b580e7dc30..a49656dcbcd 100644 --- a/compiler/testData/ir/irText/types/asOnPlatformType.kt.txt +++ b/compiler/testData/ir/irText/types/asOnPlatformType.kt.txt @@ -1,3 +1,11 @@ +inline fun T.foo(): T { + return as T +} + +inline fun T.fooN(): T? { + return as T? +} + fun test() { val nullStr: @FlexibleNullability String? = nullString() val nonnullStr: @FlexibleNullability String? = nonnullString() @@ -7,10 +15,3 @@ fun test() { nonnullStr.fooN<@FlexibleNullability String?>() /*~> Unit */ } -inline fun T.foo(): T { - return as T -} - -inline fun T.fooN(): T? { - return as T? -} diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.ir.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.ir.txt index 855b09208ee..3df2e9e6ab7 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.ir.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.ir.txt @@ -1,81 +1,217 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt - FUN name:scopedFlow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>) returnType:.Flow.scopedFlow> - annotations: - OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) - TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> + CLASS CLASS name:ChannelCoroutine modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ChannelCoroutine.ChannelCoroutine> + TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.ChannelCoroutine.ChannelCoroutine> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ChannelCoroutine modality:OPEN visibility:public 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 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:sendFair visibility:public modality:FINAL <> ($this:.ChannelCoroutine.ChannelCoroutine>, element:E of .ChannelCoroutine) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.ChannelCoroutine.ChannelCoroutine> + VALUE_PARAMETER name:element index:0 type:E of .ChannelCoroutine + BLOCK_BODY + CLASS CLASS name:SafeCollector modality:FINAL visibility:public superTypes:[.FlowCollector.SafeCollector>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SafeCollector.SafeCollector> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:collector visibility:internal modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:collector type:.FlowCollector.SafeCollector> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'collector: .FlowCollector.SafeCollector> declared in .SafeCollector.' type=.FlowCollector.SafeCollector> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:internal modality:FINAL <> ($this:.SafeCollector.SafeCollector>) returnType:.FlowCollector.SafeCollector> + correspondingProperty: PROPERTY name:collector visibility:internal modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.SafeCollector.SafeCollector> + BLOCK_BODY + RETURN type=kotlin.Nothing from='internal final fun (): .FlowCollector.SafeCollector> declared in .SafeCollector' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:collector type:.FlowCollector.SafeCollector> visibility:private [final]' type=.FlowCollector.SafeCollector> origin=null + receiver: GET_VAR ': .SafeCollector.SafeCollector> declared in .SafeCollector.' type=.SafeCollector.SafeCollector> origin=null + CONSTRUCTOR visibility:public <> (collector:.FlowCollector.SafeCollector>) returnType:.SafeCollector.SafeCollector> [primary] + VALUE_PARAMETER name:collector index:0 type:.FlowCollector.SafeCollector> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SafeCollector modality:FINAL visibility:public superTypes:[.FlowCollector.SafeCollector>]' + 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 .FlowCollector + $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 .FlowCollector + $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 .FlowCollector + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:emit visibility:public modality:OPEN <> ($this:.SafeCollector.SafeCollector>, value:T of .SafeCollector) returnType:kotlin.Unit [suspend] + overridden: + public abstract fun emit (value: T of .FlowCollector): kotlin.Unit declared in .FlowCollector + $this: VALUE_PARAMETER name: type:.SafeCollector.SafeCollector> + VALUE_PARAMETER name:value index:0 type:T of .SafeCollector + BLOCK_BODY + CLASS INTERFACE name:CoroutineScope modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CoroutineScope + 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: 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 + CLASS INTERFACE name:Flow modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Flow.Flow> + TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false + 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: 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:collect visibility:public modality:ABSTRACT <> ($this:.Flow.Flow>, collector:.FlowCollector.Flow>) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.Flow.Flow> + VALUE_PARAMETER name:collector index:0 type:.FlowCollector.Flow> + CLASS INTERFACE name:FlowCollector modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FlowCollector.FlowCollector> + TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false + 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: 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:emit visibility:public modality:ABSTRACT <> ($this:.FlowCollector.FlowCollector>, value:T of .FlowCollector) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.FlowCollector.FlowCollector> + VALUE_PARAMETER name:value index:0 type:T of .FlowCollector + 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?] reified:false + 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 .CoroutineScope + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .SendChannel + $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 .CoroutineScope + public open fun hashCode (): kotlin.Int declared in .SendChannel + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:send visibility:public modality:ABSTRACT <> ($this:.SendChannel.ProducerScope>, e:E of .ProducerScope) returnType:kotlin.Unit [suspend,fake_override] + overridden: + public abstract fun send (e: E of .SendChannel): kotlin.Unit declared in .SendChannel + $this: VALUE_PARAMETER name: type:.SendChannel.ProducerScope> + VALUE_PARAMETER name:e index:0 type:E of .ProducerScope + 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 .CoroutineScope + public open fun toString (): kotlin.String declared in .SendChannel + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:channel visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.ProducerScope.ProducerScope>) returnType:.SendChannel.ProducerScope> + correspondingProperty: PROPERTY name:channel visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.ProducerScope.ProducerScope> + CLASS INTERFACE name:ReceiveChannel modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ReceiveChannel.ReceiveChannel> + TYPE_PARAMETER name:E index:0 variance:out superTypes:[kotlin.Any?] reified:false + 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: 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 + CLASS INTERFACE name:SendChannel modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SendChannel.SendChannel> + TYPE_PARAMETER name:E index:0 variance:in superTypes:[kotlin.Any?] reified:false + 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: 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:send visibility:public modality:ABSTRACT <> ($this:.SendChannel.SendChannel>, e:E of .SendChannel) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.SendChannel.SendChannel> + VALUE_PARAMETER name:e index:0 type:E of .SendChannel + FUN name:asChannel visibility:private modality:FINAL <> ($receiver:.CoroutineScope, flow:.Flow<*>) returnType:.ReceiveChannel + $receiver: VALUE_PARAMETER name: type:.CoroutineScope + VALUE_PARAMETER name:flow index:0 type:.Flow<*> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun scopedFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>): .Flow.scopedFlow> declared in ' - CALL 'public final fun flow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' type=.Flow.scopedFlow> origin=null - : R of .scopedFlow - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.scopedFlow>, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.scopedFlow>) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER name:$this$flow type:.FlowCollector.scopedFlow> + RETURN type=kotlin.Nothing from='private final fun asChannel (flow: .Flow<*>): .ReceiveChannel declared in ' + CALL 'public final fun produce (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' type=.ReceiveChannel origin=null + : kotlin.Any + $receiver: GET_VAR ': .CoroutineScope declared in .asChannel' type=.CoroutineScope origin=null + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.ProducerScope) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER name:$this$produce type:.ProducerScope BLOCK_BODY - VAR name:collector type:.FlowCollector.scopedFlow> [val] - GET_VAR '$this$flow: .FlowCollector.scopedFlow> declared in .scopedFlow.' type=.FlowCollector.scopedFlow> origin=null - CALL 'public final fun flowScope (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope declared in ' type=kotlin.Unit origin=null - : kotlin.Unit - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.CoroutineScope) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER name:$this$flowScope type:.CoroutineScope + CALL 'public final fun collect (action: kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "value")] T of .collect, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any? + $receiver: GET_VAR 'flow: .Flow<*> declared in .asChannel' type=.Flow<*> origin=null + action: FUN_EXPR type=kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "value")] kotlin.Any?, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (value:@[ParameterName(name = "value")] kotlin.Any?) returnType:kotlin.Unit [suspend] + VALUE_PARAMETER name:value index:0 type:@[ParameterName(name = "value")] kotlin.Any? BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.coroutines.SuspendFunction2, p2: P2 of kotlin.coroutines.SuspendFunction2): R of kotlin.coroutines.SuspendFunction2 declared in kotlin.coroutines.SuspendFunction2' type=kotlin.Unit origin=null - $this: GET_VAR 'block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> declared in .scopedFlow' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '$this$flowScope: .CoroutineScope declared in .scopedFlow..' type=.CoroutineScope origin=null - p2: GET_VAR 'val collector: .FlowCollector.scopedFlow> declared in .scopedFlow.' type=.FlowCollector.scopedFlow> origin=null - FUN name:onCompletion visibility:public modality:FINAL ($receiver:.Flow.onCompletion>, action:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>) returnType:.Flow.onCompletion> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Flow.onCompletion> - VALUE_PARAMETER name:action index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun onCompletion (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' - CALL 'public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> declared in ' type=.Flow.onCompletion> origin=null - : T of .onCompletion - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.onCompletion>, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.onCompletion>) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER name:$this$unsafeFlow type:.FlowCollector.onCompletion> - BLOCK_BODY - VAR name:safeCollector type:.SafeCollector.onCompletion> [val] - CONSTRUCTOR_CALL 'public constructor (collector: .FlowCollector.SafeCollector>) declared in .SafeCollector' type=.SafeCollector.onCompletion> origin=null - : T of .onCompletion - collector: GET_VAR '$this$unsafeFlow: .FlowCollector.onCompletion> declared in .onCompletion.' type=.FlowCollector.onCompletion> origin=null - CALL 'public final fun invokeSafely (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : T of .onCompletion - $receiver: GET_VAR 'val safeCollector: .SafeCollector.onCompletion> declared in .onCompletion.' type=.SafeCollector.onCompletion> origin=null - action: GET_VAR 'action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> declared in .onCompletion' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> origin=null - FUN name:invokeSafely visibility:public modality:FINAL ($receiver:.FlowCollector.invokeSafely>, action:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>) returnType:kotlin.Unit [suspend] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.FlowCollector.invokeSafely> - VALUE_PARAMETER name:action index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> - BLOCK_BODY - FUN name:unsafeFlow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>) returnType:.Flow.unsafeFlow> [inline] - annotations: - OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit> [crossinline] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> declared in ' - CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' 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) - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Flow.onCompletion> - VALUE_PARAMETER name:action index:0 type:kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun onCompletion (action: kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' - CALL 'public final fun onCompletion (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' type=.Flow.onCompletion> origin=null - : T of .onCompletion - $receiver: GET_VAR ': .Flow.onCompletion> declared in .onCompletion' type=.Flow.onCompletion> origin=null - action: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.onCompletion>, it:@[ParameterName(name = "cause")] kotlin.Throwable?) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER name:$this$onCompletion type:.FlowCollector.onCompletion> - VALUE_PARAMETER name:it index:0 type:@[ParameterName(name = "cause")] kotlin.Throwable? - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.coroutines.SuspendFunction1): R of kotlin.coroutines.SuspendFunction1 declared in kotlin.coroutines.SuspendFunction1' type=kotlin.Unit origin=null - $this: GET_VAR 'action: kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> declared in .onCompletion' type=kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR 'it: @[ParameterName(name = "cause")] kotlin.Throwable? declared in .onCompletion.' type=@[ParameterName(name = "cause")] kotlin.Throwable? origin=null + RETURN type=kotlin.Nothing from='local final fun (value: @[ParameterName(name = "value")] kotlin.Any?): kotlin.Unit declared in .asChannel.' + CALL 'public abstract fun send (e: E of .SendChannel): kotlin.Unit declared in .SendChannel' type=kotlin.Unit origin=null + $this: CALL 'public abstract fun (): .SendChannel.ProducerScope> declared in .ProducerScope' type=.SendChannel origin=GET_PROPERTY + $this: GET_VAR '$this$produce: .ProducerScope declared in .asChannel.' type=.ProducerScope origin=null + e: BLOCK type=@[ParameterName(name = "value")] kotlin.Any origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:@[ParameterName(name = "value")] kotlin.Any? [val] + GET_VAR 'value: @[ParameterName(name = "value")] kotlin.Any? declared in .asChannel..' type=@[ParameterName(name = "value")] kotlin.Any? origin=null + WHEN type=@[ParameterName(name = "value")] kotlin.Any 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: @[ParameterName(name = "value")] kotlin.Any? declared in .asChannel..' type=@[ParameterName(name = "value")] kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_0: @[ParameterName(name = "value")] kotlin.Any? declared in .asChannel..' type=@[ParameterName(name = "value")] kotlin.Any? origin=null FUN name:asFairChannel visibility:private modality:FINAL <> ($receiver:.CoroutineScope, flow:.Flow<*>) returnType:.ReceiveChannel $receiver: VALUE_PARAMETER name: type:.CoroutineScope VALUE_PARAMETER name:flow index:0 type:.Flow<*> @@ -103,90 +239,22 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt CALL 'public final fun sendFair (element: E of .ChannelCoroutine): kotlin.Unit declared in .ChannelCoroutine' type=kotlin.Unit origin=null $this: GET_VAR 'val channel: .ChannelCoroutine declared in .asFairChannel.' type=.ChannelCoroutine origin=null element: BLOCK type=@[ParameterName(name = "value")] kotlin.Any origin=ELVIS - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:@[ParameterName(name = "value")] kotlin.Any? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:@[ParameterName(name = "value")] kotlin.Any? [val] GET_VAR 'value: @[ParameterName(name = "value")] kotlin.Any? declared in .asFairChannel..' type=@[ParameterName(name = "value")] kotlin.Any? origin=null WHEN type=@[ParameterName(name = "value")] kotlin.Any 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: @[ParameterName(name = "value")] kotlin.Any? declared in .asFairChannel..' type=@[ParameterName(name = "value")] kotlin.Any? origin=null + arg0: GET_VAR 'val tmp_1: @[ParameterName(name = "value")] kotlin.Any? declared in .asFairChannel..' type=@[ParameterName(name = "value")] kotlin.Any? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_0: @[ParameterName(name = "value")] kotlin.Any? declared in .asFairChannel..' type=@[ParameterName(name = "value")] kotlin.Any? origin=null - FUN name:asChannel visibility:private modality:FINAL <> ($receiver:.CoroutineScope, flow:.Flow<*>) returnType:.ReceiveChannel - $receiver: VALUE_PARAMETER name: type:.CoroutineScope - VALUE_PARAMETER name:flow index:0 type:.Flow<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun asChannel (flow: .Flow<*>): .ReceiveChannel declared in ' - CALL 'public final fun produce (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' type=.ReceiveChannel origin=null - : kotlin.Any - $receiver: GET_VAR ': .CoroutineScope declared in .asChannel' type=.CoroutineScope origin=null - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.ProducerScope) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER name:$this$produce type:.ProducerScope - BLOCK_BODY - CALL 'public final fun collect (action: kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "value")] T of .collect, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : kotlin.Any? - $receiver: GET_VAR 'flow: .Flow<*> declared in .asChannel' type=.Flow<*> origin=null - action: FUN_EXPR type=kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "value")] kotlin.Any?, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (value:@[ParameterName(name = "value")] kotlin.Any?) returnType:kotlin.Unit [suspend] - VALUE_PARAMETER name:value index:0 type:@[ParameterName(name = "value")] kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (value: @[ParameterName(name = "value")] kotlin.Any?): kotlin.Unit declared in .asChannel.' - CALL 'public abstract fun send (e: E of .SendChannel): kotlin.Unit declared in .SendChannel' type=kotlin.Unit origin=null - $this: CALL 'public abstract fun (): .SendChannel.ProducerScope> declared in .ProducerScope' type=.SendChannel origin=GET_PROPERTY - $this: GET_VAR '$this$produce: .ProducerScope declared in .asChannel.' type=.ProducerScope origin=null - e: BLOCK type=@[ParameterName(name = "value")] kotlin.Any origin=ELVIS - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:@[ParameterName(name = "value")] kotlin.Any? [val] - GET_VAR 'value: @[ParameterName(name = "value")] kotlin.Any? declared in .asChannel..' type=@[ParameterName(name = "value")] kotlin.Any? origin=null - WHEN type=@[ParameterName(name = "value")] kotlin.Any 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: @[ParameterName(name = "value")] kotlin.Any? declared in .asChannel..' type=@[ParameterName(name = "value")] kotlin.Any? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_1: @[ParameterName(name = "value")] kotlin.Any? declared in .asChannel..' type=@[ParameterName(name = "value")] kotlin.Any? origin=null - CLASS CLASS name:SafeCollector modality:FINAL visibility:public superTypes:[.FlowCollector.SafeCollector>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SafeCollector.SafeCollector> + then: GET_VAR 'val tmp_1: @[ParameterName(name = "value")] kotlin.Any? declared in .asFairChannel..' type=@[ParameterName(name = "value")] kotlin.Any? 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?] reified:false - CONSTRUCTOR visibility:public <> (collector:.FlowCollector.SafeCollector>) returnType:.SafeCollector.SafeCollector> [primary] - VALUE_PARAMETER name:collector index:0 type:.FlowCollector.SafeCollector> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SafeCollector modality:FINAL visibility:public superTypes:[.FlowCollector.SafeCollector>]' - PROPERTY name:collector visibility:internal modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:collector type:.FlowCollector.SafeCollector> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'collector: .FlowCollector.SafeCollector> declared in .SafeCollector.' type=.FlowCollector.SafeCollector> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:internal modality:FINAL <> ($this:.SafeCollector.SafeCollector>) returnType:.FlowCollector.SafeCollector> - correspondingProperty: PROPERTY name:collector visibility:internal modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.SafeCollector.SafeCollector> - BLOCK_BODY - RETURN type=kotlin.Nothing from='internal final fun (): .FlowCollector.SafeCollector> declared in .SafeCollector' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:collector type:.FlowCollector.SafeCollector> visibility:private [final]' type=.FlowCollector.SafeCollector> origin=null - receiver: GET_VAR ': .SafeCollector.SafeCollector> declared in .SafeCollector.' type=.SafeCollector.SafeCollector> origin=null - FUN name:emit visibility:public modality:OPEN <> ($this:.SafeCollector.SafeCollector>, value:T of .SafeCollector) returnType:kotlin.Unit [suspend] - overridden: - public abstract fun emit (value: T of .FlowCollector): kotlin.Unit declared in .FlowCollector - $this: VALUE_PARAMETER name: type:.SafeCollector.SafeCollector> - VALUE_PARAMETER name:value index:0 type:T of .SafeCollector - BLOCK_BODY - 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 .FlowCollector - $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 .FlowCollector - $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 .FlowCollector - $this: VALUE_PARAMETER name: type:kotlin.Any + $receiver: VALUE_PARAMETER name: type:.Flow.collect> + VALUE_PARAMETER name:action index:0 type:kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "value")] T of .collect, kotlin.Unit> [crossinline] + BLOCK_BODY FUN name:flow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>) returnType:.Flow.flow> annotations: OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) @@ -203,104 +271,50 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun flowScope (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope declared in ' CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' 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] + FUN name:invokeSafely visibility:public modality:FINAL ($receiver:.FlowCollector.invokeSafely>, action:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>) returnType:kotlin.Unit [suspend] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Flow.collect> - VALUE_PARAMETER name:action index:0 type:kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "value")] T of .collect, kotlin.Unit> [crossinline] + $receiver: VALUE_PARAMETER name: type:.FlowCollector.invokeSafely> + VALUE_PARAMETER name:action index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> BLOCK_BODY - CLASS CLASS name:ChannelCoroutine modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ChannelCoroutine.ChannelCoroutine> - TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.ChannelCoroutine.ChannelCoroutine> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ChannelCoroutine modality:OPEN visibility:public superTypes:[kotlin.Any]' - FUN name:sendFair visibility:public modality:FINAL <> ($this:.ChannelCoroutine.ChannelCoroutine>, element:E of .ChannelCoroutine) returnType:kotlin.Unit [suspend] - $this: VALUE_PARAMETER name: type:.ChannelCoroutine.ChannelCoroutine> - VALUE_PARAMETER name:element index:0 type:E of .ChannelCoroutine - BLOCK_BODY - 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: 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 - CLASS INTERFACE name:CoroutineScope modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CoroutineScope - 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: 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 - CLASS INTERFACE name:Flow modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Flow.Flow> - TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false - FUN name:collect visibility:public modality:ABSTRACT <> ($this:.Flow.Flow>, collector:.FlowCollector.Flow>) returnType:kotlin.Unit [suspend] - $this: VALUE_PARAMETER name: type:.Flow.Flow> - VALUE_PARAMETER name:collector index:0 type:.FlowCollector.Flow> - 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: 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 - CLASS INTERFACE name:FlowCollector modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FlowCollector.FlowCollector> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false - FUN name:emit visibility:public modality:ABSTRACT <> ($this:.FlowCollector.FlowCollector>, value:T of .FlowCollector) returnType:kotlin.Unit [suspend] - $this: VALUE_PARAMETER name: type:.FlowCollector.FlowCollector> - VALUE_PARAMETER name:value index:0 type:T of .FlowCollector - 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: 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 - CLASS INTERFACE name:ReceiveChannel modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ReceiveChannel.ReceiveChannel> - TYPE_PARAMETER name:E index:0 variance:out superTypes:[kotlin.Any?] reified:false - 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: 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:onCompletion visibility:public modality:FINAL ($receiver:.Flow.onCompletion>, action:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>) returnType:.Flow.onCompletion> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Flow.onCompletion> + VALUE_PARAMETER name:action index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun onCompletion (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' + CALL 'public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> declared in ' type=.Flow.onCompletion> origin=null + : T of .onCompletion + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.onCompletion>, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.onCompletion>) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER name:$this$unsafeFlow type:.FlowCollector.onCompletion> + BLOCK_BODY + VAR name:safeCollector type:.SafeCollector.onCompletion> [val] + CONSTRUCTOR_CALL 'public constructor (collector: .FlowCollector.SafeCollector>) declared in .SafeCollector' type=.SafeCollector.onCompletion> origin=null + : T of .onCompletion + collector: GET_VAR '$this$unsafeFlow: .FlowCollector.onCompletion> declared in .onCompletion.' type=.FlowCollector.onCompletion> origin=null + CALL 'public final fun invokeSafely (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : T of .onCompletion + $receiver: GET_VAR 'val safeCollector: .SafeCollector.onCompletion> declared in .onCompletion.' type=.SafeCollector.onCompletion> origin=null + action: GET_VAR 'action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> declared in .onCompletion' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> 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) + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Flow.onCompletion> + VALUE_PARAMETER name:action index:0 type:kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun onCompletion (action: kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' + CALL 'public final fun onCompletion (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' type=.Flow.onCompletion> origin=null + : T of .onCompletion + $receiver: GET_VAR ': .Flow.onCompletion> declared in .onCompletion' type=.Flow.onCompletion> origin=null + action: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.onCompletion>, it:@[ParameterName(name = "cause")] kotlin.Throwable?) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER name:$this$onCompletion type:.FlowCollector.onCompletion> + VALUE_PARAMETER name:it index:0 type:@[ParameterName(name = "cause")] kotlin.Throwable? + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.coroutines.SuspendFunction1): R of kotlin.coroutines.SuspendFunction1 declared in kotlin.coroutines.SuspendFunction1' type=kotlin.Unit origin=null + $this: GET_VAR 'action: kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> declared in .onCompletion' type=kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> origin=VARIABLE_AS_FUNCTION + p1: GET_VAR 'it: @[ParameterName(name = "cause")] kotlin.Throwable? declared in .onCompletion.' type=@[ParameterName(name = "cause")] kotlin.Throwable? origin=null FUN name:produce visibility:public modality:FINAL ($receiver:.CoroutineScope, block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>) returnType:.ReceiveChannel.produce> annotations: OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) @@ -310,50 +324,36 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt BLOCK_BODY 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 declared in kotlin' 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?] reified:false - PROPERTY name:channel visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.ProducerScope.ProducerScope>) returnType:.SendChannel.ProducerScope> - correspondingProperty: PROPERTY name:channel visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.ProducerScope.ProducerScope> - 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 .CoroutineScope - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .SendChannel - $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 .CoroutineScope - public open fun hashCode (): kotlin.Int declared in .SendChannel - $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 .CoroutineScope - public open fun toString (): kotlin.String declared in .SendChannel - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:send visibility:public modality:ABSTRACT <> ($this:.SendChannel.ProducerScope>, e:E of .ProducerScope) returnType:kotlin.Unit [suspend,fake_override] - overridden: - public abstract fun send (e: E of .SendChannel): kotlin.Unit declared in .SendChannel - $this: VALUE_PARAMETER name: type:.SendChannel.ProducerScope> - VALUE_PARAMETER name:e index:0 type:E of .ProducerScope - CLASS INTERFACE name:SendChannel modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SendChannel.SendChannel> - TYPE_PARAMETER name:E index:0 variance:in superTypes:[kotlin.Any?] reified:false - FUN name:send visibility:public modality:ABSTRACT <> ($this:.SendChannel.SendChannel>, e:E of .SendChannel) returnType:kotlin.Unit [suspend] - $this: VALUE_PARAMETER name: type:.SendChannel.SendChannel> - VALUE_PARAMETER name:e index:0 type:E of .SendChannel - 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: 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:scopedFlow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>) returnType:.Flow.scopedFlow> + annotations: + OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) + TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun scopedFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>): .Flow.scopedFlow> declared in ' + CALL 'public final fun flow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' type=.Flow.scopedFlow> origin=null + : R of .scopedFlow + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.scopedFlow>, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.scopedFlow>) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER name:$this$flow type:.FlowCollector.scopedFlow> + BLOCK_BODY + VAR name:collector type:.FlowCollector.scopedFlow> [val] + GET_VAR '$this$flow: .FlowCollector.scopedFlow> declared in .scopedFlow.' type=.FlowCollector.scopedFlow> origin=null + CALL 'public final fun flowScope (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope declared in ' type=kotlin.Unit origin=null + : kotlin.Unit + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.CoroutineScope) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER name:$this$flowScope type:.CoroutineScope + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.coroutines.SuspendFunction2, p2: P2 of kotlin.coroutines.SuspendFunction2): R of kotlin.coroutines.SuspendFunction2 declared in kotlin.coroutines.SuspendFunction2' type=kotlin.Unit origin=null + $this: GET_VAR 'block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> declared in .scopedFlow' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> origin=VARIABLE_AS_FUNCTION + p1: GET_VAR '$this$flowScope: .CoroutineScope declared in .scopedFlow..' type=.CoroutineScope origin=null + p2: GET_VAR 'val collector: .FlowCollector.scopedFlow> declared in .scopedFlow.' type=.FlowCollector.scopedFlow> origin=null + FUN name:unsafeFlow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>) returnType:.Flow.unsafeFlow> [inline] + annotations: + OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit> [crossinline] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> declared in ' + CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt index e1d14340f2c..0c0ab39342d 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt @@ -1,101 +1,3 @@ -@OptIn(markerClass = [ExperimentalTypeInference::class]) -fun scopedFlow(block: @ExtensionFunctionType SuspendFunction2, Unit>): Flow { - return flow(block = local suspend fun FlowCollector.() { - val collector: FlowCollector = $this$flow - flowScope(block = local suspend fun CoroutineScope.() { - block.invoke(p1 = $this$flowScope, p2 = collector) - } -) - } -) -} - -fun Flow.onCompletion(action: @ExtensionFunctionType SuspendFunction2, @ParameterName(name = "cause") Throwable?, Unit>): Flow { - return unsafeFlow(block = local suspend fun FlowCollector.() { - val safeCollector: SafeCollector = SafeCollector(collector = $this$unsafeFlow) - safeCollector.invokeSafely(action = action) - } -) -} - -suspend fun FlowCollector.invokeSafely(action: @ExtensionFunctionType SuspendFunction2, @ParameterName(name = "cause") Throwable?, Unit>) { -} - -@OptIn(markerClass = [ExperimentalTypeInference::class]) -inline fun unsafeFlow(crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { - return TODO() -} - -@Deprecated(message = "binary compatibility with a version w/o FlowCollector receiver", level = DeprecationLevel.HIDDEN) -fun Flow.onCompletion(action: SuspendFunction1<@ParameterName(name = "cause") Throwable?, Unit>): Flow { - return .onCompletion(action = local suspend fun FlowCollector.(it: @ParameterName(name = "cause") Throwable?) { - action.invoke(p1 = it) - } -) -} - -private fun CoroutineScope.asFairChannel(flow: Flow<*>): ReceiveChannel { - return .produce(block = local suspend fun ProducerScope.() { - val channel: ChannelCoroutine = $this$produce.() as ChannelCoroutine - flow.collect(action = local suspend fun (value: @ParameterName(name = "value") Any?) { - return channel.sendFair(element = { // BLOCK - val tmp_0: @ParameterName(name = "value") Any? = value - when { - EQEQ(arg0 = tmp_0, arg1 = null) -> Any() - else -> tmp_0 - } - }) - } -) - } -) -} - -private fun CoroutineScope.asChannel(flow: Flow<*>): ReceiveChannel { - return .produce(block = local suspend fun ProducerScope.() { - flow.collect(action = local suspend fun (value: @ParameterName(name = "value") Any?) { - return $this$produce.().send(e = { // BLOCK - val tmp_1: @ParameterName(name = "value") Any? = value - when { - EQEQ(arg0 = tmp_1, arg1 = null) -> Any() - else -> tmp_1 - } - }) - } -) - } -) -} - -class SafeCollector : FlowCollector { - constructor(collector: FlowCollector) /* primary */ { - super/*Any*/() - /* () */ - - } - - internal val collector: FlowCollector - field = collector - internal get - - override suspend fun emit(value: T) { - } - -} - -@OptIn(markerClass = [ExperimentalTypeInference::class]) -fun flow(block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { - return TODO() -} - -@OptIn(markerClass = [ExperimentalTypeInference::class]) -suspend fun flowScope(block: @ExtensionFunctionType SuspendFunction1): R { - return TODO() -} - -suspend inline fun Flow.collect(crossinline action: SuspendFunction1<@ParameterName(name = "value") T, Unit>) { -} - open class ChannelCoroutine { constructor() /* primary */ { super/*Any*/() @@ -108,6 +10,22 @@ open class ChannelCoroutine { } +class SafeCollector : FlowCollector { + internal val collector: FlowCollector + field = collector + internal get + + constructor(collector: FlowCollector) /* primary */ { + super/*Any*/() + /* () */ + + } + + override suspend fun emit(value: T) { + } + +} + interface CoroutineScope { } @@ -121,22 +39,104 @@ interface FlowCollector { } -interface ReceiveChannel { -} - -@OptIn(markerClass = [ExperimentalTypeInference::class]) -fun CoroutineScope.produce(block: @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel { - return TODO() -} - interface ProducerScope : CoroutineScope, SendChannel { abstract val channel: SendChannel abstract get } +interface ReceiveChannel { +} + interface SendChannel { abstract suspend fun send(e: E) } +private fun CoroutineScope.asChannel(flow: Flow<*>): ReceiveChannel { + return .produce(block = local suspend fun ProducerScope.() { + flow.collect(action = local suspend fun (value: @ParameterName(name = "value") Any?) { + return $this$produce.().send(e = { // BLOCK + val tmp_0: @ParameterName(name = "value") Any? = value + when { + EQEQ(arg0 = tmp_0, arg1 = null) -> Any() + else -> tmp_0 + } + }) + } +) + } +) +} + +private fun CoroutineScope.asFairChannel(flow: Flow<*>): ReceiveChannel { + return .produce(block = local suspend fun ProducerScope.() { + val channel: ChannelCoroutine = $this$produce.() as ChannelCoroutine + flow.collect(action = local suspend fun (value: @ParameterName(name = "value") Any?) { + return channel.sendFair(element = { // BLOCK + val tmp_1: @ParameterName(name = "value") Any? = value + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> Any() + else -> tmp_1 + } + }) + } +) + } +) +} + +suspend inline fun Flow.collect(crossinline action: SuspendFunction1<@ParameterName(name = "value") T, Unit>) { +} + +@OptIn(markerClass = [ExperimentalTypeInference::class]) +fun flow(block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { + return TODO() +} + +@OptIn(markerClass = [ExperimentalTypeInference::class]) +suspend fun flowScope(block: @ExtensionFunctionType SuspendFunction1): R { + return TODO() +} + +suspend fun FlowCollector.invokeSafely(action: @ExtensionFunctionType SuspendFunction2, @ParameterName(name = "cause") Throwable?, Unit>) { +} + +fun Flow.onCompletion(action: @ExtensionFunctionType SuspendFunction2, @ParameterName(name = "cause") Throwable?, Unit>): Flow { + return unsafeFlow(block = local suspend fun FlowCollector.() { + val safeCollector: SafeCollector = SafeCollector(collector = $this$unsafeFlow) + safeCollector.invokeSafely(action = action) + } +) +} + +@Deprecated(message = "binary compatibility with a version w/o FlowCollector receiver", level = DeprecationLevel.HIDDEN) +fun Flow.onCompletion(action: SuspendFunction1<@ParameterName(name = "cause") Throwable?, Unit>): Flow { + return .onCompletion(action = local suspend fun FlowCollector.(it: @ParameterName(name = "cause") Throwable?) { + action.invoke(p1 = it) + } +) +} + +@OptIn(markerClass = [ExperimentalTypeInference::class]) +fun CoroutineScope.produce(block: @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel { + return TODO() +} + +@OptIn(markerClass = [ExperimentalTypeInference::class]) +fun scopedFlow(block: @ExtensionFunctionType SuspendFunction2, Unit>): Flow { + return flow(block = local suspend fun FlowCollector.() { + val collector: FlowCollector = $this$flow + flowScope(block = local suspend fun CoroutineScope.() { + block.invoke(p1 = $this$flowScope, p2 = collector) + } +) + } +) +} + +@OptIn(markerClass = [ExperimentalTypeInference::class]) +inline fun unsafeFlow(crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { + return TODO() +} + diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.ir.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.ir.txt index e46ede4e6d6..7adbe94e64b 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.ir.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.ir.txt @@ -1,81 +1,217 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt - FUN name:scopedFlow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>) returnType:.Flow.scopedFlow> - annotations: - OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) - TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> + CLASS CLASS name:ChannelCoroutine modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ChannelCoroutine.ChannelCoroutine> + TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.ChannelCoroutine.ChannelCoroutine> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ChannelCoroutine modality:OPEN visibility:public 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 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:sendFair visibility:public modality:FINAL <> ($this:.ChannelCoroutine.ChannelCoroutine>, element:E of .ChannelCoroutine) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.ChannelCoroutine.ChannelCoroutine> + VALUE_PARAMETER name:element index:0 type:E of .ChannelCoroutine + BLOCK_BODY + CLASS CLASS name:SafeCollector modality:FINAL visibility:public superTypes:[.FlowCollector.SafeCollector>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SafeCollector.SafeCollector> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:collector visibility:internal modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:collector type:.FlowCollector.SafeCollector> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'collector: .FlowCollector.SafeCollector> declared in .SafeCollector.' type=.FlowCollector.SafeCollector> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:internal modality:FINAL <> ($this:.SafeCollector.SafeCollector>) returnType:.FlowCollector.SafeCollector> + correspondingProperty: PROPERTY name:collector visibility:internal modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.SafeCollector.SafeCollector> + BLOCK_BODY + RETURN type=kotlin.Nothing from='internal final fun (): .FlowCollector.SafeCollector> declared in .SafeCollector' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:collector type:.FlowCollector.SafeCollector> visibility:private [final]' type=.FlowCollector.SafeCollector> origin=null + receiver: GET_VAR ': .SafeCollector.SafeCollector> declared in .SafeCollector.' type=.SafeCollector.SafeCollector> origin=null + CONSTRUCTOR visibility:public <> (collector:.FlowCollector.SafeCollector>) returnType:.SafeCollector.SafeCollector> [primary] + VALUE_PARAMETER name:collector index:0 type:.FlowCollector.SafeCollector> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SafeCollector modality:FINAL visibility:public superTypes:[.FlowCollector.SafeCollector>]' + 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 .FlowCollector + $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 .FlowCollector + $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 .FlowCollector + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:emit visibility:public modality:OPEN <> ($this:.SafeCollector.SafeCollector>, value:T of .SafeCollector) returnType:kotlin.Unit [suspend] + overridden: + public abstract fun emit (value: T of .FlowCollector): kotlin.Unit declared in .FlowCollector + $this: VALUE_PARAMETER name: type:.SafeCollector.SafeCollector> + VALUE_PARAMETER name:value index:0 type:T of .SafeCollector + BLOCK_BODY + CLASS INTERFACE name:CoroutineScope modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CoroutineScope + 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: 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 + CLASS INTERFACE name:Flow modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Flow.Flow> + TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false + 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: 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:collect visibility:public modality:ABSTRACT <> ($this:.Flow.Flow>, collector:.FlowCollector.Flow>) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.Flow.Flow> + VALUE_PARAMETER name:collector index:0 type:.FlowCollector.Flow> + CLASS INTERFACE name:FlowCollector modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FlowCollector.FlowCollector> + TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false + 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: 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:emit visibility:public modality:ABSTRACT <> ($this:.FlowCollector.FlowCollector>, value:T of .FlowCollector) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.FlowCollector.FlowCollector> + VALUE_PARAMETER name:value index:0 type:T of .FlowCollector + 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?] reified:false + 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 .CoroutineScope + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .SendChannel + $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 .CoroutineScope + public open fun hashCode (): kotlin.Int declared in .SendChannel + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:send visibility:public modality:ABSTRACT <> ($this:.SendChannel.ProducerScope>, e:E of .ProducerScope) returnType:kotlin.Unit [suspend,fake_override] + overridden: + public abstract fun send (e: E of .SendChannel): kotlin.Unit declared in .SendChannel + $this: VALUE_PARAMETER name: type:.SendChannel.ProducerScope> + VALUE_PARAMETER name:e index:0 type:E of .ProducerScope + 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 .CoroutineScope + public open fun toString (): kotlin.String declared in .SendChannel + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:channel visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.ProducerScope.ProducerScope>) returnType:.SendChannel.ProducerScope> + correspondingProperty: PROPERTY name:channel visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.ProducerScope.ProducerScope> + CLASS INTERFACE name:ReceiveChannel modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ReceiveChannel.ReceiveChannel> + TYPE_PARAMETER name:E index:0 variance:out superTypes:[kotlin.Any?] reified:false + 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: 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 + CLASS INTERFACE name:SendChannel modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SendChannel.SendChannel> + TYPE_PARAMETER name:E index:0 variance:in superTypes:[kotlin.Any?] reified:false + 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: 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:send visibility:public modality:ABSTRACT <> ($this:.SendChannel.SendChannel>, e:E of .SendChannel) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.SendChannel.SendChannel> + VALUE_PARAMETER name:e index:0 type:E of .SendChannel + FUN name:asChannel visibility:private modality:FINAL <> ($receiver:.CoroutineScope, flow:.Flow<*>) returnType:.ReceiveChannel + $receiver: VALUE_PARAMETER name: type:.CoroutineScope + VALUE_PARAMETER name:flow index:0 type:.Flow<*> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun scopedFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>): .Flow.scopedFlow> declared in ' - CALL 'public final fun flow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' type=.Flow.scopedFlow> origin=null - : R of .scopedFlow - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.scopedFlow>, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.scopedFlow>) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER name:$this$flow type:.FlowCollector.scopedFlow> + RETURN type=kotlin.Nothing from='private final fun asChannel (flow: .Flow<*>): .ReceiveChannel declared in ' + CALL 'public final fun produce (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' type=.ReceiveChannel origin=null + : kotlin.Any + $receiver: GET_VAR ': .CoroutineScope declared in .asChannel' type=.CoroutineScope origin=null + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.ProducerScope) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER name:$this$produce type:.ProducerScope BLOCK_BODY - VAR name:collector type:.FlowCollector.scopedFlow> [val] - GET_VAR '$this$flow: .FlowCollector.scopedFlow> declared in .scopedFlow.' type=.FlowCollector.scopedFlow> origin=null - CALL 'public final fun flowScope (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope declared in ' type=kotlin.Unit origin=null - : kotlin.Unit - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.CoroutineScope) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER name:$this$flowScope type:.CoroutineScope + CALL 'public final fun collect (action: kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "value")] T of .collect, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any? + $receiver: GET_VAR 'flow: .Flow<*> declared in .asChannel' type=.Flow<*> origin=null + action: FUN_EXPR type=kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "value")] kotlin.Any?, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (value:kotlin.Any?) returnType:kotlin.Unit [suspend] + VALUE_PARAMETER name:value index:0 type:kotlin.Any? BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.coroutines.SuspendFunction2, p2: P2 of kotlin.coroutines.SuspendFunction2): R of kotlin.coroutines.SuspendFunction2 declared in kotlin.coroutines.SuspendFunction2' type=kotlin.Unit origin=INVOKE - $this: GET_VAR 'block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> declared in .scopedFlow' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '$this$flowScope: .CoroutineScope declared in .scopedFlow..' type=.CoroutineScope origin=null - p2: GET_VAR 'val collector: .FlowCollector.scopedFlow> declared in .scopedFlow.' type=.FlowCollector.scopedFlow> origin=null - FUN name:onCompletion visibility:public modality:FINAL ($receiver:.Flow.onCompletion>, action:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>) returnType:.Flow.onCompletion> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Flow.onCompletion> - VALUE_PARAMETER name:action index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun onCompletion (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' - CALL 'public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> declared in ' type=.Flow.onCompletion> origin=null - : T of .onCompletion - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.onCompletion>, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.onCompletion>) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER name:$this$unsafeFlow type:.FlowCollector.onCompletion> - BLOCK_BODY - VAR name:safeCollector type:.SafeCollector.onCompletion> [val] - CONSTRUCTOR_CALL 'public constructor (collector: .FlowCollector.SafeCollector>) declared in .SafeCollector' type=.SafeCollector.onCompletion> origin=null - : T of .onCompletion - collector: GET_VAR '$this$unsafeFlow: .FlowCollector.onCompletion> declared in .onCompletion.' type=.FlowCollector.onCompletion> origin=null - CALL 'public final fun invokeSafely (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : T of .onCompletion - $receiver: GET_VAR 'val safeCollector: .SafeCollector.onCompletion> declared in .onCompletion.' type=.SafeCollector.onCompletion> origin=null - action: GET_VAR 'action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> declared in .onCompletion' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> origin=null - FUN name:invokeSafely visibility:public modality:FINAL ($receiver:.FlowCollector.invokeSafely>, action:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>) returnType:kotlin.Unit [suspend] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.FlowCollector.invokeSafely> - VALUE_PARAMETER name:action index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> - BLOCK_BODY - FUN name:unsafeFlow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>) returnType:.Flow.unsafeFlow> [inline] - annotations: - OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit> [crossinline] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> declared in ' - CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' 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) - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Flow.onCompletion> - VALUE_PARAMETER name:action index:0 type:kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun onCompletion (action: kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' - CALL 'public final fun onCompletion (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' type=.Flow.onCompletion> origin=null - : T of .onCompletion - $receiver: GET_VAR ': .Flow.onCompletion> declared in .onCompletion' type=.Flow.onCompletion> origin=null - action: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.onCompletion>, it:kotlin.Throwable?) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER name:$this$onCompletion type:.FlowCollector.onCompletion> - VALUE_PARAMETER name:it index:0 type:kotlin.Throwable? - BLOCK_BODY - CALL 'public abstract fun invoke (p1: P1 of kotlin.coroutines.SuspendFunction1): R of kotlin.coroutines.SuspendFunction1 declared in kotlin.coroutines.SuspendFunction1' type=kotlin.Unit origin=INVOKE - $this: GET_VAR 'action: kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> declared in .onCompletion' type=kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR 'it: kotlin.Throwable? declared in .onCompletion.' type=kotlin.Throwable? origin=null + RETURN type=kotlin.Nothing from='local final fun (value: kotlin.Any?): kotlin.Unit declared in .asChannel.' + CALL 'public abstract fun send (e: E of .SendChannel): kotlin.Unit declared in .SendChannel' type=kotlin.Unit origin=null + $this: CALL 'public abstract fun (): .SendChannel.ProducerScope> declared in .ProducerScope' type=.SendChannel origin=GET_PROPERTY + $this: GET_VAR '$this$produce: .ProducerScope declared in .asChannel.' type=.ProducerScope origin=null + e: BLOCK type=kotlin.Any origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val] + GET_VAR 'value: kotlin.Any? declared in .asChannel..' type=kotlin.Any? origin=null + WHEN type=kotlin.Any 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? declared in .asChannel..' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_0: kotlin.Any? declared in .asChannel..' type=kotlin.Any? origin=null FUN name:asFairChannel visibility:private modality:FINAL <> ($receiver:.CoroutineScope, flow:.Flow<*>) returnType:.ReceiveChannel $receiver: VALUE_PARAMETER name: type:.CoroutineScope VALUE_PARAMETER name:flow index:0 type:.Flow<*> @@ -103,90 +239,22 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt CALL 'public final fun sendFair (element: E of .ChannelCoroutine): kotlin.Unit declared in .ChannelCoroutine' type=kotlin.Unit origin=null $this: GET_VAR 'val channel: .ChannelCoroutine declared in .asFairChannel.' type=.ChannelCoroutine origin=null element: BLOCK type=kotlin.Any origin=ELVIS - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any? [val] GET_VAR 'value: kotlin.Any? declared in .asFairChannel..' type=kotlin.Any? origin=null WHEN type=kotlin.Any 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? declared in .asFairChannel..' type=kotlin.Any? origin=null + arg0: GET_VAR 'val tmp_1: kotlin.Any? declared in .asFairChannel..' type=kotlin.Any? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_0: kotlin.Any? declared in .asFairChannel..' type=kotlin.Any? origin=null - FUN name:asChannel visibility:private modality:FINAL <> ($receiver:.CoroutineScope, flow:.Flow<*>) returnType:.ReceiveChannel - $receiver: VALUE_PARAMETER name: type:.CoroutineScope - VALUE_PARAMETER name:flow index:0 type:.Flow<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun asChannel (flow: .Flow<*>): .ReceiveChannel declared in ' - CALL 'public final fun produce (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' type=.ReceiveChannel origin=null - : kotlin.Any - $receiver: GET_VAR ': .CoroutineScope declared in .asChannel' type=.CoroutineScope origin=null - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.ProducerScope) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER name:$this$produce type:.ProducerScope - BLOCK_BODY - CALL 'public final fun collect (action: kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "value")] T of .collect, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - : kotlin.Any? - $receiver: GET_VAR 'flow: .Flow<*> declared in .asChannel' type=.Flow<*> origin=null - action: FUN_EXPR type=kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "value")] kotlin.Any?, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (value:kotlin.Any?) returnType:kotlin.Unit [suspend] - VALUE_PARAMETER name:value index:0 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (value: kotlin.Any?): kotlin.Unit declared in .asChannel.' - CALL 'public abstract fun send (e: E of .SendChannel): kotlin.Unit declared in .SendChannel' type=kotlin.Unit origin=null - $this: CALL 'public abstract fun (): .SendChannel.ProducerScope> declared in .ProducerScope' type=.SendChannel origin=GET_PROPERTY - $this: GET_VAR '$this$produce: .ProducerScope declared in .asChannel.' type=.ProducerScope origin=null - e: BLOCK type=kotlin.Any origin=ELVIS - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any? [val] - GET_VAR 'value: kotlin.Any? declared in .asChannel..' type=kotlin.Any? origin=null - WHEN type=kotlin.Any 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? declared in .asChannel..' type=kotlin.Any? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_1: kotlin.Any? declared in .asChannel..' type=kotlin.Any? origin=null - CLASS CLASS name:SafeCollector modality:FINAL visibility:public superTypes:[.FlowCollector.SafeCollector>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SafeCollector.SafeCollector> + then: GET_VAR 'val tmp_1: kotlin.Any? declared in .asFairChannel..' type=kotlin.Any? 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?] reified:false - CONSTRUCTOR visibility:public <> (collector:.FlowCollector.SafeCollector>) returnType:.SafeCollector.SafeCollector> [primary] - VALUE_PARAMETER name:collector index:0 type:.FlowCollector.SafeCollector> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SafeCollector modality:FINAL visibility:public superTypes:[.FlowCollector.SafeCollector>]' - PROPERTY name:collector visibility:internal modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:collector type:.FlowCollector.SafeCollector> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'collector: .FlowCollector.SafeCollector> declared in .SafeCollector.' type=.FlowCollector.SafeCollector> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:internal modality:FINAL <> ($this:.SafeCollector.SafeCollector>) returnType:.FlowCollector.SafeCollector> - correspondingProperty: PROPERTY name:collector visibility:internal modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.SafeCollector.SafeCollector> - BLOCK_BODY - RETURN type=kotlin.Nothing from='internal final fun (): .FlowCollector.SafeCollector> declared in .SafeCollector' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:collector type:.FlowCollector.SafeCollector> visibility:private [final]' type=.FlowCollector.SafeCollector> origin=null - receiver: GET_VAR ': .SafeCollector.SafeCollector> declared in .SafeCollector.' type=.SafeCollector.SafeCollector> origin=null - FUN name:emit visibility:public modality:OPEN <> ($this:.SafeCollector.SafeCollector>, value:T of .SafeCollector) returnType:kotlin.Unit [suspend] - overridden: - public abstract fun emit (value: T of .FlowCollector): kotlin.Unit declared in .FlowCollector - $this: VALUE_PARAMETER name: type:.SafeCollector.SafeCollector> - VALUE_PARAMETER name:value index:0 type:T of .SafeCollector - BLOCK_BODY - 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 .FlowCollector - $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 .FlowCollector - $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 .FlowCollector - $this: VALUE_PARAMETER name: type:kotlin.Any + $receiver: VALUE_PARAMETER name: type:.Flow.collect> + VALUE_PARAMETER name:action index:0 type:kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "value")] T of .collect, kotlin.Unit> [crossinline] + BLOCK_BODY FUN name:flow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>) returnType:.Flow.flow> annotations: OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) @@ -203,104 +271,50 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun flowScope (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope declared in ' CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' 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] + FUN name:invokeSafely visibility:public modality:FINAL ($receiver:.FlowCollector.invokeSafely>, action:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>) returnType:kotlin.Unit [suspend] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Flow.collect> - VALUE_PARAMETER name:action index:0 type:kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "value")] T of .collect, kotlin.Unit> [crossinline] + $receiver: VALUE_PARAMETER name: type:.FlowCollector.invokeSafely> + VALUE_PARAMETER name:action index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> BLOCK_BODY - CLASS CLASS name:ChannelCoroutine modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ChannelCoroutine.ChannelCoroutine> - TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.ChannelCoroutine.ChannelCoroutine> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ChannelCoroutine modality:OPEN visibility:public superTypes:[kotlin.Any]' - FUN name:sendFair visibility:public modality:FINAL <> ($this:.ChannelCoroutine.ChannelCoroutine>, element:E of .ChannelCoroutine) returnType:kotlin.Unit [suspend] - $this: VALUE_PARAMETER name: type:.ChannelCoroutine.ChannelCoroutine> - VALUE_PARAMETER name:element index:0 type:E of .ChannelCoroutine - BLOCK_BODY - 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: 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 - CLASS INTERFACE name:CoroutineScope modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CoroutineScope - 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: 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 - CLASS INTERFACE name:Flow modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Flow.Flow> - TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false - FUN name:collect visibility:public modality:ABSTRACT <> ($this:.Flow.Flow>, collector:.FlowCollector.Flow>) returnType:kotlin.Unit [suspend] - $this: VALUE_PARAMETER name: type:.Flow.Flow> - VALUE_PARAMETER name:collector index:0 type:.FlowCollector.Flow> - 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: 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 - CLASS INTERFACE name:FlowCollector modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FlowCollector.FlowCollector> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false - FUN name:emit visibility:public modality:ABSTRACT <> ($this:.FlowCollector.FlowCollector>, value:T of .FlowCollector) returnType:kotlin.Unit [suspend] - $this: VALUE_PARAMETER name: type:.FlowCollector.FlowCollector> - VALUE_PARAMETER name:value index:0 type:T of .FlowCollector - 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: 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 - CLASS INTERFACE name:ReceiveChannel modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ReceiveChannel.ReceiveChannel> - TYPE_PARAMETER name:E index:0 variance:out superTypes:[kotlin.Any?] reified:false - 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: 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:onCompletion visibility:public modality:FINAL ($receiver:.Flow.onCompletion>, action:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>) returnType:.Flow.onCompletion> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Flow.onCompletion> + VALUE_PARAMETER name:action index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun onCompletion (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' + CALL 'public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> declared in ' type=.Flow.onCompletion> origin=null + : T of .onCompletion + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.onCompletion>, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.onCompletion>) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER name:$this$unsafeFlow type:.FlowCollector.onCompletion> + BLOCK_BODY + VAR name:safeCollector type:.SafeCollector.onCompletion> [val] + CONSTRUCTOR_CALL 'public constructor (collector: .FlowCollector.SafeCollector>) declared in .SafeCollector' type=.SafeCollector.onCompletion> origin=null + : T of .onCompletion + collector: GET_VAR '$this$unsafeFlow: .FlowCollector.onCompletion> declared in .onCompletion.' type=.FlowCollector.onCompletion> origin=null + CALL 'public final fun invokeSafely (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : T of .onCompletion + $receiver: GET_VAR 'val safeCollector: .SafeCollector.onCompletion> declared in .onCompletion.' type=.SafeCollector.onCompletion> origin=null + action: GET_VAR 'action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> declared in .onCompletion' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> 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) + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Flow.onCompletion> + VALUE_PARAMETER name:action index:0 type:kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun onCompletion (action: kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' + CALL 'public final fun onCompletion (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' type=.Flow.onCompletion> origin=null + : T of .onCompletion + $receiver: GET_VAR ': .Flow.onCompletion> declared in .onCompletion' type=.Flow.onCompletion> origin=null + action: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, @[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.onCompletion>, it:kotlin.Throwable?) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER name:$this$onCompletion type:.FlowCollector.onCompletion> + VALUE_PARAMETER name:it index:0 type:kotlin.Throwable? + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.coroutines.SuspendFunction1): R of kotlin.coroutines.SuspendFunction1 declared in kotlin.coroutines.SuspendFunction1' type=kotlin.Unit origin=INVOKE + $this: GET_VAR 'action: kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> declared in .onCompletion' type=kotlin.coroutines.SuspendFunction1<@[ParameterName(name = "cause")] kotlin.Throwable?, kotlin.Unit> origin=VARIABLE_AS_FUNCTION + p1: GET_VAR 'it: kotlin.Throwable? declared in .onCompletion.' type=kotlin.Throwable? origin=null FUN name:produce visibility:public modality:FINAL ($receiver:.CoroutineScope, block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>) returnType:.ReceiveChannel.produce> annotations: OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) @@ -310,50 +324,36 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt BLOCK_BODY 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 declared in kotlin' 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?] reified:false - PROPERTY name:channel visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.ProducerScope.ProducerScope>) returnType:.SendChannel.ProducerScope> - correspondingProperty: PROPERTY name:channel visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.ProducerScope.ProducerScope> - 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 .CoroutineScope - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .SendChannel - $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 .CoroutineScope - public open fun hashCode (): kotlin.Int declared in .SendChannel - $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 .CoroutineScope - public open fun toString (): kotlin.String declared in .SendChannel - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:send visibility:public modality:ABSTRACT <> ($this:.SendChannel.ProducerScope>, e:E of .ProducerScope) returnType:kotlin.Unit [suspend,fake_override] - overridden: - public abstract fun send (e: E of .SendChannel): kotlin.Unit declared in .SendChannel - $this: VALUE_PARAMETER name: type:.SendChannel.ProducerScope> - VALUE_PARAMETER name:e index:0 type:E of .ProducerScope - CLASS INTERFACE name:SendChannel modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SendChannel.SendChannel> - TYPE_PARAMETER name:E index:0 variance:in superTypes:[kotlin.Any?] reified:false - FUN name:send visibility:public modality:ABSTRACT <> ($this:.SendChannel.SendChannel>, e:E of .SendChannel) returnType:kotlin.Unit [suspend] - $this: VALUE_PARAMETER name: type:.SendChannel.SendChannel> - VALUE_PARAMETER name:e index:0 type:E of .SendChannel - 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: 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:scopedFlow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>) returnType:.Flow.scopedFlow> + annotations: + OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) + TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun scopedFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>): .Flow.scopedFlow> declared in ' + CALL 'public final fun flow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' type=.Flow.scopedFlow> origin=null + : R of .scopedFlow + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.scopedFlow>, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.scopedFlow>) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER name:$this$flow type:.FlowCollector.scopedFlow> + BLOCK_BODY + VAR name:collector type:.FlowCollector.scopedFlow> [val] + GET_VAR '$this$flow: .FlowCollector.scopedFlow> declared in .scopedFlow.' type=.FlowCollector.scopedFlow> origin=null + CALL 'public final fun flowScope (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope declared in ' type=kotlin.Unit origin=null + : kotlin.Unit + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.CoroutineScope) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER name:$this$flowScope type:.CoroutineScope + BLOCK_BODY + CALL 'public abstract fun invoke (p1: P1 of kotlin.coroutines.SuspendFunction2, p2: P2 of kotlin.coroutines.SuspendFunction2): R of kotlin.coroutines.SuspendFunction2 declared in kotlin.coroutines.SuspendFunction2' type=kotlin.Unit origin=INVOKE + $this: GET_VAR 'block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> declared in .scopedFlow' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> origin=VARIABLE_AS_FUNCTION + p1: GET_VAR '$this$flowScope: .CoroutineScope declared in .scopedFlow..' type=.CoroutineScope origin=null + p2: GET_VAR 'val collector: .FlowCollector.scopedFlow> declared in .scopedFlow.' type=.FlowCollector.scopedFlow> origin=null + FUN name:unsafeFlow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>) returnType:.Flow.unsafeFlow> [inline] + annotations: + OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit> [crossinline] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> declared in ' + CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt index 346ca1cc314..87c5118f338 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt @@ -1,101 +1,3 @@ -@OptIn(markerClass = [ExperimentalTypeInference::class]) -fun scopedFlow(block: @ExtensionFunctionType SuspendFunction2, Unit>): Flow { - return flow(block = local suspend fun FlowCollector.() { - val collector: FlowCollector = $this$flow - flowScope(block = local suspend fun CoroutineScope.() { - block.invoke(p1 = $this$flowScope, p2 = collector) - } -) - } -) -} - -fun Flow.onCompletion(action: @ExtensionFunctionType SuspendFunction2, @ParameterName(name = "cause") Throwable?, Unit>): Flow { - return unsafeFlow(block = local suspend fun FlowCollector.() { - val safeCollector: SafeCollector = SafeCollector(collector = $this$unsafeFlow) - safeCollector.invokeSafely(action = action) - } -) -} - -suspend fun FlowCollector.invokeSafely(action: @ExtensionFunctionType SuspendFunction2, @ParameterName(name = "cause") Throwable?, Unit>) { -} - -@OptIn(markerClass = [ExperimentalTypeInference::class]) -inline fun unsafeFlow(crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { - return TODO() -} - -@Deprecated(message = "binary compatibility with a version w/o FlowCollector receiver", level = DeprecationLevel.HIDDEN) -fun Flow.onCompletion(action: SuspendFunction1<@ParameterName(name = "cause") Throwable?, Unit>): Flow { - return .onCompletion(action = local suspend fun FlowCollector.(it: Throwable?) { - action.invoke(p1 = it) - } -) -} - -private fun CoroutineScope.asFairChannel(flow: Flow<*>): ReceiveChannel { - return .produce(block = local suspend fun ProducerScope.() { - val channel: ChannelCoroutine = $this$produce.() as ChannelCoroutine - flow.collect(action = local suspend fun (value: Any?) { - return channel.sendFair(element = { // BLOCK - val tmp_0: Any? = value - when { - EQEQ(arg0 = tmp_0, arg1 = null) -> Any() - else -> tmp_0 - } - }) - } -) - } -) -} - -private fun CoroutineScope.asChannel(flow: Flow<*>): ReceiveChannel { - return .produce(block = local suspend fun ProducerScope.() { - flow.collect(action = local suspend fun (value: Any?) { - return $this$produce.().send(e = { // BLOCK - val tmp_1: Any? = value - when { - EQEQ(arg0 = tmp_1, arg1 = null) -> Any() - else -> tmp_1 - } - }) - } -) - } -) -} - -class SafeCollector : FlowCollector { - constructor(collector: FlowCollector) /* primary */ { - super/*Any*/() - /* () */ - - } - - internal val collector: FlowCollector - field = collector - internal get - - override suspend fun emit(value: T) { - } - -} - -@OptIn(markerClass = [ExperimentalTypeInference::class]) -fun flow(block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { - return TODO() -} - -@OptIn(markerClass = [ExperimentalTypeInference::class]) -suspend fun flowScope(block: @ExtensionFunctionType SuspendFunction1): R { - return TODO() -} - -suspend inline fun Flow.collect(crossinline action: SuspendFunction1<@ParameterName(name = "value") T, Unit>) { -} - open class ChannelCoroutine { constructor() /* primary */ { super/*Any*/() @@ -108,6 +10,22 @@ open class ChannelCoroutine { } +class SafeCollector : FlowCollector { + internal val collector: FlowCollector + field = collector + internal get + + constructor(collector: FlowCollector) /* primary */ { + super/*Any*/() + /* () */ + + } + + override suspend fun emit(value: T) { + } + +} + interface CoroutineScope { } @@ -121,21 +39,104 @@ interface FlowCollector { } +interface ProducerScope : CoroutineScope, SendChannel { + abstract val channel: SendChannel + abstract get + +} + interface ReceiveChannel { } +interface SendChannel { + abstract suspend fun send(e: E) + +} + +private fun CoroutineScope.asChannel(flow: Flow<*>): ReceiveChannel { + return .produce(block = local suspend fun ProducerScope.() { + flow.collect(action = local suspend fun (value: Any?) { + return $this$produce.().send(e = { // BLOCK + val tmp_0: Any? = value + when { + EQEQ(arg0 = tmp_0, arg1 = null) -> Any() + else -> tmp_0 + } + }) + } +) + } +) +} + +private fun CoroutineScope.asFairChannel(flow: Flow<*>): ReceiveChannel { + return .produce(block = local suspend fun ProducerScope.() { + val channel: ChannelCoroutine = $this$produce.() as ChannelCoroutine + flow.collect(action = local suspend fun (value: Any?) { + return channel.sendFair(element = { // BLOCK + val tmp_1: Any? = value + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> Any() + else -> tmp_1 + } + }) + } +) + } +) +} + +suspend inline fun Flow.collect(crossinline action: SuspendFunction1<@ParameterName(name = "value") T, Unit>) { +} + +@OptIn(markerClass = [ExperimentalTypeInference::class]) +fun flow(block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { + return TODO() +} + +@OptIn(markerClass = [ExperimentalTypeInference::class]) +suspend fun flowScope(block: @ExtensionFunctionType SuspendFunction1): R { + return TODO() +} + +suspend fun FlowCollector.invokeSafely(action: @ExtensionFunctionType SuspendFunction2, @ParameterName(name = "cause") Throwable?, Unit>) { +} + +fun Flow.onCompletion(action: @ExtensionFunctionType SuspendFunction2, @ParameterName(name = "cause") Throwable?, Unit>): Flow { + return unsafeFlow(block = local suspend fun FlowCollector.() { + val safeCollector: SafeCollector = SafeCollector(collector = $this$unsafeFlow) + safeCollector.invokeSafely(action = action) + } +) +} + +@Deprecated(message = "binary compatibility with a version w/o FlowCollector receiver", level = DeprecationLevel.HIDDEN) +fun Flow.onCompletion(action: SuspendFunction1<@ParameterName(name = "cause") Throwable?, Unit>): Flow { + return .onCompletion(action = local suspend fun FlowCollector.(it: Throwable?) { + action.invoke(p1 = it) + } +) +} + @OptIn(markerClass = [ExperimentalTypeInference::class]) fun CoroutineScope.produce(block: @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel { return TODO() } -interface ProducerScope : CoroutineScope, SendChannel { - abstract val channel: SendChannel - abstract get - +@OptIn(markerClass = [ExperimentalTypeInference::class]) +fun scopedFlow(block: @ExtensionFunctionType SuspendFunction2, Unit>): Flow { + return flow(block = local suspend fun FlowCollector.() { + val collector: FlowCollector = $this$flow + flowScope(block = local suspend fun CoroutineScope.() { + block.invoke(p1 = $this$flowScope, p2 = collector) + } +) + } +) } -interface SendChannel { - abstract suspend fun send(e: E) - +@OptIn(markerClass = [ExperimentalTypeInference::class]) +inline fun unsafeFlow(crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { + return TODO() } + diff --git a/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.ir.txt b/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.ir.txt index ba976e3b5e1..1b3c3300800 100644 --- a/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.ir.txt +++ b/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.ir.txt @@ -1,7 +1,4 @@ FILE fqName: fileName:/coercionToUnitInLambdaReturnValue.kt - FUN name:use visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 - BLOCK_BODY FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun use (fn: kotlin.Function0): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -10,3 +7,6 @@ FILE fqName: fileName:/coercionToUnitInLambdaReturnValue.kt BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CONST Int type=kotlin.Int value=42 + FUN name:use visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 + BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.kt.txt b/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.kt.txt index 3ca98e90cd7..2a8582e6044 100644 --- a/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.kt.txt +++ b/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.kt.txt @@ -1,9 +1,10 @@ -fun use(fn: Function0) { -} - fun test() { use(fn = local fun () { 42 /*~> Unit */ } ) } + +fun use(fn: Function0) { +} + diff --git a/compiler/testData/ir/irText/types/definitelyNonNullOverride.ir.txt b/compiler/testData/ir/irText/types/definitelyNonNullOverride.ir.txt index 91f4eb43607..5516f7fb173 100644 --- a/compiler/testData/ir/irText/types/definitelyNonNullOverride.ir.txt +++ b/compiler/testData/ir/irText/types/definitelyNonNullOverride.ir.txt @@ -6,24 +6,6 @@ FILE fqName: fileName:/definitelyNonNullOverride.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:OPEN <> ($this:.B.B>, t:T of .B) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.B.B> - VALUE_PARAMETER name:t index:0 type:T of .B - BLOCK_BODY - FUN name:bar visibility:public modality:OPEN <> ($this:.B.B>, t:T of .B) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.B.B> - VALUE_PARAMETER name:t index:0 type:T of .B - BLOCK_BODY - FUN name:qux visibility:public modality:OPEN <> ($this:.B.B>, b:.B.B>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.B.B> - VALUE_PARAMETER name:b index:0 type:.B.B> - BLOCK_BODY - FUN name:six visibility:public modality:OPEN ($this:.B.B>, t:T of .B, q:F of .B.six) returnType:kotlin.Unit - TYPE_PARAMETER name:F index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.B.B> - VALUE_PARAMETER name:t index:0 type:T of .B - VALUE_PARAMETER name:q index:1 type:F of .B.six - BLOCK_BODY 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 @@ -37,6 +19,24 @@ FILE fqName: fileName:/definitelyNonNullOverride.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:OPEN <> ($this:.B.B>, t:T of .B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B.B> + VALUE_PARAMETER name:t index:0 type:T of .B + BLOCK_BODY + FUN name:foo visibility:public modality:OPEN <> ($this:.B.B>, t:T of .B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B.B> + VALUE_PARAMETER name:t index:0 type:T of .B + BLOCK_BODY + FUN name:qux visibility:public modality:OPEN <> ($this:.B.B>, b:.B.B>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B.B> + VALUE_PARAMETER name:b index:0 type:.B.B> + BLOCK_BODY + FUN name:six visibility:public modality:OPEN ($this:.B.B>, t:T of .B, q:F of .B.six) returnType:kotlin.Unit + TYPE_PARAMETER name:F index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.B.B> + VALUE_PARAMETER name:t index:0 type:T of .B + VALUE_PARAMETER name:q index:1 type:F of .B.six + BLOCK_BODY CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.B<{T of .D & Any}>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D.D> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -45,17 +45,20 @@ FILE fqName: fileName:/definitelyNonNullOverride.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .B' : {T of .D & Any} INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.B<{T of .D & Any}>]' - FUN name:foo visibility:public modality:OPEN <> ($this:.D.D>, t:{T of .D & Any}) returnType:kotlin.Unit - overridden: - public open fun foo (t: T of .B): kotlin.Unit declared in .B - $this: VALUE_PARAMETER name: type:.D.D> - VALUE_PARAMETER name:t index:0 type:{T of .D & Any} - BLOCK_BODY FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:.B<{T of .D & Any}>, t:{T of .D & Any}) returnType:kotlin.Unit [fake_override] overridden: public open fun bar (t: T of .B): kotlin.Unit declared in .B $this: VALUE_PARAMETER name: type:.B<{T of .D & Any}> VALUE_PARAMETER name:t index:0 type:{T of .D & 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 declared in .B + $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 .B + $this: VALUE_PARAMETER name: type:kotlin.Any FUN FAKE_OVERRIDE name:qux visibility:public modality:OPEN <> ($this:.B<{T of .D & Any}>, b:.B<{T of .D & Any}>) returnType:kotlin.Unit [fake_override] overridden: public open fun qux (b: .B.B>): kotlin.Unit declared in .B @@ -68,16 +71,13 @@ FILE fqName: fileName:/definitelyNonNullOverride.kt $this: VALUE_PARAMETER name: type:.B<{T of .D & Any}> VALUE_PARAMETER name:t index:0 type:{T of .D & Any} VALUE_PARAMETER name:q index:1 type:F of .D.six - 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 .B - $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 .B - $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 .B $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.D.D>, t:{T of .D & Any}) returnType:kotlin.Unit + overridden: + public open fun foo (t: T of .B): kotlin.Unit declared in .B + $this: VALUE_PARAMETER name: type:.D.D> + VALUE_PARAMETER name:t index:0 type:{T of .D & Any} + BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/definitelyNonNullSAM.fir.ir.txt b/compiler/testData/ir/irText/types/definitelyNonNullSAM.fir.ir.txt index b3e191393da..5cd7bd7a75f 100644 --- a/compiler/testData/ir/irText/types/definitelyNonNullSAM.fir.ir.txt +++ b/compiler/testData/ir/irText/types/definitelyNonNullSAM.fir.ir.txt @@ -1,136 +1,7 @@ FILE fqName: fileName:/definitelyNonNullSAM.kt - CLASS INTERFACE name:FIn modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FIn.FIn> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false - FUN name:f visibility:public modality:ABSTRACT <> ($this:.FIn.FIn>, x:T of .FIn) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.FIn.FIn> - VALUE_PARAMETER name:x index:0 type:T of .FIn - 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: 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 - CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.Test> - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Test.Test> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Test.Test>) returnType:.FIn<{S of .Test & Any}> - $this: VALUE_PARAMETER name: type:.Test.Test> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): .FIn<{S of .Test & Any}> declared in .Test' - TYPE_OP type=.FIn<{S of .Test & Any}> origin=SAM_CONVERSION typeOperand=.FIn<{S of .Test & Any}> - FUN_EXPR type=kotlin.Function1<{S of .Test & Any}, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (sx:{S of .Test & Any}) returnType:kotlin.Unit - VALUE_PARAMETER name:sx index:0 type:{S of .Test & Any} - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null - $this: GET_VAR 'sx: {S of .Test & Any} declared in .Test.foo.' type={S of .Test & Any} 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: 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:bar visibility:public modality:FINAL () returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=.bar..bar> origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.FIn<{T of .bar & Any}>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.bar..bar> - CONSTRUCTOR visibility:public <> () returnType:.bar..bar> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.FIn<{T of .bar & Any}>]' - FUN name:f visibility:public modality:OPEN <> ($this:.bar..bar>, sx:{T of .bar & Any}) returnType:kotlin.Unit - overridden: - public abstract fun f (x: T of .FIn): kotlin.Unit declared in .FIn - $this: VALUE_PARAMETER name: type:.bar..bar> - VALUE_PARAMETER name:sx index:0 type:{T of .bar & Any} - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null - $this: GET_VAR 'sx: {T of .bar & Any} declared in .bar..f' type={T of .bar & Any} 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 .FIn - $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 .FIn - $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 .FIn - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .bar.' type=.bar..bar> origin=OBJECT_LITERAL - CLASS INTERFACE name:I1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I1.I1> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false - PROPERTY name:l visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I1.I1>) returnType:@[ExtensionFunctionType] kotlin.Function1.I1, kotlin.Unit> - correspondingProperty: PROPERTY name:l visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.I1.I1> - 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: 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 - CLASS INTERFACE name:I2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I2.I2> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false - PROPERTY name:sam visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I2.I2>) returnType:.FIn.I2> - correspondingProperty: PROPERTY name:sam visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.I2.I2> - 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: 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 CLASS CLASS name:AC modality:ABSTRACT visibility:public superTypes:[.I1.AC>; .I2.AC>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AC.AC> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.AC.AC> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AC modality:ABSTRACT visibility:public superTypes:[.I1.AC>; .I2.AC>]' PROPERTY name:sam visibility:public modality:OPEN [val] overridden: public abstract sam: .FIn.I2> @@ -148,14 +19,10 @@ FILE fqName: fileName:/definitelyNonNullSAM.kt RETURN type=kotlin.Nothing from='public open fun (): .FIn.AC> declared in .AC' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:sam type:.FIn.AC> visibility:private [final]' type=.FIn.AC> origin=null receiver: GET_VAR ': .AC.AC> declared in .AC.' type=.AC.AC> origin=null - PROPERTY FAKE_OVERRIDE name:l visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract l: @[ExtensionFunctionType] kotlin.Function1.I1, kotlin.Unit> - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.I1.AC>) returnType:@[ExtensionFunctionType] kotlin.Function1.AC, kotlin.Unit> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:l visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): @[ExtensionFunctionType] kotlin.Function1.I1, kotlin.Unit> declared in .I1 - $this: VALUE_PARAMETER name: type:.I1.AC> + CONSTRUCTOR visibility:public <> () returnType:.AC.AC> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AC modality:ABSTRACT visibility:public superTypes:[.I1.AC>; .I2.AC>]' 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 .I1 @@ -172,14 +39,17 @@ FILE fqName: fileName:/definitelyNonNullSAM.kt public open fun toString (): kotlin.String declared in .I1 public open fun toString (): kotlin.String declared in .I2 $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:l visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract l: @[ExtensionFunctionType] kotlin.Function1.I1, kotlin.Unit> + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.I1.AC>) returnType:@[ExtensionFunctionType] kotlin.Function1.AC, kotlin.Unit> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:l visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): @[ExtensionFunctionType] kotlin.Function1.I1, kotlin.Unit> declared in .I1 + $this: VALUE_PARAMETER name: type:.I1.AC> CLASS CLASS name:AD modality:ABSTRACT visibility:public superTypes:[.AC<{T of .AD & Any}>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AD.AD> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.AD.AD> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .AC' - : {T of .AD & Any} - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AD modality:ABSTRACT visibility:public superTypes:[.AC<{T of .AD & Any}>]' PROPERTY name:l visibility:public modality:OPEN [val] overridden: public abstract l: @[ExtensionFunctionType] kotlin.Function1.AC, kotlin.Unit> @@ -200,14 +70,11 @@ FILE fqName: fileName:/definitelyNonNullSAM.kt RETURN type=kotlin.Nothing from='public open fun (): @[ExtensionFunctionType] kotlin.Function1<{T of .AD & Any}, kotlin.Unit> declared in .AD' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:l type:@[ExtensionFunctionType] kotlin.Function1<{T of .AD & Any}, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function1<{T of .AD & Any}, kotlin.Unit> origin=null receiver: GET_VAR ': .AD.AD> declared in .AD.' type=.AD.AD> origin=null - PROPERTY FAKE_OVERRIDE name:sam visibility:public modality:OPEN [fake_override,val] - overridden: - public open sam: .FIn.AC> - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.AC<{T of .AD & Any}>) returnType:.FIn<{T of .AD & Any}> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:sam visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): .FIn.AC> declared in .AC - $this: VALUE_PARAMETER name: type:.AC<{T of .AD & Any}> + CONSTRUCTOR visibility:public <> () returnType:.AD.AD> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .AC' + : {T of .AD & Any} + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AD modality:ABSTRACT visibility:public superTypes:[.AC<{T of .AD & 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 declared in .AC @@ -221,3 +88,136 @@ FILE fqName: fileName:/definitelyNonNullSAM.kt overridden: public open fun toString (): kotlin.String declared in .AC $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:sam visibility:public modality:OPEN [fake_override,val] + overridden: + public open sam: .FIn.AC> + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.AC<{T of .AD & Any}>) returnType:.FIn<{T of .AD & Any}> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:sam visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): .FIn.AC> declared in .AC + $this: VALUE_PARAMETER name: type:.AC<{T of .AD & Any}> + CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.Test> + TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.Test.Test> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public 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 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:foo visibility:public modality:FINAL <> ($this:.Test.Test>) returnType:.FIn<{S of .Test & Any}> + $this: VALUE_PARAMETER name: type:.Test.Test> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): .FIn<{S of .Test & Any}> declared in .Test' + TYPE_OP type=.FIn<{S of .Test & Any}> origin=SAM_CONVERSION typeOperand=.FIn<{S of .Test & Any}> + FUN_EXPR type=kotlin.Function1<{S of .Test & Any}, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (sx:{S of .Test & Any}) returnType:kotlin.Unit + VALUE_PARAMETER name:sx index:0 type:{S of .Test & Any} + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_VAR 'sx: {S of .Test & Any} declared in .Test.foo.' type={S of .Test & Any} origin=null + CLASS INTERFACE name:FIn modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FIn.FIn> + TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false + 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: 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:f visibility:public modality:ABSTRACT <> ($this:.FIn.FIn>, x:T of .FIn) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.FIn.FIn> + VALUE_PARAMETER name:x index:0 type:T of .FIn + CLASS INTERFACE name:I1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I1.I1> + TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false + 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: 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 + PROPERTY name:l visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I1.I1>) returnType:@[ExtensionFunctionType] kotlin.Function1.I1, kotlin.Unit> + correspondingProperty: PROPERTY name:l visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.I1.I1> + CLASS INTERFACE name:I2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I2.I2> + TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false + 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: 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 + PROPERTY name:sam visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I2.I2>) returnType:.FIn.I2> + correspondingProperty: PROPERTY name:sam visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.I2.I2> + FUN name:bar visibility:public modality:FINAL () returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=.bar..bar> origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.FIn<{T of .bar & Any}>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.bar..bar> + CONSTRUCTOR visibility:public <> () returnType:.bar..bar> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.FIn<{T of .bar & 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 declared in .FIn + $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 .FIn + $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 .FIn + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:OPEN <> ($this:.bar..bar>, sx:{T of .bar & Any}) returnType:kotlin.Unit + overridden: + public abstract fun f (x: T of .FIn): kotlin.Unit declared in .FIn + $this: VALUE_PARAMETER name: type:.bar..bar> + VALUE_PARAMETER name:sx index:0 type:{T of .bar & Any} + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_VAR 'sx: {T of .bar & Any} declared in .bar..f' type={T of .bar & Any} origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .bar.' type=.bar..bar> origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/types/definitelyNonNullSAM.ir.txt b/compiler/testData/ir/irText/types/definitelyNonNullSAM.ir.txt index 0fe2d2297e7..00b3414ccf7 100644 --- a/compiler/testData/ir/irText/types/definitelyNonNullSAM.ir.txt +++ b/compiler/testData/ir/irText/types/definitelyNonNullSAM.ir.txt @@ -1,136 +1,7 @@ FILE fqName: fileName:/definitelyNonNullSAM.kt - CLASS INTERFACE name:FIn modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FIn.FIn> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false - FUN name:f visibility:public modality:ABSTRACT <> ($this:.FIn.FIn>, x:T of .FIn) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.FIn.FIn> - VALUE_PARAMETER name:x index:0 type:T of .FIn - 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: 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 - CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.Test> - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Test.Test> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Test.Test>) returnType:.FIn<{S of .Test & Any}> - $this: VALUE_PARAMETER name: type:.Test.Test> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): .FIn<{S of .Test & Any}> declared in .Test' - TYPE_OP type=.FIn<{S of .Test & Any}> origin=SAM_CONVERSION typeOperand=.FIn<{S of .Test & Any}> - FUN_EXPR type=kotlin.Function1<@[ParameterName(name = "x")] {S of .Test & Any}, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (sx:{S of .Test & Any}) returnType:kotlin.Unit - VALUE_PARAMETER name:sx index:0 type:{S of .Test & Any} - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null - $this: GET_VAR 'sx: {S of .Test & Any} declared in .Test.foo.' type={S of .Test & Any} 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: 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:bar visibility:public modality:FINAL () returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=.bar..bar> origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.FIn<{T of .bar & Any}>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.bar..bar> - CONSTRUCTOR visibility:public <> () returnType:.bar..bar> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.FIn<{T of .bar & Any}>]' - FUN name:f visibility:public modality:OPEN <> ($this:.bar..bar>, sx:{T of .bar & Any}) returnType:kotlin.Unit - overridden: - public abstract fun f (x: T of .FIn): kotlin.Unit declared in .FIn - $this: VALUE_PARAMETER name: type:.bar..bar> - VALUE_PARAMETER name:sx index:0 type:{T of .bar & Any} - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null - $this: GET_VAR 'sx: {T of .bar & Any} declared in .bar..f' type={T of .bar & Any} 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 .FIn - $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 .FIn - $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 .FIn - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .bar.' type=.bar..bar> origin=OBJECT_LITERAL - CLASS INTERFACE name:I1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I1.I1> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false - PROPERTY name:l visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I1.I1>) returnType:@[ExtensionFunctionType] kotlin.Function1.I1, kotlin.Unit> - correspondingProperty: PROPERTY name:l visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.I1.I1> - 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: 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 - CLASS INTERFACE name:I2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I2.I2> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false - PROPERTY name:sam visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I2.I2>) returnType:.FIn.I2> - correspondingProperty: PROPERTY name:sam visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.I2.I2> - 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: 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 CLASS CLASS name:AC modality:ABSTRACT visibility:public superTypes:[.I1.AC>; .I2.AC>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AC.AC> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.AC.AC> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AC modality:ABSTRACT visibility:public superTypes:[.I1.AC>; .I2.AC>]' PROPERTY name:sam visibility:public modality:OPEN [val] overridden: public abstract sam: .FIn.I2> @@ -148,14 +19,10 @@ FILE fqName: fileName:/definitelyNonNullSAM.kt RETURN type=kotlin.Nothing from='public open fun (): .FIn.AC> declared in .AC' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:sam type:.FIn.AC> visibility:private [final]' type=.FIn.AC> origin=null receiver: GET_VAR ': .AC.AC> declared in .AC.' type=.AC.AC> origin=null - PROPERTY FAKE_OVERRIDE name:l visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract l: @[ExtensionFunctionType] kotlin.Function1.I1, kotlin.Unit> - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.I1.AC>) returnType:@[ExtensionFunctionType] kotlin.Function1.AC, kotlin.Unit> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:l visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): @[ExtensionFunctionType] kotlin.Function1.I1, kotlin.Unit> declared in .I1 - $this: VALUE_PARAMETER name: type:.I1.AC> + CONSTRUCTOR visibility:public <> () returnType:.AC.AC> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AC modality:ABSTRACT visibility:public superTypes:[.I1.AC>; .I2.AC>]' 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 .I1 @@ -172,14 +39,17 @@ FILE fqName: fileName:/definitelyNonNullSAM.kt public open fun toString (): kotlin.String declared in .I1 public open fun toString (): kotlin.String declared in .I2 $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:l visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract l: @[ExtensionFunctionType] kotlin.Function1.I1, kotlin.Unit> + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.I1.AC>) returnType:@[ExtensionFunctionType] kotlin.Function1.AC, kotlin.Unit> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:l visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): @[ExtensionFunctionType] kotlin.Function1.I1, kotlin.Unit> declared in .I1 + $this: VALUE_PARAMETER name: type:.I1.AC> CLASS CLASS name:AD modality:ABSTRACT visibility:public superTypes:[.AC<{T of .AD & Any}>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AD.AD> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.AD.AD> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .AC' - : {T of .AD & Any} - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AD modality:ABSTRACT visibility:public superTypes:[.AC<{T of .AD & Any}>]' PROPERTY name:l visibility:public modality:OPEN [val] overridden: public abstract l: @[ExtensionFunctionType] kotlin.Function1.AC, kotlin.Unit> @@ -200,14 +70,11 @@ FILE fqName: fileName:/definitelyNonNullSAM.kt RETURN type=kotlin.Nothing from='public open fun (): @[ExtensionFunctionType] kotlin.Function1<{T of .AD & Any}, kotlin.Unit> declared in .AD' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:l type:@[ExtensionFunctionType] kotlin.Function1<{T of .AD & Any}, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function1<{T of .AD & Any}, kotlin.Unit> origin=null receiver: GET_VAR ': .AD.AD> declared in .AD.' type=.AD.AD> origin=null - PROPERTY FAKE_OVERRIDE name:sam visibility:public modality:OPEN [fake_override,val] - overridden: - public open sam: .FIn.AC> - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.AC<{T of .AD & Any}>) returnType:.FIn<{T of .AD & Any}> [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:sam visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): .FIn.AC> declared in .AC - $this: VALUE_PARAMETER name: type:.AC<{T of .AD & Any}> + CONSTRUCTOR visibility:public <> () returnType:.AD.AD> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .AC' + : {T of .AD & Any} + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AD modality:ABSTRACT visibility:public superTypes:[.AC<{T of .AD & 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 declared in .AC @@ -221,3 +88,136 @@ FILE fqName: fileName:/definitelyNonNullSAM.kt overridden: public open fun toString (): kotlin.String declared in .AC $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:sam visibility:public modality:OPEN [fake_override,val] + overridden: + public open sam: .FIn.AC> + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.AC<{T of .AD & Any}>) returnType:.FIn<{T of .AD & Any}> [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:sam visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): .FIn.AC> declared in .AC + $this: VALUE_PARAMETER name: type:.AC<{T of .AD & Any}> + CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.Test> + TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.Test.Test> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public 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 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:foo visibility:public modality:FINAL <> ($this:.Test.Test>) returnType:.FIn<{S of .Test & Any}> + $this: VALUE_PARAMETER name: type:.Test.Test> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): .FIn<{S of .Test & Any}> declared in .Test' + TYPE_OP type=.FIn<{S of .Test & Any}> origin=SAM_CONVERSION typeOperand=.FIn<{S of .Test & Any}> + FUN_EXPR type=kotlin.Function1<@[ParameterName(name = "x")] {S of .Test & Any}, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (sx:{S of .Test & Any}) returnType:kotlin.Unit + VALUE_PARAMETER name:sx index:0 type:{S of .Test & Any} + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_VAR 'sx: {S of .Test & Any} declared in .Test.foo.' type={S of .Test & Any} origin=null + CLASS INTERFACE name:FIn modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FIn.FIn> + TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false + 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: 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:f visibility:public modality:ABSTRACT <> ($this:.FIn.FIn>, x:T of .FIn) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.FIn.FIn> + VALUE_PARAMETER name:x index:0 type:T of .FIn + CLASS INTERFACE name:I1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I1.I1> + TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false + 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: 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 + PROPERTY name:l visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I1.I1>) returnType:@[ExtensionFunctionType] kotlin.Function1.I1, kotlin.Unit> + correspondingProperty: PROPERTY name:l visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.I1.I1> + CLASS INTERFACE name:I2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I2.I2> + TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false + 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: 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 + PROPERTY name:sam visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.I2.I2>) returnType:.FIn.I2> + correspondingProperty: PROPERTY name:sam visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.I2.I2> + FUN name:bar visibility:public modality:FINAL () returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=.bar..bar> origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.FIn<{T of .bar & Any}>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.bar..bar> + CONSTRUCTOR visibility:public <> () returnType:.bar..bar> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.FIn<{T of .bar & 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 declared in .FIn + $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 .FIn + $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 .FIn + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:OPEN <> ($this:.bar..bar>, sx:{T of .bar & Any}) returnType:kotlin.Unit + overridden: + public abstract fun f (x: T of .FIn): kotlin.Unit declared in .FIn + $this: VALUE_PARAMETER name: type:.bar..bar> + VALUE_PARAMETER name:sx index:0 type:{T of .bar & Any} + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_VAR 'sx: {T of .bar & Any} declared in .bar..f' type={T of .bar & Any} origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .bar.' type=.bar..bar> origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/types/definitelyNonNullWithJava.ir.txt b/compiler/testData/ir/irText/types/definitelyNonNullWithJava.ir.txt index 6731ec2303a..16817208cee 100644 --- a/compiler/testData/ir/irText/types/definitelyNonNullWithJava.ir.txt +++ b/compiler/testData/ir/irText/types/definitelyNonNullWithJava.ir.txt @@ -2,16 +2,6 @@ FILE fqName: fileName:/main.kt CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[.A.B>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B.B> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.B.B>, x:T1 of .B) returnType:T1 of .B - overridden: - public abstract fun foo (x: @[FlexibleNullability] T of .A?): @[FlexibleNullability] T of .A? declared in .A - $this: VALUE_PARAMETER name: type:.B.B> - VALUE_PARAMETER name:x index:0 type:T1 of .B - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.B.B>, x:{T1 of .B & Any}) returnType:{T1 of .B & Any} - overridden: - public abstract fun bar (x: @[EnhancedNullability] {T of .A & Any}): @[EnhancedNullability] {T of .A & Any} declared in .A - $this: VALUE_PARAMETER name: type:.B.B> - VALUE_PARAMETER name:x index:0 type:{T1 of .B & 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 declared in .A @@ -25,3 +15,13 @@ FILE fqName: fileName:/main.kt overridden: public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.B.B>, x:{T1 of .B & Any}) returnType:{T1 of .B & Any} + overridden: + public abstract fun bar (x: @[EnhancedNullability] {T of .A & Any}): @[EnhancedNullability] {T of .A & Any} declared in .A + $this: VALUE_PARAMETER name: type:.B.B> + VALUE_PARAMETER name:x index:0 type:{T1 of .B & Any} + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.B.B>, x:T1 of .B) returnType:T1 of .B + overridden: + public abstract fun foo (x: @[FlexibleNullability] T of .A?): @[FlexibleNullability] T of .A? declared in .A + $this: VALUE_PARAMETER name: type:.B.B> + VALUE_PARAMETER name:x index:0 type:T1 of .B diff --git a/compiler/testData/ir/irText/types/definitelyNonNullWithJava.kt.txt b/compiler/testData/ir/irText/types/definitelyNonNullWithJava.kt.txt index 4428e37d0aa..fffd80b8d0f 100644 --- a/compiler/testData/ir/irText/types/definitelyNonNullWithJava.kt.txt +++ b/compiler/testData/ir/irText/types/definitelyNonNullWithJava.kt.txt @@ -1,6 +1,7 @@ interface B : A { - abstract override fun foo(x: T1): T1 - abstract override fun bar(x: (T1 & Any)): (T1 & Any) + abstract override fun foo(x: T1): T1 + } + diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.fir.ir.txt b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.fir.ir.txt index cf9a39950f3..5939b507a20 100644 --- a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.fir.ir.txt +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.fir.ir.txt @@ -1,58 +1,7 @@ FILE fqName: fileName:/definitelyNotNullAsArgument.kt - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:input visibility:public modality:ABSTRACT <> ($this:.I.I>, t:T of .I) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.I.I> - VALUE_PARAMETER name:t index:0 type:T of .I - FUN name:output visibility:public modality:ABSTRACT <> ($this:.I.I>) returnType:T of .I - $this: VALUE_PARAMETER name: type:.I.I> - 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: 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:foo visibility:public modality:FINAL (i:.I<{T of .foo & Any}>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:i index:0 type:.I<{T of .foo & Any}> - BLOCK_BODY - CALL 'public abstract fun input (t: T of .I): kotlin.Unit declared in .I' type=kotlin.Unit origin=null - $this: GET_VAR 'i: .I<{T of .foo & Any}> declared in .foo' type=.I<{T of .foo & Any}> origin=null - t: CALL 'public abstract fun output (): T of .I declared in .I' type={T of .foo & Any} origin=null - $this: GET_VAR 'i: .I<{T of .foo & Any}> declared in .foo' type=.I<{T of .foo & Any}> origin=null - FUN name:bar visibility:public modality:FINAL (i:.I.bar & Any}>) returnType:{T of .bar & Any} - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:i index:0 type:.I.bar & Any}> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun bar (i: .I.bar & Any}>): {T of .bar & Any} declared in ' - CALL 'public abstract fun output (): T of .I declared in .I' type={T of .bar & Any} origin=null - $this: GET_VAR 'i: .I.bar & Any}> declared in .bar' type=.I.bar & Any}> origin=null - FUN name:qux visibility:public modality:FINAL (t:T of .qux, i:.I.qux & Any}>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:t index:0 type:T of .qux - VALUE_PARAMETER name:i index:1 type:.I.qux & Any}> - BLOCK_BODY - CALL 'public abstract fun input (t: T of .I): kotlin.Unit declared in .I' type=kotlin.Unit origin=null - $this: GET_VAR 'i: .I.qux & Any}> declared in .qux' type=.I.qux & Any}> origin=null - t: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type={T of .qux & Any} origin=EXCLEXCL - : {T of .qux & Any} - arg0: GET_VAR 't: T of .qux declared in .qux' type=T of .qux origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I<{TT of .C & Any}>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (t:TT of .C) returnType:.C.C> [primary] - VALUE_PARAMETER name:t index:0 type:TT of .C - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I<{TT of .C & Any}>]' PROPERTY name:t visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:t type:TT of .C visibility:private [final] EXPRESSION_BODY @@ -64,6 +13,24 @@ FILE fqName: fileName:/definitelyNotNullAsArgument.kt RETURN type=kotlin.Nothing from='public final fun (): TT of .C declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:t type:TT of .C visibility:private [final]' type=TT of .C origin=null receiver: GET_VAR ': .C.C> declared in .C.' type=.C.C> origin=null + CONSTRUCTOR visibility:public <> (t:TT of .C) returnType:.C.C> [primary] + VALUE_PARAMETER name:t index:0 type:TT of .C + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I<{TT of .C & 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 declared in .I + $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 .I + $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 .I + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:input visibility:public modality:OPEN <> ($this:.C.C>, t:{TT of .C & Any}) returnType:kotlin.Unit overridden: public abstract fun input (t: T of .I): kotlin.Unit declared in .I @@ -80,19 +47,42 @@ FILE fqName: fileName:/definitelyNotNullAsArgument.kt : {TT of .C & Any} arg0: CALL 'public final fun (): TT of .C declared in .C' type=TT of .C origin=GET_PROPERTY $this: GET_VAR ': .C.C> declared in .C.output' type=.C.C> origin=null + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false 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 .I + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .I + 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 .I + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:input visibility:public modality:ABSTRACT <> ($this:.I.I>, t:T of .I) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.I.I> + VALUE_PARAMETER name:t index:0 type:T of .I + FUN name:output visibility:public modality:ABSTRACT <> ($this:.I.I>) returnType:T of .I + $this: VALUE_PARAMETER name: type:.I.I> + FUN name:bar visibility:public modality:FINAL (i:.I.bar & Any}>) returnType:{T of .bar & Any} + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:i index:0 type:.I.bar & Any}> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (i: .I.bar & Any}>): {T of .bar & Any} declared in ' + CALL 'public abstract fun output (): T of .I declared in .I' type={T of .bar & Any} origin=null + $this: GET_VAR 'i: .I.bar & Any}> declared in .bar' type=.I.bar & Any}> origin=null + FUN name:foo visibility:public modality:FINAL (i:.I<{T of .foo & Any}>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:i index:0 type:.I<{T of .foo & Any}> + BLOCK_BODY + CALL 'public abstract fun input (t: T of .I): kotlin.Unit declared in .I' type=kotlin.Unit origin=null + $this: GET_VAR 'i: .I<{T of .foo & Any}> declared in .foo' type=.I<{T of .foo & Any}> origin=null + t: CALL 'public abstract fun output (): T of .I declared in .I' type={T of .foo & Any} origin=null + $this: GET_VAR 'i: .I<{T of .foo & Any}> declared in .foo' type=.I<{T of .foo & Any}> origin=null FUN name:foo2 visibility:public modality:FINAL (p1:T1 of .foo2, p2:T2 of .foo2) returnType:kotlin.Unit TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:T2 index:1 variance: superTypes:[.I<{T1 of .foo2 & Any}>] reified:false @@ -104,3 +94,13 @@ FILE fqName: fileName:/definitelyNotNullAsArgument.kt t: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type={T1 of .foo2 & Any} origin=EXCLEXCL : {T1 of .foo2 & Any} arg0: GET_VAR 'p1: T1 of .foo2 declared in .foo2' type=T1 of .foo2 origin=null + FUN name:qux visibility:public modality:FINAL (t:T of .qux, i:.I.qux & Any}>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:T of .qux + VALUE_PARAMETER name:i index:1 type:.I.qux & Any}> + BLOCK_BODY + CALL 'public abstract fun input (t: T of .I): kotlin.Unit declared in .I' type=kotlin.Unit origin=null + $this: GET_VAR 'i: .I.qux & Any}> declared in .qux' type=.I.qux & Any}> origin=null + t: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type={T of .qux & Any} origin=EXCLEXCL + : {T of .qux & Any} + arg0: GET_VAR 't: T of .qux declared in .qux' type=T of .qux origin=null diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.fir.kt.txt b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.fir.kt.txt index 75bab680015..c7d7545a426 100644 --- a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.fir.kt.txt +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.fir.kt.txt @@ -1,33 +1,14 @@ -interface I { - abstract fun input(t: T) - - abstract fun output(): T - -} - -fun foo(i: I<(T & Any)>) { - i.input(t = i.output()) -} - -fun bar(i: I): (T & Any) { - return i.output() -} - -fun qux(t: T, i: I) { - i.input(t = CHECK_NOT_NULL<(T & Any)>(arg0 = t)) -} - class C : I<(TT & Any)> { + val t: TT + field = t + get + constructor(t: TT) /* primary */ { super/*Any*/() /* () */ } - val t: TT - field = t - get - override fun input(t: (TT & Any)) { } @@ -37,6 +18,26 @@ class C : I<(TT & Any)> { } +interface I { + abstract fun input(t: T) + + abstract fun output(): T + +} + +fun bar(i: I): (T & Any) { + return i.output() +} + +fun foo(i: I<(T & Any)>) { + i.input(t = i.output()) +} + fun > foo2(p1: T1, p2: T2) { p2.input(t = CHECK_NOT_NULL<(T1 & Any)>(arg0 = p1)) } + +fun qux(t: T, i: I) { + i.input(t = CHECK_NOT_NULL<(T & Any)>(arg0 = t)) +} + diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.ir.txt b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.ir.txt index 3642faeae18..2e2248adfdf 100644 --- a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.ir.txt +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.ir.txt @@ -1,58 +1,7 @@ FILE fqName: fileName:/definitelyNotNullAsArgument.kt - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN name:input visibility:public modality:ABSTRACT <> ($this:.I.I>, t:T of .I) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.I.I> - VALUE_PARAMETER name:t index:0 type:T of .I - FUN name:output visibility:public modality:ABSTRACT <> ($this:.I.I>) returnType:T of .I - $this: VALUE_PARAMETER name: type:.I.I> - 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: 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:foo visibility:public modality:FINAL (i:.I<{T of .foo & Any}>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:i index:0 type:.I<{T of .foo & Any}> - BLOCK_BODY - CALL 'public abstract fun input (t: T of .I): kotlin.Unit declared in .I' type=kotlin.Unit origin=null - $this: GET_VAR 'i: .I<{T of .foo & Any}> declared in .foo' type=.I<{T of .foo & Any}> origin=null - t: CALL 'public abstract fun output (): T of .I declared in .I' type={T of .foo & Any} origin=null - $this: GET_VAR 'i: .I<{T of .foo & Any}> declared in .foo' type=.I<{T of .foo & Any}> origin=null - FUN name:bar visibility:public modality:FINAL (i:.I.bar & Any}>) returnType:{T of .bar & Any} - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:i index:0 type:.I.bar & Any}> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun bar (i: .I.bar & Any}>): {T of .bar & Any} declared in ' - CALL 'public abstract fun output (): T of .I declared in .I' type={T of .bar & Any} origin=null - $this: GET_VAR 'i: .I.bar & Any}> declared in .bar' type=.I.bar & Any}> origin=null - FUN name:qux visibility:public modality:FINAL (t:T of .qux, i:.I.qux & Any}>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:t index:0 type:T of .qux - VALUE_PARAMETER name:i index:1 type:.I.qux & Any}> - BLOCK_BODY - CALL 'public abstract fun input (t: T of .I): kotlin.Unit declared in .I' type=kotlin.Unit origin=null - $this: GET_VAR 'i: .I.qux & Any}> declared in .qux' type=.I.qux & Any}> origin=null - t: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=T of .qux origin=EXCLEXCL - : T of .qux - arg0: GET_VAR 't: T of .qux declared in .qux' type=T of .qux origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I<{TT of .C & Any}>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (t:TT of .C) returnType:.C.C> [primary] - VALUE_PARAMETER name:t index:0 type:TT of .C - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I<{TT of .C & Any}>]' PROPERTY name:t visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:t type:TT of .C visibility:private [final] EXPRESSION_BODY @@ -64,6 +13,24 @@ FILE fqName: fileName:/definitelyNotNullAsArgument.kt RETURN type=kotlin.Nothing from='public final fun (): TT of .C declared in .C' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:t type:TT of .C visibility:private [final]' type=TT of .C origin=null receiver: GET_VAR ': .C.C> declared in .C.' type=.C.C> origin=null + CONSTRUCTOR visibility:public <> (t:TT of .C) returnType:.C.C> [primary] + VALUE_PARAMETER name:t index:0 type:TT of .C + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I<{TT of .C & 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 declared in .I + $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 .I + $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 .I + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:input visibility:public modality:OPEN <> ($this:.C.C>, t:{TT of .C & Any}) returnType:kotlin.Unit overridden: public abstract fun input (t: T of .I): kotlin.Unit declared in .I @@ -80,19 +47,42 @@ FILE fqName: fileName:/definitelyNotNullAsArgument.kt : TT of .C arg0: CALL 'public final fun (): TT of .C declared in .C' type=TT of .C origin=GET_PROPERTY $this: GET_VAR ': .C.C> declared in .C.output' type=.C.C> origin=null + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false 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 .I + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .I + 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 .I + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:input visibility:public modality:ABSTRACT <> ($this:.I.I>, t:T of .I) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.I.I> + VALUE_PARAMETER name:t index:0 type:T of .I + FUN name:output visibility:public modality:ABSTRACT <> ($this:.I.I>) returnType:T of .I + $this: VALUE_PARAMETER name: type:.I.I> + FUN name:bar visibility:public modality:FINAL (i:.I.bar & Any}>) returnType:{T of .bar & Any} + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:i index:0 type:.I.bar & Any}> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (i: .I.bar & Any}>): {T of .bar & Any} declared in ' + CALL 'public abstract fun output (): T of .I declared in .I' type={T of .bar & Any} origin=null + $this: GET_VAR 'i: .I.bar & Any}> declared in .bar' type=.I.bar & Any}> origin=null + FUN name:foo visibility:public modality:FINAL (i:.I<{T of .foo & Any}>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:i index:0 type:.I<{T of .foo & Any}> + BLOCK_BODY + CALL 'public abstract fun input (t: T of .I): kotlin.Unit declared in .I' type=kotlin.Unit origin=null + $this: GET_VAR 'i: .I<{T of .foo & Any}> declared in .foo' type=.I<{T of .foo & Any}> origin=null + t: CALL 'public abstract fun output (): T of .I declared in .I' type={T of .foo & Any} origin=null + $this: GET_VAR 'i: .I<{T of .foo & Any}> declared in .foo' type=.I<{T of .foo & Any}> origin=null FUN name:foo2 visibility:public modality:FINAL (p1:T1 of .foo2, p2:T2 of .foo2) returnType:kotlin.Unit TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:T2 index:1 variance: superTypes:[.I<{T1 of .foo2 & Any}>] reified:false @@ -105,3 +95,13 @@ FILE fqName: fileName:/definitelyNotNullAsArgument.kt t: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=T1 of .foo2 origin=EXCLEXCL : T1 of .foo2 arg0: GET_VAR 'p1: T1 of .foo2 declared in .foo2' type=T1 of .foo2 origin=null + FUN name:qux visibility:public modality:FINAL (t:T of .qux, i:.I.qux & Any}>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:T of .qux + VALUE_PARAMETER name:i index:1 type:.I.qux & Any}> + BLOCK_BODY + CALL 'public abstract fun input (t: T of .I): kotlin.Unit declared in .I' type=kotlin.Unit origin=null + $this: GET_VAR 'i: .I.qux & Any}> declared in .qux' type=.I.qux & Any}> origin=null + t: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=T of .qux origin=EXCLEXCL + : T of .qux + arg0: GET_VAR 't: T of .qux declared in .qux' type=T of .qux origin=null diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt.txt b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt.txt index 610b54d619c..8f97ee49e18 100644 --- a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt.txt +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt.txt @@ -1,33 +1,14 @@ -interface I { - abstract fun input(t: T) - - abstract fun output(): T - -} - -fun foo(i: I<(T & Any)>) { - i.input(t = i.output()) -} - -fun bar(i: I): (T & Any) { - return i.output() -} - -fun qux(t: T, i: I) { - i.input(t = CHECK_NOT_NULL(arg0 = t)) -} - class C : I<(TT & Any)> { + val t: TT + field = t + get + constructor(t: TT) /* primary */ { super/*Any*/() /* () */ } - val t: TT - field = t - get - override fun input(t: (TT & Any)) { } @@ -37,6 +18,26 @@ class C : I<(TT & Any)> { } +interface I { + abstract fun input(t: T) + + abstract fun output(): T + +} + +fun bar(i: I): (T & Any) { + return i.output() +} + +fun foo(i: I<(T & Any)>) { + i.input(t = i.output()) +} + fun > foo2(p1: T1, p2: T2) { p2 /*as I<(T1 & Any)> */.input(t = CHECK_NOT_NULL(arg0 = p1)) } + +fun qux(t: T, i: I) { + i.input(t = CHECK_NOT_NULL(arg0 = t)) +} + diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.ir.txt b/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.ir.txt index c626c8d8bb3..214c392be91 100644 --- a/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.ir.txt +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.ir.txt @@ -1,12 +1,4 @@ FILE fqName: fileName:/definitelyNotNullAsReceiver.kt - FUN name:foo visibility:public modality:FINAL ($receiver:{T of .foo & Any}) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:{T of .foo & Any} - BLOCK_BODY - FUN name:foo visibility:public modality:FINAL (l:kotlin.Function1<{T of .foo & Any}, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:l index:0 type:kotlin.Function1<{T of .foo & Any}, kotlin.Unit> - BLOCK_BODY FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun foo (): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -21,3 +13,11 @@ FILE fqName: fileName:/definitelyNotNullAsReceiver.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit STRING_CONCATENATION type=kotlin.String GET_VAR 'it: kotlin.String declared in .box.' type=kotlin.String origin=null + FUN name:foo visibility:public modality:FINAL ($receiver:{T of .foo & Any}) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:{T of .foo & Any} + BLOCK_BODY + FUN name:foo visibility:public modality:FINAL (l:kotlin.Function1<{T of .foo & Any}, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:l index:0 type:kotlin.Function1<{T of .foo & Any}, kotlin.Unit> + BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.kt.txt b/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.kt.txt index 5b4afc74f99..fa5fdf700ce 100644 --- a/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.kt.txt +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.kt.txt @@ -1,9 +1,3 @@ -fun (T & Any).foo() { -} - -fun foo(l: Function1<(T & Any), Unit>) { -} - fun box() { "".foo() foo(l = local fun (it: String) { @@ -11,3 +5,10 @@ fun box() { } ) } + +fun (T & Any).foo() { +} + +fun foo(l: Function1<(T & Any), Unit>) { +} + diff --git a/compiler/testData/ir/irText/types/definitelyNotNullWithIntersection1.ir.txt b/compiler/testData/ir/irText/types/definitelyNotNullWithIntersection1.ir.txt index 300e9494028..eb4dbac0c8d 100644 --- a/compiler/testData/ir/irText/types/definitelyNotNullWithIntersection1.ir.txt +++ b/compiler/testData/ir/irText/types/definitelyNotNullWithIntersection1.ir.txt @@ -19,14 +19,6 @@ FILE fqName: fileName:/definitelyNotNullWithIntersection1.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:select visibility:public modality:FINAL (x:S of .select, y:S of .select, z:S of .select) returnType:S of .select - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:x index:0 type:S of .select - VALUE_PARAMETER name:y index:1 type:S of .select - VALUE_PARAMETER name:z index:2 type:S of .select - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun select (x: S of .select, y: S of .select, z: S of .select): S of .select declared in ' - GET_VAR 'x: S of .select declared in .select' type=S of .select origin=null FUN name:foo visibility:public modality:FINAL (a:kotlin.Array<.In<{T of .foo & Any}>>, b:kotlin.Array<.In>, c:kotlin.Array<.In.foo>>) returnType:kotlin.Boolean TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:a index:0 type:kotlin.Array<.In<{T of .foo & Any}>> @@ -52,6 +44,14 @@ FILE fqName: fileName:/definitelyNotNullWithIntersection1.kt RETURN type=kotlin.Nothing from='public final fun ofType (y: kotlin.Any?): kotlin.Boolean declared in ' TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=K of .ofType GET_VAR 'y: kotlin.Any? declared in .ofType' type=kotlin.Any? origin=null + FUN name:select visibility:public modality:FINAL (x:S of .select, y:S of .select, z:S of .select) returnType:S of .select + TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:x index:0 type:S of .select + VALUE_PARAMETER name:y index:1 type:S of .select + VALUE_PARAMETER name:z index:2 type:S of .select + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun select (x: S of .select, y: S of .select, z: S of .select): S of .select declared in ' + GET_VAR 'x: S of .select declared in .select' type=S of .select origin=null FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a1 type:kotlin.Array<.In> [val] diff --git a/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.ir.txt b/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.ir.txt index 0c9bb29c422..40a2edc5acc 100644 --- a/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.ir.txt +++ b/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/dontLeaveStubTypesInSetter.kt CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo.Foo> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T of .Foo) returnType:.Foo.Foo> [primary] - VALUE_PARAMETER name:x index:0 type:T of .Foo - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x type:T of .Foo visibility:private EXPRESSION_BODY @@ -26,6 +21,11 @@ FILE fqName: fileName:/dontLeaveStubTypesInSetter.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Foo visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Foo.Foo> declared in .Foo.' type=.Foo.Foo> origin=null value: GET_VAR ': T of .Foo declared in .Foo.' type=T of .Foo origin=null + CONSTRUCTOR visibility:public <> (x:T of .Foo) returnType:.Foo.Foo> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Foo + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public 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 declared in kotlin.Any diff --git a/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.kt.txt b/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.kt.txt index 3f98d789639..2ca5fcbcde7 100644 --- a/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.kt.txt +++ b/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.kt.txt @@ -1,15 +1,15 @@ class Foo { + var x: T + field = x + get + set + constructor(x: T) /* primary */ { super/*Any*/() /* () */ } - var x: T - field = x - get - set - } fun foo(x: MutableList): Foo { @@ -24,3 +24,4 @@ fun runMe() { } ) } + diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.ir.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.ir.txt index 4d2609a0512..ca95d1bcac8 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.ir.txt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.ir.txt @@ -1,14 +1,270 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt + PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate..> visibility:private [final,static] + EXPRESSION_BODY + BLOCK type=.additionalText$delegate..> origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, .P>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..> + PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final] + EXPRESSION_BODY + BLOCK type=.additionalText$delegate..deepO$delegate..> origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepO$delegate..> + CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..deepO$delegate. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, 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 declared in .IDelegate1 + $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 .IDelegate1 + $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 .IDelegate1 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate..deepO$delegate..>, t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] + overridden: + public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 declared in .IDelegate1 + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate..> + VALUE_PARAMETER name:t index:0 type:.Value.CR> + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' + CALL 'public final fun (): T of .Value declared in .Value' type=kotlin.Any? origin=GET_PROPERTY + $this: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..deepO$delegate..getValue' type=.Value.CR> origin=null + FUN name:qux21 visibility:public modality:FINAL ($this:.additionalText$delegate..deepO$delegate..>, t:F21T of .additionalText$delegate..deepO$delegate..qux21) returnType:F21T of .additionalText$delegate..deepO$delegate..qux21 + TYPE_PARAMETER name:F21T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate..> + VALUE_PARAMETER name:t index:0 type:F21T of .additionalText$delegate..deepO$delegate..qux21 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux21 (t: F21T of .additionalText$delegate..deepO$delegate..qux21): F21T of .additionalText$delegate..deepO$delegate..qux21 declared in .additionalText$delegate..deepO$delegate.' + GET_VAR 't: F21T of .additionalText$delegate..deepO$delegate..qux21 declared in .additionalText$delegate..deepO$delegate..qux21' type=F21T of .additionalText$delegate..deepO$delegate..qux21 origin=null + FUN name:qux22 visibility:public modality:FINAL ($this:.additionalText$delegate..deepO$delegate..>, t:F22T of .additionalText$delegate..deepO$delegate..qux22) returnType:kotlin.Any? + TYPE_PARAMETER name:F22T index:0 variance: superTypes:[.IR] reified:false + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate..> + VALUE_PARAMETER name:t index:0 type:F22T of .additionalText$delegate..deepO$delegate..qux22 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux22 (t: F22T of .additionalText$delegate..deepO$delegate..qux22): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' + CALL 'public abstract fun foo (): R of .IR declared in .IR' type=kotlin.Any? origin=null + $this: GET_VAR 't: F22T of .additionalText$delegate..deepO$delegate..qux22 declared in .additionalText$delegate..deepO$delegate..qux22' type=F22T of .additionalText$delegate..deepO$delegate..qux22 origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .additionalText$delegate..deepO$delegate.' type=.additionalText$delegate..deepO$delegate..> origin=OBJECT_LITERAL + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.additionalText$delegate..>, $receiver:.Value.CR>) returnType:kotlin.Any? + correspondingProperty: PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] + $this: VALUE_PARAMETER name: type:.additionalText$delegate..> + $receiver: VALUE_PARAMETER name: type:.Value.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Any? declared in .additionalText$delegate.' + CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' type=kotlin.Any? origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final]' type=.additionalText$delegate..deepO$delegate. origin=null + receiver: TYPE_OP type=.additionalText$delegate. origin=IMPLICIT_CAST typeOperand=.additionalText$delegate. + GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..' type=.additionalText$delegate..> origin=null + t: GET_VAR ': .Value.CR> declared in .additionalText$delegate..' type=.Value.CR> origin=null + p: PROPERTY_REFERENCE 'private final deepO: kotlin.Any?' field=null getter='private final fun (): kotlin.Any? declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value.CR>, *, kotlin.Any?> origin=PROPERTY_REFERENCE_FOR_DELEGATE + PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final] + EXPRESSION_BODY + BLOCK type=.additionalText$delegate..deepK$delegate..> origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepK$delegate..> + CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..deepK$delegate. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, 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 declared in .IDelegate1 + $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 .IDelegate1 + $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 .IDelegate1 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate..deepK$delegate..>, t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] + overridden: + public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 declared in .IDelegate1 + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepK$delegate..> + VALUE_PARAMETER name:t index:0 type:.Value.CR> + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepK$delegate.' + CALL 'public open fun foo (): R of .CR declared in .CR' type=kotlin.Any? origin=null + $this: CALL 'public final fun (): IT of .Value declared in .Value' type=.CR origin=GET_PROPERTY + $this: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..deepK$delegate..getValue' type=.Value.CR> origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .additionalText$delegate..deepK$delegate.' type=.additionalText$delegate..deepK$delegate..> origin=OBJECT_LITERAL + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.additionalText$delegate..>, $receiver:.Value.CR>) returnType:kotlin.Any? + correspondingProperty: PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] + $this: VALUE_PARAMETER name: type:.additionalText$delegate..> + $receiver: VALUE_PARAMETER name: type:.Value.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Any? declared in .additionalText$delegate.' + CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepK$delegate.' type=kotlin.Any? origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final]' type=.additionalText$delegate..deepK$delegate. origin=null + receiver: TYPE_OP type=.additionalText$delegate. origin=IMPLICIT_CAST typeOperand=.additionalText$delegate. + GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..' type=.additionalText$delegate..> origin=null + t: GET_VAR ': .Value.CR> declared in .additionalText$delegate..' type=.Value.CR> origin=null + p: PROPERTY_REFERENCE 'private final deepK: kotlin.Any?' field=null getter='private final fun (): kotlin.Any? declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value.CR>, *, kotlin.Any?> origin=PROPERTY_REFERENCE_FOR_DELEGATE + CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, .P>]' + 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 .IDelegate1 + $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 .IDelegate1 + $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 .IDelegate1 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate..>, t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:.P [operator] + overridden: + public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 declared in .IDelegate1 + $this: VALUE_PARAMETER name: type:.additionalText$delegate..> + VALUE_PARAMETER name:t index:0 type:.Value.CR> + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): .P declared in .additionalText$delegate.' + CONSTRUCTOR_CALL 'public constructor (p1: P1 of .P, p2: P2 of .P) declared in .P' type=.P origin=null + : kotlin.Any? + : kotlin.Any? + p1: CALL 'private final fun (): kotlin.Any? declared in .additionalText$delegate.' type=kotlin.Any? origin=GET_PROPERTY + $this: TYPE_OP type=.additionalText$delegate. origin=IMPLICIT_CAST typeOperand=.additionalText$delegate. + GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..getValue' type=.additionalText$delegate..> origin=null + $receiver: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..getValue' type=.Value.CR> origin=null + p2: CALL 'private final fun (): kotlin.Any? declared in .additionalText$delegate.' type=kotlin.Any? origin=GET_PROPERTY + $this: TYPE_OP type=.additionalText$delegate. origin=IMPLICIT_CAST typeOperand=.additionalText$delegate. + GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..getValue' type=.additionalText$delegate..> origin=null + $receiver: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..getValue' type=.Value.CR> origin=null + FUN name:qux11 visibility:public modality:FINAL ($this:.additionalText$delegate..>, t:F11T of .additionalText$delegate..qux11) returnType:F11T of .additionalText$delegate..qux11 + TYPE_PARAMETER name:F11T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.additionalText$delegate..> + VALUE_PARAMETER name:t index:0 type:F11T of .additionalText$delegate..qux11 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux11 (t: F11T of .additionalText$delegate..qux11): F11T of .additionalText$delegate..qux11 declared in .additionalText$delegate.' + GET_VAR 't: F11T of .additionalText$delegate..qux11 declared in .additionalText$delegate..qux11' type=F11T of .additionalText$delegate..qux11 origin=null + FUN name:qux12 visibility:public modality:FINAL ($this:.additionalText$delegate..>, t:F12T of .additionalText$delegate..qux12) returnType:kotlin.Any? + TYPE_PARAMETER name:F12T index:0 variance: superTypes:[.IR] reified:false + $this: VALUE_PARAMETER name: type:.additionalText$delegate..> + VALUE_PARAMETER name:t index:0 type:F12T of .additionalText$delegate..qux12 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux12 (t: F12T of .additionalText$delegate..qux12): kotlin.Any? declared in .additionalText$delegate.' + CALL 'public abstract fun foo (): R of .IR declared in .IR' type=kotlin.Any? origin=null + $this: GET_VAR 't: F12T of .additionalText$delegate..qux12 declared in .additionalText$delegate..qux12' type=F12T of .additionalText$delegate..qux12 origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .additionalText$delegate.' type=.additionalText$delegate..> origin=OBJECT_LITERAL + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value., .CR.>>) returnType:.P., T of .> + correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Value., .CR.>> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .P., T of .> declared in ' + CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): .P declared in .additionalText$delegate.' type=.P., T of .> origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate..> visibility:private [final,static]' type=.additionalText$delegate..> origin=null + t: GET_VAR ': .Value., .CR.>> declared in .' type=.Value., .CR.>> origin=null + p: PROPERTY_REFERENCE 'public final additionalText: .P., T of .>' field=null getter='public final fun (): .P., T of .> declared in ' setter=null type=kotlin.reflect.KProperty1<.Value., .CR.>>, .P., T of .>> origin=PROPERTY_REFERENCE_FOR_DELEGATE + <1>: T of . + CLASS CLASS name:CR modality:FINAL visibility:public superTypes:[.IR.CR>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CR.CR> + TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:r visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:r type:R of .CR visibility:private [final] + EXPRESSION_BODY + GET_VAR 'r: R of .CR declared in .CR.' type=R of .CR origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.CR.CR>) returnType:R of .CR + correspondingProperty: PROPERTY name:r visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.CR.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): R of .CR declared in .CR' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:r type:R of .CR visibility:private [final]' type=R of .CR origin=null + receiver: GET_VAR ': .CR.CR> declared in .CR.' type=.CR.CR> origin=null + CONSTRUCTOR visibility:public <> (r:R of .CR) returnType:.CR.CR> [primary] + VALUE_PARAMETER name:r index:0 type:R of .CR + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CR modality:FINAL visibility:public superTypes:[.IR.CR>]' + 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 .IR + $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 .IR + $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 .IR + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.CR.CR>) returnType:R of .CR + overridden: + public abstract fun foo (): R of .IR declared in .IR + $this: VALUE_PARAMETER name: type:.CR.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): R of .CR declared in .CR' + CALL 'public final fun (): R of .CR declared in .CR' type=R of .CR origin=GET_PROPERTY + $this: GET_VAR ': .CR.CR> declared in .CR.foo' type=.CR.CR> origin=null + CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.P.P, P2 of .P> + TYPE_PARAMETER name:P1 index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:P2 index:1 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:p1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p1 type:P1 of .P visibility:private [final] + EXPRESSION_BODY + GET_VAR 'p1: P1 of .P declared in .P.' type=P1 of .P origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.P.P, P2 of .P>) returnType:P1 of .P + correspondingProperty: PROPERTY name:p1 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.P.P, P2 of .P> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): P1 of .P declared in .P' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p1 type:P1 of .P visibility:private [final]' type=P1 of .P origin=null + receiver: GET_VAR ': .P.P, P2 of .P> declared in .P.' type=.P.P, P2 of .P> origin=null + PROPERTY name:p2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p2 type:P2 of .P visibility:private [final] + EXPRESSION_BODY + GET_VAR 'p2: P2 of .P declared in .P.' type=P2 of .P origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.P.P, P2 of .P>) returnType:P2 of .P + correspondingProperty: PROPERTY name:p2 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.P.P, P2 of .P> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): P2 of .P declared in .P' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p2 type:P2 of .P visibility:private [final]' type=P2 of .P origin=null + receiver: GET_VAR ': .P.P, P2 of .P> declared in .P.' type=.P.P, P2 of .P> origin=null + CONSTRUCTOR visibility:public <> (p1:P1 of .P, p2:P2 of .P) returnType:.P.P, P2 of .P> [primary] + VALUE_PARAMETER name:p1 index:0 type:P1 of .P + VALUE_PARAMETER name:p2 index:1 type:P2 of .P + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public 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 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 CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Value.Value, IT of .Value> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:IT index:1 variance: superTypes:[.IR.Value>] reified:false - CONSTRUCTOR visibility:public <> (value1:T of .Value, value2:IT of .Value) returnType:.Value.Value, IT of .Value> [primary] - VALUE_PARAMETER name:value1 index:0 type:T of .Value - VALUE_PARAMETER name:value2 index:1 type:IT of .Value - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value1 visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:value1 type:T of .Value visibility:private EXPRESSION_BODY @@ -39,6 +295,12 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt RETURN type=kotlin.Nothing from='public final fun (): IT of .Value declared in .Value' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:IT of .Value visibility:private [final]' type=IT of .Value origin=null receiver: GET_VAR ': .Value.Value, IT of .Value> declared in .Value.' type=.Value.Value, IT of .Value> origin=null + CONSTRUCTOR visibility:public <> (value1:T of .Value, value2:IT of .Value) returnType:.Value.Value, IT of .Value> [primary] + VALUE_PARAMETER name:value1 index:0 type:T of .Value + VALUE_PARAMETER name:value2 index:1 type:IT of .Value + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Value modality:FINAL visibility:public 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 declared in kotlin.Any @@ -56,321 +318,59 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IDelegate1.IDelegate1, R1 of .IDelegate1> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:R1 index:1 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:getValue visibility:public modality:ABSTRACT <> ($this:.IDelegate1.IDelegate1, R1 of .IDelegate1>, t:T1 of .IDelegate1, p:kotlin.reflect.KProperty<*>) returnType:R1 of .IDelegate1 [operator] $this: VALUE_PARAMETER name: type:.IDelegate1.IDelegate1, R1 of .IDelegate1> VALUE_PARAMETER name:t index:0 type:T1 of .IDelegate1 VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - 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: 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 CLASS INTERFACE name:IDelegate2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IDelegate2.IDelegate2, R2 of .IDelegate2> TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:R2 index:1 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:getValue visibility:public modality:ABSTRACT <> ($this:.IDelegate2.IDelegate2, R2 of .IDelegate2>, t:T2 of .IDelegate2, p:kotlin.reflect.KProperty<*>) returnType:R2 of .IDelegate2 [operator] $this: VALUE_PARAMETER name: type:.IDelegate2.IDelegate2, R2 of .IDelegate2> VALUE_PARAMETER name:t index:0 type:T2 of .IDelegate2 VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - 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: 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 CLASS INTERFACE name:IR modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IR.IR> TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.IR.IR>) returnType:R of .IR $this: VALUE_PARAMETER name: type:.IR.IR> - 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: 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 - CLASS CLASS name:CR modality:FINAL visibility:public superTypes:[.IR.CR>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CR.CR> - TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (r:R of .CR) returnType:.CR.CR> [primary] - VALUE_PARAMETER name:r index:0 type:R of .CR - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CR modality:FINAL visibility:public superTypes:[.IR.CR>]' - PROPERTY name:r visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:r type:R of .CR visibility:private [final] - EXPRESSION_BODY - GET_VAR 'r: R of .CR declared in .CR.' type=R of .CR origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.CR.CR>) returnType:R of .CR - correspondingProperty: PROPERTY name:r visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.CR.CR> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): R of .CR declared in .CR' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:r type:R of .CR visibility:private [final]' type=R of .CR origin=null - receiver: GET_VAR ': .CR.CR> declared in .CR.' type=.CR.CR> origin=null - FUN name:foo visibility:public modality:OPEN <> ($this:.CR.CR>) returnType:R of .CR - overridden: - public abstract fun foo (): R of .IR declared in .IR - $this: VALUE_PARAMETER name: type:.CR.CR> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): R of .CR declared in .CR' - CALL 'public final fun (): R of .CR declared in .CR' type=R of .CR origin=GET_PROPERTY - $this: GET_VAR ': .CR.CR> declared in .CR.foo' type=.CR.CR> 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 .IR - $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 .IR - $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 .IR - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.P.P, P2 of .P> - TYPE_PARAMETER name:P1 index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:P2 index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (p1:P1 of .P, p2:P2 of .P) returnType:.P.P, P2 of .P> [primary] - VALUE_PARAMETER name:p1 index:0 type:P1 of .P - VALUE_PARAMETER name:p2 index:1 type:P2 of .P - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:p1 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:p1 type:P1 of .P visibility:private [final] - EXPRESSION_BODY - GET_VAR 'p1: P1 of .P declared in .P.' type=P1 of .P origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.P.P, P2 of .P>) returnType:P1 of .P - correspondingProperty: PROPERTY name:p1 visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.P.P, P2 of .P> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): P1 of .P declared in .P' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p1 type:P1 of .P visibility:private [final]' type=P1 of .P origin=null - receiver: GET_VAR ': .P.P, P2 of .P> declared in .P.' type=.P.P, P2 of .P> origin=null - PROPERTY name:p2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:p2 type:P2 of .P visibility:private [final] - EXPRESSION_BODY - GET_VAR 'p2: P2 of .P declared in .P.' type=P2 of .P origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.P.P, P2 of .P>) returnType:P2 of .P - correspondingProperty: PROPERTY name:p2 visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.P.P, P2 of .P> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): P2 of .P declared in .P' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p2 type:P2 of .P visibility:private [final]' type=P2 of .P origin=null - receiver: GET_VAR ': .P.P, P2 of .P> declared in .P.' type=.P.P, P2 of .P> 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: 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 - PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate..> visibility:private [final,static] - EXPRESSION_BODY - BLOCK type=.additionalText$delegate..> origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, .P>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..> - CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, .P>]' - FUN name:qux11 visibility:public modality:FINAL ($this:.additionalText$delegate..>, t:F11T of .additionalText$delegate..qux11) returnType:F11T of .additionalText$delegate..qux11 - TYPE_PARAMETER name:F11T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.additionalText$delegate..> - VALUE_PARAMETER name:t index:0 type:F11T of .additionalText$delegate..qux11 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun qux11 (t: F11T of .additionalText$delegate..qux11): F11T of .additionalText$delegate..qux11 declared in .additionalText$delegate.' - GET_VAR 't: F11T of .additionalText$delegate..qux11 declared in .additionalText$delegate..qux11' type=F11T of .additionalText$delegate..qux11 origin=null - FUN name:qux12 visibility:public modality:FINAL ($this:.additionalText$delegate..>, t:F12T of .additionalText$delegate..qux12) returnType:kotlin.Any? - TYPE_PARAMETER name:F12T index:0 variance: superTypes:[.IR] reified:false - $this: VALUE_PARAMETER name: type:.additionalText$delegate..> - VALUE_PARAMETER name:t index:0 type:F12T of .additionalText$delegate..qux12 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun qux12 (t: F12T of .additionalText$delegate..qux12): kotlin.Any? declared in .additionalText$delegate.' - CALL 'public abstract fun foo (): R of .IR declared in .IR' type=kotlin.Any? origin=null - $this: GET_VAR 't: F12T of .additionalText$delegate..qux12 declared in .additionalText$delegate..qux12' type=F12T of .additionalText$delegate..qux12 origin=null - PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final] - EXPRESSION_BODY - BLOCK type=.additionalText$delegate..deepO$delegate..> origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepO$delegate..> - CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..deepO$delegate. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>]' - FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate..deepO$delegate..>, t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] - overridden: - public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 declared in .IDelegate1 - $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate..> - VALUE_PARAMETER name:t index:0 type:.Value.CR> - VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' - CALL 'public final fun (): T of .Value declared in .Value' type=kotlin.Any? origin=GET_PROPERTY - $this: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..deepO$delegate..getValue' type=.Value.CR> origin=null - FUN name:qux21 visibility:public modality:FINAL ($this:.additionalText$delegate..deepO$delegate..>, t:F21T of .additionalText$delegate..deepO$delegate..qux21) returnType:F21T of .additionalText$delegate..deepO$delegate..qux21 - TYPE_PARAMETER name:F21T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate..> - VALUE_PARAMETER name:t index:0 type:F21T of .additionalText$delegate..deepO$delegate..qux21 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun qux21 (t: F21T of .additionalText$delegate..deepO$delegate..qux21): F21T of .additionalText$delegate..deepO$delegate..qux21 declared in .additionalText$delegate..deepO$delegate.' - GET_VAR 't: F21T of .additionalText$delegate..deepO$delegate..qux21 declared in .additionalText$delegate..deepO$delegate..qux21' type=F21T of .additionalText$delegate..deepO$delegate..qux21 origin=null - FUN name:qux22 visibility:public modality:FINAL ($this:.additionalText$delegate..deepO$delegate..>, t:F22T of .additionalText$delegate..deepO$delegate..qux22) returnType:kotlin.Any? - TYPE_PARAMETER name:F22T index:0 variance: superTypes:[.IR] reified:false - $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate..> - VALUE_PARAMETER name:t index:0 type:F22T of .additionalText$delegate..deepO$delegate..qux22 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun qux22 (t: F22T of .additionalText$delegate..deepO$delegate..qux22): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' - CALL 'public abstract fun foo (): R of .IR declared in .IR' type=kotlin.Any? origin=null - $this: GET_VAR 't: F22T of .additionalText$delegate..deepO$delegate..qux22 declared in .additionalText$delegate..deepO$delegate..qux22' type=F22T of .additionalText$delegate..deepO$delegate..qux22 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 .IDelegate1 - $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 .IDelegate1 - $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 .IDelegate1 - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .additionalText$delegate..deepO$delegate.' type=.additionalText$delegate..deepO$delegate..> origin=OBJECT_LITERAL - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.additionalText$delegate..>, $receiver:.Value.CR>) returnType:kotlin.Any? - correspondingProperty: PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] - $this: VALUE_PARAMETER name: type:.additionalText$delegate..> - $receiver: VALUE_PARAMETER name: type:.Value.CR> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Any? declared in .additionalText$delegate.' - CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' type=kotlin.Any? origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final]' type=.additionalText$delegate..deepO$delegate. origin=null - receiver: TYPE_OP type=.additionalText$delegate. origin=IMPLICIT_CAST typeOperand=.additionalText$delegate. - GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..' type=.additionalText$delegate..> origin=null - t: GET_VAR ': .Value.CR> declared in .additionalText$delegate..' type=.Value.CR> origin=null - p: PROPERTY_REFERENCE 'private final deepO: kotlin.Any?' field=null getter='private final fun (): kotlin.Any? declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value.CR>, *, kotlin.Any?> origin=PROPERTY_REFERENCE_FOR_DELEGATE - PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final] - EXPRESSION_BODY - BLOCK type=.additionalText$delegate..deepK$delegate..> origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepK$delegate..> - CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..deepK$delegate. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>]' - FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate..deepK$delegate..>, t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] - overridden: - public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 declared in .IDelegate1 - $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepK$delegate..> - VALUE_PARAMETER name:t index:0 type:.Value.CR> - VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepK$delegate.' - CALL 'public open fun foo (): R of .CR declared in .CR' type=kotlin.Any? origin=null - $this: CALL 'public final fun (): IT of .Value declared in .Value' type=.CR origin=GET_PROPERTY - $this: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..deepK$delegate..getValue' type=.Value.CR> 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 .IDelegate1 - $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 .IDelegate1 - $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 .IDelegate1 - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .additionalText$delegate..deepK$delegate.' type=.additionalText$delegate..deepK$delegate..> origin=OBJECT_LITERAL - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.additionalText$delegate..>, $receiver:.Value.CR>) returnType:kotlin.Any? - correspondingProperty: PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] - $this: VALUE_PARAMETER name: type:.additionalText$delegate..> - $receiver: VALUE_PARAMETER name: type:.Value.CR> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Any? declared in .additionalText$delegate.' - CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepK$delegate.' type=kotlin.Any? origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final]' type=.additionalText$delegate..deepK$delegate. origin=null - receiver: TYPE_OP type=.additionalText$delegate. origin=IMPLICIT_CAST typeOperand=.additionalText$delegate. - GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..' type=.additionalText$delegate..> origin=null - t: GET_VAR ': .Value.CR> declared in .additionalText$delegate..' type=.Value.CR> origin=null - p: PROPERTY_REFERENCE 'private final deepK: kotlin.Any?' field=null getter='private final fun (): kotlin.Any? declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value.CR>, *, kotlin.Any?> origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate..>, t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:.P [operator] - overridden: - public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 declared in .IDelegate1 - $this: VALUE_PARAMETER name: type:.additionalText$delegate..> - VALUE_PARAMETER name:t index:0 type:.Value.CR> - VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): .P declared in .additionalText$delegate.' - CONSTRUCTOR_CALL 'public constructor (p1: P1 of .P, p2: P2 of .P) declared in .P' type=.P origin=null - : kotlin.Any? - : kotlin.Any? - p1: CALL 'private final fun (): kotlin.Any? declared in .additionalText$delegate.' type=kotlin.Any? origin=GET_PROPERTY - $this: TYPE_OP type=.additionalText$delegate. origin=IMPLICIT_CAST typeOperand=.additionalText$delegate. - GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..getValue' type=.additionalText$delegate..> origin=null - $receiver: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..getValue' type=.Value.CR> origin=null - p2: CALL 'private final fun (): kotlin.Any? declared in .additionalText$delegate.' type=kotlin.Any? origin=GET_PROPERTY - $this: TYPE_OP type=.additionalText$delegate. origin=IMPLICIT_CAST typeOperand=.additionalText$delegate. - GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..getValue' type=.additionalText$delegate..> origin=null - $receiver: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..getValue' type=.Value.CR> 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 .IDelegate1 - $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 .IDelegate1 - $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 .IDelegate1 - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .additionalText$delegate.' type=.additionalText$delegate..> origin=OBJECT_LITERAL - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value., .CR.>>) returnType:.P., T of .> - correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Value., .CR.>> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .P., T of .> declared in ' - CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): .P declared in .additionalText$delegate.' type=.P., T of .> origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate..> visibility:private [final,static]' type=.additionalText$delegate..> origin=null - t: GET_VAR ': .Value., .CR.>> declared in .' type=.Value., .CR.>> origin=null - p: PROPERTY_REFERENCE 'public final additionalText: .P., T of .>' field=null getter='public final fun (): .P., T of .> declared in ' setter=null type=kotlin.reflect.KProperty1<.Value., .CR.>>, .P., T of .>> origin=PROPERTY_REFERENCE_FOR_DELEGATE - <1>: T of . diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.kt.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.kt.txt index d60911f1e11..2baf3726f2b 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.kt.txt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.kt.txt @@ -1,87 +1,6 @@ -class Value> { - constructor(value1: T, value2: IT) /* primary */ { - super/*Any*/() - /* () */ - - } - - var value1: T - field = value1 - get - set - - val value2: IT - field = value2 - get - -} - -interface IDelegate1 { - abstract operator fun getValue(t: T1, p: KProperty<*>): R1 - -} - -interface IDelegate2 { - abstract operator fun getValue(t: T2, p: KProperty<*>): R2 - -} - -interface IR { - abstract fun foo(): R - -} - -class CR : IR { - constructor(r: R) /* primary */ { - super/*Any*/() - /* () */ - - } - - val r: R - field = r - get - - override fun foo(): R { - return .() - } - -} - -class P { - constructor(p1: P1, p2: P2) /* primary */ { - super/*Any*/() - /* () */ - - } - - val p1: P1 - field = p1 - get - - val p2: P2 - field = p2 - get - -} - val Value>.additionalText: P /* by */ field = { // BLOCK local class : IDelegate1>, P> { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun qux11(t: F11T): F11T { - return t - } - - fun > qux12(t: F12T): Any? { - return t.foo() - } - private val Value>.deepO: Any? /* by */ field = { // BLOCK local class : IDelegate1>, Any?> { @@ -132,10 +51,24 @@ val Value>.additionalText: P /* by */ return /*as */.#deepK$delegate.getValue(t = , p = ::deepK) } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + override operator fun getValue(t: Value>, p: KProperty<*>): P { return P(p1 = ( /*as */, t).(), p2 = ( /*as */, t).()) } + fun qux11(t: F11T): F11T { + return t + } + + fun > qux12(t: F12T): Any? { + return t.foo() + } + } () @@ -144,3 +77,70 @@ val Value>.additionalText: P /* by */ return #additionalText$delegate.getValue(t = , p = ::additionalText/*()*/) } +class CR : IR { + val r: R + field = r + get + + constructor(r: R) /* primary */ { + super/*Any*/() + /* () */ + + } + + override fun foo(): R { + return .() + } + +} + +class P { + val p1: P1 + field = p1 + get + + val p2: P2 + field = p2 + get + + constructor(p1: P1, p2: P2) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class Value> { + var value1: T + field = value1 + get + set + + val value2: IT + field = value2 + get + + constructor(value1: T, value2: IT) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface IDelegate1 { + abstract operator fun getValue(t: T1, p: KProperty<*>): R1 + +} + +interface IDelegate2 { + abstract operator fun getValue(t: T2, p: KProperty<*>): R2 + +} + +interface IR { + abstract fun foo(): R + +} + diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.ir.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.ir.txt index 6b7137ceef9..27cb8199f01 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.ir.txt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.ir.txt @@ -1,14 +1,274 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt + PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate. visibility:private [final,static] + EXPRESSION_BODY + BLOCK type=.additionalText$delegate. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, .P>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate. + PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final] + EXPRESSION_BODY + BLOCK type=.additionalText$delegate..deepO$delegate. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepO$delegate. + CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..deepO$delegate. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, 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 declared in .IDelegate1 + $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 .IDelegate1 + $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 .IDelegate1 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate..deepO$delegate., t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] + overridden: + public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 declared in .IDelegate1 + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate. + VALUE_PARAMETER name:t index:0 type:.Value.CR> + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'public final fun (): T of .Value declared in .Value' type=kotlin.Any? origin=GET_PROPERTY + $this: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..deepO$delegate..getValue' type=.Value.CR> origin=null + FUN name:qux21 visibility:public modality:FINAL ($this:.additionalText$delegate..deepO$delegate., t:F21T of .additionalText$delegate..deepO$delegate..qux21) returnType:F21T of .additionalText$delegate..deepO$delegate..qux21 + TYPE_PARAMETER name:F21T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate. + VALUE_PARAMETER name:t index:0 type:F21T of .additionalText$delegate..deepO$delegate..qux21 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux21 (t: F21T of .additionalText$delegate..deepO$delegate..qux21): F21T of .additionalText$delegate..deepO$delegate..qux21 declared in .additionalText$delegate..deepO$delegate.' + GET_VAR 't: F21T of .additionalText$delegate..deepO$delegate..qux21 declared in .additionalText$delegate..deepO$delegate..qux21' type=F21T of .additionalText$delegate..deepO$delegate..qux21 origin=null + FUN name:qux22 visibility:public modality:FINAL ($this:.additionalText$delegate..deepO$delegate., t:F22T of .additionalText$delegate..deepO$delegate..qux22) returnType:kotlin.Any? + TYPE_PARAMETER name:F22T index:0 variance: superTypes:[.IR] reified:false + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate. + VALUE_PARAMETER name:t index:0 type:F22T of .additionalText$delegate..deepO$delegate..qux22 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux22 (t: F22T of .additionalText$delegate..deepO$delegate..qux22): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'public abstract fun foo (): R of .IR declared in .IR' type=kotlin.Any? origin=null + $this: GET_VAR 't: F22T of .additionalText$delegate..deepO$delegate..qux22 declared in .additionalText$delegate..deepO$delegate..qux22' type=F22T of .additionalText$delegate..deepO$delegate..qux22 origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .additionalText$delegate..deepO$delegate.' type=.additionalText$delegate..deepO$delegate. origin=OBJECT_LITERAL + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.additionalText$delegate., $receiver:.Value.CR>) returnType:kotlin.Any? + correspondingProperty: PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + $receiver: VALUE_PARAMETER name: type:.Value.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Any? declared in .additionalText$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' type=kotlin.Any? origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final]' type=.additionalText$delegate..deepO$delegate. origin=null + receiver: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..' type=.additionalText$delegate. origin=null + t: GET_VAR ': .Value.CR> declared in .additionalText$delegate..' type=.Value.CR> origin=null + p: PROPERTY_REFERENCE 'private final deepO: kotlin.Any?' field=null getter='private final fun (): kotlin.Any? declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value.CR>, .additionalText$delegate., kotlin.Any?> origin=PROPERTY_REFERENCE_FOR_DELEGATE + PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final] + EXPRESSION_BODY + BLOCK type=.additionalText$delegate..deepK$delegate. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepK$delegate. + CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..deepK$delegate. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, 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 declared in .IDelegate1 + $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 .IDelegate1 + $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 .IDelegate1 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate..deepK$delegate., t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] + overridden: + public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 declared in .IDelegate1 + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepK$delegate. + VALUE_PARAMETER name:t index:0 type:.Value.CR> + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepK$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'public open fun foo (): R of .CR declared in .CR' type=kotlin.Any? origin=null + $this: CALL 'public final fun (): IT of .Value declared in .Value' type=.CR origin=GET_PROPERTY + $this: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..deepK$delegate..getValue' type=.Value.CR> origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .additionalText$delegate..deepK$delegate.' type=.additionalText$delegate..deepK$delegate. origin=OBJECT_LITERAL + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.additionalText$delegate., $receiver:.Value.CR>) returnType:kotlin.Any? + correspondingProperty: PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + $receiver: VALUE_PARAMETER name: type:.Value.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Any? declared in .additionalText$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepK$delegate.' type=kotlin.Any? origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final]' type=.additionalText$delegate..deepK$delegate. origin=null + receiver: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..' type=.additionalText$delegate. origin=null + t: GET_VAR ': .Value.CR> declared in .additionalText$delegate..' type=.Value.CR> origin=null + p: PROPERTY_REFERENCE 'private final deepK: kotlin.Any?' field=null getter='private final fun (): kotlin.Any? declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value.CR>, .additionalText$delegate., kotlin.Any?> origin=PROPERTY_REFERENCE_FOR_DELEGATE + CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, .P>]' + 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 .IDelegate1 + $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 .IDelegate1 + $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 .IDelegate1 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate., t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:.P [operator] + overridden: + public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 declared in .IDelegate1 + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + VALUE_PARAMETER name:t index:0 type:.Value.CR> + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): .P declared in .additionalText$delegate.' + CONSTRUCTOR_CALL 'public constructor (p1: P1 of .P, p2: P2 of .P) declared in .P' type=.P origin=null + : kotlin.Any? + : kotlin.Any? + p1: TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'private final fun (): kotlin.Any? declared in .additionalText$delegate.' type=kotlin.Any? origin=GET_PROPERTY + $this: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..getValue' type=.additionalText$delegate. origin=null + $receiver: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..getValue' type=.Value.CR> origin=null + p2: TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'private final fun (): kotlin.Any? declared in .additionalText$delegate.' type=kotlin.Any? origin=GET_PROPERTY + $this: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..getValue' type=.additionalText$delegate. origin=null + $receiver: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..getValue' type=.Value.CR> origin=null + FUN name:qux11 visibility:public modality:FINAL ($this:.additionalText$delegate., t:F11T of .additionalText$delegate..qux11) returnType:F11T of .additionalText$delegate..qux11 + TYPE_PARAMETER name:F11T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + VALUE_PARAMETER name:t index:0 type:F11T of .additionalText$delegate..qux11 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux11 (t: F11T of .additionalText$delegate..qux11): F11T of .additionalText$delegate..qux11 declared in .additionalText$delegate.' + GET_VAR 't: F11T of .additionalText$delegate..qux11 declared in .additionalText$delegate..qux11' type=F11T of .additionalText$delegate..qux11 origin=null + FUN name:qux12 visibility:public modality:FINAL ($this:.additionalText$delegate., t:F12T of .additionalText$delegate..qux12) returnType:kotlin.Any? + TYPE_PARAMETER name:F12T index:0 variance: superTypes:[.IR] reified:false + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + VALUE_PARAMETER name:t index:0 type:F12T of .additionalText$delegate..qux12 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux12 (t: F12T of .additionalText$delegate..qux12): kotlin.Any? declared in .additionalText$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'public abstract fun foo (): R of .IR declared in .IR' type=kotlin.Any? origin=null + $this: GET_VAR 't: F12T of .additionalText$delegate..qux12 declared in .additionalText$delegate..qux12' type=F12T of .additionalText$delegate..qux12 origin=null + CONSTRUCTOR_CALL 'public constructor () declared in .additionalText$delegate.' type=.additionalText$delegate. origin=OBJECT_LITERAL + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value., .CR.>>) returnType:.P., T of .> + correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Value., .CR.>> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .P., T of .> declared in ' + CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): .P declared in .additionalText$delegate.' type=.P., T of .> origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate. visibility:private [final,static]' type=.additionalText$delegate. origin=null + t: GET_VAR ': .Value., .CR.>> declared in .' type=.Value., .CR.>> origin=null + p: PROPERTY_REFERENCE 'public final additionalText: .P., T of .>' field=null getter='public final fun (): .P., T of .> declared in ' setter=null type=kotlin.reflect.KProperty1<.Value., .CR.>>, .P., T of .>> origin=PROPERTY_REFERENCE_FOR_DELEGATE + <1>: T of . + CLASS CLASS name:CR modality:FINAL visibility:public superTypes:[.IR.CR>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CR.CR> + TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:r visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:r type:R of .CR visibility:private [final] + EXPRESSION_BODY + GET_VAR 'r: R of .CR declared in .CR.' type=R of .CR origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.CR.CR>) returnType:R of .CR + correspondingProperty: PROPERTY name:r visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.CR.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): R of .CR declared in .CR' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:r type:R of .CR visibility:private [final]' type=R of .CR origin=null + receiver: GET_VAR ': .CR.CR> declared in .CR.' type=.CR.CR> origin=null + CONSTRUCTOR visibility:public <> (r:R of .CR) returnType:.CR.CR> [primary] + VALUE_PARAMETER name:r index:0 type:R of .CR + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CR modality:FINAL visibility:public superTypes:[.IR.CR>]' + 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 .IR + $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 .IR + $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 .IR + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.CR.CR>) returnType:R of .CR + overridden: + public abstract fun foo (): R of .IR declared in .IR + $this: VALUE_PARAMETER name: type:.CR.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): R of .CR declared in .CR' + CALL 'public final fun (): R of .CR declared in .CR' type=R of .CR origin=GET_PROPERTY + $this: GET_VAR ': .CR.CR> declared in .CR.foo' type=.CR.CR> origin=null + CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.P.P, P2 of .P> + TYPE_PARAMETER name:P1 index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:P2 index:1 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:p1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p1 type:P1 of .P visibility:private [final] + EXPRESSION_BODY + GET_VAR 'p1: P1 of .P declared in .P.' type=P1 of .P origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.P.P, P2 of .P>) returnType:P1 of .P + correspondingProperty: PROPERTY name:p1 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.P.P, P2 of .P> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): P1 of .P declared in .P' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p1 type:P1 of .P visibility:private [final]' type=P1 of .P origin=null + receiver: GET_VAR ': .P.P, P2 of .P> declared in .P.' type=.P.P, P2 of .P> origin=null + PROPERTY name:p2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p2 type:P2 of .P visibility:private [final] + EXPRESSION_BODY + GET_VAR 'p2: P2 of .P declared in .P.' type=P2 of .P origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.P.P, P2 of .P>) returnType:P2 of .P + correspondingProperty: PROPERTY name:p2 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.P.P, P2 of .P> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): P2 of .P declared in .P' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p2 type:P2 of .P visibility:private [final]' type=P2 of .P origin=null + receiver: GET_VAR ': .P.P, P2 of .P> declared in .P.' type=.P.P, P2 of .P> origin=null + CONSTRUCTOR visibility:public <> (p1:P1 of .P, p2:P2 of .P) returnType:.P.P, P2 of .P> [primary] + VALUE_PARAMETER name:p1 index:0 type:P1 of .P + VALUE_PARAMETER name:p2 index:1 type:P2 of .P + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public 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 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 CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Value.Value, IT of .Value> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:IT index:1 variance: superTypes:[.IR.Value>] reified:false - CONSTRUCTOR visibility:public <> (value1:T of .Value, value2:IT of .Value) returnType:.Value.Value, IT of .Value> [primary] - VALUE_PARAMETER name:value1 index:0 type:T of .Value - VALUE_PARAMETER name:value2 index:1 type:IT of .Value - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value1 visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:value1 type:T of .Value visibility:private EXPRESSION_BODY @@ -39,6 +299,12 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt RETURN type=kotlin.Nothing from='public final fun (): IT of .Value declared in .Value' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:IT of .Value visibility:private [final]' type=IT of .Value origin=null receiver: GET_VAR ': .Value.Value, IT of .Value> declared in .Value.' type=.Value.Value, IT of .Value> origin=null + CONSTRUCTOR visibility:public <> (value1:T of .Value, value2:IT of .Value) returnType:.Value.Value, IT of .Value> [primary] + VALUE_PARAMETER name:value1 index:0 type:T of .Value + VALUE_PARAMETER name:value2 index:1 type:IT of .Value + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Value modality:FINAL visibility:public 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 declared in kotlin.Any @@ -56,325 +322,59 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IDelegate1.IDelegate1, R1 of .IDelegate1> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:R1 index:1 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:getValue visibility:public modality:ABSTRACT <> ($this:.IDelegate1.IDelegate1, R1 of .IDelegate1>, t:T1 of .IDelegate1, p:kotlin.reflect.KProperty<*>) returnType:R1 of .IDelegate1 [operator] $this: VALUE_PARAMETER name: type:.IDelegate1.IDelegate1, R1 of .IDelegate1> VALUE_PARAMETER name:t index:0 type:T1 of .IDelegate1 VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - 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: 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 CLASS INTERFACE name:IDelegate2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IDelegate2.IDelegate2, R2 of .IDelegate2> TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:R2 index:1 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:getValue visibility:public modality:ABSTRACT <> ($this:.IDelegate2.IDelegate2, R2 of .IDelegate2>, t:T2 of .IDelegate2, p:kotlin.reflect.KProperty<*>) returnType:R2 of .IDelegate2 [operator] $this: VALUE_PARAMETER name: type:.IDelegate2.IDelegate2, R2 of .IDelegate2> VALUE_PARAMETER name:t index:0 type:T2 of .IDelegate2 VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - 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: 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 CLASS INTERFACE name:IR modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IR.IR> TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.IR.IR>) returnType:R of .IR $this: VALUE_PARAMETER name: type:.IR.IR> - 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: 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 - CLASS CLASS name:CR modality:FINAL visibility:public superTypes:[.IR.CR>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CR.CR> - TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (r:R of .CR) returnType:.CR.CR> [primary] - VALUE_PARAMETER name:r index:0 type:R of .CR - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CR modality:FINAL visibility:public superTypes:[.IR.CR>]' - PROPERTY name:r visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:r type:R of .CR visibility:private [final] - EXPRESSION_BODY - GET_VAR 'r: R of .CR declared in .CR.' type=R of .CR origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.CR.CR>) returnType:R of .CR - correspondingProperty: PROPERTY name:r visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.CR.CR> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): R of .CR declared in .CR' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:r type:R of .CR visibility:private [final]' type=R of .CR origin=null - receiver: GET_VAR ': .CR.CR> declared in .CR.' type=.CR.CR> origin=null - FUN name:foo visibility:public modality:OPEN <> ($this:.CR.CR>) returnType:R of .CR - overridden: - public abstract fun foo (): R of .IR declared in .IR - $this: VALUE_PARAMETER name: type:.CR.CR> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): R of .CR declared in .CR' - CALL 'public final fun (): R of .CR declared in .CR' type=R of .CR origin=GET_PROPERTY - $this: GET_VAR ': .CR.CR> declared in .CR.foo' type=.CR.CR> 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 .IR - $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 .IR - $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 .IR - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.P.P, P2 of .P> - TYPE_PARAMETER name:P1 index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:P2 index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (p1:P1 of .P, p2:P2 of .P) returnType:.P.P, P2 of .P> [primary] - VALUE_PARAMETER name:p1 index:0 type:P1 of .P - VALUE_PARAMETER name:p2 index:1 type:P2 of .P - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:p1 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:p1 type:P1 of .P visibility:private [final] - EXPRESSION_BODY - GET_VAR 'p1: P1 of .P declared in .P.' type=P1 of .P origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.P.P, P2 of .P>) returnType:P1 of .P - correspondingProperty: PROPERTY name:p1 visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.P.P, P2 of .P> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): P1 of .P declared in .P' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p1 type:P1 of .P visibility:private [final]' type=P1 of .P origin=null - receiver: GET_VAR ': .P.P, P2 of .P> declared in .P.' type=.P.P, P2 of .P> origin=null - PROPERTY name:p2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:p2 type:P2 of .P visibility:private [final] - EXPRESSION_BODY - GET_VAR 'p2: P2 of .P declared in .P.' type=P2 of .P origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.P.P, P2 of .P>) returnType:P2 of .P - correspondingProperty: PROPERTY name:p2 visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.P.P, P2 of .P> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): P2 of .P declared in .P' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p2 type:P2 of .P visibility:private [final]' type=P2 of .P origin=null - receiver: GET_VAR ': .P.P, P2 of .P> declared in .P.' type=.P.P, P2 of .P> 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: 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 - PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate. visibility:private [final,static] - EXPRESSION_BODY - BLOCK type=.additionalText$delegate. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, .P>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate. - CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, .P>]' - FUN name:qux11 visibility:public modality:FINAL ($this:.additionalText$delegate., t:F11T of .additionalText$delegate..qux11) returnType:F11T of .additionalText$delegate..qux11 - TYPE_PARAMETER name:F11T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.additionalText$delegate. - VALUE_PARAMETER name:t index:0 type:F11T of .additionalText$delegate..qux11 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun qux11 (t: F11T of .additionalText$delegate..qux11): F11T of .additionalText$delegate..qux11 declared in .additionalText$delegate.' - GET_VAR 't: F11T of .additionalText$delegate..qux11 declared in .additionalText$delegate..qux11' type=F11T of .additionalText$delegate..qux11 origin=null - FUN name:qux12 visibility:public modality:FINAL ($this:.additionalText$delegate., t:F12T of .additionalText$delegate..qux12) returnType:kotlin.Any? - TYPE_PARAMETER name:F12T index:0 variance: superTypes:[.IR] reified:false - $this: VALUE_PARAMETER name: type:.additionalText$delegate. - VALUE_PARAMETER name:t index:0 type:F12T of .additionalText$delegate..qux12 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun qux12 (t: F12T of .additionalText$delegate..qux12): kotlin.Any? declared in .additionalText$delegate.' - TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? - CALL 'public abstract fun foo (): R of .IR declared in .IR' type=kotlin.Any? origin=null - $this: GET_VAR 't: F12T of .additionalText$delegate..qux12 declared in .additionalText$delegate..qux12' type=F12T of .additionalText$delegate..qux12 origin=null - PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final] - EXPRESSION_BODY - BLOCK type=.additionalText$delegate..deepO$delegate. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepO$delegate. - CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..deepO$delegate. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>]' - FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate..deepO$delegate., t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] - overridden: - public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 declared in .IDelegate1 - $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate. - VALUE_PARAMETER name:t index:0 type:.Value.CR> - VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' - TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? - CALL 'public final fun (): T of .Value declared in .Value' type=kotlin.Any? origin=GET_PROPERTY - $this: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..deepO$delegate..getValue' type=.Value.CR> origin=null - FUN name:qux21 visibility:public modality:FINAL ($this:.additionalText$delegate..deepO$delegate., t:F21T of .additionalText$delegate..deepO$delegate..qux21) returnType:F21T of .additionalText$delegate..deepO$delegate..qux21 - TYPE_PARAMETER name:F21T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate. - VALUE_PARAMETER name:t index:0 type:F21T of .additionalText$delegate..deepO$delegate..qux21 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun qux21 (t: F21T of .additionalText$delegate..deepO$delegate..qux21): F21T of .additionalText$delegate..deepO$delegate..qux21 declared in .additionalText$delegate..deepO$delegate.' - GET_VAR 't: F21T of .additionalText$delegate..deepO$delegate..qux21 declared in .additionalText$delegate..deepO$delegate..qux21' type=F21T of .additionalText$delegate..deepO$delegate..qux21 origin=null - FUN name:qux22 visibility:public modality:FINAL ($this:.additionalText$delegate..deepO$delegate., t:F22T of .additionalText$delegate..deepO$delegate..qux22) returnType:kotlin.Any? - TYPE_PARAMETER name:F22T index:0 variance: superTypes:[.IR] reified:false - $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate. - VALUE_PARAMETER name:t index:0 type:F22T of .additionalText$delegate..deepO$delegate..qux22 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun qux22 (t: F22T of .additionalText$delegate..deepO$delegate..qux22): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' - TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? - CALL 'public abstract fun foo (): R of .IR declared in .IR' type=kotlin.Any? origin=null - $this: GET_VAR 't: F22T of .additionalText$delegate..deepO$delegate..qux22 declared in .additionalText$delegate..deepO$delegate..qux22' type=F22T of .additionalText$delegate..deepO$delegate..qux22 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 .IDelegate1 - $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 .IDelegate1 - $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 .IDelegate1 - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .additionalText$delegate..deepO$delegate.' type=.additionalText$delegate..deepO$delegate. origin=OBJECT_LITERAL - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.additionalText$delegate., $receiver:.Value.CR>) returnType:kotlin.Any? - correspondingProperty: PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] - $this: VALUE_PARAMETER name: type:.additionalText$delegate. - $receiver: VALUE_PARAMETER name: type:.Value.CR> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Any? declared in .additionalText$delegate.' - TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? - CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' type=kotlin.Any? origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final]' type=.additionalText$delegate..deepO$delegate. origin=null - receiver: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..' type=.additionalText$delegate. origin=null - t: GET_VAR ': .Value.CR> declared in .additionalText$delegate..' type=.Value.CR> origin=null - p: PROPERTY_REFERENCE 'private final deepO: kotlin.Any?' field=null getter='private final fun (): kotlin.Any? declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value.CR>, .additionalText$delegate., kotlin.Any?> origin=PROPERTY_REFERENCE_FOR_DELEGATE - PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final] - EXPRESSION_BODY - BLOCK type=.additionalText$delegate..deepK$delegate. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepK$delegate. - CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..deepK$delegate. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>]' - FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate..deepK$delegate., t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] - overridden: - public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 declared in .IDelegate1 - $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepK$delegate. - VALUE_PARAMETER name:t index:0 type:.Value.CR> - VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepK$delegate.' - TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? - CALL 'public open fun foo (): R of .CR declared in .CR' type=kotlin.Any? origin=null - $this: CALL 'public final fun (): IT of .Value declared in .Value' type=.CR origin=GET_PROPERTY - $this: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..deepK$delegate..getValue' type=.Value.CR> 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 .IDelegate1 - $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 .IDelegate1 - $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 .IDelegate1 - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .additionalText$delegate..deepK$delegate.' type=.additionalText$delegate..deepK$delegate. origin=OBJECT_LITERAL - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.additionalText$delegate., $receiver:.Value.CR>) returnType:kotlin.Any? - correspondingProperty: PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] - $this: VALUE_PARAMETER name: type:.additionalText$delegate. - $receiver: VALUE_PARAMETER name: type:.Value.CR> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Any? declared in .additionalText$delegate.' - TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? - CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? declared in .additionalText$delegate..deepK$delegate.' type=kotlin.Any? origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final]' type=.additionalText$delegate..deepK$delegate. origin=null - receiver: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..' type=.additionalText$delegate. origin=null - t: GET_VAR ': .Value.CR> declared in .additionalText$delegate..' type=.Value.CR> origin=null - p: PROPERTY_REFERENCE 'private final deepK: kotlin.Any?' field=null getter='private final fun (): kotlin.Any? declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value.CR>, .additionalText$delegate., kotlin.Any?> origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate., t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:.P [operator] - overridden: - public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 declared in .IDelegate1 - $this: VALUE_PARAMETER name: type:.additionalText$delegate. - VALUE_PARAMETER name:t index:0 type:.Value.CR> - VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): .P declared in .additionalText$delegate.' - CONSTRUCTOR_CALL 'public constructor (p1: P1 of .P, p2: P2 of .P) declared in .P' type=.P origin=null - : kotlin.Any? - : kotlin.Any? - p1: TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? - CALL 'private final fun (): kotlin.Any? declared in .additionalText$delegate.' type=kotlin.Any? origin=GET_PROPERTY - $this: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..getValue' type=.additionalText$delegate. origin=null - $receiver: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..getValue' type=.Value.CR> origin=null - p2: TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? - CALL 'private final fun (): kotlin.Any? declared in .additionalText$delegate.' type=kotlin.Any? origin=GET_PROPERTY - $this: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..getValue' type=.additionalText$delegate. origin=null - $receiver: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..getValue' type=.Value.CR> 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 .IDelegate1 - $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 .IDelegate1 - $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 .IDelegate1 - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .additionalText$delegate.' type=.additionalText$delegate. origin=OBJECT_LITERAL - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value., .CR.>>) returnType:.P., T of .> - correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.Value., .CR.>> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .P., T of .> declared in ' - CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): .P declared in .additionalText$delegate.' type=.P., T of .> origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate. visibility:private [final,static]' type=.additionalText$delegate. origin=null - t: GET_VAR ': .Value., .CR.>> declared in .' type=.Value., .CR.>> origin=null - p: PROPERTY_REFERENCE 'public final additionalText: .P., T of .>' field=null getter='public final fun (): .P., T of .> declared in ' setter=null type=kotlin.reflect.KProperty1<.Value., .CR.>>, .P., T of .>> origin=PROPERTY_REFERENCE_FOR_DELEGATE - <1>: T of . diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt.txt index f6ee5f05738..69ef6b740bb 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt.txt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt.txt @@ -1,87 +1,6 @@ -class Value> { - constructor(value1: T, value2: IT) /* primary */ { - super/*Any*/() - /* () */ - - } - - var value1: T - field = value1 - get - set - - val value2: IT - field = value2 - get - -} - -interface IDelegate1 { - abstract operator fun getValue(t: T1, p: KProperty<*>): R1 - -} - -interface IDelegate2 { - abstract operator fun getValue(t: T2, p: KProperty<*>): R2 - -} - -interface IR { - abstract fun foo(): R - -} - -class CR : IR { - constructor(r: R) /* primary */ { - super/*Any*/() - /* () */ - - } - - val r: R - field = r - get - - override fun foo(): R { - return .() - } - -} - -class P { - constructor(p1: P1, p2: P2) /* primary */ { - super/*Any*/() - /* () */ - - } - - val p1: P1 - field = p1 - get - - val p2: P2 - field = p2 - get - -} - val Value>.additionalText: P /* by */ field = { // BLOCK local class : IDelegate1>, P> { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun qux11(t: F11T): F11T { - return t - } - - fun > qux12(t: F12T): Any? { - return t.foo() /*as Any? */ - } - private val Value>.deepO: Any? /* by */ field = { // BLOCK local class : IDelegate1>, Any?> { @@ -132,10 +51,24 @@ val Value>.additionalText: P /* by */ return .#deepK$delegate.getValue(t = , p = ::deepK) /*as Any? */ } + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + override operator fun getValue(t: Value>, p: KProperty<*>): P { return P(p1 = (, t).() /*as Any? */, p2 = (, t).() /*as Any? */) } + fun qux11(t: F11T): F11T { + return t + } + + fun > qux12(t: F12T): Any? { + return t.foo() /*as Any? */ + } + } () @@ -143,3 +76,71 @@ val Value>.additionalText: P /* by */ get(): P { return #additionalText$delegate.getValue(t = , p = ::additionalText/*()*/) } + +class CR : IR { + val r: R + field = r + get + + constructor(r: R) /* primary */ { + super/*Any*/() + /* () */ + + } + + override fun foo(): R { + return .() + } + +} + +class P { + val p1: P1 + field = p1 + get + + val p2: P2 + field = p2 + get + + constructor(p1: P1, p2: P2) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class Value> { + var value1: T + field = value1 + get + set + + val value2: IT + field = value2 + get + + constructor(value1: T, value2: IT) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface IDelegate1 { + abstract operator fun getValue(t: T1, p: KProperty<*>): R1 + +} + +interface IDelegate2 { + abstract operator fun getValue(t: T2, p: KProperty<*>): R2 + +} + +interface IR { + abstract fun foo(): R + +} + diff --git a/compiler/testData/ir/irText/types/genericFunWithStar.fir.ir.txt b/compiler/testData/ir/irText/types/genericFunWithStar.fir.ir.txt index 0f086313436..b15a11693f6 100644 --- a/compiler/testData/ir/irText/types/genericFunWithStar.fir.ir.txt +++ b/compiler/testData/ir/irText/types/genericFunWithStar.fir.ir.txt @@ -1,4 +1,73 @@ FILE fqName: fileName:/genericFunWithStar.kt + CLASS CLASS name:Box modality:ABSTRACT visibility:public superTypes:[.IFoo; .IBar] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box.Box> + TYPE_PARAMETER name:T index:0 variance: superTypes:[.IFoo; .IBar] reified:false + CONSTRUCTOR visibility:public <> () returnType:.Box.Box> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box modality:ABSTRACT visibility:public superTypes:[.IFoo; .IBar]' + 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 .IFoo + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IBar + $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 .IFoo + public open fun hashCode (): kotlin.Int declared in .IBar + $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 .IFoo + public open fun toString (): kotlin.String declared in .IBar + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> ($this:.Box.Box>, serializers:kotlin.Array.I<*>>) returnType:.I<*> + $this: VALUE_PARAMETER name: type:.Box.Box> + VALUE_PARAMETER name:serializers index:0 type:kotlin.Array.I<*>> varargElementType:.I<*> [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (vararg serializers: .I<*>): .I<*> declared in .Box' + CALL 'public abstract fun foo (tSerializer: .I.Box.foo>): .I<.Box.Box.foo>> declared in .Box' type=.I.Box.IBase>> origin=null + : .IBase + $this: GET_VAR ': .Box.Box> declared in .Box.bar' type=.Box.Box> origin=null + tSerializer: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=.I<*> origin=GET_ARRAY_ELEMENT + $this: GET_VAR 'serializers: kotlin.Array.I<*>> declared in .Box.bar' type=kotlin.Array.I<*>> origin=null + index: CONST Int type=kotlin.Int value=0 + FUN name:foo visibility:public modality:ABSTRACT ($this:.Box.Box>, tSerializer:.I.Box.foo>) returnType:.I<.Box.Box.foo>> + TYPE_PARAMETER name:F index:0 variance: superTypes:[.IFoo; .IBar] reified:false + $this: VALUE_PARAMETER name: type:.Box.Box> + VALUE_PARAMETER name:tSerializer index:0 type:.I.Box.foo> + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> + TYPE_PARAMETER name:G index:0 variance: superTypes:[.IFoo; .IBar] reified:false + 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: 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 + CLASS INTERFACE name:IBar modality:ABSTRACT visibility:public superTypes:[.IBase] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBar + 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 .IBase + $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 .IBase + $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 .IBase + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -29,72 +98,3 @@ FILE fqName: fileName:/genericFunWithStar.kt overridden: public open fun toString (): kotlin.String declared in .IBase $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IBar modality:ABSTRACT visibility:public superTypes:[.IBase] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBar - 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 .IBase - $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 .IBase - $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 .IBase - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> - TYPE_PARAMETER name:G index:0 variance: superTypes:[.IFoo; .IBar] reified:false - 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: 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 - CLASS CLASS name:Box modality:ABSTRACT visibility:public superTypes:[.IFoo; .IBar] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box.Box> - TYPE_PARAMETER name:T index:0 variance: superTypes:[.IFoo; .IBar] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Box.Box> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box modality:ABSTRACT visibility:public superTypes:[.IFoo; .IBar]' - FUN name:foo visibility:public modality:ABSTRACT ($this:.Box.Box>, tSerializer:.I.Box.foo>) returnType:.I<.Box.Box.foo>> - TYPE_PARAMETER name:F index:0 variance: superTypes:[.IFoo; .IBar] reified:false - $this: VALUE_PARAMETER name: type:.Box.Box> - VALUE_PARAMETER name:tSerializer index:0 type:.I.Box.foo> - FUN name:bar visibility:public modality:FINAL <> ($this:.Box.Box>, serializers:kotlin.Array.I<*>>) returnType:.I<*> - $this: VALUE_PARAMETER name: type:.Box.Box> - VALUE_PARAMETER name:serializers index:0 type:kotlin.Array.I<*>> varargElementType:.I<*> [vararg] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun bar (vararg serializers: .I<*>): .I<*> declared in .Box' - CALL 'public abstract fun foo (tSerializer: .I.Box.foo>): .I<.Box.Box.foo>> declared in .Box' type=.I.Box.IBase>> origin=null - : .IBase - $this: GET_VAR ': .Box.Box> declared in .Box.bar' type=.Box.Box> origin=null - tSerializer: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=.I<*> origin=GET_ARRAY_ELEMENT - $this: GET_VAR 'serializers: kotlin.Array.I<*>> declared in .Box.bar' type=kotlin.Array.I<*>> origin=null - index: CONST Int type=kotlin.Int value=0 - 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 .IFoo - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IBar - $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 .IFoo - public open fun hashCode (): kotlin.Int declared in .IBar - $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 .IFoo - public open fun toString (): kotlin.String declared in .IBar - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/types/genericFunWithStar.fir.kt.txt b/compiler/testData/ir/irText/types/genericFunWithStar.fir.kt.txt index 5bc8a393b34..dc6e9bb5d74 100644 --- a/compiler/testData/ir/irText/types/genericFunWithStar.fir.kt.txt +++ b/compiler/testData/ir/irText/types/genericFunWithStar.fir.kt.txt @@ -1,26 +1,27 @@ -interface IBase { -} - -interface IFoo : IBase { -} - -interface IBar : IBase { -} - -interface I where G : IFoo, G : IBar { -} - -abstract class Box : IFoo, IBar where T : IFoo, T : IBar { +abstract class Box : IBar, IFoo where T : IBar, T : IFoo { constructor() /* primary */ { super/*Any*/() /* () */ } - abstract fun foo(tSerializer: I): I> where F : IFoo, F : IBar - fun bar(vararg serializers: I<*>): I<*> { return .foo(tSerializer = serializers.get(index = 0)) } + abstract fun foo(tSerializer: I): I> where F : IBar, F : IFoo + } + +interface I where G : IBar, G : IFoo { +} + +interface IBar : IBase { +} + +interface IBase { +} + +interface IFoo : IBase { +} + diff --git a/compiler/testData/ir/irText/types/genericFunWithStar.ir.txt b/compiler/testData/ir/irText/types/genericFunWithStar.ir.txt index 8a5f129b338..30f2cc04ace 100644 --- a/compiler/testData/ir/irText/types/genericFunWithStar.ir.txt +++ b/compiler/testData/ir/irText/types/genericFunWithStar.ir.txt @@ -1,4 +1,73 @@ FILE fqName: fileName:/genericFunWithStar.kt + CLASS CLASS name:Box modality:ABSTRACT visibility:public superTypes:[.IFoo; .IBar] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box.Box> + TYPE_PARAMETER name:T index:0 variance: superTypes:[.IFoo; .IBar] reified:false + CONSTRUCTOR visibility:public <> () returnType:.Box.Box> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box modality:ABSTRACT visibility:public superTypes:[.IFoo; .IBar]' + 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 .IFoo + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IBar + $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 .IFoo + public open fun hashCode (): kotlin.Int declared in .IBar + $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 .IFoo + public open fun toString (): kotlin.String declared in .IBar + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> ($this:.Box.Box>, serializers:kotlin.Array.I<*>>) returnType:.I<*> + $this: VALUE_PARAMETER name: type:.Box.Box> + VALUE_PARAMETER name:serializers index:0 type:kotlin.Array.I<*>> varargElementType:.I<*> [vararg] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (vararg serializers: .I<*>): .I<*> declared in .Box' + CALL 'public abstract fun foo (tSerializer: .I.Box.foo>): .I<.Box.Box.foo>> declared in .Box' type=.I.Box<*>> origin=null + : .IBase + $this: GET_VAR ': .Box.Box> declared in .Box.bar' type=.Box.Box> origin=null + tSerializer: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=.I<*> origin=GET_ARRAY_ELEMENT + $this: GET_VAR 'serializers: kotlin.Array.I<*>> declared in .Box.bar' type=kotlin.Array.I<*>> origin=null + index: CONST Int type=kotlin.Int value=0 + FUN name:foo visibility:public modality:ABSTRACT ($this:.Box.Box>, tSerializer:.I.Box.foo>) returnType:.I<.Box.Box.foo>> + TYPE_PARAMETER name:F index:0 variance: superTypes:[.IFoo; .IBar] reified:false + $this: VALUE_PARAMETER name: type:.Box.Box> + VALUE_PARAMETER name:tSerializer index:0 type:.I.Box.foo> + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> + TYPE_PARAMETER name:G index:0 variance: superTypes:[.IFoo; .IBar] reified:false + 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: 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 + CLASS INTERFACE name:IBar modality:ABSTRACT visibility:public superTypes:[.IBase] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBar + 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 .IBase + $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 .IBase + $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 .IBase + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -29,72 +98,3 @@ FILE fqName: fileName:/genericFunWithStar.kt overridden: public open fun toString (): kotlin.String declared in .IBase $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IBar modality:ABSTRACT visibility:public superTypes:[.IBase] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBar - 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 .IBase - $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 .IBase - $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 .IBase - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I.I> - TYPE_PARAMETER name:G index:0 variance: superTypes:[.IFoo; .IBar] reified:false - 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: 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 - CLASS CLASS name:Box modality:ABSTRACT visibility:public superTypes:[.IFoo; .IBar] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box.Box> - TYPE_PARAMETER name:T index:0 variance: superTypes:[.IFoo; .IBar] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Box.Box> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box modality:ABSTRACT visibility:public superTypes:[.IFoo; .IBar]' - FUN name:foo visibility:public modality:ABSTRACT ($this:.Box.Box>, tSerializer:.I.Box.foo>) returnType:.I<.Box.Box.foo>> - TYPE_PARAMETER name:F index:0 variance: superTypes:[.IFoo; .IBar] reified:false - $this: VALUE_PARAMETER name: type:.Box.Box> - VALUE_PARAMETER name:tSerializer index:0 type:.I.Box.foo> - FUN name:bar visibility:public modality:FINAL <> ($this:.Box.Box>, serializers:kotlin.Array.I<*>>) returnType:.I<*> - $this: VALUE_PARAMETER name: type:.Box.Box> - VALUE_PARAMETER name:serializers index:0 type:kotlin.Array.I<*>> varargElementType:.I<*> [vararg] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun bar (vararg serializers: .I<*>): .I<*> declared in .Box' - CALL 'public abstract fun foo (tSerializer: .I.Box.foo>): .I<.Box.Box.foo>> declared in .Box' type=.I.Box<*>> origin=null - : .IBase - $this: GET_VAR ': .Box.Box> declared in .Box.bar' type=.Box.Box> origin=null - tSerializer: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=.I<*> origin=GET_ARRAY_ELEMENT - $this: GET_VAR 'serializers: kotlin.Array.I<*>> declared in .Box.bar' type=kotlin.Array.I<*>> origin=null - index: CONST Int type=kotlin.Int value=0 - 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 .IFoo - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IBar - $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 .IFoo - public open fun hashCode (): kotlin.Int declared in .IBar - $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 .IFoo - public open fun toString (): kotlin.String declared in .IBar - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/types/genericFunWithStar.kt.txt b/compiler/testData/ir/irText/types/genericFunWithStar.kt.txt index 5bc8a393b34..dc6e9bb5d74 100644 --- a/compiler/testData/ir/irText/types/genericFunWithStar.kt.txt +++ b/compiler/testData/ir/irText/types/genericFunWithStar.kt.txt @@ -1,26 +1,27 @@ -interface IBase { -} - -interface IFoo : IBase { -} - -interface IBar : IBase { -} - -interface I where G : IFoo, G : IBar { -} - -abstract class Box : IFoo, IBar where T : IFoo, T : IBar { +abstract class Box : IBar, IFoo where T : IBar, T : IFoo { constructor() /* primary */ { super/*Any*/() /* () */ } - abstract fun foo(tSerializer: I): I> where F : IFoo, F : IBar - fun bar(vararg serializers: I<*>): I<*> { return .foo(tSerializer = serializers.get(index = 0)) } + abstract fun foo(tSerializer: I): I> where F : IBar, F : IFoo + } + +interface I where G : IBar, G : IFoo { +} + +interface IBar : IBase { +} + +interface IBase { +} + +interface IFoo : IBase { +} + diff --git a/compiler/testData/ir/irText/types/genericPropertyReferenceType.ir.txt b/compiler/testData/ir/irText/types/genericPropertyReferenceType.ir.txt index e83983c4306..acc415ff6cf 100644 --- a/compiler/testData/ir/irText/types/genericPropertyReferenceType.ir.txt +++ b/compiler/testData/ir/irText/types/genericPropertyReferenceType.ir.txt @@ -2,11 +2,6 @@ FILE fqName: fileName:/genericPropertyReferenceType.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T of .C) returnType:.C.C> [primary] - VALUE_PARAMETER name:x index:0 type:T of .C - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:x type:T of .C visibility:private EXPRESSION_BODY @@ -26,6 +21,11 @@ FILE fqName: fileName:/genericPropertyReferenceType.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .C visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .C.C> declared in .C.' type=.C.C> origin=null value: GET_VAR ': T of .C declared in .C.' type=T of .C origin=null + CONSTRUCTOR visibility:public <> (x:T of .C) returnType:.C.C> [primary] + VALUE_PARAMETER name:x index:0 type:T of .C + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -39,27 +39,6 @@ FILE fqName: fileName:/genericPropertyReferenceType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:y visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL ($receiver:.C.>) returnType:T of . - correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.C.> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of . declared in ' - CALL 'public final fun (): T of .C declared in .C' type=T of . origin=GET_PROPERTY - $this: GET_VAR ': .C.> declared in .' type=.C.> origin=null - FUN name: visibility:public modality:FINAL ($receiver:.C.>, v:T of .) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.C.> - VALUE_PARAMETER name:v index:0 type:T of . - BLOCK_BODY - CALL 'public final fun (: T of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .C.> declared in .' type=.C.> origin=null - : GET_VAR 'v: T of . declared in .' type=T of . origin=null - FUN name:use visibility:public modality:FINAL <> (p:kotlin.reflect.KMutableProperty) returnType:kotlin.Unit - VALUE_PARAMETER name:p index:0 type:kotlin.reflect.KMutableProperty - BLOCK_BODY FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun use (p: kotlin.reflect.KMutableProperty): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -79,3 +58,24 @@ FILE fqName: fileName:/genericPropertyReferenceType.kt <1>: kotlin.String $receiver: TYPE_OP type=.C origin=IMPLICIT_CAST typeOperand=.C GET_VAR 'a: kotlin.Any declared in .test2' type=kotlin.Any origin=null + FUN name:use visibility:public modality:FINAL <> (p:kotlin.reflect.KMutableProperty) returnType:kotlin.Unit + VALUE_PARAMETER name:p index:0 type:kotlin.reflect.KMutableProperty + BLOCK_BODY + PROPERTY name:y visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL ($receiver:.C.>) returnType:T of . + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.C.> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of . declared in ' + CALL 'public final fun (): T of .C declared in .C' type=T of . origin=GET_PROPERTY + $this: GET_VAR ': .C.> declared in .' type=.C.> origin=null + FUN name: visibility:public modality:FINAL ($receiver:.C.>, v:T of .) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.C.> + VALUE_PARAMETER name:v index:0 type:T of . + BLOCK_BODY + CALL 'public final fun (: T of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .C.> declared in .' type=.C.> origin=null + : GET_VAR 'v: T of . declared in .' type=T of . origin=null diff --git a/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt.txt b/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt.txt index 4a847278e99..779d7f1fc71 100644 --- a/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt.txt +++ b/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt.txt @@ -1,26 +1,15 @@ class C { + var x: T + field = x + get + set + constructor(x: T) /* primary */ { super/*Any*/() /* () */ } - var x: T - field = x - get - set - -} - -var C.y: T - get(): T { - return .() - } - set(v: T) { - .( = v) - } - -fun use(p: KMutableProperty) { } fun test1() { @@ -31,3 +20,15 @@ fun test2(a: Any) { a as C /*~> Unit */ use(p = a /*as C */::y/*()*/) } + +fun use(p: KMutableProperty) { +} + +var C.y: T + get(): T { + return .() + } + set(v: T) { + .( = v) + } + diff --git a/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.ir.txt b/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.ir.txt index ad71af72447..63c02c90ba5 100644 --- a/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.ir.txt +++ b/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.ir.txt @@ -2,13 +2,6 @@ FILE fqName: fileName:/inStarProjectionInReceiverType.kt CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo.Foo> TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false - PROPERTY name:x visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Foo.Foo>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Foo.Foo> - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Foo.Foo>, x:T of .Foo) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Foo.Foo> - VALUE_PARAMETER name:x index:0 type:T of .Foo 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 @@ -22,6 +15,13 @@ FILE fqName: fileName:/inStarProjectionInReceiverType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Foo.Foo>, x:T of .Foo) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Foo.Foo> + VALUE_PARAMETER name:x index:0 type:T of .Foo + PROPERTY name:x visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Foo.Foo>) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.Foo.Foo> FUN name:testReceiver visibility:public modality:FINAL <> ($receiver:.Foo<*>) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:.Foo<*> BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt.txt b/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt.txt index 05b8e171154..bb57fd93503 100644 --- a/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt.txt +++ b/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt.txt @@ -1,9 +1,9 @@ interface Foo { + abstract fun foo(x: T) + abstract val x: Int abstract get - abstract fun foo(x: T) - } fun Foo<*>.testReceiver(): Int { @@ -18,3 +18,4 @@ fun Foo<*>.testSmartCastOnExtensionReceiver() { fun testValueParameter(vp: Foo<*>): Int { return vp.() } + diff --git a/compiler/testData/ir/irText/types/intersectionType1.ir.txt b/compiler/testData/ir/irText/types/intersectionType1.ir.txt index b4170715aed..8f13bc8868a 100644 --- a/compiler/testData/ir/irText/types/intersectionType1.ir.txt +++ b/compiler/testData/ir/irText/types/intersectionType1.ir.txt @@ -19,13 +19,6 @@ FILE fqName: fileName:/intersectionType1.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:select visibility:public modality:FINAL (x:S of .select, y:S of .select) returnType:S of .select - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:x index:0 type:S of .select - VALUE_PARAMETER name:y index:1 type:S of .select - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun select (x: S of .select, y: S of .select): S of .select declared in ' - GET_VAR 'x: S of .select declared in .select' type=S of .select origin=null FUN name:foo visibility:public modality:FINAL (a:kotlin.Array<.In.foo>>, b:kotlin.Array<.In>) returnType:kotlin.Boolean TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:a index:0 type:kotlin.Array<.In.foo>> @@ -49,6 +42,13 @@ FILE fqName: fileName:/intersectionType1.kt RETURN type=kotlin.Nothing from='public final fun ofType (y: kotlin.Any?): kotlin.Boolean declared in ' TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=K of .ofType GET_VAR 'y: kotlin.Any? declared in .ofType' type=kotlin.Any? origin=null + FUN name:select visibility:public modality:FINAL (x:S of .select, y:S of .select) returnType:S of .select + TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:x index:0 type:S of .select + VALUE_PARAMETER name:y index:1 type:S of .select + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun select (x: S of .select, y: S of .select): S of .select declared in ' + GET_VAR 'x: S of .select declared in .select' type=S of .select origin=null FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a1 type:kotlin.Array<.In> [val] diff --git a/compiler/testData/ir/irText/types/intersectionType1.kt.txt b/compiler/testData/ir/irText/types/intersectionType1.kt.txt index ff496baed44..81afd9a82aa 100644 --- a/compiler/testData/ir/irText/types/intersectionType1.kt.txt +++ b/compiler/testData/ir/irText/types/intersectionType1.kt.txt @@ -7,10 +7,6 @@ class In { } -fun select(x: S, y: S): S { - return x -} - fun foo(a: Array>, b: Array>): Boolean { return select>>(x = a, y = b).get(index = 0).ofType(y = true) } @@ -19,8 +15,13 @@ inline fun In.ofType(y: Any?): Boolean { return y is K } +fun select(x: S, y: S): S { + return x +} + fun test() { val a1: Array> = arrayOf>(elements = [In()]) val a2: Array> = arrayOf>(elements = [In()]) foo(a = a1, b = a2) /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/types/intersectionType2.ir.txt b/compiler/testData/ir/irText/types/intersectionType2.ir.txt index df8a72d98e7..767c039d352 100644 --- a/compiler/testData/ir/irText/types/intersectionType2.ir.txt +++ b/compiler/testData/ir/irText/types/intersectionType2.ir.txt @@ -1,35 +1,4 @@ FILE fqName: fileName:/intersectionType2.kt - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> - TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false - 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: 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 - CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo - 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: 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 CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.Foo; .A<.B>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B CONSTRUCTOR visibility:public <> () returnType:.B [primary] @@ -74,13 +43,37 @@ FILE fqName: fileName:/intersectionType2.kt public open fun toString (): kotlin.String declared in .Foo public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:run visibility:public modality:FINAL (fn:kotlin.Function0.run>) returnType:T of .run - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.run> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun run (fn: kotlin.Function0.run>): T of .run declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .run origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.run> declared in .run' type=kotlin.Function0.run> origin=VARIABLE_AS_FUNCTION + CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> + TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false + 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: 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 + CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo + 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: 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:foo visibility:public modality:FINAL <> () returnType:kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Any declared in ' @@ -103,3 +96,10 @@ FILE fqName: fileName:/intersectionType2.kt then: GET_VAR 'val nn: .C declared in .foo.' type=.C origin=null RETURN type=kotlin.Nothing from='local final fun (): kotlin.Any declared in .foo' GET_VAR 'val c: kotlin.Any declared in .foo.' type=kotlin.Any origin=null + FUN name:run visibility:public modality:FINAL (fn:kotlin.Function0.run>) returnType:T of .run + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.run> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun run (fn: kotlin.Function0.run>): T of .run declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .run origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0.run> declared in .run' type=kotlin.Function0.run> origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/types/intersectionType2.kt.txt b/compiler/testData/ir/irText/types/intersectionType2.kt.txt index 9197127ef56..38404b9d473 100644 --- a/compiler/testData/ir/irText/types/intersectionType2.kt.txt +++ b/compiler/testData/ir/irText/types/intersectionType2.kt.txt @@ -1,31 +1,27 @@ +open class B : A, Foo { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +open class C : A, Foo { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + interface A { } interface Foo { } -open class B : Foo, A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -open class C : Foo, A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -fun run(fn: Function0): T { - return fn.invoke() -} - fun foo(): Any { return run(fn = local fun (): Any { val mm: B = B() @@ -38,3 +34,8 @@ fun foo(): Any { } ) } + +fun run(fn: Function0): T { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/types/intersectionType3.ir.txt b/compiler/testData/ir/irText/types/intersectionType3.ir.txt index da837b7e244..5642c38b0c3 100644 --- a/compiler/testData/ir/irText/types/intersectionType3.ir.txt +++ b/compiler/testData/ir/irText/types/intersectionType3.ir.txt @@ -1,41 +1,4 @@ FILE fqName: fileName:/intersectionType3.kt - CLASS INTERFACE name:In modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In.In> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false - 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: 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:isT visibility:public modality:FINAL ($receiver:.In.isT>) returnType:kotlin.Boolean [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true - $receiver: VALUE_PARAMETER name: type:.In.isT> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun isT (): kotlin.Boolean declared in ' - TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of .isT - GET_VAR ': .In.isT> declared in .isT' type=.In.isT> origin=null - FUN name:asT visibility:public modality:FINAL ($receiver:.In.asT>) returnType:kotlin.Unit [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true - $receiver: VALUE_PARAMETER name: type:.In.asT> - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=T of .asT origin=CAST typeOperand=T of .asT - GET_VAR ': .In.asT> declared in .asT' type=.In.asT> origin=null - FUN name:sel visibility:public modality:FINAL (x:S of .sel, y:S of .sel) returnType:S of .sel - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:x index:0 type:S of .sel - VALUE_PARAMETER name:y index:1 type:S of .sel - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' - GET_VAR 'x: S of .sel declared in .sel' type=S of .sel origin=null CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -51,21 +14,6 @@ FILE fqName: fileName:/intersectionType3.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - 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: 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 CLASS INTERFACE name:A1 modality:ABSTRACT visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -96,6 +44,37 @@ FILE fqName: fileName:/intersectionType3.kt overridden: public open fun toString (): kotlin.String declared in .A $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + 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: 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 + CLASS INTERFACE name:In modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In.In> + TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false + 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: 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 CLASS INTERFACE name:Z1 modality:ABSTRACT visibility:public superTypes:[.A; .B] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -132,39 +111,27 @@ FILE fqName: fileName:/intersectionType3.kt public open fun toString (): kotlin.String declared in .A public open fun toString (): kotlin.String declared in .B $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testInIs1 visibility:public modality:FINAL <> (x:.In<.A>, y:.In<.B>) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:.In<.A> - VALUE_PARAMETER name:y index:1 type:.In<.B> + FUN name:asT visibility:public modality:FINAL ($receiver:.In.asT>) returnType:kotlin.Unit [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true + $receiver: VALUE_PARAMETER name: type:.In.asT> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInIs1 (x: .In<.A>, y: .In<.B>): kotlin.Boolean declared in ' - CALL 'public final fun isT (): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null - : kotlin.Any - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.A> declared in .testInIs1' type=.In<.A> origin=null - y: GET_VAR 'y: .In<.B> declared in .testInIs1' type=.In<.B> origin=null - FUN name:testInIs2 visibility:public modality:FINAL <> (x:.In<.Z1>, y:.In<.Z2>) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:.In<.Z1> - VALUE_PARAMETER name:y index:1 type:.In<.Z2> + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=T of .asT origin=CAST typeOperand=T of .asT + GET_VAR ': .In.asT> declared in .asT' type=.In.asT> origin=null + FUN name:isT visibility:public modality:FINAL ($receiver:.In.isT>) returnType:kotlin.Boolean [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true + $receiver: VALUE_PARAMETER name: type:.In.isT> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInIs2 (x: .In<.Z1>, y: .In<.Z2>): kotlin.Boolean declared in ' - CALL 'public final fun isT (): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null - : kotlin.Any - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.Z1> declared in .testInIs2' type=.In<.Z1> origin=null - y: GET_VAR 'y: .In<.Z2> declared in .testInIs2' type=.In<.Z2> origin=null - FUN name:testInIs3 visibility:public modality:FINAL <> (x:.In<.A1>, y:.In<.A2>) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:.In<.A1> - VALUE_PARAMETER name:y index:1 type:.In<.A2> + RETURN type=kotlin.Nothing from='public final fun isT (): kotlin.Boolean declared in ' + TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of .isT + GET_VAR ': .In.isT> declared in .isT' type=.In.isT> origin=null + FUN name:sel visibility:public modality:FINAL (x:S of .sel, y:S of .sel) returnType:S of .sel + TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:x index:0 type:S of .sel + VALUE_PARAMETER name:y index:1 type:S of .sel BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInIs3 (x: .In<.A1>, y: .In<.A2>): kotlin.Boolean declared in ' - CALL 'public final fun isT (): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null - : .A - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.A1> declared in .testInIs3' type=.In<.A1> origin=null - y: GET_VAR 'y: .In<.A2> declared in .testInIs3' type=.In<.A2> origin=null + RETURN type=kotlin.Nothing from='public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' + GET_VAR 'x: S of .sel declared in .sel' type=S of .sel origin=null FUN name:testInAs1 visibility:public modality:FINAL <> (x:.In<.A>, y:.In<.B>) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:.In<.A> VALUE_PARAMETER name:y index:1 type:.In<.B> @@ -198,3 +165,36 @@ FILE fqName: fileName:/intersectionType3.kt : .In x: GET_VAR 'x: .In<.A1> declared in .testInAs3' type=.In<.A1> origin=null y: GET_VAR 'y: .In<.A2> declared in .testInAs3' type=.In<.A2> origin=null + FUN name:testInIs1 visibility:public modality:FINAL <> (x:.In<.A>, y:.In<.B>) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:.In<.A> + VALUE_PARAMETER name:y index:1 type:.In<.B> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInIs1 (x: .In<.A>, y: .In<.B>): kotlin.Boolean declared in ' + CALL 'public final fun isT (): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null + : kotlin.Any + $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null + : .In + x: GET_VAR 'x: .In<.A> declared in .testInIs1' type=.In<.A> origin=null + y: GET_VAR 'y: .In<.B> declared in .testInIs1' type=.In<.B> origin=null + FUN name:testInIs2 visibility:public modality:FINAL <> (x:.In<.Z1>, y:.In<.Z2>) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:.In<.Z1> + VALUE_PARAMETER name:y index:1 type:.In<.Z2> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInIs2 (x: .In<.Z1>, y: .In<.Z2>): kotlin.Boolean declared in ' + CALL 'public final fun isT (): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null + : kotlin.Any + $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null + : .In + x: GET_VAR 'x: .In<.Z1> declared in .testInIs2' type=.In<.Z1> origin=null + y: GET_VAR 'y: .In<.Z2> declared in .testInIs2' type=.In<.Z2> origin=null + FUN name:testInIs3 visibility:public modality:FINAL <> (x:.In<.A1>, y:.In<.A2>) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:.In<.A1> + VALUE_PARAMETER name:y index:1 type:.In<.A2> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInIs3 (x: .In<.A1>, y: .In<.A2>): kotlin.Boolean declared in ' + CALL 'public final fun isT (): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null + : .A + $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null + : .In + x: GET_VAR 'x: .In<.A1> declared in .testInIs3' type=.In<.A1> origin=null + y: GET_VAR 'y: .In<.A2> declared in .testInIs3' type=.In<.A2> origin=null diff --git a/compiler/testData/ir/irText/types/intersectionType3.kt.txt b/compiler/testData/ir/irText/types/intersectionType3.kt.txt index cf53fd74730..e8ebec2c7b3 100644 --- a/compiler/testData/ir/irText/types/intersectionType3.kt.txt +++ b/compiler/testData/ir/irText/types/intersectionType3.kt.txt @@ -1,36 +1,48 @@ -interface In { -} - -inline fun In.isT(): Boolean { - return is T -} - -inline fun In.asT() { - as T /*~> Unit */ -} - -fun sel(x: S, y: S): S { - return x -} - interface A { } -interface B { -} - interface A1 : A { } interface A2 : A { } +interface B { +} + +interface In { +} + interface Z1 : A, B { } interface Z2 : A, B { } +inline fun In.asT() { + as T /*~> Unit */ +} + +inline fun In.isT(): Boolean { + return is T +} + +fun sel(x: S, y: S): S { + return x +} + +fun testInAs1(x: In, y: In) { + return sel>(x = x, y = y).asT() +} + +fun testInAs2(x: In, y: In) { + return sel>(x = x, y = y).asT() +} + +fun testInAs3(x: In, y: In) { + return sel>(x = x, y = y).asT() +} + fun testInIs1(x: In, y: In): Boolean { return sel>(x = x, y = y).isT() } @@ -43,14 +55,3 @@ fun testInIs3(x: In, y: In): Boolean { return sel>(x = x, y = y).isT() } -fun testInAs1(x: In, y: In) { - return sel>(x = x, y = y).asT() -} - -fun testInAs2(x: In, y: In) { - return sel>(x = x, y = y).asT() -} - -fun testInAs3(x: In, y: In) { - return sel>(x = x, y = y).asT() -} diff --git a/compiler/testData/ir/irText/types/intersectionTypeInSamType.ir.txt b/compiler/testData/ir/irText/types/intersectionTypeInSamType.ir.txt index e4061ff2be0..bcabb5fdad3 100644 --- a/compiler/testData/ir/irText/types/intersectionTypeInSamType.ir.txt +++ b/compiler/testData/ir/irText/types/intersectionTypeInSamType.ir.txt @@ -1,6 +1,11 @@ FILE fqName: fileName:/intersectionTypeInSamType.kt - CLASS INTERFACE name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X + CLASS CLASS name:G1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.G1.G1> + TYPE_PARAMETER name:T index:0 variance: superTypes:[.X] reified:false + CONSTRUCTOR visibility:public <> () returnType:.G1.G1> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:G1 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -14,8 +19,17 @@ FILE fqName: fileName:/intersectionTypeInSamType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Z modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z + FUN name:checkFoo visibility:public modality:FINAL <> ($this:.G1.G1>, x:.IFoo.G1>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.G1.G1> + VALUE_PARAMETER name:x index:0 type:.IFoo.G1> + BLOCK_BODY + CLASS CLASS name:G2 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.G2.G2> + TYPE_PARAMETER name:T index:0 variance: superTypes:[.X; .Z] reified:false + CONSTRUCTOR visibility:public <> () returnType:.G2.G2> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:G2 modality:FINAL visibility:public 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 declared in kotlin.Any @@ -29,6 +43,18 @@ FILE fqName: fileName:/intersectionTypeInSamType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:checkBar1 visibility:public modality:FINAL <> ($this:.G2.G2>, x:.IBar1.G2>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.G2.G2> + VALUE_PARAMETER name:x index:0 type:.IBar1.G2> + BLOCK_BODY + FUN name:checkBar2 visibility:public modality:FINAL <> ($this:.G2.G2>, x:.IBar2.G2>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.G2.G2> + VALUE_PARAMETER name:x index:0 type:.IBar2.G2> + BLOCK_BODY + FUN name:checkFoo visibility:public modality:FINAL <> ($this:.G2.G2>, x:.IFoo.G2>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.G2.G2> + VALUE_PARAMETER name:x index:0 type:.IFoo.G2> + BLOCK_BODY CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[.X; .Z] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -65,31 +91,9 @@ FILE fqName: fileName:/intersectionTypeInSamType.kt public open fun toString (): kotlin.String declared in .X public open fun toString (): kotlin.String declared in .Z $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo.IFoo> - TYPE_PARAMETER name:T index:0 variance: superTypes:[.X] reified:false - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo.IFoo>, t:T of .IFoo) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFoo.IFoo> - VALUE_PARAMETER name:t index:0 type:T of .IFoo - 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: 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 CLASS INTERFACE name:IBar1 modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBar1.IBar1> TYPE_PARAMETER name:T index:0 variance: superTypes:[.X; .Z] reified:false - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.IBar1.IBar1>, t:T of .IBar1) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IBar1.IBar1> - VALUE_PARAMETER name:t index:0 type:T of .IBar1 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 @@ -103,12 +107,64 @@ FILE fqName: fileName:/intersectionTypeInSamType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.IBar1.IBar1>, t:T of .IBar1) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IBar1.IBar1> + VALUE_PARAMETER name:t index:0 type:T of .IBar1 CLASS INTERFACE name:IBar2 modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBar2.IBar2> TYPE_PARAMETER name:T index:0 variance: superTypes:[.X; .Z] reified:false + 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: 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:bar visibility:public modality:ABSTRACT <> ($this:.IBar2.IBar2>, t:T of .IBar2) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.IBar2.IBar2> VALUE_PARAMETER name:t index:0 type:T of .IBar2 + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo.IFoo> + TYPE_PARAMETER name:T index:0 variance: superTypes:[.X] reified:false + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.IFoo.IFoo>, t:T of .IFoo) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFoo.IFoo> + VALUE_PARAMETER name:t index:0 type:T of .IFoo + CLASS INTERFACE name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X + 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: 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 + CLASS INTERFACE name:Z modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z 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 @@ -129,62 +185,6 @@ FILE fqName: fileName:/intersectionTypeInSamType.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun sel (x: T of .sel, y: T of .sel): T of .sel declared in ' GET_VAR 'x: T of .sel declared in .sel' type=T of .sel origin=null - CLASS CLASS name:G1 modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.G1.G1> - TYPE_PARAMETER name:T index:0 variance: superTypes:[.X] reified:false - CONSTRUCTOR visibility:public <> () returnType:.G1.G1> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:G1 modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:checkFoo visibility:public modality:FINAL <> ($this:.G1.G1>, x:.IFoo.G1>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.G1.G1> - VALUE_PARAMETER name:x index:0 type:.IFoo.G1> - BLOCK_BODY - 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: 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 - CLASS CLASS name:G2 modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.G2.G2> - TYPE_PARAMETER name:T index:0 variance: superTypes:[.X; .Z] reified:false - CONSTRUCTOR visibility:public <> () returnType:.G2.G2> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:G2 modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:checkFoo visibility:public modality:FINAL <> ($this:.G2.G2>, x:.IFoo.G2>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.G2.G2> - VALUE_PARAMETER name:x index:0 type:.IFoo.G2> - BLOCK_BODY - FUN name:checkBar1 visibility:public modality:FINAL <> ($this:.G2.G2>, x:.IBar1.G2>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.G2.G2> - VALUE_PARAMETER name:x index:0 type:.IBar1.G2> - BLOCK_BODY - FUN name:checkBar2 visibility:public modality:FINAL <> ($this:.G2.G2>, x:.IBar2.G2>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.G2.G2> - VALUE_PARAMETER name:x index:0 type:.IBar2.G2> - BLOCK_BODY - 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: 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:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:g type:.G1<*> [val] diff --git a/compiler/testData/ir/irText/types/javaWildcardType.ir.txt b/compiler/testData/ir/irText/types/javaWildcardType.ir.txt index 6333d3c21c6..d3329dcd01b 100644 --- a/compiler/testData/ir/irText/types/javaWildcardType.ir.txt +++ b/compiler/testData/ir/irText/types/javaWildcardType.ir.txt @@ -1,40 +1,18 @@ FILE fqName: fileName:/javaWildcardType.kt - CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K - FUN name:kf1 visibility:public modality:ABSTRACT <> ($this:.K) returnType:kotlin.collections.Collection - $this: VALUE_PARAMETER name: type:.K - FUN name:kf2 visibility:public modality:ABSTRACT <> ($this:.K) returnType:kotlin.collections.Collection - $this: VALUE_PARAMETER name: type:.K - FUN name:kg1 visibility:public modality:ABSTRACT <> ($this:.K, c:kotlin.collections.Collection) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.K - VALUE_PARAMETER name:c index:0 type:kotlin.collections.Collection - FUN name:kg2 visibility:public modality:ABSTRACT <> ($this:.K, c:kotlin.collections.Collection) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.K - VALUE_PARAMETER name:c index:0 type:kotlin.collections.Collection - 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: 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 CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.J; .K] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final] + EXPRESSION_BODY + GET_VAR 'j: .J declared in .C.' type=.J origin=null + FIELD DELEGATE name:$$delegate_1 type:.K visibility:private [final] + EXPRESSION_BODY + GET_VAR 'k: .K declared in .C.' type=.K origin=null CONSTRUCTOR visibility:public <> (j:.J, k:.K) returnType:.C [primary] VALUE_PARAMETER name:j index:0 type:.J VALUE_PARAMETER name:k index:1 type:.K BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.J; .K]' - FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final] - EXPRESSION_BODY - GET_VAR 'j: .J declared in .C.' type=.J origin=null FUN DELEGATED_MEMBER name:jf1 visibility:public modality:OPEN <> ($this:.C) returnType:@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection? overridden: public abstract fun jf1 (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection? declared in .J @@ -73,9 +51,6 @@ FILE fqName: fileName:/javaWildcardType.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final]' type=.J origin=null receiver: GET_VAR ': .C declared in .C.jg2' type=.C origin=null c: GET_VAR 'c: @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? declared in .C.jg2' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? origin=null - FIELD DELEGATE name:$$delegate_1 type:.K visibility:private [final] - EXPRESSION_BODY - GET_VAR 'k: .K declared in .C.' type=.K origin=null FUN DELEGATED_MEMBER name:kf1 visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.collections.Collection overridden: public abstract fun kf1 (): kotlin.collections.Collection declared in .K @@ -130,3 +105,28 @@ FILE fqName: fileName:/javaWildcardType.kt public open fun toString (): kotlin.String declared in .J public open fun toString (): kotlin.String declared in .K $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K + 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: 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:kf1 visibility:public modality:ABSTRACT <> ($this:.K) returnType:kotlin.collections.Collection + $this: VALUE_PARAMETER name: type:.K + FUN name:kf2 visibility:public modality:ABSTRACT <> ($this:.K) returnType:kotlin.collections.Collection + $this: VALUE_PARAMETER name: type:.K + FUN name:kg1 visibility:public modality:ABSTRACT <> ($this:.K, c:kotlin.collections.Collection) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.K + VALUE_PARAMETER name:c index:0 type:kotlin.collections.Collection + FUN name:kg2 visibility:public modality:ABSTRACT <> ($this:.K, c:kotlin.collections.Collection) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.K + VALUE_PARAMETER name:c index:0 type:kotlin.collections.Collection diff --git a/compiler/testData/ir/irText/types/javaWildcardType.kt.txt b/compiler/testData/ir/irText/types/javaWildcardType.kt.txt index ddc6cfa87a0..b33ea7d8a16 100644 --- a/compiler/testData/ir/irText/types/javaWildcardType.kt.txt +++ b/compiler/testData/ir/irText/types/javaWildcardType.kt.txt @@ -1,22 +1,12 @@ -interface K { - abstract fun kf1(): Collection - - abstract fun kf2(): Collection - - abstract fun kg1(c: Collection) - - abstract fun kg2(c: Collection) - -} - class C : J, K { + private /* final field */ val $$delegate_0: J = j + private /* final field */ val $$delegate_1: K = k constructor(j: J, k: K) /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: J = j override fun jf1(): @FlexibleNullability @FlexibleMutability MutableCollection? { return .#$$delegate_0.jf1() } @@ -33,7 +23,6 @@ class C : J, K { .#$$delegate_0.jg2(c = c) } - private /* final field */ val $$delegate_1: K = k override fun kf1(): Collection { return .#$$delegate_1.kf1() } @@ -51,3 +40,15 @@ class C : J, K { } } + +interface K { + abstract fun kf1(): Collection + + abstract fun kf2(): Collection + + abstract fun kg1(c: Collection) + + abstract fun kg2(c: Collection) + +} + diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType.ir.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.ir.txt index 56a9a0fa055..f01aec6ef72 100644 --- a/compiler/testData/ir/irText/types/localVariableOfIntersectionType.ir.txt +++ b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.ir.txt @@ -1,4 +1,38 @@ FILE fqName: fileName:/localVariableOfIntersectionType.kt + CLASS INTERFACE name:IA modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IA + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.IA) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IA + CLASS INTERFACE name:IB modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IB + 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: 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:bar visibility:public modality:ABSTRACT <> ($this:.IB) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IB CLASS INTERFACE name:In modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In.In> TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false @@ -18,10 +52,6 @@ FILE fqName: fileName:/localVariableOfIntersectionType.kt CLASS INTERFACE name:Inv modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Inv.Inv> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - PROPERTY name:t visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Inv.Inv>) returnType:T of .Inv - correspondingProperty: PROPERTY name:t visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Inv.Inv> 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 @@ -35,60 +65,30 @@ FILE fqName: fileName:/localVariableOfIntersectionType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:t visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Inv.Inv>) returnType:T of .Inv + correspondingProperty: PROPERTY name:t visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.Inv.Inv> CLASS INTERFACE name:Z modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z + 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: 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:create visibility:public modality:ABSTRACT ($this:.Z, x:.In.Z.create>, y:.In.Z.create>) returnType:.Inv.Z.create> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false $this: VALUE_PARAMETER name: type:.Z VALUE_PARAMETER name:x index:0 type:.In.Z.create> VALUE_PARAMETER name:y index:1 type:.In.Z.create> - 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: 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 - CLASS INTERFACE name:IA modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IA - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IA) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IA - 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: 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 - CLASS INTERFACE name:IB modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IB - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.IB) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IB - 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: 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:test visibility:public modality:FINAL <> (a:.In<.IA>, b:.In<.IB>, z:.Z) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.In<.IA> VALUE_PARAMETER name:b index:1 type:.In<.IB> diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt.txt index bfe29ab8c87..cfb798f3314 100644 --- a/compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt.txt +++ b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt.txt @@ -1,3 +1,13 @@ +interface IA { + abstract fun foo() + +} + +interface IB { + abstract fun bar() + +} + interface In { } @@ -12,16 +22,6 @@ interface Z { } -interface IA { - abstract fun foo() - -} - -interface IB { - abstract fun bar() - -} - fun test(a: In, b: In, z: Z) { z.create(x = a, y = b).() /*as IA */.foo() z.create(x = a, y = b).() /*as IB */.bar() @@ -29,3 +29,4 @@ fun test(a: In, b: In, z: Z) { t /*as IA */.foo() t /*as IB */.bar() } + diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullability.ir.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullability.ir.txt index 206ecad8d09..a7ea18d5eee 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullability.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullability.ir.txt @@ -1,22 +1,4 @@ FILE fqName: fileName:/enhancedNullability.kt - FUN name:use visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - FUN name:testUse visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun use (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null - s: TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String - CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null - FUN name:testLocalVal visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:local type:kotlin.String [val] - TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String - CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null - FUN name:testReturnValue visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testReturnValue (): kotlin.String declared in ' - TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String - CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null PROPERTY name:testGlobalVal visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:testGlobalVal type:kotlin.String visibility:private [final,static] EXPRESSION_BODY @@ -27,13 +9,6 @@ FILE fqName: fileName:/enhancedNullability.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testGlobalVal type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null - PROPERTY name:testGlobalValGetter visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String - correspondingProperty: PROPERTY name:testGlobalValGetter visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' - TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String - CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null FUN name:testJUse visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public open fun use (s: @[EnhancedNullability] kotlin.String): kotlin.Unit declared in .J' type=kotlin.Unit origin=null @@ -42,6 +17,11 @@ FILE fqName: fileName:/enhancedNullability.kt s: CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null CALL 'public open fun use (x: @[EnhancedNullability] kotlin.Int): kotlin.Unit declared in .J' type=kotlin.Unit origin=null x: CONST Int type=kotlin.Int value=42 + FUN name:testLocalVal visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:local type:kotlin.String [val] + TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String + CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null FUN name:testLocalVarUse visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:ns type:@[FlexibleNullability] kotlin.String? [val] @@ -53,3 +33,23 @@ FILE fqName: fileName:/enhancedNullability.kt CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null CALL 'public open fun use (s: @[EnhancedNullability] kotlin.String): kotlin.Unit declared in .J' type=kotlin.Unit origin=null s: GET_VAR 'val nns: kotlin.String declared in .testLocalVarUse' type=kotlin.String origin=null + FUN name:testReturnValue visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testReturnValue (): kotlin.String declared in ' + TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String + CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null + FUN name:testUse visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun use (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String + CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null + FUN name:use visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + PROPERTY name:testGlobalValGetter visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:testGlobalValGetter visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String + CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullability.kt.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullability.kt.txt index 3a6460ede42..35c9241c577 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullability.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullability.kt.txt @@ -1,36 +1,37 @@ -fun use(s: String) { -} - -fun testUse() { - use(s = notNullString() /*!! String */) -} - -fun testLocalVal() { - val local: String = notNullString() /*!! String */ -} - -fun testReturnValue(): String { - return notNullString() /*!! String */ -} - val testGlobalVal: String field = notNullString() /*!! String */ get -val testGlobalValGetter: String - get(): String { - return notNullString() /*!! String */ - } - fun testJUse() { use(s = nullString()) use(s = notNullString()) use(x = 42) } +fun testLocalVal() { + val local: String = notNullString() /*!! String */ +} + fun testLocalVarUse() { val ns: @FlexibleNullability String? = nullString() use(s = ns) val nns: String = notNullString() /*!! String */ use(s = nns) } + +fun testReturnValue(): String { + return notNullString() /*!! String */ +} + +fun testUse() { + use(s = notNullString() /*!! String */) +} + +fun use(s: String) { +} + +val testGlobalValGetter: String + get(): String { + return notNullString() /*!! String */ + } + diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.fir.ir.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.fir.ir.txt index 095ff6cd4ef..594643d8096 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.fir.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.fir.ir.txt @@ -1,16 +1,6 @@ FILE fqName: fileName:/enhancedNullabilityInDestructuringAssignment.kt - FUN name:use visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.P - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.P [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -33,18 +23,12 @@ FILE fqName: fileName:/enhancedNullabilityInDestructuringAssignment.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .P' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .P declared in .P.' type=.P origin=null - FUN name:component1 visibility:public modality:FINAL <> ($this:.P) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.P + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.P [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .P' - CALL 'public final fun (): kotlin.Int declared in .P' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .P declared in .P.component1' type=.P origin=null - FUN name:component2 visibility:public modality:FINAL <> ($this:.P) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.P - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in .P' - CALL 'public final fun (): kotlin.Int declared in .P' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .P declared in .P.component2' type=.P origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public 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 declared in kotlin.Any @@ -58,16 +42,22 @@ FILE fqName: fileName:/enhancedNullabilityInDestructuringAssignment.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:component1 visibility:public modality:FINAL <> ($this:.P) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.P + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .P' + CALL 'public final fun (): kotlin.Int declared in .P' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .P declared in .P.component1' type=.P origin=null + FUN name:component2 visibility:public modality:FINAL <> ($this:.P) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.P + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in .P' + CALL 'public final fun (): kotlin.Int declared in .P' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .P declared in .P.component2' type=.P origin=null CLASS CLASS name:Q modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Q.Q, T2 of .Q> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:T2 index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T1 of .Q, y:T2 of .Q) returnType:.Q.Q, T2 of .Q> [primary] - VALUE_PARAMETER name:x index:0 type:T1 of .Q - VALUE_PARAMETER name:y index:1 type:T2 of .Q - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Q modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:T1 of .Q visibility:private [final] EXPRESSION_BODY @@ -90,18 +80,12 @@ FILE fqName: fileName:/enhancedNullabilityInDestructuringAssignment.kt RETURN type=kotlin.Nothing from='public final fun (): T2 of .Q declared in .Q' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:T2 of .Q visibility:private [final]' type=T2 of .Q origin=null receiver: GET_VAR ': .Q.Q, T2 of .Q> declared in .Q.' type=.Q.Q, T2 of .Q> origin=null - FUN name:component1 visibility:public modality:FINAL <> ($this:.Q.Q, T2 of .Q>) returnType:T1 of .Q [operator] - $this: VALUE_PARAMETER name: type:.Q.Q, T2 of .Q> + CONSTRUCTOR visibility:public <> (x:T1 of .Q, y:T2 of .Q) returnType:.Q.Q, T2 of .Q> [primary] + VALUE_PARAMETER name:x index:0 type:T1 of .Q + VALUE_PARAMETER name:y index:1 type:T2 of .Q BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): T1 of .Q declared in .Q' - CALL 'public final fun (): T1 of .Q declared in .Q' type=T1 of .Q origin=GET_PROPERTY - $this: GET_VAR ': .Q.Q, T2 of .Q> declared in .Q.component1' type=.Q.Q, T2 of .Q> origin=null - FUN name:component2 visibility:public modality:FINAL <> ($this:.Q.Q, T2 of .Q>) returnType:T2 of .Q [operator] - $this: VALUE_PARAMETER name: type:.Q.Q, T2 of .Q> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component2 (): T2 of .Q declared in .Q' - CALL 'public final fun (): T2 of .Q declared in .Q' type=T2 of .Q origin=GET_PROPERTY - $this: GET_VAR ': .Q.Q, T2 of .Q> declared in .Q.component2' type=.Q.Q, T2 of .Q> origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Q modality:FINAL visibility:public 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 declared in kotlin.Any @@ -115,6 +99,18 @@ FILE fqName: fileName:/enhancedNullabilityInDestructuringAssignment.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:component1 visibility:public modality:FINAL <> ($this:.Q.Q, T2 of .Q>) returnType:T1 of .Q [operator] + $this: VALUE_PARAMETER name: type:.Q.Q, T2 of .Q> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): T1 of .Q declared in .Q' + CALL 'public final fun (): T1 of .Q declared in .Q' type=T1 of .Q origin=GET_PROPERTY + $this: GET_VAR ': .Q.Q, T2 of .Q> declared in .Q.component1' type=.Q.Q, T2 of .Q> origin=null + FUN name:component2 visibility:public modality:FINAL <> ($this:.Q.Q, T2 of .Q>) returnType:T2 of .Q [operator] + $this: VALUE_PARAMETER name: type:.Q.Q, T2 of .Q> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component2 (): T2 of .Q declared in .Q' + CALL 'public final fun (): T2 of .Q declared in .Q' type=T2 of .Q origin=GET_PROPERTY + $this: GET_VAR ': .Q.Q, T2 of .Q> declared in .Q.component2' type=.Q.Q, T2 of .Q> origin=null FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.P [val] @@ -194,3 +190,7 @@ FILE fqName: fileName:/enhancedNullabilityInDestructuringAssignment.kt CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in ' type=kotlin.Unit origin=null x: GET_VAR 'val x: kotlin.Int declared in .test4' type=kotlin.Int origin=null y: GET_VAR 'val y: @[EnhancedNullability] @[NotNull(value = )] .P declared in .test4' type=@[EnhancedNullability] @[NotNull(value = )] .P origin=null + FUN name:use visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.fir.kt.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.fir.kt.txt index 7c0bbd60d6e..cd7f8927d5f 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.fir.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.fir.kt.txt @@ -1,13 +1,4 @@ -fun use(x: Any, y: Any) { -} - class P { - constructor(x: Int, y: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x get @@ -16,6 +7,12 @@ class P { field = y get + constructor(x: Int, y: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): Int { return .() } @@ -27,12 +24,6 @@ class P { } class Q { - constructor(x: T1, y: T2) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: T1 field = x get @@ -41,6 +32,12 @@ class Q { field = y get + constructor(x: T1, y: T2) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): T1 { return .() } @@ -86,3 +83,6 @@ fun test4() { use(x = x, y = y) } +fun use(x: Any, y: Any) { +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.ir.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.ir.txt index 6dc7bea059e..1a604a2fabd 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.ir.txt @@ -1,16 +1,6 @@ FILE fqName: fileName:/enhancedNullabilityInDestructuringAssignment.kt - FUN name:use visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.P - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.P [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -33,18 +23,12 @@ FILE fqName: fileName:/enhancedNullabilityInDestructuringAssignment.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .P' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .P declared in .P.' type=.P origin=null - FUN name:component1 visibility:public modality:FINAL <> ($this:.P) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.P + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.P [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .P' - CALL 'public final fun (): kotlin.Int declared in .P' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .P declared in .P.component1' type=.P origin=null - FUN name:component2 visibility:public modality:FINAL <> ($this:.P) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.P - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in .P' - CALL 'public final fun (): kotlin.Int declared in .P' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .P declared in .P.component2' type=.P origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public 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 declared in kotlin.Any @@ -58,16 +42,22 @@ FILE fqName: fileName:/enhancedNullabilityInDestructuringAssignment.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:component1 visibility:public modality:FINAL <> ($this:.P) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.P + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .P' + CALL 'public final fun (): kotlin.Int declared in .P' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .P declared in .P.component1' type=.P origin=null + FUN name:component2 visibility:public modality:FINAL <> ($this:.P) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.P + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in .P' + CALL 'public final fun (): kotlin.Int declared in .P' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .P declared in .P.component2' type=.P origin=null CLASS CLASS name:Q modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Q.Q, T2 of .Q> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:T2 index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (x:T1 of .Q, y:T2 of .Q) returnType:.Q.Q, T2 of .Q> [primary] - VALUE_PARAMETER name:x index:0 type:T1 of .Q - VALUE_PARAMETER name:y index:1 type:T2 of .Q - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Q modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:T1 of .Q visibility:private [final] EXPRESSION_BODY @@ -90,18 +80,12 @@ FILE fqName: fileName:/enhancedNullabilityInDestructuringAssignment.kt RETURN type=kotlin.Nothing from='public final fun (): T2 of .Q declared in .Q' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:T2 of .Q visibility:private [final]' type=T2 of .Q origin=null receiver: GET_VAR ': .Q.Q, T2 of .Q> declared in .Q.' type=.Q.Q, T2 of .Q> origin=null - FUN name:component1 visibility:public modality:FINAL <> ($this:.Q.Q, T2 of .Q>) returnType:T1 of .Q [operator] - $this: VALUE_PARAMETER name: type:.Q.Q, T2 of .Q> + CONSTRUCTOR visibility:public <> (x:T1 of .Q, y:T2 of .Q) returnType:.Q.Q, T2 of .Q> [primary] + VALUE_PARAMETER name:x index:0 type:T1 of .Q + VALUE_PARAMETER name:y index:1 type:T2 of .Q BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): T1 of .Q declared in .Q' - CALL 'public final fun (): T1 of .Q declared in .Q' type=T1 of .Q origin=GET_PROPERTY - $this: GET_VAR ': .Q.Q, T2 of .Q> declared in .Q.component1' type=.Q.Q, T2 of .Q> origin=null - FUN name:component2 visibility:public modality:FINAL <> ($this:.Q.Q, T2 of .Q>) returnType:T2 of .Q [operator] - $this: VALUE_PARAMETER name: type:.Q.Q, T2 of .Q> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component2 (): T2 of .Q declared in .Q' - CALL 'public final fun (): T2 of .Q declared in .Q' type=T2 of .Q origin=GET_PROPERTY - $this: GET_VAR ': .Q.Q, T2 of .Q> declared in .Q.component2' type=.Q.Q, T2 of .Q> origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Q modality:FINAL visibility:public 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 declared in kotlin.Any @@ -115,6 +99,18 @@ FILE fqName: fileName:/enhancedNullabilityInDestructuringAssignment.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:component1 visibility:public modality:FINAL <> ($this:.Q.Q, T2 of .Q>) returnType:T1 of .Q [operator] + $this: VALUE_PARAMETER name: type:.Q.Q, T2 of .Q> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): T1 of .Q declared in .Q' + CALL 'public final fun (): T1 of .Q declared in .Q' type=T1 of .Q origin=GET_PROPERTY + $this: GET_VAR ': .Q.Q, T2 of .Q> declared in .Q.component1' type=.Q.Q, T2 of .Q> origin=null + FUN name:component2 visibility:public modality:FINAL <> ($this:.Q.Q, T2 of .Q>) returnType:T2 of .Q [operator] + $this: VALUE_PARAMETER name: type:.Q.Q, T2 of .Q> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component2 (): T2 of .Q declared in .Q' + CALL 'public final fun (): T2 of .Q declared in .Q' type=T2 of .Q origin=GET_PROPERTY + $this: GET_VAR ': .Q.Q, T2 of .Q> declared in .Q.component2' type=.Q.Q, T2 of .Q> origin=null FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY COMPOSITE type=kotlin.Unit origin=DESTRUCTURING_DECLARATION @@ -204,3 +200,7 @@ FILE fqName: fileName:/enhancedNullabilityInDestructuringAssignment.kt x: GET_VAR 'val x: kotlin.Int declared in .test4' type=kotlin.Int origin=null y: TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P GET_VAR 'val y: @[NotNull(value = )] @[EnhancedNullability] .P declared in .test4' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=null + FUN name:use visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt.txt index b73fe116297..60ce2590372 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt.txt @@ -1,13 +1,4 @@ -fun use(x: Any, y: Any) { -} - class P { - constructor(x: Int, y: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x get @@ -16,6 +7,12 @@ class P { field = y get + constructor(x: Int, y: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): Int { return .() } @@ -27,12 +24,6 @@ class P { } class Q { - constructor(x: T1, y: T2) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: T1 field = x get @@ -41,6 +32,12 @@ class Q { field = y get + constructor(x: T1, y: T2) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): T1 { return .() } @@ -93,3 +90,7 @@ fun test4() { // } use(x = x, y = y /*!! @NotNull P */) } + +fun use(x: Any, y: Any) { +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.ir.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.ir.txt index 9b3df58cd22..aaf4a4297e1 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.ir.txt @@ -1,138 +1,6 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt - FUN name:use visibility:public modality:FINAL <> (s:.P) returnType:kotlin.Unit - VALUE_PARAMETER name:s index:0 type:.P - BLOCK_BODY - FUN name:testForInListUnused visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=FOR_LOOP_ITERATOR - $this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testForInListUnused' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:@[NotNull(value = )] .P [val] - TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[EnhancedNullability] @[NotNull(value = )] .P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testForInListUnused' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null - BLOCK type=kotlin.Unit origin=null - FUN name:testForInListDestructured visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=FOR_LOOP_ITERATOR - $this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:@[NotNull(value = )] .P [val] - TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[EnhancedNullability] @[NotNull(value = )] .P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null - VAR name:x type:kotlin.Int [val] - CALL 'public final fun component1 (): kotlin.Int declared in .P' type=kotlin.Int origin=COMPONENT_N(index=1) - $this: GET_VAR 'val tmp_2: @[NotNull(value = )] .P declared in .testForInListDestructured' type=@[NotNull(value = )] .P origin=null - VAR name:y type:kotlin.Int [val] - CALL 'public final fun component2 (): kotlin.Int declared in .P' type=kotlin.Int origin=COMPONENT_N(index=2) - $this: GET_VAR 'val tmp_2: @[NotNull(value = )] .P declared in .testForInListDestructured' type=@[NotNull(value = )] .P origin=null - BLOCK type=kotlin.Unit origin=null - FUN name:testDesugaredForInList visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:iterator type:kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null - $this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? origin=null - WHILE label=null origin=WHILE_LOOP - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testDesugaredForInList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null - body: BLOCK type=kotlin.Unit origin=null - VAR name:x type:@[NotNull(value = )] .P [val] - TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[EnhancedNullability] @[NotNull(value = )] .P origin=null - $this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testDesugaredForInList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null - FUN name:testForInArrayUnused visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit - VALUE_PARAMETER name:j index:0 type:.J - BLOCK_BODY - BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.Iterator<@[EnhancedNullability] .P> [val] - CALL 'public final fun iterator (): kotlin.collections.Iterator declared in kotlin.Array' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR - $this: CALL 'public open fun arrayOfNotNull (): @[EnhancedNullability] @[FlexibleArrayElementVariance] kotlin.Array.P> declared in .J' type=@[EnhancedNullability] @[FlexibleArrayElementVariance] kotlin.Array.P> origin=null - $this: GET_VAR 'j: .J declared in .testForInArrayUnused' type=.J origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUnused' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:.P [val] - TYPE_OP type=.P origin=IMPLICIT_NOTNULL typeOperand=.P - CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=@[EnhancedNullability] .P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUnused' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null - BLOCK type=kotlin.Unit origin=null - FUN name:testForInListUse visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_4 type:kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=FOR_LOOP_ITERATOR - $this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_4: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testForInListUse' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:@[NotNull(value = )] .P [val] - TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[EnhancedNullability] @[NotNull(value = )] .P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_4: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testForInListUse' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null - BLOCK type=kotlin.Unit origin=null - CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null - s: GET_VAR 'val x: @[NotNull(value = )] .P declared in .testForInListUse' type=@[NotNull(value = )] .P origin=null - CALL 'public open fun use (s: @[EnhancedNullability] .P): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - s: GET_VAR 'val x: @[NotNull(value = )] .P declared in .testForInListUse' type=@[NotNull(value = )] .P origin=null - FUN name:testForInArrayUse visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit - VALUE_PARAMETER name:j index:0 type:.J - BLOCK_BODY - BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_5 type:kotlin.collections.Iterator<@[EnhancedNullability] .P> [val] - CALL 'public final fun iterator (): kotlin.collections.Iterator declared in kotlin.Array' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR - $this: CALL 'public open fun arrayOfNotNull (): @[EnhancedNullability] @[FlexibleArrayElementVariance] kotlin.Array.P> declared in .J' type=@[EnhancedNullability] @[FlexibleArrayElementVariance] kotlin.Array.P> origin=null - $this: GET_VAR 'j: .J declared in .testForInArrayUse' type=.J origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUse' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:.P [val] - TYPE_OP type=.P origin=IMPLICIT_NOTNULL typeOperand=.P - CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=@[EnhancedNullability] .P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUse' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null - BLOCK type=kotlin.Unit origin=null - CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null - s: GET_VAR 'val x: .P declared in .testForInArrayUse' type=.P origin=null - CALL 'public open fun use (s: @[EnhancedNullability] .P): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - s: GET_VAR 'val x: .P declared in .testForInArrayUse' type=.P origin=null - CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K - FUN name:arrayOfNotNull visibility:public modality:ABSTRACT <> ($this:.K) returnType:kotlin.Array<.P> - $this: VALUE_PARAMETER name: type:.K - 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: 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 CLASS CLASS name:P modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.P - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.P [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -155,6 +23,12 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .P' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .P declared in .P.' type=.P origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.P [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.P) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.P BLOCK_BODY @@ -182,41 +56,6 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int) declared in .P' type=.P origin=null x: GET_VAR 'x: kotlin.Int declared in .P.copy' type=kotlin.Int origin=null y: GET_VAR 'y: kotlin.Int declared in .P.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.P) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.P - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .P' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="P(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .P declared in .P.toString' type=.P origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="y=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .P declared in .P.toString' type=.P origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.P) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.P - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null - SET_VAR 'var result: kotlin.Int declared in .P.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .P.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .P' - GET_VAR 'var result: kotlin.Int declared in .P.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.P, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -236,7 +75,7 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt GET_VAR 'other: kotlin.Any? declared in .P.equals' type=kotlin.Any? origin=null then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' CONST Boolean type=kotlin.Boolean value=false - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.P [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.P [val] TYPE_OP type=.P origin=CAST typeOperand=.P GET_VAR 'other: kotlin.Any? declared in .P.equals' type=kotlin.Any? origin=null WHEN type=kotlin.Unit origin=null @@ -246,7 +85,7 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .P declared in .P.equals' type=.P origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR 'val tmp_6: .P declared in .P.equals' type=.P origin=null + receiver: GET_VAR 'val tmp_0: .P declared in .P.equals' type=.P origin=null then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null @@ -256,8 +95,169 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .P declared in .P.equals' type=.P origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR 'val tmp_6: .P declared in .P.equals' type=.P origin=null + receiver: GET_VAR 'val tmp_0: .P declared in .P.equals' type=.P origin=null then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.P) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.P + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null + SET_VAR 'var result: kotlin.Int declared in .P.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .P.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .P' + GET_VAR 'var result: kotlin.Int declared in .P.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.P) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.P + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .P' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="P(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .P declared in .P.toString' type=.P origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="y=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .P declared in .P.toString' type=.P origin=null + CONST String type=kotlin.String value=")" + CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K + 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: 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:arrayOfNotNull visibility:public modality:ABSTRACT <> ($this:.K) returnType:kotlin.Array<.P> + $this: VALUE_PARAMETER name: type:.K + FUN name:testDesugaredForInList visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:iterator type:kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> [val] + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null + $this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? origin=null + WHILE label=null origin=WHILE_LOOP + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=null + $this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testDesugaredForInList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null + body: BLOCK type=kotlin.Unit origin=null + VAR name:x type:@[NotNull(value = )] .P [val] + TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[EnhancedNullability] @[NotNull(value = )] .P origin=null + $this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testDesugaredForInList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null + FUN name:testForInArrayUnused visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit + VALUE_PARAMETER name:j index:0 type:.J + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.Iterator<@[EnhancedNullability] .P> [val] + CALL 'public final fun iterator (): kotlin.collections.Iterator declared in kotlin.Array' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR + $this: CALL 'public open fun arrayOfNotNull (): @[EnhancedNullability] @[FlexibleArrayElementVariance] kotlin.Array.P> declared in .J' type=@[EnhancedNullability] @[FlexibleArrayElementVariance] kotlin.Array.P> origin=null + $this: GET_VAR 'j: .J declared in .testForInArrayUnused' type=.J origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUnused' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:.P [val] + TYPE_OP type=.P origin=IMPLICIT_NOTNULL typeOperand=.P + CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=@[EnhancedNullability] .P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUnused' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null + BLOCK type=kotlin.Unit origin=null + FUN name:testForInArrayUse visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit + VALUE_PARAMETER name:j index:0 type:.J + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator<@[EnhancedNullability] .P> [val] + CALL 'public final fun iterator (): kotlin.collections.Iterator declared in kotlin.Array' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR + $this: CALL 'public open fun arrayOfNotNull (): @[EnhancedNullability] @[FlexibleArrayElementVariance] kotlin.Array.P> declared in .J' type=@[EnhancedNullability] @[FlexibleArrayElementVariance] kotlin.Array.P> origin=null + $this: GET_VAR 'j: .J declared in .testForInArrayUse' type=.J origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUse' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:.P [val] + TYPE_OP type=.P origin=IMPLICIT_NOTNULL typeOperand=.P + CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=@[EnhancedNullability] .P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUse' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null + BLOCK type=kotlin.Unit origin=null + CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: GET_VAR 'val x: .P declared in .testForInArrayUse' type=.P origin=null + CALL 'public open fun use (s: @[EnhancedNullability] .P): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + s: GET_VAR 'val x: .P declared in .testForInArrayUse' type=.P origin=null + FUN name:testForInListDestructured visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> [val] + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=FOR_LOOP_ITERATOR + $this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:@[NotNull(value = )] .P [val] + TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[EnhancedNullability] @[NotNull(value = )] .P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null + VAR name:x type:kotlin.Int [val] + CALL 'public final fun component1 (): kotlin.Int declared in .P' type=kotlin.Int origin=COMPONENT_N(index=1) + $this: GET_VAR 'val tmp_4: @[NotNull(value = )] .P declared in .testForInListDestructured' type=@[NotNull(value = )] .P origin=null + VAR name:y type:kotlin.Int [val] + CALL 'public final fun component2 (): kotlin.Int declared in .P' type=kotlin.Int origin=COMPONENT_N(index=2) + $this: GET_VAR 'val tmp_4: @[NotNull(value = )] .P declared in .testForInListDestructured' type=@[NotNull(value = )] .P origin=null + BLOCK type=kotlin.Unit origin=null + FUN name:testForInListUnused visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_5 type:kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> [val] + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=FOR_LOOP_ITERATOR + $this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_5: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testForInListUnused' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:@[NotNull(value = )] .P [val] + TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[EnhancedNullability] @[NotNull(value = )] .P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_5: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testForInListUnused' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null + BLOCK type=kotlin.Unit origin=null + FUN name:testForInListUse visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_6 type:kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> [val] + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=FOR_LOOP_ITERATOR + $this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[EnhancedNullability] @[NotNull(value = )] .P>? origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_6: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testForInListUse' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:@[NotNull(value = )] .P [val] + TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[EnhancedNullability] @[NotNull(value = )] .P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_6: kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> declared in .testForInListUse' type=kotlin.collections.MutableIterator<@[EnhancedNullability] @[NotNull(value = )] .P> origin=null + BLOCK type=kotlin.Unit origin=null + CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: GET_VAR 'val x: @[NotNull(value = )] .P declared in .testForInListUse' type=@[NotNull(value = )] .P origin=null + CALL 'public open fun use (s: @[EnhancedNullability] .P): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + s: GET_VAR 'val x: @[NotNull(value = )] .P declared in .testForInListUse' type=@[NotNull(value = )] .P origin=null + FUN name:use visibility:public modality:FINAL <> (s:.P) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:.P + BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.kt.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.kt.txt index b6f8309c0a7..4bffa510bc7 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.kt.txt @@ -1,86 +1,4 @@ -fun use(s: P) { -} - -fun testForInListUnused() { - { // BLOCK - val tmp_0: MutableIterator<@EnhancedNullability @NotNull P> = listOfNotNull().iterator() - while (tmp_0.hasNext()) { // BLOCK - val x: @NotNull P = tmp_0.next() /*!! @NotNull P */ - { // BLOCK - } - } - } -} - -fun testForInListDestructured() { - { // BLOCK - val tmp_1: MutableIterator<@EnhancedNullability @NotNull P> = listOfNotNull().iterator() - while (tmp_1.hasNext()) { // BLOCK - val tmp_2: @NotNull P = tmp_1.next() /*!! @NotNull P */ - val x: Int = tmp_2.component1() - val y: Int = tmp_2.component2() - { // BLOCK - } - } - } -} - -fun testDesugaredForInList() { - val iterator: MutableIterator<@EnhancedNullability @NotNull P> = listOfNotNull().iterator() - while (iterator.hasNext()) { // BLOCK - val x: @NotNull P = iterator.next() /*!! @NotNull P */ - } -} - -fun testForInArrayUnused(j: J) { - { // BLOCK - val tmp_3: Iterator<@EnhancedNullability P> = j.arrayOfNotNull().iterator() - while (tmp_3.hasNext()) { // BLOCK - val x: P = tmp_3.next() /*!! P */ - { // BLOCK - } - } - } -} - -fun testForInListUse() { - { // BLOCK - val tmp_4: MutableIterator<@EnhancedNullability @NotNull P> = listOfNotNull().iterator() - while (tmp_4.hasNext()) { // BLOCK - val x: @NotNull P = tmp_4.next() /*!! @NotNull P */ - { // BLOCK - use(s = x) - use(s = x) - } - } - } -} - -fun testForInArrayUse(j: J) { - { // BLOCK - val tmp_5: Iterator<@EnhancedNullability P> = j.arrayOfNotNull().iterator() - while (tmp_5.hasNext()) { // BLOCK - val x: P = tmp_5.next() /*!! P */ - { // BLOCK - use(s = x) - use(s = x) - } - } - } -} - -interface K { - abstract fun arrayOfNotNull(): Array

- -} - data class P { - constructor(x: Int, y: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x get @@ -89,6 +7,12 @@ data class P { field = y get + constructor(x: Int, y: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): Int { return .#x } @@ -101,8 +25,21 @@ data class P { return P(x = x, y = y) } - override fun toString(): String { - return "P(" + "x=" + .#x + ", " + "y=" + .#y + ")" + override operator fun equals(other: Any?): Boolean { + when { + EQEQEQ(arg0 = , arg1 = other) -> return true + } + when { + other !is P -> return false + } + val tmp_0: P = other as P + when { + EQEQ(arg0 = .#x, arg1 = tmp_0.#x).not() -> return false + } + when { + EQEQ(arg0 = .#y, arg1 = tmp_0.#y).not() -> return false + } + return true } override fun hashCode(): Int { @@ -111,22 +48,85 @@ data class P { return result } - override operator fun equals(other: Any?): Boolean { - when { - EQEQEQ(arg0 = , arg1 = other) -> return true - } - when { - other !is P -> return false - } - val tmp_6: P = other as P - when { - EQEQ(arg0 = .#x, arg1 = tmp_6.#x).not() -> return false - } - when { - EQEQ(arg0 = .#y, arg1 = tmp_6.#y).not() -> return false - } - return true + override fun toString(): String { + return "P(" + "x=" + .#x + ", " + "y=" + .#y + ")" } } +interface K { + abstract fun arrayOfNotNull(): Array

+ +} + +fun testDesugaredForInList() { + val iterator: MutableIterator<@EnhancedNullability @NotNull P> = listOfNotNull().iterator() + while (iterator.hasNext()) { // BLOCK + val x: @NotNull P = iterator.next() /*!! @NotNull P */ + } +} + +fun testForInArrayUnused(j: J) { + { // BLOCK + val tmp_1: Iterator<@EnhancedNullability P> = j.arrayOfNotNull().iterator() + while (tmp_1.hasNext()) { // BLOCK + val x: P = tmp_1.next() /*!! P */ + { // BLOCK + } + } + } +} + +fun testForInArrayUse(j: J) { + { // BLOCK + val tmp_2: Iterator<@EnhancedNullability P> = j.arrayOfNotNull().iterator() + while (tmp_2.hasNext()) { // BLOCK + val x: P = tmp_2.next() /*!! P */ + { // BLOCK + use(s = x) + use(s = x) + } + } + } +} + +fun testForInListDestructured() { + { // BLOCK + val tmp_3: MutableIterator<@EnhancedNullability @NotNull P> = listOfNotNull().iterator() + while (tmp_3.hasNext()) { // BLOCK + val tmp_4: @NotNull P = tmp_3.next() /*!! @NotNull P */ + val x: Int = tmp_4.component1() + val y: Int = tmp_4.component2() + { // BLOCK + } + } + } +} + +fun testForInListUnused() { + { // BLOCK + val tmp_5: MutableIterator<@EnhancedNullability @NotNull P> = listOfNotNull().iterator() + while (tmp_5.hasNext()) { // BLOCK + val x: @NotNull P = tmp_5.next() /*!! @NotNull P */ + { // BLOCK + } + } + } +} + +fun testForInListUse() { + { // BLOCK + val tmp_6: MutableIterator<@EnhancedNullability @NotNull P> = listOfNotNull().iterator() + while (tmp_6.hasNext()) { // BLOCK + val x: @NotNull P = tmp_6.next() /*!! @NotNull P */ + { // BLOCK + use(s = x) + use(s = x) + } + } + } +} + +fun use(s: P) { +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.ir.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.ir.txt index dff9a55d5b1..737b1d3227f 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.ir.txt @@ -1,149 +1,6 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt - FUN name:use visibility:public modality:FINAL <> (s:.P) returnType:kotlin.Unit - VALUE_PARAMETER name:s index:0 type:.P - BLOCK_BODY - FUN name:testForInListUnused visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR - $this: TYPE_OP type=kotlin.collections.MutableList<*> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList<*> - TYPE_OP type=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> - CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testForInListUnused' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:@[NotNull(value = )] @[EnhancedNullability] .P [val] - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testForInListUnused' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null - BLOCK type=kotlin.Unit origin=null - FUN name:testForInListDestructured visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR - $this: TYPE_OP type=kotlin.collections.MutableList<*> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList<*> - TYPE_OP type=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> - CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:@[NotNull(value = )] @[EnhancedNullability] .P [val] - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null - VAR name:x type:kotlin.Int [val] - CALL 'public final fun component1 (): kotlin.Int declared in .P' type=kotlin.Int origin=COMPONENT_N(index=1) - $this: TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P - GET_VAR 'val tmp_2: @[NotNull(value = )] @[EnhancedNullability] .P declared in .testForInListDestructured' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=null - VAR name:y type:kotlin.Int [val] - CALL 'public final fun component2 (): kotlin.Int declared in .P' type=kotlin.Int origin=COMPONENT_N(index=2) - $this: TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P - GET_VAR 'val tmp_2: @[NotNull(value = )] @[EnhancedNullability] .P declared in .testForInListDestructured' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=null - BLOCK type=kotlin.Unit origin=null - FUN name:testDesugaredForInList visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:iterator type:kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null - $this: TYPE_OP type=kotlin.collections.MutableList<*> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList<*> - TYPE_OP type=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> - CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? origin=null - WHILE label=null origin=WHILE_LOOP - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testDesugaredForInList' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null - body: BLOCK type=kotlin.Unit origin=null - VAR name:x type:@[NotNull(value = )] .P [val] - TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=null - $this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testDesugaredForInList' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null - FUN name:testForInArrayUnused visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit - VALUE_PARAMETER name:j index:0 type:.J - BLOCK_BODY - BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.Iterator<@[EnhancedNullability] .P> [val] - CALL 'public final fun iterator (): kotlin.collections.Iterator declared in kotlin.Array' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR - $this: TYPE_OP type=kotlin.Array<@[EnhancedNullability] .P> origin=IMPLICIT_CAST typeOperand=kotlin.Array<@[EnhancedNullability] .P> - TYPE_OP type=kotlin.Array.P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.Array.P> - CALL 'public open fun arrayOfNotNull (): @[EnhancedNullability] kotlin.Array.P> declared in .J' type=@[EnhancedNullability] kotlin.Array.P> origin=null - $this: GET_VAR 'j: .J declared in .testForInArrayUnused' type=.J origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUnused' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:@[EnhancedNullability] .P [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=@[EnhancedNullability] .P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUnused' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null - BLOCK type=kotlin.Unit origin=null - FUN name:testForInListUse visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_4 type:kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR - $this: TYPE_OP type=kotlin.collections.MutableList<*> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList<*> - TYPE_OP type=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> - CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_4: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testForInListUse' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:@[NotNull(value = )] @[EnhancedNullability] .P [val] - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_4: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testForInListUse' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null - BLOCK type=kotlin.Unit origin=null - CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null - s: TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P - GET_VAR 'val x: @[NotNull(value = )] @[EnhancedNullability] .P declared in .testForInListUse' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=null - CALL 'public open fun use (s: @[EnhancedNullability] .P): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - s: GET_VAR 'val x: @[NotNull(value = )] @[EnhancedNullability] .P declared in .testForInListUse' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=null - FUN name:testForInArrayUse visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit - VALUE_PARAMETER name:j index:0 type:.J - BLOCK_BODY - BLOCK type=kotlin.Unit origin=FOR_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_5 type:kotlin.collections.Iterator<@[EnhancedNullability] .P> [val] - CALL 'public final fun iterator (): kotlin.collections.Iterator declared in kotlin.Array' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR - $this: TYPE_OP type=kotlin.Array<@[EnhancedNullability] .P> origin=IMPLICIT_CAST typeOperand=kotlin.Array<@[EnhancedNullability] .P> - TYPE_OP type=kotlin.Array.P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.Array.P> - CALL 'public open fun arrayOfNotNull (): @[EnhancedNullability] kotlin.Array.P> declared in .J' type=@[EnhancedNullability] kotlin.Array.P> origin=null - $this: GET_VAR 'j: .J declared in .testForInArrayUse' type=.J origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUse' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:@[EnhancedNullability] .P [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=@[EnhancedNullability] .P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUse' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null - BLOCK type=kotlin.Unit origin=null - CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null - s: TYPE_OP type=.P origin=IMPLICIT_NOTNULL typeOperand=.P - GET_VAR 'val x: @[EnhancedNullability] .P declared in .testForInArrayUse' type=@[EnhancedNullability] .P origin=null - CALL 'public open fun use (s: @[EnhancedNullability] .P): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - s: GET_VAR 'val x: @[EnhancedNullability] .P declared in .testForInArrayUse' type=@[EnhancedNullability] .P origin=null - CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K - FUN name:arrayOfNotNull visibility:public modality:ABSTRACT <> ($this:.K) returnType:kotlin.Array<.P> - $this: VALUE_PARAMETER name: type:.K - 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: 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 CLASS CLASS name:P modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.P - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.P [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -166,6 +23,12 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .P' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .P declared in .P.' type=.P origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.P [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.P) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER name: type:.P BLOCK_BODY @@ -193,41 +56,6 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int) declared in .P' type=.P origin=null x: GET_VAR 'x: kotlin.Int declared in .P.copy' type=kotlin.Int origin=null y: GET_VAR 'y: kotlin.Int declared in .P.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.P) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.P - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .P' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="P(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .P declared in .P.toString' type=.P origin=null - CONST String type=kotlin.String value=", " - CONST String type=kotlin.String value="y=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .P declared in .P.toString' type=.P origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.P) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.P - BLOCK_BODY - VAR name:result type:kotlin.Int [var] - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null - SET_VAR 'var result: kotlin.Int declared in .P.hashCode' type=kotlin.Unit origin=EQ - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int declared in .P.hashCode' type=kotlin.Int origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .P' - GET_VAR 'var result: kotlin.Int declared in .P.hashCode' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.P, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -247,7 +75,7 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt GET_VAR 'other: kotlin.Any? declared in .P.equals' type=kotlin.Any? origin=null then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' CONST Boolean type=kotlin.Boolean value=false - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.P [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.P [val] TYPE_OP type=.P origin=CAST typeOperand=.P GET_VAR 'other: kotlin.Any? declared in .P.equals' type=kotlin.Any? origin=null WHEN type=kotlin.Unit origin=null @@ -257,7 +85,7 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .P declared in .P.equals' type=.P origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR 'val tmp_6: .P declared in .P.equals' type=.P origin=null + receiver: GET_VAR 'val tmp_0: .P declared in .P.equals' type=.P origin=null then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null @@ -267,8 +95,180 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .P declared in .P.equals' type=.P origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR 'val tmp_6: .P declared in .P.equals' type=.P origin=null + receiver: GET_VAR 'val tmp_0: .P declared in .P.equals' type=.P origin=null then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.P) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.P + BLOCK_BODY + VAR name:result type:kotlin.Int [var] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null + SET_VAR 'var result: kotlin.Int declared in .P.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int declared in .P.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .P' + GET_VAR 'var result: kotlin.Int declared in .P.hashCode' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.P) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.P + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .P' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="P(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .P declared in .P.toString' type=.P origin=null + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="y=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .P declared in .P.toString' type=.P origin=null + CONST String type=kotlin.String value=")" + CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K + 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: 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:arrayOfNotNull visibility:public modality:ABSTRACT <> ($this:.K) returnType:kotlin.Array<.P> + $this: VALUE_PARAMETER name: type:.K + FUN name:testDesugaredForInList visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:iterator type:kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> [val] + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null + $this: TYPE_OP type=kotlin.collections.MutableList<*> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList<*> + TYPE_OP type=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> + CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? origin=null + WHILE label=null origin=WHILE_LOOP + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=null + $this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testDesugaredForInList' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null + body: BLOCK type=kotlin.Unit origin=null + VAR name:x type:@[NotNull(value = )] .P [val] + TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=null + $this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testDesugaredForInList' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null + FUN name:testForInArrayUnused visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit + VALUE_PARAMETER name:j index:0 type:.J + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.Iterator<@[EnhancedNullability] .P> [val] + CALL 'public final fun iterator (): kotlin.collections.Iterator declared in kotlin.Array' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR + $this: TYPE_OP type=kotlin.Array<@[EnhancedNullability] .P> origin=IMPLICIT_CAST typeOperand=kotlin.Array<@[EnhancedNullability] .P> + TYPE_OP type=kotlin.Array.P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.Array.P> + CALL 'public open fun arrayOfNotNull (): @[EnhancedNullability] kotlin.Array.P> declared in .J' type=@[EnhancedNullability] kotlin.Array.P> origin=null + $this: GET_VAR 'j: .J declared in .testForInArrayUnused' type=.J origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUnused' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:@[EnhancedNullability] .P [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=@[EnhancedNullability] .P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUnused' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null + BLOCK type=kotlin.Unit origin=null + FUN name:testForInArrayUse visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit + VALUE_PARAMETER name:j index:0 type:.J + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator<@[EnhancedNullability] .P> [val] + CALL 'public final fun iterator (): kotlin.collections.Iterator declared in kotlin.Array' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR + $this: TYPE_OP type=kotlin.Array<@[EnhancedNullability] .P> origin=IMPLICIT_CAST typeOperand=kotlin.Array<@[EnhancedNullability] .P> + TYPE_OP type=kotlin.Array.P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.Array.P> + CALL 'public open fun arrayOfNotNull (): @[EnhancedNullability] kotlin.Array.P> declared in .J' type=@[EnhancedNullability] kotlin.Array.P> origin=null + $this: GET_VAR 'j: .J declared in .testForInArrayUse' type=.J origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUse' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:@[EnhancedNullability] .P [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=@[EnhancedNullability] .P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<@[EnhancedNullability] .P> declared in .testForInArrayUse' type=kotlin.collections.Iterator<@[EnhancedNullability] .P> origin=null + BLOCK type=kotlin.Unit origin=null + CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: TYPE_OP type=.P origin=IMPLICIT_NOTNULL typeOperand=.P + GET_VAR 'val x: @[EnhancedNullability] .P declared in .testForInArrayUse' type=@[EnhancedNullability] .P origin=null + CALL 'public open fun use (s: @[EnhancedNullability] .P): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + s: GET_VAR 'val x: @[EnhancedNullability] .P declared in .testForInArrayUse' type=@[EnhancedNullability] .P origin=null + FUN name:testForInListDestructured visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> [val] + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR + $this: TYPE_OP type=kotlin.collections.MutableList<*> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList<*> + TYPE_OP type=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> + CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:@[NotNull(value = )] @[EnhancedNullability] .P [val] + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null + VAR name:x type:kotlin.Int [val] + CALL 'public final fun component1 (): kotlin.Int declared in .P' type=kotlin.Int origin=COMPONENT_N(index=1) + $this: TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P + GET_VAR 'val tmp_4: @[NotNull(value = )] @[EnhancedNullability] .P declared in .testForInListDestructured' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=null + VAR name:y type:kotlin.Int [val] + CALL 'public final fun component2 (): kotlin.Int declared in .P' type=kotlin.Int origin=COMPONENT_N(index=2) + $this: TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P + GET_VAR 'val tmp_4: @[NotNull(value = )] @[EnhancedNullability] .P declared in .testForInListDestructured' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=null + BLOCK type=kotlin.Unit origin=null + FUN name:testForInListUnused visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_5 type:kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> [val] + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR + $this: TYPE_OP type=kotlin.collections.MutableList<*> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList<*> + TYPE_OP type=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> + CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_5: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testForInListUnused' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:@[NotNull(value = )] @[EnhancedNullability] .P [val] + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_5: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testForInListUnused' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null + BLOCK type=kotlin.Unit origin=null + FUN name:testForInListUse visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_6 type:kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> [val] + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR + $this: TYPE_OP type=kotlin.collections.MutableList<*> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList<*> + TYPE_OP type=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = )] @[EnhancedNullability] .P> + CALL 'public open fun listOfNotNull (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[NotNull(value = )] @[EnhancedNullability] .P>? origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_6: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testForInListUse' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:@[NotNull(value = )] @[EnhancedNullability] .P [val] + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator declared in kotlin.collections.MutableIterator' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_6: kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> declared in .testForInListUse' type=kotlin.collections.MutableIterator<@[NotNull(value = )] @[EnhancedNullability] .P> origin=null + BLOCK type=kotlin.Unit origin=null + CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: TYPE_OP type=@[NotNull(value = )] .P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = )] .P + GET_VAR 'val x: @[NotNull(value = )] @[EnhancedNullability] .P declared in .testForInListUse' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=null + CALL 'public open fun use (s: @[EnhancedNullability] .P): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + s: GET_VAR 'val x: @[NotNull(value = )] @[EnhancedNullability] .P declared in .testForInListUse' type=@[NotNull(value = )] @[EnhancedNullability] .P origin=null + FUN name:use visibility:public modality:FINAL <> (s:.P) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:.P + BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.kt.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.kt.txt index 716bc85ac8c..c958e9efb56 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.kt.txt @@ -1,86 +1,4 @@ -fun use(s: P) { -} - -fun testForInListUnused() { - { // BLOCK - val tmp_0: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator() - while (tmp_0.hasNext()) { // BLOCK - val x: @NotNull @EnhancedNullability P = tmp_0.next() - { // BLOCK - } - } - } -} - -fun testForInListDestructured() { - { // BLOCK - val tmp_1: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator() - while (tmp_1.hasNext()) { // BLOCK - val tmp_2: @NotNull @EnhancedNullability P = tmp_1.next() - val x: Int = tmp_2 /*!! @NotNull P */.component1() - val y: Int = tmp_2 /*!! @NotNull P */.component2() - { // BLOCK - } - } - } -} - -fun testDesugaredForInList() { - val iterator: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator() - while (iterator.hasNext()) { // BLOCK - val x: @NotNull P = iterator.next() /*!! @NotNull P */ - } -} - -fun testForInArrayUnused(j: J) { - { // BLOCK - val tmp_3: Iterator<@EnhancedNullability P> = j.arrayOfNotNull() /*!! Array */ /*as Array<@EnhancedNullability P> */.iterator() - while (tmp_3.hasNext()) { // BLOCK - val x: @EnhancedNullability P = tmp_3.next() - { // BLOCK - } - } - } -} - -fun testForInListUse() { - { // BLOCK - val tmp_4: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator() - while (tmp_4.hasNext()) { // BLOCK - val x: @NotNull @EnhancedNullability P = tmp_4.next() - { // BLOCK - use(s = x /*!! @NotNull P */) - use(s = x) - } - } - } -} - -fun testForInArrayUse(j: J) { - { // BLOCK - val tmp_5: Iterator<@EnhancedNullability P> = j.arrayOfNotNull() /*!! Array */ /*as Array<@EnhancedNullability P> */.iterator() - while (tmp_5.hasNext()) { // BLOCK - val x: @EnhancedNullability P = tmp_5.next() - { // BLOCK - use(s = x /*!! P */) - use(s = x) - } - } - } -} - -interface K { - abstract fun arrayOfNotNull(): Array

- -} - data class P { - constructor(x: Int, y: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - val x: Int field = x get @@ -89,6 +7,12 @@ data class P { field = y get + constructor(x: Int, y: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + operator fun component1(): Int { return .#x } @@ -101,8 +25,21 @@ data class P { return P(x = x, y = y) } - override fun toString(): String { - return "P(" + "x=" + .#x + ", " + "y=" + .#y + ")" + override operator fun equals(other: Any?): Boolean { + when { + EQEQEQ(arg0 = , arg1 = other) -> return true + } + when { + other !is P -> return false + } + val tmp_0: P = other as P + when { + EQEQ(arg0 = .#x, arg1 = tmp_0.#x).not() -> return false + } + when { + EQEQ(arg0 = .#y, arg1 = tmp_0.#y).not() -> return false + } + return true } override fun hashCode(): Int { @@ -111,21 +48,85 @@ data class P { return result } - override operator fun equals(other: Any?): Boolean { - when { - EQEQEQ(arg0 = , arg1 = other) -> return true - } - when { - other !is P -> return false - } - val tmp_6: P = other as P - when { - EQEQ(arg0 = .#x, arg1 = tmp_6.#x).not() -> return false - } - when { - EQEQ(arg0 = .#y, arg1 = tmp_6.#y).not() -> return false - } - return true + override fun toString(): String { + return "P(" + "x=" + .#x + ", " + "y=" + .#y + ")" } } + +interface K { + abstract fun arrayOfNotNull(): Array

+ +} + +fun testDesugaredForInList() { + val iterator: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator() + while (iterator.hasNext()) { // BLOCK + val x: @NotNull P = iterator.next() /*!! @NotNull P */ + } +} + +fun testForInArrayUnused(j: J) { + { // BLOCK + val tmp_1: Iterator<@EnhancedNullability P> = j.arrayOfNotNull() /*!! Array */ /*as Array<@EnhancedNullability P> */.iterator() + while (tmp_1.hasNext()) { // BLOCK + val x: @EnhancedNullability P = tmp_1.next() + { // BLOCK + } + } + } +} + +fun testForInArrayUse(j: J) { + { // BLOCK + val tmp_2: Iterator<@EnhancedNullability P> = j.arrayOfNotNull() /*!! Array */ /*as Array<@EnhancedNullability P> */.iterator() + while (tmp_2.hasNext()) { // BLOCK + val x: @EnhancedNullability P = tmp_2.next() + { // BLOCK + use(s = x /*!! P */) + use(s = x) + } + } + } +} + +fun testForInListDestructured() { + { // BLOCK + val tmp_3: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator() + while (tmp_3.hasNext()) { // BLOCK + val tmp_4: @NotNull @EnhancedNullability P = tmp_3.next() + val x: Int = tmp_4 /*!! @NotNull P */.component1() + val y: Int = tmp_4 /*!! @NotNull P */.component2() + { // BLOCK + } + } + } +} + +fun testForInListUnused() { + { // BLOCK + val tmp_5: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator() + while (tmp_5.hasNext()) { // BLOCK + val x: @NotNull @EnhancedNullability P = tmp_5.next() + { // BLOCK + } + } + } +} + +fun testForInListUse() { + { // BLOCK + val tmp_6: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator() + while (tmp_6.hasNext()) { // BLOCK + val x: @NotNull @EnhancedNullability P = tmp_6.next() + { // BLOCK + use(s = x /*!! @NotNull P */) + use(s = x) + } + } + } +} + +fun use(s: P) { +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.fir.ir.txt b/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.fir.ir.txt index fe3437a5158..58d039794bb 100644 --- a/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.fir.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.fir.ir.txt @@ -1,21 +1,13 @@ FILE fqName: fileName:/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt - FUN name:testPlatformEqualsPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Boolean + FUN name:testKotlinCompareToPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testPlatformEqualsPlatform (): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null - $this: CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null - $this: GET_VAR ': .JavaClass declared in .testPlatformEqualsPlatform' type=.JavaClass origin=null - other: CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null - $this: GET_VAR ': .JavaClass declared in .testPlatformEqualsPlatform' type=.JavaClass origin=null - FUN name:testPlatformEqualsKotlin visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:.JavaClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testPlatformEqualsKotlin (): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null - $this: CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null - $this: GET_VAR ': .JavaClass declared in .testPlatformEqualsKotlin' type=.JavaClass origin=null - other: CONST Double type=kotlin.Double value=0.0 + RETURN type=kotlin.Nothing from='public final fun testKotlinCompareToPlatform (): kotlin.Int declared in ' + CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null + $this: CONST Double type=kotlin.Double value=0.0 + other: TYPE_OP type=kotlin.Double origin=IMPLICIT_NOTNULL typeOperand=kotlin.Double + CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .testKotlinCompareToPlatform' type=.JavaClass origin=null FUN name:testKotlinEqualsPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY @@ -24,6 +16,14 @@ FILE fqName: fileName:/explicitEqualsAndCompareToCallsOnPlatformTypeReceiv $this: CONST Double type=kotlin.Double value=0.0 other: CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null $this: GET_VAR ': .JavaClass declared in .testKotlinEqualsPlatform' type=.JavaClass origin=null + FUN name:testPlatformCompareToKotlin visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int + $receiver: VALUE_PARAMETER name: type:.JavaClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testPlatformCompareToKotlin (): kotlin.Int declared in ' + CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null + $this: CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .testPlatformCompareToKotlin' type=.JavaClass origin=null + other: CONST Double type=kotlin.Double value=0.0 FUN name:testPlatformCompareToPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY @@ -34,20 +34,20 @@ FILE fqName: fileName:/explicitEqualsAndCompareToCallsOnPlatformTypeReceiv other: TYPE_OP type=kotlin.Double origin=IMPLICIT_NOTNULL typeOperand=kotlin.Double CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null $this: GET_VAR ': .JavaClass declared in .testPlatformCompareToPlatform' type=.JavaClass origin=null - FUN name:testPlatformCompareToKotlin visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int + FUN name:testPlatformEqualsKotlin visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testPlatformCompareToKotlin (): kotlin.Int declared in ' - CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun testPlatformEqualsKotlin (): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null $this: CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null - $this: GET_VAR ': .JavaClass declared in .testPlatformCompareToKotlin' type=.JavaClass origin=null + $this: GET_VAR ': .JavaClass declared in .testPlatformEqualsKotlin' type=.JavaClass origin=null other: CONST Double type=kotlin.Double value=0.0 - FUN name:testKotlinCompareToPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int + FUN name:testPlatformEqualsPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testKotlinCompareToPlatform (): kotlin.Int declared in ' - CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null - $this: CONST Double type=kotlin.Double value=0.0 - other: TYPE_OP type=kotlin.Double origin=IMPLICIT_NOTNULL typeOperand=kotlin.Double - CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null - $this: GET_VAR ': .JavaClass declared in .testKotlinCompareToPlatform' type=.JavaClass origin=null + RETURN type=kotlin.Nothing from='public final fun testPlatformEqualsPlatform (): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null + $this: CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .testPlatformEqualsPlatform' type=.JavaClass origin=null + other: CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .testPlatformEqualsPlatform' type=.JavaClass origin=null diff --git a/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.fir.kt.txt b/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.fir.kt.txt index 4985c2b163c..f35df8ca557 100644 --- a/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.fir.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.fir.kt.txt @@ -1,24 +1,24 @@ -fun JavaClass.testPlatformEqualsPlatform(): Boolean { - return .null0().equals(other = .null0()) -} - -fun JavaClass.testPlatformEqualsKotlin(): Boolean { - return .null0().equals(other = 0.0) +fun JavaClass.testKotlinCompareToPlatform(): Int { + return 0.0.compareTo(other = .null0() /*!! Double */) } fun JavaClass.testKotlinEqualsPlatform(): Boolean { return 0.0.equals(other = .null0()) } -fun JavaClass.testPlatformCompareToPlatform(): Int { - return .null0().compareTo(other = .null0() /*!! Double */) -} - fun JavaClass.testPlatformCompareToKotlin(): Int { return .null0().compareTo(other = 0.0) } -fun JavaClass.testKotlinCompareToPlatform(): Int { - return 0.0.compareTo(other = .null0() /*!! Double */) +fun JavaClass.testPlatformCompareToPlatform(): Int { + return .null0().compareTo(other = .null0() /*!! Double */) +} + +fun JavaClass.testPlatformEqualsKotlin(): Boolean { + return .null0().equals(other = 0.0) +} + +fun JavaClass.testPlatformEqualsPlatform(): Boolean { + return .null0().equals(other = .null0()) } diff --git a/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.ir.txt b/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.ir.txt index 2a553631803..2c73d3f6cd9 100644 --- a/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.ir.txt @@ -1,23 +1,13 @@ FILE fqName: fileName:/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt - FUN name:testPlatformEqualsPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Boolean + FUN name:testKotlinCompareToPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testPlatformEqualsPlatform (): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null - $this: TYPE_OP type=kotlin.Double origin=IMPLICIT_NOTNULL typeOperand=kotlin.Double + RETURN type=kotlin.Nothing from='public final fun testKotlinCompareToPlatform (): kotlin.Int declared in ' + CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null + $this: CONST Double type=kotlin.Double value=0.0 + other: TYPE_OP type=kotlin.Double origin=IMPLICIT_NOTNULL typeOperand=kotlin.Double CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null - $this: GET_VAR ': .JavaClass declared in .testPlatformEqualsPlatform' type=.JavaClass origin=null - other: CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null - $this: GET_VAR ': .JavaClass declared in .testPlatformEqualsPlatform' type=.JavaClass origin=null - FUN name:testPlatformEqualsKotlin visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:.JavaClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testPlatformEqualsKotlin (): kotlin.Boolean declared in ' - CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null - $this: TYPE_OP type=kotlin.Double origin=IMPLICIT_NOTNULL typeOperand=kotlin.Double - CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null - $this: GET_VAR ': .JavaClass declared in .testPlatformEqualsKotlin' type=.JavaClass origin=null - other: CONST Double type=kotlin.Double value=0.0 + $this: GET_VAR ': .JavaClass declared in .testKotlinCompareToPlatform' type=.JavaClass origin=null FUN name:testKotlinEqualsPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY @@ -26,6 +16,15 @@ FILE fqName: fileName:/explicitEqualsAndCompareToCallsOnPlatformTypeReceiv $this: CONST Double type=kotlin.Double value=0.0 other: CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null $this: GET_VAR ': .JavaClass declared in .testKotlinEqualsPlatform' type=.JavaClass origin=null + FUN name:testPlatformCompareToKotlin visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int + $receiver: VALUE_PARAMETER name: type:.JavaClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testPlatformCompareToKotlin (): kotlin.Int declared in ' + CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null + $this: TYPE_OP type=kotlin.Double origin=IMPLICIT_NOTNULL typeOperand=kotlin.Double + CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .testPlatformCompareToKotlin' type=.JavaClass origin=null + other: CONST Double type=kotlin.Double value=0.0 FUN name:testPlatformCompareToPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY @@ -37,21 +36,22 @@ FILE fqName: fileName:/explicitEqualsAndCompareToCallsOnPlatformTypeReceiv other: TYPE_OP type=kotlin.Double origin=IMPLICIT_NOTNULL typeOperand=kotlin.Double CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null $this: GET_VAR ': .JavaClass declared in .testPlatformCompareToPlatform' type=.JavaClass origin=null - FUN name:testPlatformCompareToKotlin visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int + FUN name:testPlatformEqualsKotlin visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testPlatformCompareToKotlin (): kotlin.Int declared in ' - CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun testPlatformEqualsKotlin (): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null $this: TYPE_OP type=kotlin.Double origin=IMPLICIT_NOTNULL typeOperand=kotlin.Double CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null - $this: GET_VAR ': .JavaClass declared in .testPlatformCompareToKotlin' type=.JavaClass origin=null + $this: GET_VAR ': .JavaClass declared in .testPlatformEqualsKotlin' type=.JavaClass origin=null other: CONST Double type=kotlin.Double value=0.0 - FUN name:testKotlinCompareToPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int + FUN name:testPlatformEqualsPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testKotlinCompareToPlatform (): kotlin.Int declared in ' - CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null - $this: CONST Double type=kotlin.Double value=0.0 - other: TYPE_OP type=kotlin.Double origin=IMPLICIT_NOTNULL typeOperand=kotlin.Double + RETURN type=kotlin.Nothing from='public final fun testPlatformEqualsPlatform (): kotlin.Boolean declared in ' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Double' type=kotlin.Boolean origin=null + $this: TYPE_OP type=kotlin.Double origin=IMPLICIT_NOTNULL typeOperand=kotlin.Double CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null - $this: GET_VAR ': .JavaClass declared in .testKotlinCompareToPlatform' type=.JavaClass origin=null + $this: GET_VAR ': .JavaClass declared in .testPlatformEqualsPlatform' type=.JavaClass origin=null + other: CALL 'public open fun null0 (): @[FlexibleNullability] kotlin.Double? declared in .JavaClass' type=@[FlexibleNullability] kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .testPlatformEqualsPlatform' type=.JavaClass origin=null diff --git a/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt.txt b/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt.txt index 7d106cf39b5..826d83c526d 100644 --- a/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt.txt @@ -1,23 +1,24 @@ -fun JavaClass.testPlatformEqualsPlatform(): Boolean { - return .null0() /*!! Double */.equals(other = .null0()) -} - -fun JavaClass.testPlatformEqualsKotlin(): Boolean { - return .null0() /*!! Double */.equals(other = 0.0) +fun JavaClass.testKotlinCompareToPlatform(): Int { + return 0.0.compareTo(other = .null0() /*!! Double */) } fun JavaClass.testKotlinEqualsPlatform(): Boolean { return 0.0.equals(other = .null0()) } -fun JavaClass.testPlatformCompareToPlatform(): Int { - return .null0() /*!! Double */.compareTo(other = .null0() /*!! Double */) -} - fun JavaClass.testPlatformCompareToKotlin(): Int { return .null0() /*!! Double */.compareTo(other = 0.0) } -fun JavaClass.testKotlinCompareToPlatform(): Int { - return 0.0.compareTo(other = .null0() /*!! Double */) +fun JavaClass.testPlatformCompareToPlatform(): Int { + return .null0() /*!! Double */.compareTo(other = .null0() /*!! Double */) } + +fun JavaClass.testPlatformEqualsKotlin(): Boolean { + return .null0() /*!! Double */.equals(other = 0.0) +} + +fun JavaClass.testPlatformEqualsPlatform(): Boolean { + return .null0() /*!! Double */.equals(other = .null0()) +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.fir.ir.txt b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.fir.ir.txt index b1b84dfa3c2..92c1aad1c7b 100644 --- a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.fir.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.fir.ir.txt @@ -1,24 +1,23 @@ FILE fqName: fileName:/implicitNotNullOnPlatformType.kt - FUN name:f visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY CLASS CLASS name:MySet modality:FINAL visibility:public superTypes:[kotlin.collections.Set] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MySet CONSTRUCTOR visibility:public <> () returnType:.MySet [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MySet modality:FINAL visibility:public superTypes:[kotlin.collections.Set]' - PROPERTY name:size visibility:public modality:OPEN [val] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: - public abstract size: kotlin.Int - FUN name: visibility:public modality:OPEN <> ($this:.MySet) returnType:kotlin.Int - correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in kotlin.collections.Set - $this: VALUE_PARAMETER name: type:.MySet - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .MySet' - CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.Set + $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.collections.Set + $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.collections.Set + $this: VALUE_PARAMETER name: type:kotlin.Any 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 declared in kotlin.collections.Set @@ -49,19 +48,20 @@ FILE fqName: fileName:/implicitNotNullOnPlatformType.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator declared in .MySet' CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' 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] + PROPERTY name:size visibility:public modality:OPEN [val] overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.Set - $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.collections.Set - $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.collections.Set - $this: VALUE_PARAMETER name: type:kotlin.Any + public abstract size: kotlin.Int + FUN name: visibility:public modality:OPEN <> ($this:.MySet) returnType:kotlin.Int + correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in kotlin.collections.Set + $this: VALUE_PARAMETER name: type:.MySet + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .MySet' + CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null + FUN name:f visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun f (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.fir.kt.txt b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.fir.kt.txt index cb7cf8d81b9..5ab7cfa37c1 100644 --- a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.fir.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.fir.kt.txt @@ -1,6 +1,3 @@ -fun f(s: String) { -} - class MySet : Set { constructor() /* primary */ { super/*Any*/() @@ -8,11 +5,6 @@ class MySet : Set { } - override val size: Int - override get(): Int { - return TODO() - } - override operator fun contains(element: String): Boolean { return TODO() } @@ -29,6 +21,14 @@ class MySet : Set { return TODO() } + override val size: Int + override get(): Int { + return TODO() + } + +} + +fun f(s: String) { } fun test() { @@ -40,3 +40,4 @@ fun testContains(m: MySet) { m.contains(element = #STRING /*!! String */) /*~> Unit */ m.contains(element = "abc") /*~> Unit */ } + diff --git a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.ir.txt b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.ir.txt index b1b84dfa3c2..92c1aad1c7b 100644 --- a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.ir.txt @@ -1,24 +1,23 @@ FILE fqName: fileName:/implicitNotNullOnPlatformType.kt - FUN name:f visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY CLASS CLASS name:MySet modality:FINAL visibility:public superTypes:[kotlin.collections.Set] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MySet CONSTRUCTOR visibility:public <> () returnType:.MySet [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MySet modality:FINAL visibility:public superTypes:[kotlin.collections.Set]' - PROPERTY name:size visibility:public modality:OPEN [val] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: - public abstract size: kotlin.Int - FUN name: visibility:public modality:OPEN <> ($this:.MySet) returnType:kotlin.Int - correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in kotlin.collections.Set - $this: VALUE_PARAMETER name: type:.MySet - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .MySet' - CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.Set + $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.collections.Set + $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.collections.Set + $this: VALUE_PARAMETER name: type:kotlin.Any 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 declared in kotlin.collections.Set @@ -49,19 +48,20 @@ FILE fqName: fileName:/implicitNotNullOnPlatformType.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.Iterator declared in .MySet' CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' 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] + PROPERTY name:size visibility:public modality:OPEN [val] overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.Set - $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.collections.Set - $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.collections.Set - $this: VALUE_PARAMETER name: type:kotlin.Any + public abstract size: kotlin.Int + FUN name: visibility:public modality:OPEN <> ($this:.MySet) returnType:kotlin.Int + correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in kotlin.collections.Set + $this: VALUE_PARAMETER name: type:.MySet + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .MySet' + CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null + FUN name:f visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun f (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.kt.txt b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.kt.txt index c26f8cd2080..5543c8b479c 100644 --- a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.kt.txt @@ -1,6 +1,3 @@ -fun f(s: String) { -} - class MySet : Set { constructor() /* primary */ { super/*Any*/() @@ -8,11 +5,6 @@ class MySet : Set { } - override val size: Int - override get(): Int { - return TODO() - } - override operator fun contains(element: String): Boolean { return TODO() } @@ -29,6 +21,14 @@ class MySet : Set { return TODO() } + override val size: Int + override get(): Int { + return TODO() + } + +} + +fun f(s: String) { } fun test() { diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.ir.txt index eb5aaa6853f..8256b111c90 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.ir.txt @@ -1,63 +1,15 @@ Module: lib Module: main FILE fqName: fileName:/nullCheckOnInterfaceDelegation.kt - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.IFoo - 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: 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 - CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.A; .IFoo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.A; .IFoo]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Derived) returnType:@[FlexibleNullability] kotlin.String? - overridden: - public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .A - public abstract fun foo (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.Derived - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .Derived' - CALL 'public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .A' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]' type=@[FlexibleNullability] kotlin.String? origin=null - $this: GET_VAR ': .Derived declared in .Derived.foo' type=.Derived 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 .A - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo - $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 .A - public open fun hashCode (): kotlin.Int declared in .IFoo - $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 .A - public open fun toString (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegated + FIELD DELEGATE name:$$delegate_0 type:.Derived visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .Derived' type=.Derived origin=null CONSTRUCTOR visibility:public <> () returnType:.Delegated [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.IFoo]' - FIELD DELEGATE name:$$delegate_0 type:.Derived visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .Derived' type=.Derived origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Delegated) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -81,6 +33,54 @@ FILE fqName: fileName:/nullCheckOnInterfaceDelegation.kt overridden: public open fun toString (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.A; .IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.A; .IFoo]' + 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 .A + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo + $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 .A + public open fun hashCode (): kotlin.Int declared in .IFoo + $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 .A + public open fun toString (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.Derived) returnType:@[FlexibleNullability] kotlin.String? + overridden: + public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .A + public abstract fun foo (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.Derived + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .Derived' + CALL 'public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .A' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]' type=@[FlexibleNullability] kotlin.String? origin=null + $this: GET_VAR ': .Derived declared in .Derived.foo' type=.Derived origin=null + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + 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: 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:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.IFoo FUN name:testReturnValue visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testReturnValue (): kotlin.String declared in ' diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.kt.txt index a711a0bcae8..c221dbbf96d 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.kt.txt @@ -2,8 +2,17 @@ // MODULE: main // FILE: nullCheckOnInterfaceDelegation.kt -interface IFoo { - abstract fun foo(): String +class Delegated : IFoo { + private /* final field */ val $$delegate_0: Derived = Derived() + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override fun foo(): String { + return .#$$delegate_0.foo() /*!! String */ + } } @@ -20,20 +29,12 @@ class Derived : A, IFoo { } -class Delegated : IFoo { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: Derived = Derived() - override fun foo(): String { - return .#$$delegate_0.foo() /*!! String */ - } +interface IFoo { + abstract fun foo(): String } fun testReturnValue(): String { return Delegated().foo() } + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.ir.txt index 627d7d056ca..42c82c7494f 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.ir.txt @@ -1,11 +1,4 @@ FILE fqName: fileName:/nnStringVsT.kt - FUN name:useT visibility:public modality:FINAL (fn:kotlin.Function0.useT>) returnType:T of .useT - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.useT> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun useT (fn: kotlin.Function0.useT>): T of .useT declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useT origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.useT> declared in .useT' type=kotlin.Function0.useT> origin=VARIABLE_AS_FUNCTION FUN name:testNoNullCheck visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -16,3 +9,10 @@ FILE fqName: fileName:/nnStringVsT.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): @[EnhancedNullability] kotlin.String declared in .testNoNullCheck' CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null + FUN name:useT visibility:public modality:FINAL (fn:kotlin.Function0.useT>) returnType:T of .useT + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.useT> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun useT (fn: kotlin.Function0.useT>): T of .useT declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useT origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0.useT> declared in .useT' type=kotlin.Function0.useT> origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.kt.txt index dc478f48f32..3dfe73231a2 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.kt.txt @@ -1,10 +1,11 @@ -fun useT(fn: Function0): T { - return fn.invoke() -} - fun testNoNullCheck() { useT<@EnhancedNullability String>(fn = local fun (): @EnhancedNullability String { return notNullString() } ) /*~> Unit */ } + +fun useT(fn: Function0): T { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.ir.txt index fd3b22f4784..96caddb6f10 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.ir.txt @@ -1,11 +1,4 @@ FILE fqName: fileName:/nnStringVsTAny.kt - FUN name:useTAny visibility:public modality:FINAL (fn:kotlin.Function0.useTAny>) returnType:T of .useTAny - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.useTAny> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun useTAny (fn: kotlin.Function0.useTAny>): T of .useTAny declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTAny origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.useTAny> declared in .useTAny' type=kotlin.Function0.useTAny> origin=VARIABLE_AS_FUNCTION FUN name:testNoNullCheck visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -16,3 +9,10 @@ FILE fqName: fileName:/nnStringVsTAny.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): @[EnhancedNullability] kotlin.String declared in .testNoNullCheck' CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null + FUN name:useTAny visibility:public modality:FINAL (fn:kotlin.Function0.useTAny>) returnType:T of .useTAny + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.useTAny> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun useTAny (fn: kotlin.Function0.useTAny>): T of .useTAny declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTAny origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0.useTAny> declared in .useTAny' type=kotlin.Function0.useTAny> origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.kt.txt index 21344509cb9..a825d4dd153 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.kt.txt @@ -1,10 +1,11 @@ -fun useTAny(fn: Function0): T { - return fn.invoke() -} - fun testNoNullCheck() { useTAny<@EnhancedNullability String>(fn = local fun (): @EnhancedNullability String { return notNullString() } ) /*~> Unit */ } + +fun useTAny(fn: Function0): T { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.ir.txt index 6d1e702964a..7f1c2683155 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.ir.txt @@ -1,12 +1,4 @@ FILE fqName: fileName:/nnStringVsTConstrained.kt - FUN name:useTConstrained visibility:public modality:FINAL (xs:kotlin.Array.useTConstrained>, fn:kotlin.Function0.useTConstrained>) returnType:T of .useTConstrained - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:xs index:0 type:kotlin.Array.useTConstrained> - VALUE_PARAMETER name:fn index:1 type:kotlin.Function0.useTConstrained> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun useTConstrained (xs: kotlin.Array.useTConstrained>, fn: kotlin.Function0.useTConstrained>): T of .useTConstrained declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTConstrained origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.useTConstrained> declared in .useTConstrained' type=kotlin.Function0.useTConstrained> origin=VARIABLE_AS_FUNCTION FUN name:testWithNullCheck visibility:public modality:FINAL <> (xs:kotlin.Array) returnType:kotlin.Unit VALUE_PARAMETER name:xs index:0 type:kotlin.Array BLOCK_BODY @@ -20,3 +12,11 @@ FILE fqName: fileName:/nnStringVsTConstrained.kt RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .testWithNullCheck' TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null + FUN name:useTConstrained visibility:public modality:FINAL (xs:kotlin.Array.useTConstrained>, fn:kotlin.Function0.useTConstrained>) returnType:T of .useTConstrained + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:xs index:0 type:kotlin.Array.useTConstrained> + VALUE_PARAMETER name:fn index:1 type:kotlin.Function0.useTConstrained> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun useTConstrained (xs: kotlin.Array.useTConstrained>, fn: kotlin.Function0.useTConstrained>): T of .useTConstrained declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTConstrained origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0.useTConstrained> declared in .useTConstrained' type=kotlin.Function0.useTConstrained> origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.kt.txt index 2204fdce9fe..c4fc7c42bf9 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.kt.txt @@ -1,10 +1,11 @@ -fun useTConstrained(xs: Array, fn: Function0): T { - return fn.invoke() -} - fun testWithNullCheck(xs: Array) { useTConstrained(xs = xs, fn = local fun (): String { return notNullString() /*!! String */ } ) /*~> Unit */ } + +fun useTConstrained(xs: Array, fn: Function0): T { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.ir.txt index 9496ec47937..d5161ff803c 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.ir.txt @@ -1,12 +1,4 @@ FILE fqName: fileName:/nnStringVsTXArray.kt - FUN name:useTX visibility:public modality:FINAL (x:T of .useTX, fn:kotlin.Function0.useTX>) returnType:T of .useTX - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:x index:0 type:T of .useTX - VALUE_PARAMETER name:fn index:1 type:kotlin.Function0.useTX> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun useTX (x: T of .useTX, fn: kotlin.Function0.useTX>): T of .useTX declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTX origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.useTX> declared in .useTX' type=kotlin.Function0.useTX> origin=VARIABLE_AS_FUNCTION FUN name:testWithNullCheck visibility:public modality:FINAL <> (xs:kotlin.Array) returnType:kotlin.Unit VALUE_PARAMETER name:xs index:0 type:kotlin.Array BLOCK_BODY @@ -20,3 +12,11 @@ FILE fqName: fileName:/nnStringVsTXArray.kt RETURN type=kotlin.Nothing from='local final fun (): java.io.Serializable declared in .testWithNullCheck' TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null + FUN name:useTX visibility:public modality:FINAL (x:T of .useTX, fn:kotlin.Function0.useTX>) returnType:T of .useTX + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:x index:0 type:T of .useTX + VALUE_PARAMETER name:fn index:1 type:kotlin.Function0.useTX> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun useTX (x: T of .useTX, fn: kotlin.Function0.useTX>): T of .useTX declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTX origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0.useTX> declared in .useTX' type=kotlin.Function0.useTX> origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.kt.txt index 49ffddaca46..dbb096c6a95 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.kt.txt @@ -1,10 +1,11 @@ -fun useTX(x: T, fn: Function0): T { - return fn.invoke() -} - fun testWithNullCheck(xs: Array) { useTX(x = xs, fn = local fun (): Serializable { return notNullString() /*!! String */ } ) /*~> Unit */ } + +fun useTX(x: T, fn: Function0): T { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.ir.txt index 133a109ac00..036df9291c0 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.ir.txt @@ -1,12 +1,4 @@ FILE fqName: fileName:/nnStringVsTXString.kt - FUN name:useTX visibility:public modality:FINAL (x:T of .useTX, fn:kotlin.Function0.useTX>) returnType:T of .useTX - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:x index:0 type:T of .useTX - VALUE_PARAMETER name:fn index:1 type:kotlin.Function0.useTX> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun useTX (x: T of .useTX, fn: kotlin.Function0.useTX>): T of .useTX declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTX origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.useTX> declared in .useTX' type=kotlin.Function0.useTX> origin=VARIABLE_AS_FUNCTION FUN name:testWithNullCheck visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -19,3 +11,11 @@ FILE fqName: fileName:/nnStringVsTXString.kt RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .testWithNullCheck' TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String CALL 'public open fun notNullString (): @[EnhancedNullability] kotlin.String declared in .J' type=@[EnhancedNullability] kotlin.String origin=null + FUN name:useTX visibility:public modality:FINAL (x:T of .useTX, fn:kotlin.Function0.useTX>) returnType:T of .useTX + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:x index:0 type:T of .useTX + VALUE_PARAMETER name:fn index:1 type:kotlin.Function0.useTX> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun useTX (x: T of .useTX, fn: kotlin.Function0.useTX>): T of .useTX declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTX origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0.useTX> declared in .useTX' type=kotlin.Function0.useTX> origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.kt.txt index 55f8fa6850b..8dbadf6e8bc 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.kt.txt @@ -1,10 +1,11 @@ -fun useTX(x: T, fn: Function0): T { - return fn.invoke() -} - fun testWithNullCheck() { useTX(x = "", fn = local fun (): String { return notNullString() /*!! String */ } ) /*~> Unit */ } + +fun useTX(x: T, fn: Function0): T { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.ir.txt index 1d50785fd7b..a789cb39856 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.ir.txt @@ -1,10 +1,4 @@ FILE fqName: fileName:/stringVsAny.kt - FUN name:useAny visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun useAny (fn: kotlin.Function0): kotlin.Any declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .useAny' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:testNullCheck visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -15,3 +9,9 @@ FILE fqName: fileName:/stringVsAny.kt RETURN type=kotlin.Nothing from='local final fun (): kotlin.Any declared in .testNullCheck' TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String CALL 'public open fun string (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null + FUN name:useAny visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun useAny (fn: kotlin.Function0): kotlin.Any declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Any origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0 declared in .useAny' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.kt.txt index 0056e178b0e..8a41eee0842 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.kt.txt @@ -1,10 +1,11 @@ -fun useAny(fn: Function0): Any { - return fn.invoke() -} - fun testNullCheck() { useAny(fn = local fun (): Any { return string() /*!! String */ } ) /*~> Unit */ } + +fun useAny(fn: Function0): Any { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.ir.txt index 407683f37b6..a7b44f14aee 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.ir.txt @@ -1,11 +1,4 @@ FILE fqName: fileName:/stringVsT.kt - FUN name:useT visibility:public modality:FINAL (fn:kotlin.Function0.useT>) returnType:T of .useT - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.useT> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun useT (fn: kotlin.Function0.useT>): T of .useT declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useT origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.useT> declared in .useT' type=kotlin.Function0.useT> origin=VARIABLE_AS_FUNCTION FUN name:testNoNullCheck visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -16,3 +9,10 @@ FILE fqName: fileName:/stringVsT.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): @[FlexibleNullability] kotlin.String? declared in .testNoNullCheck' CALL 'public open fun string (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null + FUN name:useT visibility:public modality:FINAL (fn:kotlin.Function0.useT>) returnType:T of .useT + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.useT> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun useT (fn: kotlin.Function0.useT>): T of .useT declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useT origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0.useT> declared in .useT' type=kotlin.Function0.useT> origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.kt.txt index 285e8086a68..ec3a841710a 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.kt.txt @@ -1,10 +1,11 @@ -fun useT(fn: Function0): T { - return fn.invoke() -} - fun testNoNullCheck() { useT<@FlexibleNullability String?>(fn = local fun (): @FlexibleNullability String? { return string() } ) /*~> Unit */ } + +fun useT(fn: Function0): T { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.ir.txt index ee360456893..2a8966a3c72 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.ir.txt @@ -1,11 +1,4 @@ FILE fqName: fileName:/stringVsTAny.kt - FUN name:useTAny visibility:public modality:FINAL (fn:kotlin.Function0.useTAny>) returnType:T of .useTAny - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.useTAny> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun useTAny (fn: kotlin.Function0.useTAny>): T of .useTAny declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTAny origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.useTAny> declared in .useTAny' type=kotlin.Function0.useTAny> origin=VARIABLE_AS_FUNCTION FUN name:testNoNullCheck visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -16,3 +9,10 @@ FILE fqName: fileName:/stringVsTAny.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): @[FlexibleNullability] kotlin.String? declared in .testNoNullCheck' CALL 'public open fun string (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null + FUN name:useTAny visibility:public modality:FINAL (fn:kotlin.Function0.useTAny>) returnType:T of .useTAny + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.useTAny> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun useTAny (fn: kotlin.Function0.useTAny>): T of .useTAny declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTAny origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0.useTAny> declared in .useTAny' type=kotlin.Function0.useTAny> origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.kt.txt index 2e8309ae4a8..70fb125443a 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.kt.txt @@ -1,10 +1,11 @@ -fun useTAny(fn: Function0): T { - return fn.invoke() -} - fun testNoNullCheck() { useTAny<@FlexibleNullability String?>(fn = local fun (): @FlexibleNullability String? { return string() } ) /*~> Unit */ } + +fun useTAny(fn: Function0): T { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.ir.txt index 693c6ba786a..febed78ad06 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.ir.txt @@ -1,12 +1,4 @@ FILE fqName: fileName:/stringVsTConstrained.kt - FUN name:useTConstrained visibility:public modality:FINAL (xs:kotlin.Array.useTConstrained>, fn:kotlin.Function0.useTConstrained>) returnType:T of .useTConstrained - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:xs index:0 type:kotlin.Array.useTConstrained> - VALUE_PARAMETER name:fn index:1 type:kotlin.Function0.useTConstrained> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun useTConstrained (xs: kotlin.Array.useTConstrained>, fn: kotlin.Function0.useTConstrained>): T of .useTConstrained declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTConstrained origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.useTConstrained> declared in .useTConstrained' type=kotlin.Function0.useTConstrained> origin=VARIABLE_AS_FUNCTION FUN name:testWithNullCheck visibility:public modality:FINAL <> (xs:kotlin.Array) returnType:kotlin.Unit VALUE_PARAMETER name:xs index:0 type:kotlin.Array BLOCK_BODY @@ -20,3 +12,11 @@ FILE fqName: fileName:/stringVsTConstrained.kt RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .testWithNullCheck' TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String CALL 'public open fun string (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null + FUN name:useTConstrained visibility:public modality:FINAL (xs:kotlin.Array.useTConstrained>, fn:kotlin.Function0.useTConstrained>) returnType:T of .useTConstrained + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:xs index:0 type:kotlin.Array.useTConstrained> + VALUE_PARAMETER name:fn index:1 type:kotlin.Function0.useTConstrained> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun useTConstrained (xs: kotlin.Array.useTConstrained>, fn: kotlin.Function0.useTConstrained>): T of .useTConstrained declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTConstrained origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0.useTConstrained> declared in .useTConstrained' type=kotlin.Function0.useTConstrained> origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.kt.txt index f32e62d9a75..0001459a823 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.kt.txt @@ -1,10 +1,11 @@ -fun useTConstrained(xs: Array, fn: Function0): T { - return fn.invoke() -} - fun testWithNullCheck(xs: Array) { useTConstrained(xs = xs, fn = local fun (): String { return string() /*!! String */ } ) /*~> Unit */ } + +fun useTConstrained(xs: Array, fn: Function0): T { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.ir.txt index e27f5268e14..5fc6201e365 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.ir.txt @@ -1,12 +1,4 @@ FILE fqName: fileName:/stringVsTXArray.kt - FUN name:useTX visibility:public modality:FINAL (x:T of .useTX, fn:kotlin.Function0.useTX>) returnType:T of .useTX - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:x index:0 type:T of .useTX - VALUE_PARAMETER name:fn index:1 type:kotlin.Function0.useTX> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun useTX (x: T of .useTX, fn: kotlin.Function0.useTX>): T of .useTX declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTX origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.useTX> declared in .useTX' type=kotlin.Function0.useTX> origin=VARIABLE_AS_FUNCTION FUN name:testNoNullCheck visibility:public modality:FINAL <> (xs:kotlin.Array) returnType:kotlin.Unit VALUE_PARAMETER name:xs index:0 type:kotlin.Array BLOCK_BODY @@ -19,3 +11,11 @@ FILE fqName: fileName:/stringVsTXArray.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): @[FlexibleNullability] java.io.Serializable? declared in .testNoNullCheck' CALL 'public open fun string (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null + FUN name:useTX visibility:public modality:FINAL (x:T of .useTX, fn:kotlin.Function0.useTX>) returnType:T of .useTX + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:x index:0 type:T of .useTX + VALUE_PARAMETER name:fn index:1 type:kotlin.Function0.useTX> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun useTX (x: T of .useTX, fn: kotlin.Function0.useTX>): T of .useTX declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTX origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0.useTX> declared in .useTX' type=kotlin.Function0.useTX> origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.kt.txt index 6302dadf8a2..ad20261c34e 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.kt.txt @@ -1,10 +1,11 @@ -fun useTX(x: T, fn: Function0): T { - return fn.invoke() -} - fun testNoNullCheck(xs: Array) { useTX<@FlexibleNullability Serializable?>(x = xs, fn = local fun (): @FlexibleNullability Serializable? { return string() } ) /*~> Unit */ } + +fun useTX(x: T, fn: Function0): T { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.ir.txt index 3b6e7ecb61d..b51f77ded28 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.ir.txt @@ -1,12 +1,4 @@ FILE fqName: fileName:/stringVsTXString.kt - FUN name:useTX visibility:public modality:FINAL (x:T of .useTX, fn:kotlin.Function0.useTX>) returnType:T of .useTX - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:x index:0 type:T of .useTX - VALUE_PARAMETER name:fn index:1 type:kotlin.Function0.useTX> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun useTX (x: T of .useTX, fn: kotlin.Function0.useTX>): T of .useTX declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTX origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.useTX> declared in .useTX' type=kotlin.Function0.useTX> origin=VARIABLE_AS_FUNCTION FUN name:testNoNullCheck visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -18,3 +10,11 @@ FILE fqName: fileName:/stringVsTXString.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): @[FlexibleNullability] kotlin.String? declared in .testNoNullCheck' CALL 'public open fun string (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null + FUN name:useTX visibility:public modality:FINAL (x:T of .useTX, fn:kotlin.Function0.useTX>) returnType:T of .useTX + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:x index:0 type:T of .useTX + VALUE_PARAMETER name:fn index:1 type:kotlin.Function0.useTX> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun useTX (x: T of .useTX, fn: kotlin.Function0.useTX>): T of .useTX declared in ' + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .useTX origin=INVOKE + $this: GET_VAR 'fn: kotlin.Function0.useTX> declared in .useTX' type=kotlin.Function0.useTX> origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.kt.txt index 76faf6f9f81..a07a983b4e9 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.kt.txt @@ -1,10 +1,11 @@ -fun useTX(x: T, fn: Function0): T { - return fn.invoke() -} - fun testNoNullCheck() { useTX<@FlexibleNullability String?>(x = "", fn = local fun (): @FlexibleNullability String? { return string() } ) /*~> Unit */ } + +fun useTX(x: T, fn: Function0): T { + return fn.invoke() +} + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.ir.txt index b37006c5eb3..f2ea255b833 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.ir.txt @@ -1,17 +1,10 @@ FILE fqName: fileName:/nullabilityAssertionOnExtensionReceiver.kt - FUN name:extension visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:memberExtension visibility:public modality:FINAL <> ($this:.C, $receiver:kotlin.String) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY 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 @@ -25,6 +18,13 @@ FILE fqName: fileName:/nullabilityAssertionOnExtensionReceiver.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:memberExtension visibility:public modality:FINAL <> ($this:.C, $receiver:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + FUN name:extension visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY FUN name:testExt visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun extension (): kotlin.Unit declared in ' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.kt.txt index 13b5113cbc9..cff1f2c6c26 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.kt.txt @@ -1,6 +1,3 @@ -fun String.extension() { -} - class C { constructor() /* primary */ { super/*Any*/() @@ -13,6 +10,9 @@ class C { } +fun String.extension() { +} + fun testExt() { s() /*!! String */.extension() } @@ -20,3 +20,4 @@ fun testExt() { fun C.testMemberExt() { (, s() /*!! String */).memberExtension() } + diff --git a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.ir.txt b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.ir.txt deleted file mode 100644 index ef24b6aa191..00000000000 --- a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.ir.txt +++ /dev/null @@ -1,178 +0,0 @@ -FILE fqName: fileName:/rawTypeInSignature.kt - CLASS CLASS name:GenericInv modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.GenericInv.GenericInv> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Number] reified:false - CONSTRUCTOR visibility:public <> () returnType:.GenericInv.GenericInv> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GenericInv modality:FINAL visibility:public 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 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 - CLASS CLASS name:GenericIn modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.GenericIn.GenericIn> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Number] reified:false - CONSTRUCTOR visibility:public <> () returnType:.GenericIn.GenericIn> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GenericIn modality:FINAL visibility:public 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 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 - CLASS CLASS name:GenericOut modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.GenericOut.GenericOut> - TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Number] reified:false - CONSTRUCTOR visibility:public <> () returnType:.GenericOut.GenericOut> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GenericOut modality:FINAL visibility:public 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 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:testReturnsRawGenericInv visibility:public modality:FINAL <> (j:.JRaw) returnType:@[FlexibleNullability] @[RawType] .GenericInv? - VALUE_PARAMETER name:j index:0 type:.JRaw - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericInv (j: .JRaw): @[FlexibleNullability] @[RawType] .GenericInv? declared in ' - CALL 'public abstract fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] .GenericInv? declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericInv? origin=null - $this: GET_VAR 'j: .JRaw declared in .testReturnsRawGenericInv' type=.JRaw origin=null - FUN name:testReturnsRawGenericIn visibility:public modality:FINAL <> (j:.JRaw) returnType:@[FlexibleNullability] @[RawType] .GenericIn? - VALUE_PARAMETER name:j index:0 type:.JRaw - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericIn (j: .JRaw): @[FlexibleNullability] @[RawType] .GenericIn? declared in ' - CALL 'public abstract fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] .GenericIn? declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericIn? origin=null - $this: GET_VAR 'j: .JRaw declared in .testReturnsRawGenericIn' type=.JRaw origin=null - FUN name:testReturnsRawGenericOut visibility:public modality:FINAL <> (j:.JRaw) returnType:@[FlexibleNullability] @[RawType] .GenericOut? - VALUE_PARAMETER name:j index:0 type:.JRaw - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericOut (j: .JRaw): @[FlexibleNullability] @[RawType] .GenericOut? declared in ' - CALL 'public abstract fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] .GenericOut? declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericOut? origin=null - $this: GET_VAR 'j: .JRaw declared in .testReturnsRawGenericOut' type=.JRaw origin=null - CLASS CLASS name:KRaw modality:FINAL visibility:public superTypes:[.JRaw] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KRaw - CONSTRUCTOR visibility:public <> (j:.JRaw) returnType:.KRaw [primary] - VALUE_PARAMETER name:j index:0 type:.JRaw - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KRaw modality:FINAL visibility:public superTypes:[.JRaw]' - FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final] - EXPRESSION_BODY - GET_VAR 'j: .JRaw declared in .KRaw.' type=.JRaw origin=null - FUN DELEGATED_MEMBER name:takesRawList visibility:public modality:OPEN <> ($this:.KRaw, list:@[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList?) returnType:kotlin.Unit - overridden: - public abstract fun takesRawList (list: @[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList?): kotlin.Unit declared in .JRaw - $this: VALUE_PARAMETER name: type:.KRaw - VALUE_PARAMETER name:list index:0 type:@[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList? - BLOCK_BODY - CALL 'public abstract fun takesRawList (list: @[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList?): kotlin.Unit declared in .JRaw' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null - receiver: GET_VAR ': .KRaw declared in .KRaw.takesRawList' type=.KRaw origin=null - list: GET_VAR 'list: @[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList? declared in .KRaw.takesRawList' type=@[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList? origin=null - FUN DELEGATED_MEMBER name:returnsRawList visibility:public modality:OPEN <> ($this:.KRaw) returnType:@[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList? - overridden: - public abstract fun returnsRawList (): @[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList? declared in .JRaw - $this: VALUE_PARAMETER name: type:.KRaw - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun returnsRawList (): @[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList? declared in .KRaw' - CALL 'public abstract fun returnsRawList (): @[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList? declared in .JRaw' type=@[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList? origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null - receiver: GET_VAR ': .KRaw declared in .KRaw.returnsRawList' type=.KRaw origin=null - FUN DELEGATED_MEMBER name:takesRawGenericInv visibility:public modality:OPEN <> ($this:.KRaw, g:@[FlexibleNullability] @[RawType] .GenericInv?) returnType:kotlin.Unit - overridden: - public abstract fun takesRawGenericInv (g: @[FlexibleNullability] @[RawType] .GenericInv?): kotlin.Unit declared in .JRaw - $this: VALUE_PARAMETER name: type:.KRaw - VALUE_PARAMETER name:g index:0 type:@[FlexibleNullability] @[RawType] .GenericInv? - BLOCK_BODY - CALL 'public abstract fun takesRawGenericInv (g: @[FlexibleNullability] @[RawType] .GenericInv?): kotlin.Unit declared in .JRaw' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null - receiver: GET_VAR ': .KRaw declared in .KRaw.takesRawGenericInv' type=.KRaw origin=null - g: GET_VAR 'g: @[FlexibleNullability] @[RawType] .GenericInv? declared in .KRaw.takesRawGenericInv' type=@[FlexibleNullability] @[RawType] .GenericInv? origin=null - FUN DELEGATED_MEMBER name:returnsRawGenericInv visibility:public modality:OPEN <> ($this:.KRaw) returnType:@[FlexibleNullability] @[RawType] .GenericInv? - overridden: - public abstract fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] .GenericInv? declared in .JRaw - $this: VALUE_PARAMETER name: type:.KRaw - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] .GenericInv? declared in .KRaw' - CALL 'public abstract fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] .GenericInv? declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericInv? origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null - receiver: GET_VAR ': .KRaw declared in .KRaw.returnsRawGenericInv' type=.KRaw origin=null - FUN DELEGATED_MEMBER name:takesRawGenericIn visibility:public modality:OPEN <> ($this:.KRaw, g:@[FlexibleNullability] @[RawType] .GenericIn?) returnType:kotlin.Unit - overridden: - public abstract fun takesRawGenericIn (g: @[FlexibleNullability] @[RawType] .GenericIn?): kotlin.Unit declared in .JRaw - $this: VALUE_PARAMETER name: type:.KRaw - VALUE_PARAMETER name:g index:0 type:@[FlexibleNullability] @[RawType] .GenericIn? - BLOCK_BODY - CALL 'public abstract fun takesRawGenericIn (g: @[FlexibleNullability] @[RawType] .GenericIn?): kotlin.Unit declared in .JRaw' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null - receiver: GET_VAR ': .KRaw declared in .KRaw.takesRawGenericIn' type=.KRaw origin=null - g: GET_VAR 'g: @[FlexibleNullability] @[RawType] .GenericIn? declared in .KRaw.takesRawGenericIn' type=@[FlexibleNullability] @[RawType] .GenericIn? origin=null - FUN DELEGATED_MEMBER name:returnsRawGenericIn visibility:public modality:OPEN <> ($this:.KRaw) returnType:@[FlexibleNullability] @[RawType] .GenericIn? - overridden: - public abstract fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] .GenericIn? declared in .JRaw - $this: VALUE_PARAMETER name: type:.KRaw - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] .GenericIn? declared in .KRaw' - CALL 'public abstract fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] .GenericIn? declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericIn? origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null - receiver: GET_VAR ': .KRaw declared in .KRaw.returnsRawGenericIn' type=.KRaw origin=null - FUN DELEGATED_MEMBER name:takesRawGenericOut visibility:public modality:OPEN <> ($this:.KRaw, g:@[FlexibleNullability] @[RawType] .GenericOut?) returnType:kotlin.Unit - overridden: - public abstract fun takesRawGenericOut (g: @[FlexibleNullability] @[RawType] .GenericOut?): kotlin.Unit declared in .JRaw - $this: VALUE_PARAMETER name: type:.KRaw - VALUE_PARAMETER name:g index:0 type:@[FlexibleNullability] @[RawType] .GenericOut? - BLOCK_BODY - CALL 'public abstract fun takesRawGenericOut (g: @[FlexibleNullability] @[RawType] .GenericOut?): kotlin.Unit declared in .JRaw' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null - receiver: GET_VAR ': .KRaw declared in .KRaw.takesRawGenericOut' type=.KRaw origin=null - g: GET_VAR 'g: @[FlexibleNullability] @[RawType] .GenericOut? declared in .KRaw.takesRawGenericOut' type=@[FlexibleNullability] @[RawType] .GenericOut? origin=null - FUN DELEGATED_MEMBER name:returnsRawGenericOut visibility:public modality:OPEN <> ($this:.KRaw) returnType:@[FlexibleNullability] @[RawType] .GenericOut? - overridden: - public abstract fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] .GenericOut? declared in .JRaw - $this: VALUE_PARAMETER name: type:.KRaw - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] .GenericOut? declared in .KRaw' - CALL 'public abstract fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] .GenericOut? declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericOut? origin=null - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null - receiver: GET_VAR ': .KRaw declared in .KRaw.returnsRawGenericOut' type=.KRaw 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 .JRaw - $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 .JRaw - $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 .JRaw - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.kt.txt b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.kt.txt deleted file mode 100644 index 423b61a2589..00000000000 --- a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.kt.txt +++ /dev/null @@ -1,81 +0,0 @@ -class GenericInv { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -class GenericIn { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -class GenericOut { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -fun testReturnsRawGenericInv(j: JRaw): @FlexibleNullability @RawType GenericInv? { - return j.returnsRawGenericInv() -} - -fun testReturnsRawGenericIn(j: JRaw): @FlexibleNullability @RawType GenericIn? { - return j.returnsRawGenericIn() -} - -fun testReturnsRawGenericOut(j: JRaw): @FlexibleNullability @RawType GenericOut? { - return j.returnsRawGenericOut() -} - -class KRaw : JRaw { - constructor(j: JRaw) /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: JRaw = j - override fun takesRawList(list: @FlexibleNullability @FlexibleMutability @RawType MutableList?) { - .#$$delegate_0.takesRawList(list = list) - } - - override fun returnsRawList(): @FlexibleNullability @FlexibleMutability @RawType MutableList? { - return .#$$delegate_0.returnsRawList() - } - - override fun takesRawGenericInv(g: @FlexibleNullability @RawType GenericInv?) { - .#$$delegate_0.takesRawGenericInv(g = g) - } - - override fun returnsRawGenericInv(): @FlexibleNullability @RawType GenericInv? { - return .#$$delegate_0.returnsRawGenericInv() - } - - override fun takesRawGenericIn(g: @FlexibleNullability @RawType GenericIn?) { - .#$$delegate_0.takesRawGenericIn(g = g) - } - - override fun returnsRawGenericIn(): @FlexibleNullability @RawType GenericIn? { - return .#$$delegate_0.returnsRawGenericIn() - } - - override fun takesRawGenericOut(g: @FlexibleNullability @RawType GenericOut?) { - .#$$delegate_0.takesRawGenericOut(g = g) - } - - override fun returnsRawGenericOut(): @FlexibleNullability @RawType GenericOut? { - return .#$$delegate_0.returnsRawGenericOut() - } - -} - diff --git a/compiler/testData/ir/irText/types/rawTypeInSignature.ir.txt b/compiler/testData/ir/irText/types/rawTypeInSignature.ir.txt index 1231469ed10..58d93d6ef6c 100644 --- a/compiler/testData/ir/irText/types/rawTypeInSignature.ir.txt +++ b/compiler/testData/ir/irText/types/rawTypeInSignature.ir.txt @@ -1,11 +1,11 @@ FILE fqName: fileName:/rawTypeInSignature.kt - CLASS CLASS name:GenericInv modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.GenericInv.GenericInv> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Number] reified:false - CONSTRUCTOR visibility:public <> () returnType:.GenericInv.GenericInv> [primary] + CLASS CLASS name:GenericIn modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.GenericIn.GenericIn> + TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Number] reified:false + CONSTRUCTOR visibility:public <> () returnType:.GenericIn.GenericIn> [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GenericInv modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GenericIn modality:FINAL visibility:public 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 declared in kotlin.Any @@ -19,13 +19,13 @@ FILE fqName: fileName:/rawTypeInSignature.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:GenericIn modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.GenericIn.GenericIn> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Number] reified:false - CONSTRUCTOR visibility:public <> () returnType:.GenericIn.GenericIn> [primary] + CLASS CLASS name:GenericInv modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.GenericInv.GenericInv> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Number] reified:false + CONSTRUCTOR visibility:public <> () returnType:.GenericInv.GenericInv> [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GenericIn modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GenericInv modality:FINAL visibility:public 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 declared in kotlin.Any @@ -59,34 +59,16 @@ FILE fqName: fileName:/rawTypeInSignature.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testReturnsRawGenericInv visibility:public modality:FINAL <> (j:.JRaw) returnType:@[FlexibleNullability] @[RawType] .GenericInv? - VALUE_PARAMETER name:j index:0 type:.JRaw - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericInv (j: .JRaw): @[FlexibleNullability] @[RawType] .GenericInv? declared in ' - CALL 'public abstract fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] .GenericInv? declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericInv? origin=null - $this: GET_VAR 'j: .JRaw declared in .testReturnsRawGenericInv' type=.JRaw origin=null - FUN name:testReturnsRawGenericIn visibility:public modality:FINAL <> (j:.JRaw) returnType:@[FlexibleNullability] @[RawType] .GenericIn? - VALUE_PARAMETER name:j index:0 type:.JRaw - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericIn (j: .JRaw): @[FlexibleNullability] @[RawType] .GenericIn? declared in ' - CALL 'public abstract fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] .GenericIn? declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericIn? origin=null - $this: GET_VAR 'j: .JRaw declared in .testReturnsRawGenericIn' type=.JRaw origin=null - FUN name:testReturnsRawGenericOut visibility:public modality:FINAL <> (j:.JRaw) returnType:@[FlexibleNullability] @[RawType] .GenericOut? - VALUE_PARAMETER name:j index:0 type:.JRaw - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericOut (j: .JRaw): @[FlexibleNullability] @[RawType] .GenericOut? declared in ' - CALL 'public abstract fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] .GenericOut? declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericOut? origin=null - $this: GET_VAR 'j: .JRaw declared in .testReturnsRawGenericOut' type=.JRaw origin=null CLASS CLASS name:KRaw modality:FINAL visibility:public superTypes:[.JRaw] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KRaw + FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final] + EXPRESSION_BODY + GET_VAR 'j: .JRaw declared in .KRaw.' type=.JRaw origin=null CONSTRUCTOR visibility:public <> (j:.JRaw) returnType:.KRaw [primary] VALUE_PARAMETER name:j index:0 type:.JRaw BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KRaw modality:FINAL visibility:public superTypes:[.JRaw]' - FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final] - EXPRESSION_BODY - GET_VAR 'j: .JRaw declared in .KRaw.' type=.JRaw origin=null FUN DELEGATED_MEMBER name:returnsRawGenericIn visibility:public modality:OPEN <> ($this:.KRaw) returnType:@[FlexibleNullability] @[RawType] .GenericIn? overridden: public abstract fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] .GenericIn? declared in .JRaw @@ -176,3 +158,21 @@ FILE fqName: fileName:/rawTypeInSignature.kt overridden: public open fun toString (): kotlin.String declared in .JRaw $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testReturnsRawGenericIn visibility:public modality:FINAL <> (j:.JRaw) returnType:@[FlexibleNullability] @[RawType] .GenericIn? + VALUE_PARAMETER name:j index:0 type:.JRaw + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericIn (j: .JRaw): @[FlexibleNullability] @[RawType] .GenericIn? declared in ' + CALL 'public abstract fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] .GenericIn? declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericIn? origin=null + $this: GET_VAR 'j: .JRaw declared in .testReturnsRawGenericIn' type=.JRaw origin=null + FUN name:testReturnsRawGenericInv visibility:public modality:FINAL <> (j:.JRaw) returnType:@[FlexibleNullability] @[RawType] .GenericInv? + VALUE_PARAMETER name:j index:0 type:.JRaw + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericInv (j: .JRaw): @[FlexibleNullability] @[RawType] .GenericInv? declared in ' + CALL 'public abstract fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] .GenericInv? declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericInv? origin=null + $this: GET_VAR 'j: .JRaw declared in .testReturnsRawGenericInv' type=.JRaw origin=null + FUN name:testReturnsRawGenericOut visibility:public modality:FINAL <> (j:.JRaw) returnType:@[FlexibleNullability] @[RawType] .GenericOut? + VALUE_PARAMETER name:j index:0 type:.JRaw + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testReturnsRawGenericOut (j: .JRaw): @[FlexibleNullability] @[RawType] .GenericOut? declared in ' + CALL 'public abstract fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] .GenericOut? declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericOut? origin=null + $this: GET_VAR 'j: .JRaw declared in .testReturnsRawGenericOut' type=.JRaw origin=null diff --git a/compiler/testData/ir/irText/types/rawTypeInSignature.kt b/compiler/testData/ir/irText/types/rawTypeInSignature.kt index 805826a44a7..717903005cc 100644 --- a/compiler/testData/ir/irText/types/rawTypeInSignature.kt +++ b/compiler/testData/ir/irText/types/rawTypeInSignature.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // TARGET_BACKEND: JVM // SEPARATE_SIGNATURE_DUMP_FOR_K2 diff --git a/compiler/testData/ir/irText/types/rawTypeInSignature.kt.txt b/compiler/testData/ir/irText/types/rawTypeInSignature.kt.txt index 29fcbe9425e..1f36df7611d 100644 --- a/compiler/testData/ir/irText/types/rawTypeInSignature.kt.txt +++ b/compiler/testData/ir/irText/types/rawTypeInSignature.kt.txt @@ -1,4 +1,4 @@ -class GenericInv { +class GenericIn { constructor() /* primary */ { super/*Any*/() /* () */ @@ -7,7 +7,7 @@ class GenericInv { } -class GenericIn { +class GenericInv { constructor() /* primary */ { super/*Any*/() /* () */ @@ -25,26 +25,14 @@ class GenericOut { } -fun testReturnsRawGenericInv(j: JRaw): @FlexibleNullability @RawType GenericInv? { - return j.returnsRawGenericInv() -} - -fun testReturnsRawGenericIn(j: JRaw): @FlexibleNullability @RawType GenericIn? { - return j.returnsRawGenericIn() -} - -fun testReturnsRawGenericOut(j: JRaw): @FlexibleNullability @RawType GenericOut? { - return j.returnsRawGenericOut() -} - class KRaw : JRaw { + private /* final field */ val $$delegate_0: JRaw = j constructor(j: JRaw) /* primary */ { super/*Any*/() /* () */ } - private /* final field */ val $$delegate_0: JRaw = j override fun returnsRawGenericIn(): @FlexibleNullability @RawType GenericIn? { return .#$$delegate_0.returnsRawGenericIn() } @@ -78,3 +66,16 @@ class KRaw : JRaw { } } + +fun testReturnsRawGenericIn(j: JRaw): @FlexibleNullability @RawType GenericIn? { + return j.returnsRawGenericIn() +} + +fun testReturnsRawGenericInv(j: JRaw): @FlexibleNullability @RawType GenericInv? { + return j.returnsRawGenericInv() +} + +fun testReturnsRawGenericOut(j: JRaw): @FlexibleNullability @RawType GenericOut? { + return j.returnsRawGenericOut() +} + diff --git a/compiler/testData/ir/irText/types/receiverOfIntersectionType.fir.ir.txt b/compiler/testData/ir/irText/types/receiverOfIntersectionType.fir.ir.txt index bda294d30db..ad5e74bfc93 100644 --- a/compiler/testData/ir/irText/types/receiverOfIntersectionType.fir.ir.txt +++ b/compiler/testData/ir/irText/types/receiverOfIntersectionType.fir.ir.txt @@ -1,23 +1,60 @@ FILE fqName: fileName:/receiverOfIntersectionType.kt - CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I; .J] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I; .J]' 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 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .I + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J $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 + public open fun hashCode (): kotlin.Int declared in .I + public open fun hashCode (): kotlin.Int declared in .J $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 + public open fun toString (): kotlin.String declared in .I + public open fun toString (): kotlin.String declared in .J $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:ff visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit + overridden: + public abstract fun ff (): kotlin.Unit declared in .I + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.I; .J] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.I; .J]' + 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 .I + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J + $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 .I + public open fun hashCode (): kotlin.Int declared in .J + $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 .I + public open fun toString (): kotlin.String declared in .J + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:ff visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Unit + overridden: + public abstract fun ff (): kotlin.Unit declared in .I + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[.K] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I - FUN name:ff visibility:public modality:ABSTRACT <> ($this:.I) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.I 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 .K @@ -31,6 +68,8 @@ FILE fqName: fileName:/receiverOfIntersectionType.kt overridden: public open fun toString (): kotlin.String declared in .K $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:ff visibility:public modality:ABSTRACT <> ($this:.I) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.I CLASS INTERFACE name:J modality:ABSTRACT visibility:public superTypes:[.K] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.J FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -46,75 +85,21 @@ FILE fqName: fileName:/receiverOfIntersectionType.kt overridden: public open fun toString (): kotlin.String declared in .K $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I; .J] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I; .J]' - FUN name:ff visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit - overridden: - public abstract fun ff (): kotlin.Unit declared in .I - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY + CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K 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 .I - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .I - public open fun hashCode (): kotlin.Int declared in .J + 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 .I - public open fun toString (): kotlin.String declared in .J + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.I; .J] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - CONSTRUCTOR visibility:public <> () returnType:.B [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.I; .J]' - FUN name:ff visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Unit - overridden: - public abstract fun ff (): kotlin.Unit declared in .I - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - 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 .I - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J - $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 .I - public open fun hashCode (): kotlin.Int declared in .J - $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 .I - public open fun toString (): kotlin.String declared in .J - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testIntersection visibility:public modality:FINAL <> (a:.A, b:.B) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:.A - VALUE_PARAMETER name:b index:1 type:.B - BLOCK_BODY - VAR name:v type:.K [val] - WHEN type=.K origin=IF - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'a: .A declared in .testIntersection' type=.A origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'b: .B declared in .testIntersection' type=.B origin=null - CALL 'public abstract fun ff (): kotlin.Unit declared in .I' type=kotlin.Unit origin=null - $this: TYPE_OP type=.I origin=IMPLICIT_CAST typeOperand=.I - GET_VAR 'val v: .K declared in .testIntersection' type=.K origin=null FUN name:testFlexible1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:v type:.K? [val] @@ -145,3 +130,18 @@ FILE fqName: fileName:/receiverOfIntersectionType.kt x: GET_VAR 'b: .B declared in .testFlexible2' type=.B origin=null CALL 'public abstract fun ff (): kotlin.Unit declared in .I' type=kotlin.Unit origin=null $this: GET_VAR 'val v: .K? declared in .testFlexible2' type=.K? origin=null + FUN name:testIntersection visibility:public modality:FINAL <> (a:.A, b:.B) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + VALUE_PARAMETER name:b index:1 type:.B + BLOCK_BODY + VAR name:v type:.K [val] + WHEN type=.K origin=IF + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'a: .A declared in .testIntersection' type=.A origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'b: .B declared in .testIntersection' type=.B origin=null + CALL 'public abstract fun ff (): kotlin.Unit declared in .I' type=kotlin.Unit origin=null + $this: TYPE_OP type=.I origin=IMPLICIT_CAST typeOperand=.I + GET_VAR 'val v: .K declared in .testIntersection' type=.K origin=null diff --git a/compiler/testData/ir/irText/types/receiverOfIntersectionType.fir.kt.txt b/compiler/testData/ir/irText/types/receiverOfIntersectionType.fir.kt.txt index 1368ce18b31..d6666287042 100644 --- a/compiler/testData/ir/irText/types/receiverOfIntersectionType.fir.kt.txt +++ b/compiler/testData/ir/irText/types/receiverOfIntersectionType.fir.kt.txt @@ -1,14 +1,3 @@ -interface K { -} - -interface I : K { - abstract fun ff() - -} - -interface J : K { -} - class A : I, J { constructor() /* primary */ { super/*Any*/() @@ -33,12 +22,15 @@ class B : I, J { } -fun testIntersection(a: A, b: B) { - val v: K = when { - true -> a - else -> b - } - v /*as I */.ff() +interface I : K { + abstract fun ff() + +} + +interface J : K { +} + +interface K { } fun testFlexible1() { @@ -57,3 +49,11 @@ fun testFlexible2(a: A, b: B) { v.ff() } +fun testIntersection(a: A, b: B) { + val v: K = when { + true -> a + else -> b + } + v /*as I */.ff() +} + diff --git a/compiler/testData/ir/irText/types/receiverOfIntersectionType.ir.txt b/compiler/testData/ir/irText/types/receiverOfIntersectionType.ir.txt index d4740563589..c305c4d7829 100644 --- a/compiler/testData/ir/irText/types/receiverOfIntersectionType.ir.txt +++ b/compiler/testData/ir/irText/types/receiverOfIntersectionType.ir.txt @@ -1,23 +1,60 @@ FILE fqName: fileName:/receiverOfIntersectionType.kt - CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I; .J] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I; .J]' 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 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .I + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J $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 + public open fun hashCode (): kotlin.Int declared in .I + public open fun hashCode (): kotlin.Int declared in .J $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 + public open fun toString (): kotlin.String declared in .I + public open fun toString (): kotlin.String declared in .J $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:ff visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit + overridden: + public abstract fun ff (): kotlin.Unit declared in .I + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.I; .J] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.I; .J]' + 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 .I + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J + $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 .I + public open fun hashCode (): kotlin.Int declared in .J + $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 .I + public open fun toString (): kotlin.String declared in .J + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:ff visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Unit + overridden: + public abstract fun ff (): kotlin.Unit declared in .I + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[.K] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I - FUN name:ff visibility:public modality:ABSTRACT <> ($this:.I) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.I 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 .K @@ -31,6 +68,8 @@ FILE fqName: fileName:/receiverOfIntersectionType.kt overridden: public open fun toString (): kotlin.String declared in .K $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:ff visibility:public modality:ABSTRACT <> ($this:.I) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.I CLASS INTERFACE name:J modality:ABSTRACT visibility:public superTypes:[.K] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.J FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -46,75 +85,21 @@ FILE fqName: fileName:/receiverOfIntersectionType.kt overridden: public open fun toString (): kotlin.String declared in .K $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I; .J] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I; .J]' - FUN name:ff visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit - overridden: - public abstract fun ff (): kotlin.Unit declared in .I - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY + CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K 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 .I - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J + public open fun equals (other: kotlin.Any?): kotlin.Boolean 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 .I - public open fun hashCode (): kotlin.Int declared in .J + 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 .I - public open fun toString (): kotlin.String declared in .J + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.I; .J] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - CONSTRUCTOR visibility:public <> () returnType:.B [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.I; .J]' - FUN name:ff visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Unit - overridden: - public abstract fun ff (): kotlin.Unit declared in .I - $this: VALUE_PARAMETER name: type:.B - BLOCK_BODY - 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 .I - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J - $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 .I - public open fun hashCode (): kotlin.Int declared in .J - $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 .I - public open fun toString (): kotlin.String declared in .J - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testIntersection visibility:public modality:FINAL <> (a:.A, b:.B) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:.A - VALUE_PARAMETER name:b index:1 type:.B - BLOCK_BODY - VAR name:v type:.K [val] - WHEN type=.K origin=IF - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'a: .A declared in .testIntersection' type=.A origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'b: .B declared in .testIntersection' type=.B origin=null - CALL 'public abstract fun ff (): kotlin.Unit declared in .I' type=kotlin.Unit origin=null - $this: TYPE_OP type=.I origin=IMPLICIT_CAST typeOperand=.I - GET_VAR 'val v: .K declared in .testIntersection' type=.K origin=null FUN name:testFlexible1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:v type:@[FlexibleNullability] .K? [val] @@ -149,3 +134,18 @@ FILE fqName: fileName:/receiverOfIntersectionType.kt $this: TYPE_OP type=.I origin=IMPLICIT_CAST typeOperand=.I TYPE_OP type=.K origin=IMPLICIT_NOTNULL typeOperand=.K GET_VAR 'val v: @[FlexibleNullability] .K? declared in .testFlexible2' type=@[FlexibleNullability] .K? origin=null + FUN name:testIntersection visibility:public modality:FINAL <> (a:.A, b:.B) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + VALUE_PARAMETER name:b index:1 type:.B + BLOCK_BODY + VAR name:v type:.K [val] + WHEN type=.K origin=IF + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'a: .A declared in .testIntersection' type=.A origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'b: .B declared in .testIntersection' type=.B origin=null + CALL 'public abstract fun ff (): kotlin.Unit declared in .I' type=kotlin.Unit origin=null + $this: TYPE_OP type=.I origin=IMPLICIT_CAST typeOperand=.I + GET_VAR 'val v: .K declared in .testIntersection' type=.K origin=null diff --git a/compiler/testData/ir/irText/types/receiverOfIntersectionType.kt.txt b/compiler/testData/ir/irText/types/receiverOfIntersectionType.kt.txt index 6592ea840dc..f18f99630d3 100644 --- a/compiler/testData/ir/irText/types/receiverOfIntersectionType.kt.txt +++ b/compiler/testData/ir/irText/types/receiverOfIntersectionType.kt.txt @@ -1,14 +1,3 @@ -interface K { -} - -interface I : K { - abstract fun ff() - -} - -interface J : K { -} - class A : I, J { constructor() /* primary */ { super/*Any*/() @@ -33,12 +22,15 @@ class B : I, J { } -fun testIntersection(a: A, b: B) { - val v: K = when { - true -> a - else -> b - } - v /*as I */.ff() +interface I : K { + abstract fun ff() + +} + +interface J : K { +} + +interface K { } fun testFlexible1() { @@ -56,3 +48,12 @@ fun testFlexible2(a: A, b: B) { } v /*!! K */ /*as I */.ff() } + +fun testIntersection(a: A, b: B) { + val v: K = when { + true -> a + else -> b + } + v /*as I */.ff() +} + diff --git a/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.ir.txt b/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.ir.txt index 371436c499f..eaca68d953c 100644 --- a/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.ir.txt +++ b/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.ir.txt @@ -1,15 +1,6 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]' - FUN name:f visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in .A' - CONST Int type=kotlin.Int value=1 PROPERTY name:aVal visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:aVal type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -21,6 +12,28 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aVal type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public 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 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:f visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in .A' + CONST Int type=kotlin.Int value=1 FUN name:testA1 visibility:public modality:FINAL <> ($this:.A, x:kotlin.Any) returnType:kotlin.Int? $this: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name:x index:0 type:kotlin.Any @@ -51,25 +64,39 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Null type=kotlin.Nothing? value=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: 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 CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B CONSTRUCTOR visibility:public <> () returnType:.B [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A]' + 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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:f visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int [fake_override] + overridden: + public final fun f (): kotlin.Int declared in .A + $this: VALUE_PARAMETER name: type:.A + 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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:testA1 visibility:public modality:FINAL <> ($this:.A, x:kotlin.Any) returnType:kotlin.Int? [fake_override] + overridden: + public final fun testA1 (x: kotlin.Any): kotlin.Int? declared in .A + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:x index:0 type:kotlin.Any + FUN FAKE_OVERRIDE name:testA2 visibility:public modality:FINAL <> ($this:.A, x:kotlin.Any) returnType:kotlin.Int? [fake_override] + overridden: + public final fun testA2 (x: kotlin.Any): kotlin.Int? declared in .A + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:x 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 .A + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:testB1 visibility:public modality:FINAL <> ($this:.B, x:kotlin.Any) returnType:kotlin.Int? $this: VALUE_PARAMETER name: type:.B VALUE_PARAMETER name:x index:0 type:kotlin.Any @@ -100,10 +127,6 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Null type=kotlin.Nothing? value=null - FUN FAKE_OVERRIDE name:f visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int [fake_override] - overridden: - public final fun f (): kotlin.Int declared in .A - $this: VALUE_PARAMETER name: type:.A PROPERTY FAKE_OVERRIDE name:aVal visibility:public modality:FINAL [fake_override,val] overridden: public final aVal: kotlin.Int @@ -112,41 +135,9 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt overridden: public final fun (): kotlin.Int declared in .A $this: VALUE_PARAMETER name: type:.A - FUN FAKE_OVERRIDE name:testA1 visibility:public modality:FINAL <> ($this:.A, x:kotlin.Any) returnType:kotlin.Int? [fake_override] - overridden: - public final fun testA1 (x: kotlin.Any): kotlin.Int? declared in .A - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:x index:0 type:kotlin.Any - FUN FAKE_OVERRIDE name:testA2 visibility:public modality:FINAL <> ($this:.A, x:kotlin.Any) returnType:kotlin.Int? [fake_override] - overridden: - public final fun testA2 (x: kotlin.Any): kotlin.Int? declared in .A - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:x index:0 type: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 declared in .A - $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 .A - $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 .A - $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:GA modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.GA.GA> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.GA.GA> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GA modality:OPEN visibility:public superTypes:[kotlin.Any]' - FUN name:f visibility:public modality:FINAL <> ($this:.GA.GA>) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.GA.GA> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in .GA' - CONST Int type=kotlin.Int value=1 PROPERTY name:aVal visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:aVal type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -158,6 +149,10 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .GA' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aVal type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .GA.GA> declared in .GA.' type=.GA.GA> origin=null + CONSTRUCTOR visibility:public <> () returnType:.GA.GA> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GA modality:OPEN visibility:public 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 declared in kotlin.Any @@ -171,6 +166,11 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:FINAL <> ($this:.GA.GA>) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.GA.GA> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in .GA' + CONST Int type=kotlin.Int value=1 CLASS CLASS name:GB modality:FINAL visibility:public superTypes:[.GA.GB>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.GB.GB, S of .GB> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -180,6 +180,23 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .GA' : T of .GB INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GB modality:FINAL visibility:public superTypes:[.GA.GB>]' + 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 .GA + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:f visibility:public modality:FINAL <> ($this:.GA.GB>) returnType:kotlin.Int [fake_override] + overridden: + public final fun f (): kotlin.Int declared in .GA + $this: VALUE_PARAMETER name: type:.GA.GB> + 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 .GA + $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 .GA + $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:testGB1 visibility:public modality:FINAL <> ($this:.GB.GB, S of .GB>, a:kotlin.Any) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.GB.GB, S of .GB> VALUE_PARAMETER name:a index:0 type:kotlin.Any @@ -195,10 +212,6 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt CALL 'public final fun (): kotlin.Int declared in .GB' type=kotlin.Int origin=GET_PROPERTY $this: TYPE_OP type=.GB origin=IMPLICIT_CAST typeOperand=.GB GET_VAR 'a: kotlin.Any declared in .GB.testGB1' type=kotlin.Any origin=null - FUN FAKE_OVERRIDE name:f visibility:public modality:FINAL <> ($this:.GA.GB>) returnType:kotlin.Int [fake_override] - overridden: - public final fun f (): kotlin.Int declared in .GA - $this: VALUE_PARAMETER name: type:.GA.GB> PROPERTY FAKE_OVERRIDE name:aVal visibility:public modality:FINAL [fake_override,val] overridden: public final aVal: kotlin.Int @@ -207,16 +220,3 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt overridden: public final fun (): kotlin.Int declared in .GA $this: VALUE_PARAMETER name: type:.GA.GB> - 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 .GA - $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 .GA - $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 .GA - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.kt.txt b/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.kt.txt index afc88bcfc37..595d55c4df0 100644 --- a/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.kt.txt +++ b/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.kt.txt @@ -1,4 +1,8 @@ open class A { + val aVal: Int + field = 42 + get + constructor() /* primary */ { super/*Any*/() /* () */ @@ -9,10 +13,6 @@ open class A { return 1 } - val aVal: Int - field = 42 - get - fun testA1(x: Any): Int? { return when { x is B -> x /*as B */.f() @@ -53,6 +53,10 @@ class B : A { } open class GA { + val aVal: Int + field = 42 + get + constructor() /* primary */ { super/*Any*/() /* () */ @@ -63,10 +67,6 @@ open class GA { return 1 } - val aVal: Int - field = 42 - get - } class GB : GA { @@ -83,3 +83,4 @@ class GB : GA { } } + diff --git a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.ir.txt b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.ir.txt index e3b40cfbf2f..7f3c63e401b 100644 --- a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.ir.txt +++ b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.ir.txt @@ -1,4 +1,15 @@ FILE fqName: fileName:/smartCastOnFieldReceiverOfGenericType.kt + FUN name:testGetField visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.String + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.JCell origin=CAST typeOperand=.JCell + GET_VAR 'a: kotlin.Any declared in .testGetField' type=kotlin.Any origin=null + RETURN type=kotlin.Nothing from='public final fun testGetField (a: kotlin.Any): kotlin.String declared in ' + TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:@[FlexibleNullability] T of .JCell? visibility:public' type=@[FlexibleNullability] kotlin.String? origin=null + receiver: TYPE_OP type=.JCell origin=IMPLICIT_CAST typeOperand=.JCell + GET_VAR 'a: kotlin.Any declared in .testGetField' type=kotlin.Any origin=null FUN name:testSetField visibility:public modality:FINAL <> (a:kotlin.Any, b:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any VALUE_PARAMETER name:b index:1 type:kotlin.Any @@ -14,14 +25,3 @@ FILE fqName: fileName:/smartCastOnFieldReceiverOfGenericType.kt GET_VAR 'a: kotlin.Any declared in .testSetField' type=kotlin.Any origin=null value: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String GET_VAR 'b: kotlin.Any declared in .testSetField' type=kotlin.Any origin=null - FUN name:testGetField visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.String - VALUE_PARAMETER name:a index:0 type:kotlin.Any - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=.JCell origin=CAST typeOperand=.JCell - GET_VAR 'a: kotlin.Any declared in .testGetField' type=kotlin.Any origin=null - RETURN type=kotlin.Nothing from='public final fun testGetField (a: kotlin.Any): kotlin.String declared in ' - TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:@[FlexibleNullability] T of .JCell? visibility:public' type=@[FlexibleNullability] kotlin.String? origin=null - receiver: TYPE_OP type=.JCell origin=IMPLICIT_CAST typeOperand=.JCell - GET_VAR 'a: kotlin.Any declared in .testGetField' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.kt.txt b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.kt.txt index 5cff33b63be..99473093c24 100644 --- a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.kt.txt +++ b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.kt.txt @@ -1,11 +1,11 @@ +fun testGetField(a: Any): String { + a as JCell /*~> Unit */ + return a /*as JCell */.#value /*!! String */ +} + fun testSetField(a: Any, b: Any) { a as JCell /*~> Unit */ b as String /*~> Unit */ a /*as JCell */.#value = b /*as String */ } -fun testGetField(a: Any): String { - a as JCell /*~> Unit */ - return a /*as JCell */.#value /*!! String */ -} - diff --git a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.ir.txt b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.ir.txt index e3b40cfbf2f..7f3c63e401b 100644 --- a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.ir.txt +++ b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.ir.txt @@ -1,4 +1,15 @@ FILE fqName: fileName:/smartCastOnFieldReceiverOfGenericType.kt + FUN name:testGetField visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.String + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.JCell origin=CAST typeOperand=.JCell + GET_VAR 'a: kotlin.Any declared in .testGetField' type=kotlin.Any origin=null + RETURN type=kotlin.Nothing from='public final fun testGetField (a: kotlin.Any): kotlin.String declared in ' + TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:@[FlexibleNullability] T of .JCell? visibility:public' type=@[FlexibleNullability] kotlin.String? origin=null + receiver: TYPE_OP type=.JCell origin=IMPLICIT_CAST typeOperand=.JCell + GET_VAR 'a: kotlin.Any declared in .testGetField' type=kotlin.Any origin=null FUN name:testSetField visibility:public modality:FINAL <> (a:kotlin.Any, b:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any VALUE_PARAMETER name:b index:1 type:kotlin.Any @@ -14,14 +25,3 @@ FILE fqName: fileName:/smartCastOnFieldReceiverOfGenericType.kt GET_VAR 'a: kotlin.Any declared in .testSetField' type=kotlin.Any origin=null value: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String GET_VAR 'b: kotlin.Any declared in .testSetField' type=kotlin.Any origin=null - FUN name:testGetField visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.String - VALUE_PARAMETER name:a index:0 type:kotlin.Any - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=.JCell origin=CAST typeOperand=.JCell - GET_VAR 'a: kotlin.Any declared in .testGetField' type=kotlin.Any origin=null - RETURN type=kotlin.Nothing from='public final fun testGetField (a: kotlin.Any): kotlin.String declared in ' - TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:@[FlexibleNullability] T of .JCell? visibility:public' type=@[FlexibleNullability] kotlin.String? origin=null - receiver: TYPE_OP type=.JCell origin=IMPLICIT_CAST typeOperand=.JCell - GET_VAR 'a: kotlin.Any declared in .testGetField' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.kt.txt b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.kt.txt index 96678e91d79..c437d06e106 100644 --- a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.kt.txt +++ b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.kt.txt @@ -1,11 +1,11 @@ +fun testGetField(a: Any): String { + a as JCell /*~> Unit */ + return a /*as JCell */(super).#value /*!! String */ +} + fun testSetField(a: Any, b: Any) { a as JCell /*~> Unit */ b as String /*~> Unit */ a /*as JCell */(super).#value = b /*as String */ } -fun testGetField(a: Any): String { - a as JCell /*~> Unit */ - return a /*as JCell */(super).#value /*!! String */ -} - diff --git a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.ir.txt b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.ir.txt index 74dd922196f..821e61eada5 100644 --- a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.ir.txt +++ b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.ir.txt @@ -1,4 +1,90 @@ FILE fqName: fileName:/smartCastOnReceiverOfGenericType.kt + CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell.Cell> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + PROPERTY name:value visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private + EXPRESSION_BODY + GET_VAR 'value: T of .Cell declared in .Cell.' type=T of .Cell origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell.Cell>) returnType:T of .Cell + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Cell.Cell> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Cell declared in .Cell' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private' type=T of .Cell origin=null + receiver: GET_VAR ': .Cell.Cell> declared in .Cell.' type=.Cell.Cell> origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell.Cell>, :T of .Cell) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Cell.Cell> + VALUE_PARAMETER name: index:0 type:T of .Cell + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Cell.Cell> declared in .Cell.' type=.Cell.Cell> origin=null + value: GET_VAR ': T of .Cell declared in .Cell.' type=T of .Cell origin=null + CONSTRUCTOR visibility:public <> (value:T of .Cell) returnType:.Cell.Cell> [primary] + VALUE_PARAMETER name:value index:0 type:T of .Cell + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:FINAL visibility:public 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 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 + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false + CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> + TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>) returnType:.Outer.Inner.Outer.Inner, T1 of .Outer> [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Outer> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] 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 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:use visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer.Inner, T1 of .Outer>, x1:T1 of .Outer, x2:T2 of .Outer.Inner) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> + VALUE_PARAMETER name:x1 index:0 type:T1 of .Outer + VALUE_PARAMETER name:x2 index:1 type:T2 of .Outer.Inner + BLOCK_BODY + CONSTRUCTOR visibility:public <> () returnType:.Outer.Outer> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public 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 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:testFunction visibility:public modality:FINAL <> (a:kotlin.Any, b:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any VALUE_PARAMETER name:b index:1 type:kotlin.Any @@ -15,21 +101,6 @@ FILE fqName: fileName:/smartCastOnReceiverOfGenericType.kt GET_VAR 'a: kotlin.Any declared in .testFunction' type=kotlin.Any origin=null element: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String GET_VAR 'b: kotlin.Any declared in .testFunction' type=kotlin.Any origin=null - FUN name:testProperty visibility:public modality:FINAL <> (a:kotlin.Any, b:kotlin.Any) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:kotlin.Any - VALUE_PARAMETER name:b index:1 type:kotlin.Any - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=.Cell origin=CAST typeOperand=.Cell - GET_VAR 'a: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=kotlin.String origin=CAST typeOperand=kotlin.String - GET_VAR 'b: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null - CALL 'public final fun (: T of .Cell): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=EQ - $this: TYPE_OP type=.Cell origin=IMPLICIT_CAST typeOperand=.Cell - GET_VAR 'a: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null - : TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'b: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null FUN name:testInnerClass visibility:public modality:FINAL <> (a:kotlin.Any, b:kotlin.Any, c:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any VALUE_PARAMETER name:b index:1 type:kotlin.Any @@ -68,89 +139,18 @@ FILE fqName: fileName:/smartCastOnReceiverOfGenericType.kt GET_VAR 'a: kotlin.Any declared in .testNonSubstitutedTypeParameter' type=kotlin.Any origin=null element: TYPE_OP type=kotlin.collections.List.testNonSubstitutedTypeParameter> origin=IMPLICIT_CAST typeOperand=kotlin.collections.List.testNonSubstitutedTypeParameter> GET_VAR 'b: kotlin.Any declared in .testNonSubstitutedTypeParameter' type=kotlin.Any origin=null - CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell.Cell> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .Cell) returnType:.Cell.Cell> [primary] - VALUE_PARAMETER name:value index:0 type:T of .Cell - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private - EXPRESSION_BODY - GET_VAR 'value: T of .Cell declared in .Cell.' type=T of .Cell origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell.Cell>) returnType:T of .Cell - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Cell.Cell> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .Cell declared in .Cell' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private' type=T of .Cell origin=null - receiver: GET_VAR ': .Cell.Cell> declared in .Cell.' type=.Cell.Cell> origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell.Cell>, :T of .Cell) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Cell.Cell> - VALUE_PARAMETER name: index:0 type:T of .Cell - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Cell.Cell> declared in .Cell.' type=.Cell.Cell> origin=null - value: GET_VAR ': T of .Cell declared in .Cell.' type=T of .Cell 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: 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 - CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> - TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Outer.Outer> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> - TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>) returnType:.Outer.Inner.Outer.Inner, T1 of .Outer> [primary] - $outer: VALUE_PARAMETER name: type:.Outer.Outer> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - FUN name:use visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer.Inner, T1 of .Outer>, x1:T1 of .Outer, x2:T2 of .Outer.Inner) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> - VALUE_PARAMETER name:x1 index:0 type:T1 of .Outer - VALUE_PARAMETER name:x2 index:1 type:T2 of .Outer.Inner - BLOCK_BODY - 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: 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 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: 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:testProperty visibility:public modality:FINAL <> (a:kotlin.Any, b:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + VALUE_PARAMETER name:b index:1 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Cell origin=CAST typeOperand=.Cell + GET_VAR 'a: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.String origin=CAST typeOperand=kotlin.String + GET_VAR 'b: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null + CALL 'public final fun (: T of .Cell): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=EQ + $this: TYPE_OP type=.Cell origin=IMPLICIT_CAST typeOperand=.Cell + GET_VAR 'a: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null + : TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'b: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt.txt b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt.txt index 5dd6385f961..a9dbb288c55 100644 --- a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt.txt +++ b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt.txt @@ -1,15 +1,44 @@ +class Cell { + var value: T + field = value + get + set + + constructor(value: T) /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class Outer { + inner class Inner { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun use(x1: T1, x2: T2) { + } + + } + + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + fun testFunction(a: Any, b: Any) { a as MutableList /*~> Unit */ b as String /*~> Unit */ a /*as MutableList */.add(element = b /*as String */) /*~> Unit */ } -fun testProperty(a: Any, b: Any) { - a as Cell /*~> Unit */ - b as String /*~> Unit */ - a /*as Cell */.( = b /*as String */) -} - fun testInnerClass(a: Any, b: Any, c: Any) { a as Inner /*~> Unit */ b as Int /*~> Unit */ @@ -23,37 +52,9 @@ fun testNonSubstitutedTypeParameter(a: Any, b: Any) { a /*as MutableList> */.add(element = b /*as List */) /*~> Unit */ } -class Cell { - constructor(value: T) /* primary */ { - super/*Any*/() - /* () */ - - } - - var value: T - field = value - get - set - +fun testProperty(a: Any, b: Any) { + a as Cell /*~> Unit */ + b as String /*~> Unit */ + a /*as Cell */.( = b /*as String */) } -class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - inner class Inner { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun use(x1: T1, x2: T2) { - } - - } - -} diff --git a/compiler/testData/ir/irText/types/starProjection.ir.txt b/compiler/testData/ir/irText/types/starProjection.ir.txt index fd03ca02435..43b5b81058b 100644 --- a/compiler/testData/ir/irText/types/starProjection.ir.txt +++ b/compiler/testData/ir/irText/types/starProjection.ir.txt @@ -1,4 +1,27 @@ FILE fqName: fileName:/starProjection.kt + CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:ABSTRACT visibility:public 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 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:dispatchResumeWithException visibility:public modality:ABSTRACT <> ($this:.C, exception:kotlin.Throwable, continuation:.Continuation<*>) returnType:kotlin.Boolean + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:exception index:0 type:kotlin.Throwable + VALUE_PARAMETER name:continuation index:1 type:.Continuation<*> CLASS INTERFACE name:Continuation modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Continuation.Continuation> TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false @@ -15,26 +38,3 @@ FILE fqName: fileName:/starProjection.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' - FUN name:dispatchResumeWithException visibility:public modality:ABSTRACT <> ($this:.C, exception:kotlin.Throwable, continuation:.Continuation<*>) returnType:kotlin.Boolean - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:exception index:0 type:kotlin.Throwable - VALUE_PARAMETER name:continuation index:1 type:.Continuation<*> - 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: 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 diff --git a/compiler/testData/ir/irText/types/starProjection.kt.txt b/compiler/testData/ir/irText/types/starProjection.kt.txt index 180b34c0359..138f1954c37 100644 --- a/compiler/testData/ir/irText/types/starProjection.kt.txt +++ b/compiler/testData/ir/irText/types/starProjection.kt.txt @@ -1,6 +1,3 @@ -interface Continuation { -} - abstract class C { constructor() /* primary */ { super/*Any*/() @@ -11,3 +8,7 @@ abstract class C { abstract fun dispatchResumeWithException(exception: Throwable, continuation: Continuation<*>): Boolean } + +interface Continuation { +} + diff --git a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.ir.txt b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.ir.txt index 61bd4d5a6d6..f7736132818 100644 --- a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.ir.txt +++ b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.ir.txt @@ -1,14 +1,7 @@ FILE fqName: fileName:/typeAliasWithUnsafeVariance.kt - TYPEALIAS name:Action visibility:public expandedType:kotlin.Function1.Action, kotlin.Unit> - TYPE_PARAMETER name:RenderingT index:0 variance: superTypes:[kotlin.Any?] reified:false CLASS CLASS name:Tag modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Tag.Tag> TYPE_PARAMETER name:RenderingT index:0 variance:out superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (action:kotlin.Function1.Tag, kotlin.Unit>) returnType:.Tag.Tag> [primary] - VALUE_PARAMETER name:action index:0 type:kotlin.Function1.Tag, kotlin.Unit> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Tag modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:action visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1.Tag, kotlin.Unit> visibility:private [final] EXPRESSION_BODY @@ -20,6 +13,11 @@ FILE fqName: fileName:/typeAliasWithUnsafeVariance.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1.Tag, kotlin.Unit> declared in .Tag' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1.Tag, kotlin.Unit> visibility:private [final]' type=kotlin.Function1.Tag, kotlin.Unit> origin=null receiver: GET_VAR ': .Tag.Tag> declared in .Tag.' type=.Tag.Tag> origin=null + CONSTRUCTOR visibility:public <> (action:kotlin.Function1.Tag, kotlin.Unit>) returnType:.Tag.Tag> [primary] + VALUE_PARAMETER name:action index:0 type:kotlin.Function1.Tag, kotlin.Unit> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Tag modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Tag.Tag>) returnType:kotlin.Function1.Tag, kotlin.Unit> [operator] $this: VALUE_PARAMETER name: type:.Tag.Tag> BLOCK_BODY @@ -37,27 +35,6 @@ FILE fqName: fileName:/typeAliasWithUnsafeVariance.kt CONSTRUCTOR_CALL 'public constructor (action: kotlin.Function1.Tag, kotlin.Unit>) declared in .Tag' type=.Tag.Tag> origin=null : RenderingT of .Tag action: GET_VAR 'action: kotlin.Function1.Tag, kotlin.Unit> declared in .Tag.copy' type=kotlin.Function1.Tag, kotlin.Unit> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Tag.Tag>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Tag.Tag> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Tag' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Tag(" - CONST String type=kotlin.String value="action=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1.Tag, kotlin.Unit> visibility:private [final]' type=kotlin.Function1.Tag, kotlin.Unit> origin=null - receiver: GET_VAR ': .Tag.Tag> declared in .Tag.toString' type=.Tag.Tag> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Tag.Tag>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Tag.Tag> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Tag' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Function1' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1.Tag, kotlin.Unit> visibility:private [final]' type=kotlin.Function1.Tag, kotlin.Unit> origin=null - receiver: GET_VAR ': .Tag.Tag> declared in .Tag.hashCode' type=.Tag.Tag> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Tag.Tag>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -92,12 +69,35 @@ FILE fqName: fileName:/typeAliasWithUnsafeVariance.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Tag' CONST Boolean type=kotlin.Boolean value=true - FUN name:getTag visibility:public modality:FINAL <> () returnType:.Tag<*> - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor () declared in java.lang.Exception' type=java.lang.Exception origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Tag.Tag>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Tag.Tag> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Tag' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Function1' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1.Tag, kotlin.Unit> visibility:private [final]' type=kotlin.Function1.Tag, kotlin.Unit> origin=null + receiver: GET_VAR ': .Tag.Tag> declared in .Tag.hashCode' type=.Tag.Tag> origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Tag.Tag>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Tag.Tag> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Tag' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Tag(" + CONST String type=kotlin.String value="action=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1.Tag, kotlin.Unit> visibility:private [final]' type=kotlin.Function1.Tag, kotlin.Unit> origin=null + receiver: GET_VAR ': .Tag.Tag> declared in .Tag.toString' type=.Tag.Tag> origin=null + CONST String type=kotlin.String value=")" FUN name:doAction visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Function1.Tag, kotlin.Unit> declared in .Tag' type=kotlin.Function1 origin=GET_PROPERTY $this: CALL 'public final fun getTag (): .Tag<*> declared in ' type=.Tag<*> origin=null + FUN name:getTag visibility:public modality:FINAL <> () returnType:.Tag<*> + BLOCK_BODY + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor () declared in java.lang.Exception' type=java.lang.Exception origin=null + TYPEALIAS name:Action visibility:public expandedType:kotlin.Function1.Action, kotlin.Unit> + TYPE_PARAMETER name:RenderingT index:0 variance: superTypes:[kotlin.Any?] reified:false diff --git a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.kt.txt b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.kt.txt index e866cc780f2..cbdc8c0bb86 100644 --- a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.kt.txt +++ b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.kt.txt @@ -1,15 +1,14 @@ -typealias Action = Function1 data class Tag { + val action: Function1 + field = action + get + constructor(action: Function1) /* primary */ { super/*Any*/() /* () */ } - val action: Function1 - field = action - get - operator fun component1(): Function1 { return .#action } @@ -18,14 +17,6 @@ data class Tag { return Tag(action = action) } - override fun toString(): String { - return "Tag(" + "action=" + .#action + ")" - } - - override fun hashCode(): Int { - return .#action.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -40,12 +31,22 @@ data class Tag { return true } + override fun hashCode(): Int { + return .#action.hashCode() + } + + override fun toString(): String { + return "Tag(" + "action=" + .#action + ")" + } + +} + +fun doAction() { + getTag().() /*~> Unit */ } fun getTag(): Tag<*> { throw Exception() } -fun doAction() { - getTag().() /*~> Unit */ -} +typealias Action = Function1 diff --git a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.ir.txt b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.ir.txt index 218649c51f8..b9f12887040 100644 --- a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.ir.txt +++ b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.ir.txt @@ -1,14 +1,7 @@ FILE fqName: fileName:/typeAliasWithUnsafeVariance.kt - TYPEALIAS name:Action visibility:public expandedType:kotlin.Function1<@[UnsafeVariance] RenderingT of .Action, kotlin.Unit> - TYPE_PARAMETER name:RenderingT index:0 variance: superTypes:[kotlin.Any?] reified:false CLASS CLASS name:Tag modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Tag.Tag> TYPE_PARAMETER name:RenderingT index:0 variance:out superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (action:kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit>) returnType:.Tag.Tag> [primary] - VALUE_PARAMETER name:action index:0 type:kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Tag modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:action visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> visibility:private [final] EXPRESSION_BODY @@ -20,6 +13,11 @@ FILE fqName: fileName:/typeAliasWithUnsafeVariance.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> declared in .Tag' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> visibility:private [final]' type=kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> origin=null receiver: GET_VAR ': .Tag.Tag> declared in .Tag.' type=.Tag.Tag> origin=null + CONSTRUCTOR visibility:public <> (action:kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit>) returnType:.Tag.Tag> [primary] + VALUE_PARAMETER name:action index:0 type:kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Tag modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.Tag.Tag>) returnType:kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> [operator] $this: VALUE_PARAMETER name: type:.Tag.Tag> BLOCK_BODY @@ -37,27 +35,6 @@ FILE fqName: fileName:/typeAliasWithUnsafeVariance.kt CONSTRUCTOR_CALL 'public constructor (action: kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit>) declared in .Tag' type=.Tag.Tag> origin=null : RenderingT of .Tag action: GET_VAR 'action: kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> declared in .Tag.copy' type=kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Tag.Tag>) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Tag.Tag> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Tag' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Tag(" - CONST String type=kotlin.String value="action=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> visibility:private [final]' type=kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> origin=null - receiver: GET_VAR ': .Tag.Tag> declared in .Tag.toString' type=.Tag.Tag> origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Tag.Tag>) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.Tag.Tag> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Tag' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Function1' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> visibility:private [final]' type=kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> origin=null - receiver: GET_VAR ': .Tag.Tag> declared in .Tag.hashCode' type=.Tag.Tag> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Tag.Tag>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -92,12 +69,35 @@ FILE fqName: fileName:/typeAliasWithUnsafeVariance.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Tag' CONST Boolean type=kotlin.Boolean value=true - FUN name:getTag visibility:public modality:FINAL <> () returnType:.Tag<*> - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor () declared in java.lang.Exception' type=java.lang.Exception origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Tag.Tag>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Tag.Tag> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Tag' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Function1' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> visibility:private [final]' type=kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> origin=null + receiver: GET_VAR ': .Tag.Tag> declared in .Tag.hashCode' type=.Tag.Tag> origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Tag.Tag>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Tag.Tag> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Tag' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Tag(" + CONST String type=kotlin.String value="action=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> visibility:private [final]' type=kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> origin=null + receiver: GET_VAR ': .Tag.Tag> declared in .Tag.toString' type=.Tag.Tag> origin=null + CONST String type=kotlin.String value=")" FUN name:doAction visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Function1<@[UnsafeVariance] RenderingT of .Tag, kotlin.Unit> declared in .Tag' type=kotlin.Function1 origin=GET_PROPERTY $this: CALL 'public final fun getTag (): .Tag<*> declared in ' type=.Tag<*> origin=null + FUN name:getTag visibility:public modality:FINAL <> () returnType:.Tag<*> + BLOCK_BODY + THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor () declared in java.lang.Exception' type=java.lang.Exception origin=null + TYPEALIAS name:Action visibility:public expandedType:kotlin.Function1<@[UnsafeVariance] RenderingT of .Action, kotlin.Unit> + TYPE_PARAMETER name:RenderingT index:0 variance: superTypes:[kotlin.Any?] reified:false diff --git a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt.txt b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt.txt index d84a9ee51d5..0e273fe12ba 100644 --- a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt.txt +++ b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt.txt @@ -1,15 +1,14 @@ -typealias Action = Function1<@UnsafeVariance RenderingT, Unit> data class Tag { + val action: Function1<@UnsafeVariance RenderingT, Unit> + field = action + get + constructor(action: Function1<@UnsafeVariance RenderingT, Unit>) /* primary */ { super/*Any*/() /* () */ } - val action: Function1<@UnsafeVariance RenderingT, Unit> - field = action - get - operator fun component1(): Function1<@UnsafeVariance RenderingT, Unit> { return .#action } @@ -18,14 +17,6 @@ data class Tag { return Tag(action = action) } - override fun toString(): String { - return "Tag(" + "action=" + .#action + ")" - } - - override fun hashCode(): Int { - return .#action.hashCode() - } - override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true @@ -40,12 +31,22 @@ data class Tag { return true } + override fun hashCode(): Int { + return .#action.hashCode() + } + + override fun toString(): String { + return "Tag(" + "action=" + .#action + ")" + } + +} + +fun doAction() { + getTag().() /*~> Unit */ } fun getTag(): Tag<*> { throw Exception() } -fun doAction() { - getTag().() /*~> Unit */ -} +typealias Action = Function1<@UnsafeVariance RenderingT, Unit> diff --git a/compiler/testData/ir/irText/types/typeCheckOnDefinitelyNotNull.ir.txt b/compiler/testData/ir/irText/types/typeCheckOnDefinitelyNotNull.ir.txt index 7d3c13c882f..221faaa17f3 100644 --- a/compiler/testData/ir/irText/types/typeCheckOnDefinitelyNotNull.ir.txt +++ b/compiler/testData/ir/irText/types/typeCheckOnDefinitelyNotNull.ir.txt @@ -6,13 +6,6 @@ FILE fqName: fileName:/typeCheckOnDefinitelyNotNull.kt RETURN type=kotlin.Nothing from='public final fun asFoo (t: T of .asFoo): {T of .asFoo & Any} declared in ' TYPE_OP type={T of .asFoo & Any} origin=CAST typeOperand={T of .asFoo & Any} GET_VAR 't: T of .asFoo declared in .asFoo' type=T of .asFoo origin=null - FUN name:safeAsFoo visibility:public modality:FINAL (t:T of .safeAsFoo) returnType:T of .safeAsFoo? - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER name:t index:0 type:T of .safeAsFoo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun safeAsFoo (t: T of .safeAsFoo): T of .safeAsFoo? declared in ' - TYPE_OP type=T of .safeAsFoo? origin=SAFE_CAST typeOperand={T of .safeAsFoo & Any} - GET_VAR 't: T of .safeAsFoo declared in .safeAsFoo' type=T of .safeAsFoo origin=null FUN name:implicitAsFoo visibility:public modality:FINAL (x:kotlin.Any) returnType:kotlin.Int [inline] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.CharSequence?] reified:true VALUE_PARAMETER name:x index:0 type:kotlin.Any @@ -28,3 +21,10 @@ FILE fqName: fileName:/typeCheckOnDefinitelyNotNull.kt then: CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=GET_PROPERTY $this: TYPE_OP type={T of .implicitAsFoo & Any} origin=IMPLICIT_CAST typeOperand={T of .implicitAsFoo & Any} GET_VAR 'x: kotlin.Any declared in .implicitAsFoo' type=kotlin.Any origin=null + FUN name:safeAsFoo visibility:public modality:FINAL (t:T of .safeAsFoo) returnType:T of .safeAsFoo? + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:T of .safeAsFoo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun safeAsFoo (t: T of .safeAsFoo): T of .safeAsFoo? declared in ' + TYPE_OP type=T of .safeAsFoo? origin=SAFE_CAST typeOperand={T of .safeAsFoo & Any} + GET_VAR 't: T of .safeAsFoo declared in .safeAsFoo' type=T of .safeAsFoo origin=null diff --git a/compiler/testData/ir/irText/types/typeCheckOnDefinitelyNotNull.kt.txt b/compiler/testData/ir/irText/types/typeCheckOnDefinitelyNotNull.kt.txt index f7fad17869b..657a369e1ba 100644 --- a/compiler/testData/ir/irText/types/typeCheckOnDefinitelyNotNull.kt.txt +++ b/compiler/testData/ir/irText/types/typeCheckOnDefinitelyNotNull.kt.txt @@ -2,13 +2,14 @@ fun asFoo(t: T): (T & Any) { return t as (T & Any) } -fun safeAsFoo(t: T): T? { - return t as? (T & Any) -} - inline fun implicitAsFoo(x: Any): Int { return when { x !is T -> 0 else -> x /*as (T & Any) */.() } } + +fun safeAsFoo(t: T): T? { + return t as? (T & Any) +} + diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrPrettyKotlinDumpHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrPrettyKotlinDumpHandler.kt index 931563ac343..26c2b2c0db5 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrPrettyKotlinDumpHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrPrettyKotlinDumpHandler.kt @@ -52,6 +52,7 @@ class IrPrettyKotlinDumpHandler( printFilePath = false, printFakeOverridesStrategy = FakeOverridesStrategy.NONE, normalizeNames = true, // KT-61983: K1 and K2 kotlin-like dumps are closer to each other when tempvar names are normalized + stableOrder = true, ), ) } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrTextDumpHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrTextDumpHandler.kt index 4a4846f4154..f57d795c026 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrTextDumpHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrTextDumpHandler.kt @@ -94,7 +94,8 @@ class IrTextDumpHandler( // PSI2IR assigns field `abbreviation` with type abbreviation. It serves only debugging purposes, and no compiler functionality relies on it. // FIR2IR does not initialize field `abbreviation` at all. printTypeAbbreviations = false, - isHiddenDeclaration = { isHiddenDeclaration(it, irBuiltins) } + isHiddenDeclaration = { isHiddenDeclaration(it, irBuiltins) }, + stableOrder = true, ) val builder = baseDumper.builderForModule(module.name) diff --git a/plugins/fir-plugin-prototype/testData/box/classWithAllPropertiesConstructor.fir.ir.txt b/plugins/fir-plugin-prototype/testData/box/classWithAllPropertiesConstructor.fir.ir.txt index 02c1d26b659..737400ee076 100644 --- a/plugins/fir-plugin-prototype/testData/box/classWithAllPropertiesConstructor.fir.ir.txt +++ b/plugins/fir-plugin-prototype/testData/box/classWithAllPropertiesConstructor.fir.ir.txt @@ -2,11 +2,6 @@ Module: a FILE fqName: fileName:/module_a_classWithAllPropertiesConstructor.kt CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.A [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -18,6 +13,11 @@ FILE fqName: fileName:/module_a_classWithAllPropertiesConstructor.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.A [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -33,11 +33,6 @@ FILE fqName: fileName:/module_a_classWithAllPropertiesConstructor.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.B [primary] - VALUE_PARAMETER name:s index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] EXPRESSION_BODY @@ -49,37 +44,11 @@ FILE fqName: fileName:/module_a_classWithAllPropertiesConstructor.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .B' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .B declared in .B.' type=.B 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: 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 - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.C [primary] + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.B [primary] VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:s visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 's: kotlin.String declared in .C.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.String - correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public 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 declared in kotlin.Any @@ -97,10 +66,6 @@ FILE fqName: fileName:/module_a_classWithAllPropertiesConstructor.kt annotations: AllPropertiesConstructor $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base - CONSTRUCTOR visibility:public <> () returnType:.Base [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:a type:.A visibility:private [final] EXPRESSION_BODY @@ -125,6 +90,15 @@ FILE fqName: fileName:/module_a_classWithAllPropertiesConstructor.kt RETURN type=kotlin.Nothing from='public final fun (): .B declared in .Base' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:.B visibility:private [final]' type=.B origin=null receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null + CONSTRUCTOR visibility:public <> () returnType:.Base [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' + CONSTRUCTOR visibility:public <> (a:.A, b:.B) returnType:.Base + VALUE_PARAMETER name:a index:0 type:.A + VALUE_PARAMETER name:b index:1 type:.B + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in 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 declared in kotlin.Any @@ -138,21 +112,43 @@ FILE fqName: fileName:/module_a_classWithAllPropertiesConstructor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR visibility:public <> (a:.A, b:.B) returnType:.Base - VALUE_PARAMETER name:a index:0 type:.A - VALUE_PARAMETER name:b index:1 type:.B + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + PROPERTY name:s visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 's: kotlin.String declared in .C.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.String + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.C [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 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 Module: b FILE fqName: fileName:/Derived.kt CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base] annotations: AllPropertiesConstructor $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base]' PROPERTY name:c visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:c type:.C visibility:private [final] EXPRESSION_BODY @@ -165,6 +161,31 @@ FILE fqName: fileName:/Derived.kt RETURN type=kotlin.Nothing from='public final fun (): .C declared in .Derived' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:.C visibility:private [final]' type=.C origin=null receiver: GET_VAR ': .Derived declared in .Derived.' type=.Derived origin=null + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base]' + CONSTRUCTOR visibility:public <> (a:.A, b:.B, c:.C) returnType:.Derived + VALUE_PARAMETER name:a index:0 type:.A + VALUE_PARAMETER name:b index:1 type:.B + VALUE_PARAMETER name:c index:2 type:.C + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (a: .A, b: .B) declared in .Base' + a: GET_VAR 'a: .A declared in .Derived.' type=.A origin=null + b: GET_VAR 'b: .B declared in .Derived.' type=.B 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 .Base + $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 .Base + $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 .Base + $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY FAKE_OVERRIDE name:a visibility:public modality:FINAL [fake_override,val] overridden: public final a: .A @@ -181,27 +202,6 @@ FILE fqName: fileName:/Derived.kt overridden: public final fun (): .B declared in .Base $this: VALUE_PARAMETER name: type:.Base - 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 .Base - $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 .Base - $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 .Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR visibility:public <> (a:.A, b:.B, c:.C) returnType:.Derived - VALUE_PARAMETER name:a index:0 type:.A - VALUE_PARAMETER name:b index:1 type:.B - VALUE_PARAMETER name:c index:2 type:.C - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (a: .A, b: .B) declared in .Base' - a: GET_VAR 'a: .A declared in .Derived.' type=.A origin=null - b: GET_VAR 'b: .B declared in .Derived.' type=.B origin=null FILE fqName: fileName:/main.kt FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY diff --git a/plugins/fir-plugin-prototype/testData/box/composableFunction.fir.ir.txt b/plugins/fir-plugin-prototype/testData/box/composableFunction.fir.ir.txt index 959ff253da8..e83d5079f88 100644 --- a/plugins/fir-plugin-prototype/testData/box/composableFunction.fir.ir.txt +++ b/plugins/fir-plugin-prototype/testData/box/composableFunction.fir.ir.txt @@ -1,14 +1,49 @@ FILE fqName: fileName:/composableFunction.kt - FUN name:runUsual visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit - VALUE_PARAMETER name:block index:0 type:kotlin.Function0 + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE - $this: GET_VAR 'block: kotlin.Function0 declared in .runUsual' type=kotlin.Function0 origin=null + VAR name:res1 type:kotlin.Int [val] + CALL 'public final fun test_1 (): kotlin.Int declared in ' type=kotlin.Int origin=null + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean 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_VAR 'val res1: kotlin.Int declared in .box' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=8 + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Fail 1: " + GET_VAR 'val res1: kotlin.Int declared in .box' type=kotlin.Int origin=null + VAR name:res2 type:kotlin.String [val] + CALL 'public final fun test_2 (): kotlin.String declared in ' type=kotlin.String origin=null + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean 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_VAR 'val res2: kotlin.String declared in .box' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="OK" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Fail 2: " + GET_VAR 'val res2: kotlin.String declared in .box' type=kotlin.String origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" FUN name:runComposable visibility:public modality:FINAL <> (block:@[MyComposable] kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:block index:0 type:@[MyComposable] kotlin.Function0 BLOCK_BODY CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=null $this: GET_VAR 'block: @[MyComposable] kotlin.Function0 declared in .runComposable' type=@[MyComposable] kotlin.Function0 origin=null + FUN name:runComposable2 visibility:public modality:FINAL <> (block:kotlin.Function1) returnType:kotlin.String + VALUE_PARAMETER name:block index:0 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun runComposable2 (block: kotlin.Function1): kotlin.String declared in ' + CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=null + $this: GET_VAR 'block: kotlin.Function1 declared in .runComposable2' type=kotlin.Function1 origin=null + p1: CONST String type=kotlin.String value="O" + FUN name:runUsual visibility:public modality:FINAL <> (block:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:block index:0 type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE + $this: GET_VAR 'block: kotlin.Function0 declared in .runUsual' type=kotlin.Function0 origin=null FUN name:test_1 visibility:public modality:FINAL <> () returnType:kotlin.Int BLOCK_BODY VAR name:x type:kotlin.Int [var] @@ -116,13 +151,6 @@ FILE fqName: fileName:/composableFunction.kt GET_VAR 'val tmp_6: kotlin.Int declared in .test_1.' type=kotlin.Int origin=null RETURN type=kotlin.Nothing from='public final fun test_1 (): kotlin.Int declared in ' GET_VAR 'var x: kotlin.Int declared in .test_1' type=kotlin.Int origin=null - FUN name:runComposable2 visibility:public modality:FINAL <> (block:kotlin.Function1) returnType:kotlin.String - VALUE_PARAMETER name:block index:0 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun runComposable2 (block: kotlin.Function1): kotlin.String declared in ' - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.String origin=null - $this: GET_VAR 'block: kotlin.Function1 declared in .runComposable2' type=kotlin.Function1 origin=null - p1: CONST String type=kotlin.String value="O" FUN name:test_2 visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test_2 (): kotlin.String declared in ' @@ -135,31 +163,3 @@ FILE fqName: fileName:/composableFunction.kt CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS $this: GET_VAR 'it: kotlin.String declared in .test_2.' type=kotlin.String origin=null other: CONST String type=kotlin.String value="K" - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - VAR name:res1 type:kotlin.Int [val] - CALL 'public final fun test_1 (): kotlin.Int declared in ' type=kotlin.Int origin=null - WHEN type=kotlin.Unit origin=IF - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean 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_VAR 'val res1: kotlin.Int declared in .box' type=kotlin.Int origin=null - arg1: CONST Int type=kotlin.Int value=8 - then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Fail 1: " - GET_VAR 'val res1: kotlin.Int declared in .box' type=kotlin.Int origin=null - VAR name:res2 type:kotlin.String [val] - CALL 'public final fun test_2 (): kotlin.String declared in ' type=kotlin.String origin=null - WHEN type=kotlin.Unit origin=IF - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean 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_VAR 'val res2: kotlin.String declared in .box' type=kotlin.String origin=null - arg1: CONST String type=kotlin.String value="OK" - then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Fail 2: " - GET_VAR 'val res2: kotlin.String declared in .box' type=kotlin.String 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/plugins/fir-plugin-prototype/testData/box/generatedClassWithMembersAndNestedClasses.fir.ir.txt b/plugins/fir-plugin-prototype/testData/box/generatedClassWithMembersAndNestedClasses.fir.ir.txt index 0c91c80ae82..a7a8f78d6f4 100644 --- a/plugins/fir-plugin-prototype/testData/box/generatedClassWithMembersAndNestedClasses.fir.ir.txt +++ b/plugins/fir-plugin-prototype/testData/box/generatedClassWithMembersAndNestedClasses.fir.ir.txt @@ -7,11 +7,6 @@ FILE fqName:bar fileName:/generatedClassWithMembersAndNestedClasses.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:box visibility:public modality:FINAL <> ($this:bar.Foo) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:bar.Foo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in bar.Foo' - CONST String type=kotlin.String value="OK" 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 @@ -25,6 +20,16 @@ FILE fqName:bar fileName:/generatedClassWithMembersAndNestedClasses.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:box visibility:public modality:FINAL <> ($this:bar.Foo) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:bar.Foo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in bar.Foo' + CONST String type=kotlin.String value="OK" + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + CALL 'public final fun testConstructor (): kotlin.Unit declared in bar' type=kotlin.Unit origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in bar' + CALL 'public final fun testNestedClasses (): kotlin.String declared in bar' type=kotlin.String origin=null FUN name:testConstructor visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:generatedClass type:foo.AllOpenGenerated [val] @@ -37,8 +42,3 @@ FILE fqName:bar fileName:/generatedClassWithMembersAndNestedClasses.kt CALL 'public final fun box (): kotlin.String declared in bar.Foo' type=kotlin.String origin=null $this: CALL 'public final fun materialize (): bar.Foo declared in foo.AllOpenGenerated.NestedFoo' type=bar.Foo origin=null $this: GET_VAR 'val nestedFoo: foo.AllOpenGenerated.NestedFoo declared in bar.testNestedClasses' type=foo.AllOpenGenerated.NestedFoo origin=null - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - CALL 'public final fun testConstructor (): kotlin.Unit declared in bar' type=kotlin.Unit origin=null - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in bar' - CALL 'public final fun testNestedClasses (): kotlin.String declared in bar' type=kotlin.String origin=null diff --git a/plugins/fir-plugin-prototype/testData/box/serializer.fir.ir.txt b/plugins/fir-plugin-prototype/testData/box/serializer.fir.ir.txt index cd8ad192d4e..0526b479324 100644 --- a/plugins/fir-plugin-prototype/testData/box/serializer.fir.ir.txt +++ b/plugins/fir-plugin-prototype/testData/box/serializer.fir.ir.txt @@ -1,135 +1,12 @@ FILE fqName: fileName:/serializer.kt - CLASS OBJECT name:FirstSerializer modality:FINAL visibility:public superTypes:[kotlin.Any] - annotations: - CoreSerializer - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirstSerializer - CONSTRUCTOR visibility:private <> () returnType:.FirstSerializer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:FirstSerializer modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:bFunction visibility:public modality:FINAL <> ($this:.FirstSerializer) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.FirstSerializer - BLOCK_BODY - FUN name:aFunction visibility:public modality:FINAL <> ($this:.FirstSerializer) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.FirstSerializer - BLOCK_BODY - PROPERTY name:bProp visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:bProp type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirstSerializer) returnType:kotlin.Int - correspondingProperty: PROPERTY name:bProp visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.FirstSerializer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .FirstSerializer' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bProp type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .FirstSerializer declared in .FirstSerializer.' type=.FirstSerializer origin=null - PROPERTY name:aProp visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:aProp type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=2 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirstSerializer) returnType:kotlin.Int - correspondingProperty: PROPERTY name:aProp visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.FirstSerializer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .FirstSerializer' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aProp type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .FirstSerializer declared in .FirstSerializer.' type=.FirstSerializer origin=null - FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeA visibility:public modality:FINAL <> ($this:.FirstSerializer, x:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.FirstSerializer - VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.A - BLOCK_BODY - FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeB visibility:public modality:FINAL <> ($this:.FirstSerializer, x:.B) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.FirstSerializer - VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.B - BLOCK_BODY - FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeC visibility:public modality:FINAL <> ($this:.FirstSerializer, x:.C) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.FirstSerializer - VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.C - BLOCK_BODY - FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeD visibility:public modality:FINAL <> ($this:.FirstSerializer, x:.D) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.FirstSerializer - VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.D - BLOCK_BODY - 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: 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 - CLASS OBJECT name:SecondSerializer modality:FINAL visibility:public superTypes:[kotlin.Any] - annotations: - CoreSerializer - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SecondSerializer - CONSTRUCTOR visibility:private <> () returnType:.SecondSerializer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:SecondSerializer modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeA visibility:public modality:FINAL <> ($this:.SecondSerializer, x:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.SecondSerializer - VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.A - BLOCK_BODY - FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeB visibility:public modality:FINAL <> ($this:.SecondSerializer, x:.B) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.SecondSerializer - VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.B - BLOCK_BODY - FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeC visibility:public modality:FINAL <> ($this:.SecondSerializer, x:.C) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.SecondSerializer - VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.C - BLOCK_BODY - FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeD visibility:public modality:FINAL <> ($this:.SecondSerializer, x:.D) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.SecondSerializer - VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.D - BLOCK_BODY - 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: 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 - CLASS CLASS name:D modality:FINAL visibility:public superTypes:[kotlin.Any] + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] annotations: MySerializable - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D - CONSTRUCTOR visibility:public <> () returnType:.D [primary] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public 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 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 - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] - annotations: - MySerializable - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public 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 declared in kotlin.Any @@ -164,14 +41,14 @@ FILE fqName: fileName:/serializer.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] annotations: MySerializable - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public 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 declared in kotlin.Any @@ -185,6 +62,135 @@ FILE fqName: fileName:/serializer.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:D modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + MySerializable + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D + CONSTRUCTOR visibility:public <> () returnType:.D [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public 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 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 + CLASS OBJECT name:FirstSerializer modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + CoreSerializer + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FirstSerializer + PROPERTY name:bProp visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:bProp type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirstSerializer) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bProp visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.FirstSerializer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .FirstSerializer' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bProp type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .FirstSerializer declared in .FirstSerializer.' type=.FirstSerializer origin=null + PROPERTY name:aProp visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:aProp type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=2 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.FirstSerializer) returnType:kotlin.Int + correspondingProperty: PROPERTY name:aProp visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.FirstSerializer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .FirstSerializer' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aProp type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .FirstSerializer declared in .FirstSerializer.' type=.FirstSerializer origin=null + CONSTRUCTOR visibility:private <> () returnType:.FirstSerializer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:FirstSerializer modality:FINAL visibility:public 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 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 GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeA visibility:public modality:FINAL <> ($this:.FirstSerializer, x:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.FirstSerializer + VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.A + BLOCK_BODY + FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeB visibility:public modality:FINAL <> ($this:.FirstSerializer, x:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.FirstSerializer + VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.B + BLOCK_BODY + FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeC visibility:public modality:FINAL <> ($this:.FirstSerializer, x:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.FirstSerializer + VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.C + BLOCK_BODY + FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeD visibility:public modality:FINAL <> ($this:.FirstSerializer, x:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.FirstSerializer + VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.D + BLOCK_BODY + FUN name:aFunction visibility:public modality:FINAL <> ($this:.FirstSerializer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.FirstSerializer + BLOCK_BODY + FUN name:bFunction visibility:public modality:FINAL <> ($this:.FirstSerializer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.FirstSerializer + BLOCK_BODY + CLASS OBJECT name:SecondSerializer modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + CoreSerializer + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SecondSerializer + CONSTRUCTOR visibility:private <> () returnType:.SecondSerializer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:SecondSerializer modality:FINAL visibility:public 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 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 GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeA visibility:public modality:FINAL <> ($this:.SecondSerializer, x:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.SecondSerializer + VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.A + BLOCK_BODY + FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeB visibility:public modality:FINAL <> ($this:.SecondSerializer, x:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.SecondSerializer + VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.B + BLOCK_BODY + FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeC visibility:public modality:FINAL <> ($this:.SecondSerializer, x:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.SecondSerializer + VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.C + BLOCK_BODY + FUN GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:serializeD visibility:public modality:FINAL <> ($this:.SecondSerializer, x:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.SecondSerializer + VALUE_PARAMETER GENERATED[org.jetbrains.kotlin.fir.plugin.generators.MembersOfSerializerGenerator.Key] name:x index:0 type:.D + BLOCK_BODY + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + CALL 'public final fun testFirstSerializer (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun testSecondSerializer (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" FUN name:testFirstSerializer visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun serializeA (x: .A): kotlin.Unit declared in .FirstSerializer' type=kotlin.Unit origin=null @@ -213,9 +219,3 @@ FILE fqName: fileName:/serializer.kt CALL 'public final fun serializeD (x: .D): kotlin.Unit declared in .SecondSerializer' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:SecondSerializer modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.SecondSerializer x: CONSTRUCTOR_CALL 'public constructor () declared in .D' type=.D origin=null - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - CALL 'public final fun testFirstSerializer (): kotlin.Unit declared in ' type=kotlin.Unit origin=null - CALL 'public final fun testSecondSerializer (): kotlin.Unit declared in ' type=kotlin.Unit 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/plugins/fir-plugin-prototype/testData/firLoadK2Compiled/annotationsGeneratedInBackend.fir.kt.txt b/plugins/fir-plugin-prototype/testData/firLoadK2Compiled/annotationsGeneratedInBackend.fir.kt.txt index 5c7dfd2c91c..df84d855fa8 100644 --- a/plugins/fir-plugin-prototype/testData/firLoadK2Compiled/annotationsGeneratedInBackend.fir.kt.txt +++ b/plugins/fir-plugin-prototype/testData/firLoadK2Compiled/annotationsGeneratedInBackend.fir.kt.txt @@ -3,23 +3,12 @@ package test @AddAnnotations @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") class Some { - @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") - constructor(@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") x: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") val x: Int field = x @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") get - @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") - fun foo() { - } - @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") class Derived { @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") @@ -31,5 +20,16 @@ class Some { } + @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") + constructor(@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") x: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + + @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") + fun foo() { + } + } diff --git a/plugins/fir-plugin-prototype/testData/firLoadK2Compiled/annotationsGeneratedInBackend_MPP.fir.kt.txt b/plugins/fir-plugin-prototype/testData/firLoadK2Compiled/annotationsGeneratedInBackend_MPP.fir.kt.txt index 008f165a667..5fdfcce6fe0 100644 --- a/plugins/fir-plugin-prototype/testData/firLoadK2Compiled/annotationsGeneratedInBackend_MPP.fir.kt.txt +++ b/plugins/fir-plugin-prototype/testData/firLoadK2Compiled/annotationsGeneratedInBackend_MPP.fir.kt.txt @@ -3,23 +3,12 @@ package test @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") class VerySpecificNameInCommon { - @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") - constructor(@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") x: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") val x: Int field = x @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") get - @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") - fun foo() { - } - @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") class Derived { @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") @@ -31,6 +20,17 @@ class VerySpecificNameInCommon { } + @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") + constructor(@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") x: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + + @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") + fun foo() { + } + } // FILE: module_main_annotationsGeneratedInBackend_MPP.kt @@ -38,23 +38,12 @@ package test @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") class VerySpecificNameInPlatform { - @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") - constructor(@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") x: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") val x: Int field = x @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") get - @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") - fun foo() { - } - @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") class Derived { @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") @@ -66,5 +55,16 @@ class VerySpecificNameInPlatform { } + @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") + constructor(@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") x: Int) /* primary */ { + super/*Any*/() + /* () */ + + } + + @AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") + fun foo() { + } + }