'Unsupported' exception replaces with an error

This commit is contained in:
Andrey Breslav
2011-07-05 16:47:12 +04:00
parent 0c5eca16d5
commit 24819c2c95
@@ -275,12 +275,14 @@ public class TopDownAnalyzer {
List<JetImportDirective> importDirectives = namespace.getImportDirectives();
for (JetImportDirective importDirective : importDirectives) {
if (importDirective.isAbsoluteInRootNamespace()) {
throw new UnsupportedOperationException();
trace.getErrorHandler().genericError(namespace.getNode(), "Unsupported by TDA"); // TODO
continue;
}
if (importDirective.isAllUnder()) {
JetExpression importedReference = importDirective.getImportedReference();
if (importedReference != null) {
JetType type = semanticServices.getTypeInferrerServices(trace, JetFlowInformationProvider.THROW_EXCEPTION).getTypeWithNamespaces(namespaceScope, importedReference, false);
JetTypeInferrer.Services typeInferrerServices = semanticServices.getTypeInferrerServices(trace, JetFlowInformationProvider.THROW_EXCEPTION);
JetType type = typeInferrerServices.getTypeWithNamespaces(namespaceScope, importedReference, false);
if (type != null) {
namespaceScope.importScope(type.getMemberScope());
}