KT-9835 Completion thinks receiver is nullable when it is not
#KT-9835 Fixed
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
interface R<T>
|
||||
|
||||
val <T> R<T>.prop: Int get() = TODO()
|
||||
fun <T> R<T>.extFun(): Int = TODO()
|
||||
|
||||
interface I
|
||||
|
||||
fun foo(r: R<out I>) {
|
||||
r.<caret>
|
||||
}
|
||||
|
||||
// EXIST: { itemText: "prop", typeText: "Int", attributes: "bold" }
|
||||
// EXIST: { itemText: "extFun", typeText: "Int", attributes: "bold" }
|
||||
|
||||
|
||||
+5
@@ -2,9 +2,14 @@ fun foo(klass: Class<*>) {
|
||||
klass.<caret>
|
||||
}
|
||||
|
||||
fun <T> Class<T>.extFun(): Class<in T> = TODO()
|
||||
|
||||
// EXIST: simpleName
|
||||
// ABSENT: getSimpleName
|
||||
// EXIST: enclosingClass
|
||||
// ABSENT: getEnclosingClass
|
||||
// EXIST: annotations
|
||||
// ABSENT: getAnnotations
|
||||
// EXIST: superclass
|
||||
// ABSENT: getSuperclass
|
||||
// EXIST: extFun
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
public interface R<D extends I> {
|
||||
int getFoo();
|
||||
int f();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
interface I
|
||||
|
||||
fun foo(r: R<out I>) {
|
||||
r.<caret>
|
||||
}
|
||||
|
||||
// EXIST: { itemText: "foo", tailText: " (from getFoo())", typeText: "Int", attributes: "bold" }
|
||||
// EXIST: { itemText: "f", tailText: "()", typeText: "Int", attributes: "bold" }
|
||||
+6
@@ -1197,6 +1197,12 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("KT9835.kt")
|
||||
public void testKT9835() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/boldOrGrayed/KT9835.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NonPredictableSmartCast.kt")
|
||||
public void testNonPredictableSmartCast() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/boldOrGrayed/NonPredictableSmartCast.kt");
|
||||
|
||||
+6
@@ -1197,6 +1197,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("KT9835.kt")
|
||||
public void testKT9835() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/boldOrGrayed/KT9835.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NonPredictableSmartCast.kt")
|
||||
public void testNonPredictableSmartCast() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/boldOrGrayed/NonPredictableSmartCast.kt");
|
||||
|
||||
+6
@@ -209,6 +209,12 @@ public class MultiFileJvmBasicCompletionTestGenerated extends AbstractMultiFileJ
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("KT9835")
|
||||
public void testKT9835() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/KT9835/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("MoreSpecificExtensionGeneric")
|
||||
public void testMoreSpecificExtensionGeneric() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/MoreSpecificExtensionGeneric/");
|
||||
|
||||
Reference in New Issue
Block a user