Remove reference to error type constructor from unresolved annotation

This commit is contained in:
Nikolay Krasko
2012-08-29 22:47:50 +04:00
parent 9a9efd5b2f
commit 78cb5381f7
3 changed files with 15 additions and 0 deletions
@@ -186,6 +186,11 @@ public class CallResolver {
JetTypeReference typeReference = expression.getTypeReference();
assert typeReference != null;
JetType constructedType = typeResolver.resolveType(context.scope, typeReference, context.trace, true);
if (ErrorUtils.isErrorType(constructedType)) {
return checkArgumentTypesAndFail(context);
}
DeclarationDescriptor declarationDescriptor = constructedType.getConstructor().getDeclarationDescriptor();
if (declarationDescriptor instanceof ClassDescriptor) {
ClassDescriptor classDescriptor = (ClassDescriptor) declarationDescriptor;
@@ -0,0 +1,4 @@
`!null`first object Foo {}
`!null`second(`!null`aa, `!null`asdf) object More {
}
@@ -202,6 +202,12 @@ public abstract class ExpectedResolveData {
renderReferenceInContext(referenceExpression) +
" but was resolved to " + renderNullableDescriptor(referenceTarget),
unresolvedReferences.contains(referenceExpression));
assertTrue(
String.format("Reference =%s= has a reference target =%s= but expected to be unresolved",
renderReferenceInContext(referenceExpression), renderNullableDescriptor(referenceTarget)),
referenceTarget == null);
continue;
}
if ("!!".equals(name)) {