Minimal refactoring that eliminates importing Java's root namespace by default.

All tests pass. Some beautifying needed

#KT-1477 Fixed
This commit is contained in:
Andrey Breslav
2012-03-11 20:28:37 +04:00
parent 6bc3bbb53d
commit 3c71512850
10 changed files with 134 additions and 40 deletions
@@ -84,6 +84,9 @@ public abstract class CodegenContext {
while(true) {
DeclarationDescriptor contextDescriptor = c.getContextDescriptor();
if(!(contextDescriptor instanceof ClassDescriptor) && !(contextDescriptor instanceof NamespaceDescriptor)) {
if (c.getParentContext() == null) {
System.out.println();
}
c = c.getParentContext();
}
else {
@@ -52,7 +52,7 @@ public class NamespaceCodegen {
}
public void generate(JetFile file) {
NamespaceDescriptor descriptor = state.getBindingContext().get(BindingContext.NAMESPACE, file);
NamespaceDescriptor descriptor = state.getBindingContext().get(BindingContext.FILE_TO_NAMESPACE, file);
final CodegenContext context = CodegenContext.STATIC.intoNamespace(descriptor);
final FunctionCodegen functionCodegen = new FunctionCodegen(context, v, state);