psi2ir: update testData for property references

This commit is contained in:
Dmitry Petrov
2019-03-13 16:03:22 +03:00
parent 5b5f3a7468
commit c86ef5da53
9 changed files with 287 additions and 22 deletions
@@ -48,7 +48,7 @@ FILE fqName:<root> fileName:/boundCallableReferences.kt
PROPERTY name:test2 visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.reflect.KProperty0<kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'bar: Int' field='bar: Int' getter='<get-bar>(): Int' setter=null type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
PROPERTY_REFERENCE 'bar: Int' field=null getter='<get-bar>(): Int' setter=null type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
$this: CALL 'constructor A()' type=A origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test2> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0<kotlin.Int> flags:
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL flags:val
@@ -45,10 +45,9 @@ FILE fqName:<root> fileName:/callableRefToGenericMember.kt
PROPERTY name:test2 visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.reflect.KProperty1<A<kotlin.String>, kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'bar: Int' field='bar: Int' getter='<get-bar>(): Int' setter=null type=kotlin.reflect.KProperty1<A<kotlin.String>, kotlin.Int> origin=null
PROPERTY_REFERENCE 'bar: Int' field=null getter='<get-bar>(): Int' setter=null type=kotlin.reflect.KProperty1<A<kotlin.String>, kotlin.Int> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test2> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty1<A<kotlin.String>, kotlin.Int> flags:
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test2>(): KProperty1<A<String>, Int>'
GET_FIELD 'test2: KProperty1<A<String>, Int>' type=kotlin.reflect.KProperty1<A<kotlin.String>, kotlin.Int> origin=null
@@ -37,7 +37,7 @@ FILE fqName:test fileName:/callableReferenceToImportedFromObject.kt
PROPERTY name:test1 visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.reflect.KProperty0<kotlin.String> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'a: String' field='a: String' getter='<get-a>(): String' setter=null type=kotlin.reflect.KProperty0<kotlin.String> origin=null
PROPERTY_REFERENCE 'a: String' field=null getter='<get-a>(): String' setter=null type=kotlin.reflect.KProperty0<kotlin.String> origin=null
$this: GET_OBJECT 'Foo' type=test.Foo
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0<kotlin.String> flags:
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL flags:val
@@ -47,7 +47,7 @@ FILE fqName:test fileName:/callableReferenceToImportedFromObject.kt
PROPERTY name:test1a visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test1a type:kotlin.reflect.KProperty0<kotlin.String> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'a: String' field='a: String' getter='<get-a>(): String' setter=null type=kotlin.reflect.KProperty0<kotlin.String> origin=null
PROPERTY_REFERENCE 'a: String' field=null getter='<get-a>(): String' setter=null type=kotlin.reflect.KProperty0<kotlin.String> origin=null
$this: GET_OBJECT 'Foo' type=test.Foo
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1a> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0<kotlin.String> flags:
correspondingProperty: PROPERTY name:test1a visibility:public modality:FINAL flags:val
@@ -69,7 +69,7 @@ FILE fqName:<root> fileName:/genericPropertyRef.kt
FIELD DELEGATE name:additionalText$delegate type:DVal visibility:private flags:final,static
EXPRESSION_BODY
CALL 'constructor DVal(Any)' type=DVal origin=null
kmember: PROPERTY_REFERENCE 'text: String?' field='text: String?' getter='<get-text>(): String?' setter='<set-text>(String?): Unit' type=kotlin.reflect.KMutableProperty1<Value<T>, kotlin.String?> origin=null
kmember: PROPERTY_REFERENCE 'text: String?' field=null getter='<get-text>(): String?' setter='<set-text>(String?): Unit' type=kotlin.reflect.KMutableProperty1<Value<T>, kotlin.String?> origin=null
FUN DELEGATED_PROPERTY_ACCESSOR name:<get-additionalText> visibility:public modality:FINAL <T> ($receiver:Value<T>) returnType:kotlin.Int flags:
correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL flags:delegated,val
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
@@ -85,7 +85,7 @@ FILE fqName:<root> fileName:/genericPropertyRef.kt
FIELD DELEGATE name:additionalValue$delegate type:DVal visibility:private flags:final,static
EXPRESSION_BODY
CALL 'constructor DVal(Any)' type=DVal origin=null
kmember: PROPERTY_REFERENCE 'value: T' field='value: T' getter='<get-value>(): T' setter='<set-value>(T): Unit' type=kotlin.reflect.KMutableProperty1<Value<T>, T> origin=null
kmember: PROPERTY_REFERENCE 'value: T' field=null getter='<get-value>(): T' setter='<set-value>(T): Unit' type=kotlin.reflect.KMutableProperty1<Value<T>, T> origin=null
FUN DELEGATED_PROPERTY_ACCESSOR name:<get-additionalValue> visibility:public modality:FINAL <T> ($receiver:Value<T>) returnType:kotlin.Int flags:
correspondingProperty: PROPERTY name:additionalValue visibility:public modality:FINAL flags:delegated,val
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
@@ -186,7 +186,7 @@ FILE fqName:<root> fileName:/genericPropertyRef.kt
PROPERTY name:barRef visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:barRef type:kotlin.reflect.KMutableProperty1<kotlin.String?, kotlin.String?> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'bar: T on T' field='bar: T on T' getter='<get-bar>() on T: T' setter='<set-bar>(T) on T: Unit' type=kotlin.reflect.KMutableProperty1<kotlin.String?, kotlin.String?> origin=null
PROPERTY_REFERENCE 'bar: T on T' field=null getter='<get-bar>() on T: T' setter='<set-bar>(T) on T: Unit' type=kotlin.reflect.KMutableProperty1<kotlin.String?, kotlin.String?> origin=null
<T>: kotlin.String?
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-barRef> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty1<kotlin.String?, kotlin.String?> flags:
correspondingProperty: PROPERTY name:barRef visibility:public modality:FINAL flags:val
@@ -0,0 +1,51 @@
// FILE: propertyReferences.kt
object Delegate {
operator fun getValue(thisRef: Any?, kProp: Any) = 1
operator fun setValue(thisRef: Any?, kProp: Any, value: Int) {}
}
val valWithBackingField = 1
val test_valWithBackingField = ::valWithBackingField
var varWithBackingField = 1
val test_varWithBackingField = ::varWithBackingField
var varWithBackingFieldAndAccessors = 1
get() = field
set(value) { field = value }
val test_varWithBackingFieldAndAccessors = ::varWithBackingFieldAndAccessors
val valWithAccessors
get() = 1
val test_valWithAccessors = ::valWithAccessors
var varWithAccessors
get() = 1
set(value) {}
val test_varWithAccessors = ::varWithAccessors
val delegatedVal by Delegate
val test_delegatedVal = ::delegatedVal
var delegatedVar by Delegate
val test_delegatedVar = ::delegatedVar
val constVal = 1
val test_constVal = ::constVal
val test_J_CONST = J::CONST
val test_J_nonConst = J::nonConst
// FILE: J.java
public class J {
public static final int CONST = 1;
public static int nonConst = 2;
}
@@ -0,0 +1,221 @@
FILE fqName:<root> fileName:/propertyReferences.kt
CLASS OBJECT name:Delegate modality:FINAL visibility:public flags: superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:Delegate flags:
CONSTRUCTOR visibility:private <> () returnType:Delegate flags:primary
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='Delegate'
FUN name:getValue visibility:public modality:FINAL <> ($this:Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any) returnType:kotlin.Int flags:
$this: VALUE_PARAMETER name:<this> type:Delegate flags:
VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? flags:
VALUE_PARAMETER name:kProp index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='getValue(Any?, Any): Int'
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 flags:
$this: VALUE_PARAMETER name:<this> type:Delegate flags:
VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? flags:
VALUE_PARAMETER name:kProp index:1 type:kotlin.Any flags:
VALUE_PARAMETER name:value index:2 type:kotlin.Int flags:
BLOCK_BODY
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
PROPERTY name:valWithBackingField visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:valWithBackingField type:kotlin.Int visibility:public flags:final,static
EXPRESSION_BODY
CONST Int type=kotlin.Int value=1
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-valWithBackingField> visibility:public modality:FINAL <> () returnType:kotlin.Int flags:
correspondingProperty: PROPERTY name:valWithBackingField visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-valWithBackingField>(): Int'
GET_FIELD 'valWithBackingField: Int' type=kotlin.Int origin=null
PROPERTY name:test_valWithBackingField visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test_valWithBackingField type:kotlin.reflect.KProperty0<kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'valWithBackingField: Int' field=null getter='<get-valWithBackingField>(): Int' setter=null type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test_valWithBackingField> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0<kotlin.Int> flags:
correspondingProperty: PROPERTY name:test_valWithBackingField visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test_valWithBackingField>(): KProperty0<Int>'
GET_FIELD 'test_valWithBackingField: KProperty0<Int>' type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
PROPERTY name:varWithBackingField visibility:public modality:FINAL flags:var
FIELD PROPERTY_BACKING_FIELD name:varWithBackingField type:kotlin.Int visibility:public flags:static
EXPRESSION_BODY
CONST Int type=kotlin.Int value=1
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-varWithBackingField> visibility:public modality:FINAL <> () returnType:kotlin.Int flags:
correspondingProperty: PROPERTY name:varWithBackingField visibility:public modality:FINAL flags:var
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-varWithBackingField>(): Int'
GET_FIELD 'varWithBackingField: Int' type=kotlin.Int origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-varWithBackingField> visibility:public modality:FINAL <> (<set-?>:kotlin.Int) returnType:kotlin.Unit flags:
correspondingProperty: PROPERTY name:varWithBackingField visibility:public modality:FINAL flags:var
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int flags:
BLOCK_BODY
SET_FIELD 'varWithBackingField: Int' type=kotlin.Unit origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
PROPERTY name:test_varWithBackingField visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test_varWithBackingField type:kotlin.reflect.KMutableProperty0<kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'varWithBackingField: Int' field=null getter='<get-varWithBackingField>(): Int' setter='<set-varWithBackingField>(Int): Unit' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test_varWithBackingField> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0<kotlin.Int> flags:
correspondingProperty: PROPERTY name:test_varWithBackingField visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test_varWithBackingField>(): KMutableProperty0<Int>'
GET_FIELD 'test_varWithBackingField: KMutableProperty0<Int>' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=null
PROPERTY name:varWithBackingFieldAndAccessors visibility:public modality:FINAL flags:var
FIELD PROPERTY_BACKING_FIELD name:varWithBackingFieldAndAccessors type:kotlin.Int visibility:public flags:static
EXPRESSION_BODY
CONST Int type=kotlin.Int value=1
FUN name:<get-varWithBackingFieldAndAccessors> visibility:public modality:FINAL <> () returnType:kotlin.Int flags:
correspondingProperty: PROPERTY name:varWithBackingFieldAndAccessors visibility:public modality:FINAL flags:var
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-varWithBackingFieldAndAccessors>(): Int'
GET_FIELD 'varWithBackingFieldAndAccessors: Int' type=kotlin.Int origin=null
FUN name:<set-varWithBackingFieldAndAccessors> visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit flags:
correspondingProperty: PROPERTY name:varWithBackingFieldAndAccessors visibility:public modality:FINAL flags:var
VALUE_PARAMETER name:value index:0 type:kotlin.Int flags:
BLOCK_BODY
SET_FIELD 'varWithBackingFieldAndAccessors: Int' type=kotlin.Unit origin=EQ
value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null
PROPERTY name:test_varWithBackingFieldAndAccessors visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test_varWithBackingFieldAndAccessors type:kotlin.reflect.KMutableProperty0<kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'varWithBackingFieldAndAccessors: Int' field=null getter='<get-varWithBackingFieldAndAccessors>(): Int' setter='<set-varWithBackingFieldAndAccessors>(Int): Unit' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test_varWithBackingFieldAndAccessors> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0<kotlin.Int> flags:
correspondingProperty: PROPERTY name:test_varWithBackingFieldAndAccessors visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test_varWithBackingFieldAndAccessors>(): KMutableProperty0<Int>'
GET_FIELD 'test_varWithBackingFieldAndAccessors: KMutableProperty0<Int>' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=null
PROPERTY name:valWithAccessors visibility:public modality:FINAL flags:val
FUN name:<get-valWithAccessors> visibility:public modality:FINAL <> () returnType:kotlin.Int flags:
correspondingProperty: PROPERTY name:valWithAccessors visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-valWithAccessors>(): Int'
CONST Int type=kotlin.Int value=1
PROPERTY name:test_valWithAccessors visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test_valWithAccessors type:kotlin.reflect.KProperty0<kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'valWithAccessors: Int' field=null getter='<get-valWithAccessors>(): Int' setter=null type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test_valWithAccessors> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0<kotlin.Int> flags:
correspondingProperty: PROPERTY name:test_valWithAccessors visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test_valWithAccessors>(): KProperty0<Int>'
GET_FIELD 'test_valWithAccessors: KProperty0<Int>' type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
PROPERTY name:varWithAccessors visibility:public modality:FINAL flags:var
FUN name:<get-varWithAccessors> visibility:public modality:FINAL <> () returnType:kotlin.Int flags:
correspondingProperty: PROPERTY name:varWithAccessors visibility:public modality:FINAL flags:var
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-varWithAccessors>(): Int'
CONST Int type=kotlin.Int value=1
FUN name:<set-varWithAccessors> visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit flags:
correspondingProperty: PROPERTY name:varWithAccessors visibility:public modality:FINAL flags:var
VALUE_PARAMETER name:value index:0 type:kotlin.Int flags:
BLOCK_BODY
PROPERTY name:test_varWithAccessors visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test_varWithAccessors type:kotlin.reflect.KMutableProperty0<kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'varWithAccessors: Int' field=null getter='<get-varWithAccessors>(): Int' setter='<set-varWithAccessors>(Int): Unit' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test_varWithAccessors> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0<kotlin.Int> flags:
correspondingProperty: PROPERTY name:test_varWithAccessors visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test_varWithAccessors>(): KMutableProperty0<Int>'
GET_FIELD 'test_varWithAccessors: KMutableProperty0<Int>' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=null
PROPERTY name:delegatedVal visibility:public modality:FINAL flags:delegated,val
FIELD DELEGATE name:delegatedVal$delegate type:Delegate visibility:private flags:final,static
EXPRESSION_BODY
GET_OBJECT 'Delegate' type=Delegate
FUN DELEGATED_PROPERTY_ACCESSOR name:<get-delegatedVal> visibility:public modality:FINAL <> () returnType:kotlin.Int flags:
correspondingProperty: PROPERTY name:delegatedVal visibility:public modality:FINAL flags:delegated,val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-delegatedVal>(): Int'
CALL 'getValue(Any?, Any): Int' type=kotlin.Int origin=null
$this: GET_FIELD '`delegatedVal$delegate`: Delegate' type=Delegate origin=null
thisRef: CONST Null type=kotlin.Nothing? value=null
kProp: PROPERTY_REFERENCE 'delegatedVal: Int' field=null getter='<get-delegatedVal>(): Int' setter=null type=kotlin.reflect.KProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
PROPERTY name:test_delegatedVal visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test_delegatedVal type:kotlin.reflect.KProperty0<kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'delegatedVal: Int' field=null getter='<get-delegatedVal>(): Int' setter=null type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test_delegatedVal> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0<kotlin.Int> flags:
correspondingProperty: PROPERTY name:test_delegatedVal visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test_delegatedVal>(): KProperty0<Int>'
GET_FIELD 'test_delegatedVal: KProperty0<Int>' type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
PROPERTY name:delegatedVar visibility:public modality:FINAL flags:delegated,var
FIELD DELEGATE name:delegatedVar$delegate type:Delegate visibility:private flags:final,static
EXPRESSION_BODY
GET_OBJECT 'Delegate' type=Delegate
FUN DELEGATED_PROPERTY_ACCESSOR name:<get-delegatedVar> visibility:public modality:FINAL <> () returnType:kotlin.Int flags:
correspondingProperty: PROPERTY name:delegatedVar visibility:public modality:FINAL flags:delegated,var
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-delegatedVar>(): Int'
CALL 'getValue(Any?, Any): Int' type=kotlin.Int origin=null
$this: GET_FIELD '`delegatedVar$delegate`: Delegate' type=Delegate origin=null
thisRef: CONST Null type=kotlin.Nothing? value=null
kProp: PROPERTY_REFERENCE 'delegatedVar: Int' field=null getter='<get-delegatedVar>(): Int' setter='<set-delegatedVar>(Int): Unit' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
FUN DELEGATED_PROPERTY_ACCESSOR name:<set-delegatedVar> visibility:public modality:FINAL <> (<set-?>:kotlin.Int) returnType:kotlin.Unit flags:
correspondingProperty: PROPERTY name:delegatedVar visibility:public modality:FINAL flags:delegated,var
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<set-delegatedVar>(Int): Unit'
CALL 'setValue(Any?, Any, Int): Unit' type=kotlin.Unit origin=null
$this: GET_FIELD '`delegatedVar$delegate`: Delegate' type=Delegate origin=null
thisRef: CONST Null type=kotlin.Nothing? value=null
kProp: PROPERTY_REFERENCE 'delegatedVar: Int' field=null getter='<get-delegatedVar>(): Int' setter='<set-delegatedVar>(Int): Unit' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
PROPERTY name:test_delegatedVar visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test_delegatedVar type:kotlin.reflect.KMutableProperty0<kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'delegatedVar: Int' field=null getter='<get-delegatedVar>(): Int' setter='<set-delegatedVar>(Int): Unit' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test_delegatedVar> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0<kotlin.Int> flags:
correspondingProperty: PROPERTY name:test_delegatedVar visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test_delegatedVar>(): KMutableProperty0<Int>'
GET_FIELD 'test_delegatedVar: KMutableProperty0<Int>' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=null
PROPERTY name:constVal visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:constVal type:kotlin.Int visibility:public flags:final,static
EXPRESSION_BODY
CONST Int type=kotlin.Int value=1
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-constVal> visibility:public modality:FINAL <> () returnType:kotlin.Int flags:
correspondingProperty: PROPERTY name:constVal visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-constVal>(): Int'
GET_FIELD 'constVal: Int' type=kotlin.Int origin=null
PROPERTY name:test_constVal visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test_constVal type:kotlin.reflect.KProperty0<kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'constVal: Int' field=null getter='<get-constVal>(): Int' setter=null type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test_constVal> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0<kotlin.Int> flags:
correspondingProperty: PROPERTY name:test_constVal visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test_constVal>(): KProperty0<Int>'
GET_FIELD 'test_constVal: KProperty0<Int>' type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
PROPERTY name:test_J_CONST visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test_J_CONST type:kotlin.reflect.KProperty0<kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'CONST: Int' field='CONST: Int' getter=null setter=null type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test_J_CONST> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0<kotlin.Int> flags:
correspondingProperty: PROPERTY name:test_J_CONST visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test_J_CONST>(): KProperty0<Int>'
GET_FIELD 'test_J_CONST: KProperty0<Int>' type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
PROPERTY name:test_J_nonConst visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test_J_nonConst type:kotlin.reflect.KMutableProperty0<kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'nonConst: Int' field='nonConst: Int' getter=null setter=null type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test_J_nonConst> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0<kotlin.Int> flags:
correspondingProperty: PROPERTY name:test_J_nonConst visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test_J_nonConst>(): KMutableProperty0<Int>'
GET_FIELD 'test_J_nonConst: KMutableProperty0<Int>' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=null
@@ -2,12 +2,11 @@ class A {
fun foo() {}
}
fun bar() {}
val qux = 42
val qux = 1
val test1 = A::class
val test2 = qux::class
val test3 = A::foo
val test4 = ::A
val test5 = A()::foo
val test6 = ::bar
val test7 = ::qux
val test6 = ::bar
@@ -26,7 +26,7 @@ FILE fqName:<root> fileName:/reflectionLiterals.kt
PROPERTY name:qux visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:qux type:kotlin.Int visibility:public flags:final,static
EXPRESSION_BODY
CONST Int type=kotlin.Int value=42
CONST Int type=kotlin.Int value=1
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-qux> visibility:public modality:FINAL <> () returnType:kotlin.Int flags:
correspondingProperty: PROPERTY name:qux visibility:public modality:FINAL flags:val
BLOCK_BODY
@@ -88,13 +88,3 @@ FILE fqName:<root> fileName:/reflectionLiterals.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test6>(): KFunction0<Unit>'
GET_FIELD 'test6: KFunction0<Unit>' type=kotlin.reflect.KFunction0<kotlin.Unit> origin=null
PROPERTY name:test7 visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test7 type:kotlin.reflect.KProperty0<kotlin.Int> visibility:public flags:final,static
EXPRESSION_BODY
PROPERTY_REFERENCE 'qux: Int' field='qux: Int' getter='<get-qux>(): Int' setter=null type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test7> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0<kotlin.Int> flags:
correspondingProperty: PROPERTY name:test7 visibility:public modality:FINAL flags:val
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test7>(): KProperty0<Int>'
GET_FIELD 'test7: KProperty0<Int>' type=kotlin.reflect.KProperty0<kotlin.Int> origin=null
@@ -1062,6 +1062,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
runTest("compiler/testData/ir/irText/expressions/primitivesImplicitConversions.kt");
}
@TestMetadata("propertyReferences.kt")
public void testPropertyReferences() throws Exception {
runTest("compiler/testData/ir/irText/expressions/propertyReferences.kt");
}
@TestMetadata("references.kt")
public void testReferences() throws Exception {
runTest("compiler/testData/ir/irText/expressions/references.kt");