More tests for smart casts
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
import java.io.File
|
||||
|
||||
fun foo(o: Any) {
|
||||
if (o is File) {
|
||||
o.<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST_JAVA_ONLY: { lookupString: "absolutePath", itemText: "absolutePath", tailText: " (from getAbsolutePath())", typeText: "String!" }
|
||||
// ABSENT: getAbsolutePath
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import java.io.File
|
||||
|
||||
fun Any.foo() {
|
||||
if (this is File) {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST_JAVA_ONLY: { lookupString: "absolutePath", itemText: "absolutePath", tailText: " (from getAbsolutePath())", typeText: "String!" }
|
||||
// ABSENT: getAbsolutePath
|
||||
+12
@@ -1251,6 +1251,18 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SyntheticExtensionsSmartCast.kt")
|
||||
public void testSyntheticExtensionsSmartCast() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/extensions/SyntheticExtensionsSmartCast.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SyntheticExtensionsSmartCast2.kt")
|
||||
public void testSyntheticExtensionsSmartCast2() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/extensions/SyntheticExtensionsSmartCast2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("WrongExplicitReceiver.kt")
|
||||
public void testWrongExplicitReceiver() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/extensions/WrongExplicitReceiver.kt");
|
||||
|
||||
+12
@@ -1251,6 +1251,18 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SyntheticExtensionsSmartCast.kt")
|
||||
public void testSyntheticExtensionsSmartCast() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/extensions/SyntheticExtensionsSmartCast.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SyntheticExtensionsSmartCast2.kt")
|
||||
public void testSyntheticExtensionsSmartCast2() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/extensions/SyntheticExtensionsSmartCast2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("WrongExplicitReceiver.kt")
|
||||
public void testWrongExplicitReceiver() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/extensions/WrongExplicitReceiver.kt");
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
import java.io.File
|
||||
|
||||
fun foo(o: Any) {
|
||||
if (o is File) {
|
||||
o.getAbsolutePath()<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
import java.io.File
|
||||
|
||||
fun foo(o: Any) {
|
||||
if (o is File) {
|
||||
o.absolutePath<caret>
|
||||
}
|
||||
}
|
||||
@@ -7463,6 +7463,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCast.kt")
|
||||
public void testSmartCast() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/usePropertyAccessSyntax/smartCast.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("superCall.kt")
|
||||
public void testSuperCall() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/usePropertyAccessSyntax/superCall.kt");
|
||||
|
||||
Reference in New Issue
Block a user