KT-16535 'provideDelegate' convention is not supported in IR

Implement provideDelegate convention support.
NB delegate type now depends on 'provideDelegate' convention resolution.
This commit is contained in:
Dmitry Petrov
2017-02-28 12:07:34 +03:00
parent 6046b25f56
commit 885f397cdd
14 changed files with 544 additions and 28 deletions
@@ -0,0 +1,60 @@
FILE /differentReceivers.kt
CLASS CLASS MyClass
CONSTRUCTOR public constructor MyClass(value: kotlin.String)
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='MyClass'
PROPERTY public final val value: kotlin.String
FIELD PROPERTY_BACKING_FIELD public final val value: kotlin.String
EXPRESSION_BODY
GET_VAR 'value-parameter value: String' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <get-value>(): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-value>(): String'
GET_FIELD 'value: String' type=kotlin.String origin=null
receiver: GET_VAR '<receiver: MyClass>' type=MyClass origin=null
FUN public operator fun MyClass.provideDelegate(host: kotlin.Any?, p: kotlin.Any): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='provideDelegate(Any?, Any) on MyClass: String'
CALL '<get-value>(): String' type=kotlin.String origin=GET_PROPERTY
$this: GET_VAR '<receiver: provideDelegate(Any?, Any) on MyClass: String>' type=MyClass origin=null
FUN public operator fun kotlin.String.getValue(receiver: kotlin.Any?, p: kotlin.Any): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='getValue(Any?, Any) on String: String'
GET_VAR '<receiver: getValue(Any?, Any) on String: String>' type=kotlin.String origin=null
PROPERTY public val testO: kotlin.String
FIELD DELEGATE val `testO$delegate`: kotlin.String
EXPRESSION_BODY
CALL 'provideDelegate(Any?, Any) on MyClass: String' type=kotlin.String origin=null
$receiver: CALL 'constructor MyClass(String)' type=MyClass origin=null
value: CONST String type=kotlin.String value='O'
host: CONST Null type=kotlin.Nothing? value='null'
p: CALLABLE_REFERENCE 'testO: String' type=kotlin.reflect.KProperty0<kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE
FUN DELEGATED_PROPERTY_ACCESSOR public fun <get-testO>(): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-testO>(): String'
CALL 'getValue(Any?, Any) on String: String' type=kotlin.String origin=null
$receiver: GET_FIELD '`testO$delegate`: String' type=kotlin.String origin=null
receiver: CONST Null type=kotlin.Nothing? value='null'
p: CALLABLE_REFERENCE 'testO: String' type=kotlin.reflect.KProperty0<kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE
PROPERTY public val testK: kotlin.String
FIELD DELEGATE val `testK$delegate`: kotlin.String
EXPRESSION_BODY
CONST String type=kotlin.String value='K'
FUN DELEGATED_PROPERTY_ACCESSOR public fun <get-testK>(): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-testK>(): String'
CALL 'getValue(Any?, Any) on String: String' type=kotlin.String origin=null
$receiver: GET_FIELD '`testK$delegate`: String' type=kotlin.String origin=null
receiver: CONST Null type=kotlin.Nothing? value='null'
p: CALLABLE_REFERENCE 'testK: String' type=kotlin.reflect.KProperty0<kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE
PROPERTY public val testOK: kotlin.String
FIELD PROPERTY_BACKING_FIELD public val testOK: kotlin.String
EXPRESSION_BODY
CALL 'plus(Any?): String' type=kotlin.String origin=PLUS
$this: CALL '<get-testO>(): String' type=kotlin.String origin=GET_PROPERTY
other: CALL '<get-testK>(): String' type=kotlin.String origin=GET_PROPERTY
FUN DEFAULT_PROPERTY_ACCESSOR public fun <get-testOK>(): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-testOK>(): String'
GET_FIELD 'testOK: String' type=kotlin.String origin=null