a02cb16fb2
The main idea is getting rid of stub types and using just type variables See more detailed description at docs/fir/delegated_property_inference.md The problem with stub types is that they need really special treatment in many places, and on the other hand, there are no clear contracts on how they should work (that regularly leads to bugs like KT-59529) ^KT-61060 Fixed ^KT-61075 Fixed ^KT-61077 Fixed ^KT-59529 Fixed ^KT-61633 Related ^KT-61618 Related ^KT-61740 Related ^KT-59107 Related ^KT-61747 Related ^KT-61077 Related ^KT-61781 Related
23 lines
585 B
Kotlin
Vendored
23 lines
585 B
Kotlin
Vendored
// FIR_IDENTICAL
|
|
// ISSUE: KT-61075
|
|
// WITH_REFLECT
|
|
|
|
import kotlin.properties.ReadWriteProperty
|
|
|
|
open class BaseState
|
|
interface CustomComparable<T>
|
|
annotation class XCollection
|
|
|
|
fun <E> treeSet(): ReadWriteProperty<Any?, E> where E: BaseState, E: CustomComparable<E> = TODO()
|
|
|
|
internal class VisibleTreeState {
|
|
internal class State: BaseState(), CustomComparable<State>
|
|
|
|
// K1: ok
|
|
// K2: NEW_INFERENCE_ERROR
|
|
@get:XCollection var expandedNodes: State by treeSet()
|
|
|
|
// K1: ok
|
|
// K2: NEW_INFERENCE_ERROR
|
|
@set:XCollection var selectedNodes: State by treeSet()
|
|
} |