FIR: implementation of delegateProvider in delegate resolve

This commit is contained in:
Mikhail Glukhikh
2019-07-19 15:46:16 +03:00
parent 213f951da3
commit d32e5065c5
21 changed files with 278 additions and 66 deletions
@@ -0,0 +1,9 @@
class Delegate(val value: String) {
operator fun getValue(thisRef: Any?, property: Any?) = value
}
class DelegateProvider(val value: String) {
operator fun provideDelegate(thisRef: Any?, property: Any?) = Delegate(value)
}
val testTopLevel by DelegateProvider("OK")
@@ -0,0 +1,31 @@
FILE: simpleDelegateProvider.kt
public final class Delegate : R|kotlin/Any| {
public constructor(value: R|kotlin/String|): R|Delegate| {
super<R|kotlin/Any|>()
}
public final val value: R|kotlin/String| = R|<local>/value|
public get(): R|kotlin/String|
public final operator fun getValue(thisRef: R|kotlin/Any|?, property: R|kotlin/Any|?): R|kotlin/String| {
^getValue R|/Delegate.value|
}
}
public final class DelegateProvider : R|kotlin/Any| {
public constructor(value: R|kotlin/String|): R|DelegateProvider| {
super<R|kotlin/Any|>()
}
public final val value: R|kotlin/String| = R|<local>/value|
public get(): R|kotlin/String|
public final operator fun provideDelegate(thisRef: R|kotlin/Any|?, property: R|kotlin/Any|?): R|Delegate| {
^provideDelegate R|/Delegate.Delegate|(R|/DelegateProvider.value|)
}
}
public final val testTopLevel: R|kotlin/String|by R|/DelegateProvider.DelegateProvider|(String(OK)).R|/DelegateProvider.provideDelegate|(Null(null), ::R|/testTopLevel|)
public get(): R|kotlin/String| {
^ D|/testTopLevel|.R|/Delegate.getValue|(Null(null), ::R|/testTopLevel|)
}