Report NO_CLASS_OBJECT when no namespace is found and no class object if found

This commit is contained in:
Andrey Breslav
2011-10-12 21:18:57 +04:00
parent cb6fbe990a
commit 3562a37f31
@@ -887,6 +887,12 @@ public class JetTypeInferrer {
if (furtherNameLookup(expression, referencedName, result, context)) {
return context.services.checkType(result[0], expression, context);
}
// To report NO_CLASS_OBJECT when no namespace found
if (classifier != null) {
context.trace.report(NO_CLASS_OBJECT.on(expression, classifier));
context.trace.record(REFERENCE_TARGET, expression, classifier);
return ErrorUtils.createErrorType("No class object in " + expression.getReferencedName());
}
return null;
}