Omport order fixed: the current package must have the highest priority

This commit is contained in:
Andrey Breslav
2012-07-27 18:44:14 +04:00
parent 58ec90d7ee
commit 6c6317740c
@@ -67,11 +67,9 @@ public class ScopeProvider {
throw new IllegalStateException("Root package not found");
}
writableScope.importScope(rootPackageDescriptor.getMemberScope());
// Don't import twice
if (!packageDescriptor.getQualifiedName().equals(FqName.ROOT)) {
writableScope.importScope(packageDescriptor.getMemberScope());
writableScope.importScope(rootPackageDescriptor.getMemberScope());
}
List<JetImportDirective> importDirectives = Lists.newArrayList(file.getImportDirectives());
@@ -81,6 +79,8 @@ public class ScopeProvider {
resolveSession.getModuleConfiguration(), resolveSession.getTrace(),
resolveSession.getInjector().getQualifiedExpressionResolver());
writableScope.importScope(packageDescriptor.getMemberScope());
writableScope.changeLockLevel(WritableScope.LockLevel.READING);
// TODO: Cache
return writableScope;