Separate UNSAFE_IMPLICIT_INVOKE_CALL diagnostics introduced (see KT-8252)

This commit is contained in:
Mikhail Glukhikh
2016-01-15 10:39:12 +03:00
parent fe11b5a473
commit 6157ebe3b8
11 changed files with 33 additions and 14 deletions
+8
View File
@@ -0,0 +1,8 @@
class Rule(val apply: () -> Unit)
fun foo() {
val rule: Rule? = Rule { }
rule?.<error descr="[UNSAFE_IMPLICIT_INVOKE_CALL] Reference has a nullable type (() -> kotlin.Unit)?, use explicit ?.invoke() to make function-like call instead">apply</error>()
val apply = rule?.apply
<error descr="[UNSAFE_IMPLICIT_INVOKE_CALL] Reference has a nullable type (() -> kotlin.Unit)?, use explicit ?.invoke() to make function-like call instead">apply</error>()
}
@@ -295,6 +295,12 @@ public class PsiCheckerTestGenerated extends AbstractPsiCheckerTest {
doTest(fileName);
}
@TestMetadata("SafeInvoke.kt")
public void testSafeInvoke() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/SafeInvoke.kt");
doTest(fileName);
}
@TestMetadata("Shadowing.kt")
public void testShadowing() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/Shadowing.kt");