fixed an exception from 'getConstructorReferenceExpression'

(from exception analyzer)
This commit is contained in:
Svetlana Isakova
2012-12-29 17:31:57 +04:00
parent 4d4ba52378
commit 55968aabad
3 changed files with 10 additions and 2 deletions
@@ -37,10 +37,9 @@ public class JetConstructorCalleeExpression extends JetExpressionImpl {
return null;
}
JetTypeElement typeElement = typeReference.getTypeElement();
if (typeElement == null) {
if (!(typeElement instanceof JetUserType)) {
return null;
}
assert typeElement instanceof JetUserType : typeElement;
return ((JetUserType) typeElement).getReferenceExpression();
}
@@ -0,0 +1,4 @@
package typeReferenceError
class <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>Pair<!><<!SYNTAX!><!>:(val c: <!SYNTAX!><!SYNTAX!><!>fun<!><!SYNTAX!><!> <!UNRESOLVED_REFERENCE!>main<!>()
@@ -1949,6 +1949,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
doTest("compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/namedFun.kt");
}
@TestMetadata("typeReferenceError.kt")
public void testTypeReferenceError() throws Exception {
doTest("compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/typeReferenceError.kt");
}
}
public static Test innerSuite() {