do not need to check stand-alone class object for class,
when it's on the left hand side of dot it is analyzed in 'getIdForImplicitReceiver' (test added)
This commit is contained in:
-4
@@ -202,10 +202,6 @@ public class DataFlowValueFactory {
|
||||
if (declarationDescriptor instanceof NamespaceDescriptor) {
|
||||
return createNamespaceInfo(declarationDescriptor);
|
||||
}
|
||||
if (declarationDescriptor instanceof ClassDescriptor) {
|
||||
ClassDescriptor classDescriptor = (ClassDescriptor) declarationDescriptor;
|
||||
return createInfo(classDescriptor, classDescriptor.getClassObjectDescriptor() != null);
|
||||
}
|
||||
return NO_IDENTIFIER_INFO;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
open class T {
|
||||
val x : Int? = null
|
||||
}
|
||||
|
||||
class A {
|
||||
class object: T() {
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
class object: T() {
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
if (A.x != null) {
|
||||
useInt(A.x)
|
||||
useInt(<!TYPE_MISMATCH!>B.x<!>)
|
||||
}
|
||||
}
|
||||
|
||||
fun useInt(i: Int) = i
|
||||
@@ -4867,6 +4867,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/diagnostics/tests/smartCasts"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("classObjectMember.kt")
|
||||
public void testClassObjectMember() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/smartCasts/classObjectMember.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("combineWithNoSelectorInfo.kt")
|
||||
public void testCombineWithNoSelectorInfo() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/smartCasts/combineWithNoSelectorInfo.kt");
|
||||
|
||||
Reference in New Issue
Block a user