Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt50994.fir.kt
T
Kirill Rakhman d91000e39c [FIR] Report INAPPLICABLE_CANDIDATE or more specific diagnostic for callable references
... instead of just UNRESOLVED_REFERENCE when something went wrong
during resolution.

#KT-59401 related
2023-11-08 15:45:48 +00:00

42 lines
1.3 KiB
Kotlin
Vendored

// FIR_DUMP
// WITH_REFLECT
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty1
class ProcessorWithParent : Entity {
var processor by parent(ProcessorWithChildren::processors)
}
class ProcessorWithChildren : Entity {
var processors by children(ProcessorWithParent::class.java, ProcessorWithParent::<!INAPPLICABLE_CANDIDATE!>processor<!>)
}
class Processor2WithParent : Entity {
var processor: Processor2WithChildren? by parent(Processor2WithChildren::processors)
}
class Processor2WithChildren : Entity {
var processors by children(Processor2WithParent::class.java, Processor2WithParent::processor)
}
class Processor3WithParent : Entity {
var processor by parent(Processor3WithChildren::processors)
}
class Processor3WithChildren : Entity {
var processors: MutableCollection<Processor3WithParent> by children(Processor3WithParent::class.java, Processor3WithParent::processor)
}
inline fun <reified SP : Entity, reified TP : Entity> SP.parent(
property: KProperty1<TP, MutableCollection<SP>>
): Delegate<SP, TP?> = null!!
fun <SC : Entity, TC : Entity> SC.children(
clazz: Class<TC>, property: KProperty1<TC, SC?>, name: String = property.name
): Delegate<SC, MutableCollection<TC>> = null!!
interface Delegate<R : Entity, T> : ReadWriteProperty<R, T>
interface Entity