"Static members" completion after "by"

This commit is contained in:
Valentin Kipyatkov
2016-03-25 16:03:09 +03:00
parent 6fa230311c
commit ae0d840aab
3 changed files with 24 additions and 7 deletions
@@ -1,6 +1,10 @@
import kotlin.reflect.KProperty
class Property<TOwner, TValue>(owner: TOwner, value: TValue)
class Property<TOwner, TValue>(owner: TOwner, value: TValue) {
companion object {
fun <TOwner, TValue> create(owner: TOwner, value: TValue) = Property<TOwner, TValue>(owner, value)
}
}
operator fun <TValue, TOwner> Property<TOwner, TValue>.getValue(thisRef: TOwner, property: KProperty<*>): TValue {
throw Exception()
@@ -14,3 +18,4 @@ class C {
// EXIST: { itemText: "createProperty", typeText: "Property<C, TValue>" }
// EXIST: { itemText: "Property", tailText: "(owner: C, value: TValue) (<root>)" }
// EXIST: { itemText:"Property.create", tailText:"(owner: C, value: TValue) (<root>)", typeText:"Property<C, TValue>" }
@@ -2,6 +2,10 @@ import kotlin.reflect.KProperty
class X1 {
operator fun getValue(thisRef: C, property: KProperty<*>): String = ""
companion object {
fun create() = X1()
}
}
class X2 {
operator fun getValue(thisRef: String, property: KProperty<*>): String = ""
@@ -30,15 +34,19 @@ class C {
}
// EXIST: lazy
// EXIST: createX1
// ABSENT: createX2
// EXIST: createX3
// EXIST: createY1
// ABSENT: createY2
// EXIST: createY3
// EXIST: X1
// ABSENT: X2
// EXIST: X3
// EXIST: Y1
// ABSENT: Y2
// ABSENT: Y3
// EXIST: { itemText:"X1.create", tailText:"() (<root>)", typeText:"X1", attributes:"" }