Smart completion after "by" works for getValue/setValue in generic class

This commit is contained in:
Valentin Kipyatkov
2016-03-31 21:26:50 +03:00
parent 4dde458e84
commit e05d6a7056
7 changed files with 82 additions and 1 deletions
@@ -0,0 +1,12 @@
import kotlin.reflect.KProperty
class X<T>(t: T) {
operator fun getValue(thisRef: C<T>, property: KProperty<*>): T = throw Exception()
}
class C<T> {
val property by <caret>
}
// EXIST: lazy
// EXIST: { itemText: "X", tailText: "(t: T) (<root>)" }
@@ -0,0 +1,12 @@
import kotlin.reflect.KProperty
class X<T>(t: T) {
operator fun getValue(thisRef: C<T>, property: KProperty<*>): T = throw Exception()
}
class C<T> {
val property: T by <caret>
}
// EXIST: lazy
// EXIST: { itemText: "X", tailText: "(t: T) (<root>)" }
@@ -0,0 +1,12 @@
import kotlin.reflect.KProperty
class X<T>(t: T) {
operator fun getValue(thisRef: C<String, T>, property: KProperty<*>): T = throw Exception()
}
class C<T1, T2> {
val property: T2 by <caret>
}
// EXIST: lazy
// ABSENT: X
@@ -0,0 +1,12 @@
import kotlin.reflect.KProperty
class X<T>(t: T) {
operator fun getValue(thisRef: C<T>, property: KProperty<*>): T = throw Exception()
operator fun setValue(thisRef: C<T>, property: KProperty<*>, t: T) {}
}
class C<T> {
var property by <caret>
}
// EXIST: { itemText: "X", tailText: "(t: T) (<root>)" }