IR: mark interface delegate fields as synthetic

This requires separating them origin-wise from property delegates.
This commit is contained in:
pyos
2020-01-20 14:26:46 +01:00
committed by Dmitry Petrov
parent ce1f746c5e
commit f1669e2230
31 changed files with 125 additions and 124 deletions
@@ -18,7 +18,7 @@ FILE fqName:<root> fileName:/delegateFieldWithAnnotations.kt
PROPERTY name:test1 visibility:public modality:FINAL [delegated,val]
annotations:
Ann
FIELD DELEGATE name:test1$delegate type:kotlin.Lazy<kotlin.Int> visibility:private [final,static]
FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy<kotlin.Int> visibility:private [final,static]
EXPRESSION_BODY
CALL 'public final fun lazy <T> (initializer: kotlin.Function0<T of kotlin.lazy>): kotlin.Lazy<T of kotlin.lazy> declared in kotlin' type=kotlin.Lazy<kotlin.Int> origin=null
<T>: kotlin.Int
@@ -32,6 +32,6 @@ FILE fqName:<root> fileName:/delegateFieldWithAnnotations.kt
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): kotlin.Int declared in <root>'
CALL 'public final fun getValue <T> (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue [inline,operator] declared in kotlin' type=kotlin.Int origin=null
<T>: kotlin.Int
$receiver: GET_FIELD 'FIELD DELEGATE name:test1$delegate type:kotlin.Lazy<kotlin.Int> visibility:private [final,static]' type=kotlin.Lazy<kotlin.Int> origin=GET_PROPERTY
$receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy<kotlin.Int> visibility:private [final,static]' type=kotlin.Lazy<kotlin.Int> origin=GET_PROPERTY
thisRef: CONST Null type=kotlin.Nothing? value=null
property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test1$delegate type:kotlin.Lazy<kotlin.Int> visibility:private [final,static]' getter='public final fun <get-test1> (): kotlin.Int declared in <root>' setter=null type=kotlin.reflect.KProperty<*> origin=null
property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy<kotlin.Int> visibility:private [final,static]' getter='public final fun <get-test1> (): kotlin.Int declared in <root>' setter=null type=kotlin.reflect.KProperty<*> origin=null
@@ -16,7 +16,7 @@ FILE fqName:<root> fileName:/delegateFieldWithAnnotations.kt
public open fun toString (): kotlin.String [fake_override] declared in kotlin.Annotation
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
PROPERTY name:test1 visibility:public modality:FINAL [delegated,val]
FIELD DELEGATE name:test1$delegate type:kotlin.Lazy<kotlin.Int> visibility:private [final,static]
FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy<kotlin.Int> visibility:private [final,static]
annotations:
Ann
EXPRESSION_BODY
@@ -33,6 +33,6 @@ FILE fqName:<root> fileName:/delegateFieldWithAnnotations.kt
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): kotlin.Int declared in <root>'
CALL 'public final fun getValue <T> (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue [inline,operator] declared in kotlin' type=kotlin.Int origin=null
<T>: kotlin.Int
$receiver: GET_FIELD 'FIELD DELEGATE name:test1$delegate type:kotlin.Lazy<kotlin.Int> visibility:private [final,static]' type=kotlin.Lazy<kotlin.Int> origin=null
$receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy<kotlin.Int> visibility:private [final,static]' type=kotlin.Lazy<kotlin.Int> origin=null
thisRef: CONST Null type=kotlin.Nothing? value=null
property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field=null getter='public final fun <get-test1> (): kotlin.Int declared in <root>' setter=null type=kotlin.reflect.KProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
@@ -86,7 +86,7 @@ FILE fqName:<root> fileName:/delegatedPropertyAccessorsWithAnnotations.kt
PROPERTY name:test1 visibility:public modality:FINAL [delegated,val]
annotations:
A(x = 'test1.get')
FIELD DELEGATE name:test1$delegate type:<root>.Cell visibility:private [final,static]
FIELD PROPERTY_DELEGATE name:test1$delegate type:<root>.Cell visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> (value: kotlin.Int) [primary] declared in <root>.Cell' type=<root>.Cell origin=null
value: CONST Int type=kotlin.Int value=1
@@ -95,15 +95,15 @@ FILE fqName:<root> fileName:/delegatedPropertyAccessorsWithAnnotations.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): kotlin.Int declared in <root>'
CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int [operator] declared in <root>.Cell' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:test1$delegate type:<root>.Cell visibility:private [final,static]' type=<root>.Cell origin=GET_PROPERTY
$this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test1$delegate type:<root>.Cell visibility:private [final,static]' type=<root>.Cell origin=GET_PROPERTY
thisRef: CONST Null type=kotlin.Nothing? value=null
kProp: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test1$delegate type:<root>.Cell visibility:private [final,static]' getter='public final fun <get-test1> (): kotlin.Int declared in <root>' setter=null type=kotlin.reflect.KProperty<*> origin=null
kProp: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:test1$delegate type:<root>.Cell visibility:private [final,static]' getter='public final fun <get-test1> (): kotlin.Int declared in <root>' setter=null type=kotlin.reflect.KProperty<*> origin=null
PROPERTY name:test2 visibility:public modality:FINAL [delegated,var]
annotations:
A(x = 'test2.get')
A(x = 'test2.set')
A(x = 'test2.set.param')
FIELD DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]
FIELD PROPERTY_DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> (value: kotlin.Int) [primary] declared in <root>.Cell' type=<root>.Cell origin=null
value: CONST Int type=kotlin.Int value=2
@@ -112,15 +112,15 @@ FILE fqName:<root> fileName:/delegatedPropertyAccessorsWithAnnotations.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): kotlin.Int declared in <root>'
CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int [operator] declared in <root>.Cell' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]' type=<root>.Cell origin=GET_PROPERTY
$this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]' type=<root>.Cell origin=GET_PROPERTY
thisRef: CONST Null type=kotlin.Nothing? value=null
kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field='FIELD DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]' getter='public final fun <get-test2> (): kotlin.Int declared in <root>' setter='public final fun <set-test2> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.reflect.KProperty<*> origin=null
kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field='FIELD PROPERTY_DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]' getter='public final fun <get-test2> (): kotlin.Int declared in <root>' setter='public final fun <set-test2> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.reflect.KProperty<*> origin=null
FUN DELEGATED_PROPERTY_ACCESSOR name:<set-test2> visibility:public modality:FINAL <> (<set-?>:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [delegated,var]
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
BLOCK_BODY
CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any?, newValue: kotlin.Int): kotlin.Unit [operator] declared in <root>.Cell' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]' type=<root>.Cell origin=GET_PROPERTY
$this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]' type=<root>.Cell origin=GET_PROPERTY
thisRef: CONST Null type=kotlin.Nothing? value=null
kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field='FIELD DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]' getter='public final fun <get-test2> (): kotlin.Int declared in <root>' setter='public final fun <set-test2> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.reflect.KProperty<*> origin=null
kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field='FIELD PROPERTY_DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]' getter='public final fun <get-test2> (): kotlin.Int declared in <root>' setter='public final fun <set-test2> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.reflect.KProperty<*> origin=null
newValue: GET_VAR '<set-?>: kotlin.Int declared in <root>.<set-test2>' type=kotlin.Int origin=null
@@ -84,7 +84,7 @@ FILE fqName:<root> fileName:/delegatedPropertyAccessorsWithAnnotations.kt
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
PROPERTY name:test1 visibility:public modality:FINAL [delegated,val]
FIELD DELEGATE name:test1$delegate type:<root>.Cell visibility:private [final,static]
FIELD PROPERTY_DELEGATE name:test1$delegate type:<root>.Cell visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> (value: kotlin.Int) [primary] declared in <root>.Cell' type=<root>.Cell origin=null
value: CONST Int type=kotlin.Int value=1
@@ -95,11 +95,11 @@ FILE fqName:<root> fileName:/delegatedPropertyAccessorsWithAnnotations.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): kotlin.Int declared in <root>'
CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int [operator] declared in <root>.Cell' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:test1$delegate type:<root>.Cell visibility:private [final,static]' type=<root>.Cell origin=null
$this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test1$delegate type:<root>.Cell visibility:private [final,static]' type=<root>.Cell origin=null
thisRef: CONST Null type=kotlin.Nothing? value=null
kProp: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field=null getter='public final fun <get-test1> (): kotlin.Int declared in <root>' setter=null type=kotlin.reflect.KProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
PROPERTY name:test2 visibility:public modality:FINAL [delegated,var]
FIELD DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]
FIELD PROPERTY_DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> (value: kotlin.Int) [primary] declared in <root>.Cell' type=<root>.Cell origin=null
value: CONST Int type=kotlin.Int value=2
@@ -110,7 +110,7 @@ FILE fqName:<root> fileName:/delegatedPropertyAccessorsWithAnnotations.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): kotlin.Int declared in <root>'
CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int [operator] declared in <root>.Cell' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]' type=<root>.Cell origin=null
$this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]' type=<root>.Cell origin=null
thisRef: CONST Null type=kotlin.Nothing? value=null
kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field=null getter='public final fun <get-test2> (): kotlin.Int declared in <root>' setter='public final fun <set-test2> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
FUN DELEGATED_PROPERTY_ACCESSOR name:<set-test2> visibility:public modality:FINAL <> (<set-?>:kotlin.Int) returnType:kotlin.Unit
@@ -123,7 +123,7 @@ FILE fqName:<root> fileName:/delegatedPropertyAccessorsWithAnnotations.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <set-test2> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>'
CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any?, newValue: kotlin.Int): kotlin.Unit [operator] declared in <root>.Cell' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]' type=<root>.Cell origin=null
$this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test2$delegate type:<root>.Cell visibility:private [final,static]' type=<root>.Cell origin=null
thisRef: CONST Null type=kotlin.Nothing? value=null
kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field=null getter='public final fun <get-test2> (): kotlin.Int declared in <root>' setter='public final fun <set-test2> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
newValue: GET_VAR '<set-?>: kotlin.Int declared in <root>.<set-test2>' type=kotlin.Int origin=null
@@ -33,7 +33,7 @@ FILE fqName:<root> fileName:/localDelegatedPropertiesWithAnnotations.kt
LOCAL_DELEGATED_PROPERTY name:test type:kotlin.Int flags:val
annotations:
A(x = 'foo/test')
VAR DELEGATE name:test$delegate type:kotlin.Lazy<kotlin.Int> [val]
VAR PROPERTY_DELEGATE name:test$delegate type:kotlin.Lazy<kotlin.Int> [val]
CALL 'public final fun lazy <T> (initializer: kotlin.Function0<T of kotlin.lazy>): kotlin.Lazy<T of kotlin.lazy> declared in kotlin' type=kotlin.Lazy<kotlin.Int> origin=null
<T>: kotlin.Int
initializer: FUN_EXPR type=kotlin.Function0<kotlin.Int> origin=LAMBDA