FIR2IR: drop field receiver consistency check (due to delegate field case)

This commit is contained in:
Mikhail Glukhikh
2019-08-29 16:04:50 +03:00
parent 75c4c88d0a
commit 0962755fde
4 changed files with 20 additions and 20 deletions
@@ -769,9 +769,6 @@ internal class Fir2IrVisitor(
if (!ownerField.isStatic) {
receiver = qualifiedAccess.dispatchReceiver.takeIf { it !is FirNoReceiverExpression }?.toIrExpression()
?: qualifiedAccess.explicitReceiver?.toIrExpression()
if (receiver == null) {
throw AssertionError()
}
}
this
}
@@ -6,7 +6,7 @@ FILE fqName:<root> fileName:/classLevelProperties.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:test1 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final]
FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CONST Int type=kotlin.Int value=0
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Int
@@ -14,7 +14,7 @@ FILE fqName:<root> fileName:/classLevelProperties.kt
$this: VALUE_PARAMETER name:<this> type:<root>.C
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): kotlin.Int declared in <root>.C'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final]' type=kotlin.Int origin=null
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.<get-test1>' type=<root>.C origin=null
PROPERTY name:test2 visibility:public modality:FINAL [val]
FUN name:<get-test2> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Int
@@ -24,7 +24,7 @@ FILE fqName:<root> fileName:/classLevelProperties.kt
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): kotlin.Int declared in <root>.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:public
FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private
EXPRESSION_BODY
CONST Int type=kotlin.Int value=0
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test3> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Int
@@ -32,18 +32,18 @@ FILE fqName:<root> fileName:/classLevelProperties.kt
$this: VALUE_PARAMETER name:<this> type:<root>.C
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test3> (): kotlin.Int declared in <root>.C'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:public' type=kotlin.Int origin=null
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.<get-test3>' type=<root>.C origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-test3> visibility:public modality:FINAL <> ($this:<root>.C, <set-?>:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.C
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.<set-test3>' type=<root>.C origin=null
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.C.<set-test3>' type=kotlin.Int origin=null
PROPERTY name:test4 visibility:public modality:FINAL [var]
FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:public
FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:private
EXPRESSION_BODY
CONST Int type=kotlin.Int value=1
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test4> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Int
@@ -51,17 +51,18 @@ FILE fqName:<root> fileName:/classLevelProperties.kt
$this: VALUE_PARAMETER name:<this> type:<root>.C
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test4> (): kotlin.Int declared in <root>.C'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:public' type=kotlin.Int origin=null
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:private' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.<get-test4>' type=<root>.C origin=null
FUN name:<set-test4> visibility:public modality:FINAL <> ($this:<root>.C, value:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.C
VALUE_PARAMETER name:value index:0 type:kotlin.Int
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.C declared in <root>.C' type=<root>.C origin=null
value: GET_VAR 'value: kotlin.Int declared in <root>.C.<set-test4>' type=kotlin.Int origin=null
PROPERTY name:test5 visibility:public modality:FINAL [var]
FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:public
FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:private
EXPRESSION_BODY
CONST Int type=kotlin.Int value=1
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test5> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Int
@@ -69,14 +70,14 @@ FILE fqName:<root> fileName:/classLevelProperties.kt
$this: VALUE_PARAMETER name:<this> type:<root>.C
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test5> (): kotlin.Int declared in <root>.C'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:public' type=kotlin.Int origin=null
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:private' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.<get-test5>' type=<root>.C origin=null
FUN name:<set-test5> visibility:private modality:FINAL <> ($this:<root>.C, value:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.C
VALUE_PARAMETER name:value index:0 type:kotlin.Int
PROPERTY name:test6 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Int visibility:public [final]
FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CONST Int type=kotlin.Int value=1
FUN name:<get-test6> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Int
@@ -23,7 +23,7 @@ FILE fqName:<root> fileName:/delegatedProperties.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:map visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.MutableMap<kotlin.String, kotlin.Any> visibility:public [final]
FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.MutableMap<kotlin.String, kotlin.Any> visibility:private [final]
EXPRESSION_BODY
GET_VAR 'map: kotlin.collections.MutableMap<kotlin.String, kotlin.Any> declared in <root>.C.<init>' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-map> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.collections.MutableMap<kotlin.String, kotlin.Any>
@@ -31,7 +31,7 @@ FILE fqName:<root> fileName:/delegatedProperties.kt
$this: VALUE_PARAMETER name:<this> type:<root>.C
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-map> (): kotlin.collections.MutableMap<kotlin.String, kotlin.Any> declared in <root>.C'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.MutableMap<kotlin.String, kotlin.Any> visibility:public [final]' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> origin=null
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.MutableMap<kotlin.String, kotlin.Any> visibility:private [final]' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> origin=null
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.<get-map>' type=<root>.C origin=null
PROPERTY name:test2 visibility:public modality:FINAL [delegated,val]
FIELD DELEGATE name:test2$delegate type:kotlin.Lazy<kotlin.Int> visibility:private [final]
@@ -7,7 +7,7 @@ FILE fqName:<root> fileName:/member.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] 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:public [final]
FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]
EXPRESSION_BODY
GET_VAR 'value: kotlin.String declared in <root>.Delegate.<init>' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-value> visibility:public modality:FINAL <> ($this:<root>.Delegate) returnType:kotlin.String
@@ -15,7 +15,7 @@ FILE fqName:<root> fileName:/member.kt
$this: VALUE_PARAMETER name:<this> type:<root>.Delegate
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-value> (): kotlin.String declared in <root>.Delegate'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final]' type=kotlin.String origin=null
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
receiver: GET_VAR '<this>: <root>.Delegate declared in <root>.Delegate.<get-value>' type=<root>.Delegate origin=null
FUN name:getValue visibility:public modality:FINAL <> ($this:<root>.Delegate, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.Delegate
@@ -24,6 +24,7 @@ FILE fqName:<root> fileName:/member.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in <root>.Delegate'
CALL 'public final fun <get-value> (): kotlin.String declared in <root>.Delegate' type=kotlin.String origin=null
$this: GET_VAR '<this>: <root>.Delegate declared in <root>.Delegate' type=<root>.Delegate origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
@@ -45,7 +46,7 @@ FILE fqName:<root> fileName:/member.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] 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:public [final]
FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]
EXPRESSION_BODY
GET_VAR 'value: kotlin.String declared in <root>.DelegateProvider.<init>' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-value> visibility:public modality:FINAL <> ($this:<root>.DelegateProvider) returnType:kotlin.String
@@ -53,7 +54,7 @@ FILE fqName:<root> fileName:/member.kt
$this: VALUE_PARAMETER name:<this> type:<root>.DelegateProvider
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-value> (): kotlin.String declared in <root>.DelegateProvider'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final]' type=kotlin.String origin=null
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
receiver: GET_VAR '<this>: <root>.DelegateProvider declared in <root>.DelegateProvider.<get-value>' type=<root>.DelegateProvider origin=null
FUN name:provideDelegate visibility:public modality:FINAL <> ($this:<root>.DelegateProvider, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:<root>.Delegate
$this: VALUE_PARAMETER name:<this> type:<root>.DelegateProvider
@@ -63,6 +64,7 @@ FILE fqName:<root> fileName:/member.kt
RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): <root>.Delegate declared in <root>.DelegateProvider'
CONSTRUCTOR_CALL 'public constructor <init> (value: kotlin.String) [primary] declared in <root>.Delegate' type=<root>.Delegate origin=null
value: CALL 'public final fun <get-value> (): kotlin.String declared in <root>.DelegateProvider' type=kotlin.String origin=null
$this: GET_VAR '<this>: <root>.DelegateProvider declared in <root>.DelegateProvider' type=<root>.DelegateProvider origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any