Do not wrap flexible types into Nullable/NotNull types
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// FILE: p/PsiElement.java
|
||||
|
||||
package p;
|
||||
|
||||
public interface PsiElement {}
|
||||
|
||||
// FILE: p/JetExpression.java
|
||||
|
||||
package p;
|
||||
|
||||
public interface JetExpression extends PsiElement {}
|
||||
|
||||
// FILE: p/Util.java
|
||||
|
||||
package p;
|
||||
|
||||
public class Util {
|
||||
|
||||
public static <T extends PsiElement> T getParentOfType(@Nullable PsiElement element, @NotNull Class<T> aClass) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void on(JetExpression e) {}
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
import p.*
|
||||
|
||||
fun test(e: JetExpression) {
|
||||
Util.on(
|
||||
Util.getParentOfType(e, javaClass<JetExpression>()) ?: e
|
||||
)
|
||||
}
|
||||
|
||||
fun <T> javaClass(): Class<T> = null!!
|
||||
@@ -7717,6 +7717,11 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("getParentOfType.kt")
|
||||
public void testGetParentOfType() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/platformTypes/getParentOfType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inference.kt")
|
||||
public void testInference() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/platformTypes/inference.kt");
|
||||
|
||||
Reference in New Issue
Block a user