Smart completion after "by" works for getValue/setValue in generic class
This commit is contained in:
@@ -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>)" }
|
||||
+24
@@ -1534,11 +1534,35 @@ public class JvmSmartCompletionTestGenerated extends AbstractJvmSmartCompletionT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ValInGenericClass1.kt")
|
||||
public void testValInGenericClass1() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/smart/propertyDelegate/ValInGenericClass1.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ValInGenericClass2.kt")
|
||||
public void testValInGenericClass2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/smart/propertyDelegate/ValInGenericClass2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ValInGenericClass3.kt")
|
||||
public void testValInGenericClass3() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/smart/propertyDelegate/ValInGenericClass3.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("VarInClass.kt")
|
||||
public void testVarInClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/smart/propertyDelegate/VarInClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("VarInGenericClass.kt")
|
||||
public void testVarInGenericClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/smart/propertyDelegate/VarInGenericClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/idea-completion/testData/smart/smartCasts")
|
||||
|
||||
Reference in New Issue
Block a user