[FIR] Create this reference for getValue calls in delegates with proper type

^KT-57288 Fixed
This commit is contained in:
Dmitriy Novozhilov
2023-03-17 14:01:31 +02:00
committed by Space Team
parent 823c60a7dc
commit 16872f7a74
11 changed files with 85 additions and 19 deletions
@@ -0,0 +1,21 @@
// WITH_STDLIB
// ISSUE: KT-57288
import kotlin.properties.ReadWriteProperty
interface Delegate<R, T> : ReadWriteProperty<R, T> {
infix fun resource(factory: Factory<R, T>): Delegate<R, T>
}
interface Factory<Source, Target>
interface Some
fun <Self : Some, Target : Some> Self.delegateOf(clazz: Class<Target>): Delegate<Self, Target?> = null!!
abstract class SomeImpl<R : Some> : Some {
abstract val type: Class<R>
var bundle by delegateOf(type) resource getFactory()
fun <M : SomeImpl<T>, T : Some> getFactory(): Factory<M, T?> = null!!
}