diff --git a/compiler/frontend/src/org/jetbrains/jet/analyzer/AnalyzeExhaust.java b/compiler/frontend/src/org/jetbrains/jet/analyzer/AnalyzeExhaust.java index 7d4456aa4d1..a23ecb2d4be 100644 --- a/compiler/frontend/src/org/jetbrains/jet/analyzer/AnalyzeExhaust.java +++ b/compiler/frontend/src/org/jetbrains/jet/analyzer/AnalyzeExhaust.java @@ -19,19 +19,44 @@ package org.jetbrains.jet.analyzer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.ModuleConfiguration; +import org.jetbrains.jet.lang.descriptors.ClassDescriptor; import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; import org.jetbrains.jet.lang.psi.JetImportDirective; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.BindingTrace; import org.jetbrains.jet.lang.resolve.BodiesResolveContext; +import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe; import org.jetbrains.jet.lang.resolve.scopes.WritableScope; import java.util.Collection; +import java.util.Collections; /** * @author Stepan Koltsov */ public class AnalyzeExhaust { + private static final ModuleConfiguration ERROR_CONFIGURATION = new ModuleConfiguration() { + @Override + public void addDefaultImports(@NotNull Collection directives) { + } + + @Override + public void extendNamespaceScope(@NotNull BindingTrace trace, @NotNull NamespaceDescriptor namespaceDescriptor, @NotNull WritableScope namespaceMemberScope) { + } + + @NotNull + @Override + public Collection getKotlinAnalogs(@NotNull FqNameUnsafe className) { + return Collections.emptyList(); + } + + @Override + public String toString() { + return "ERROR_CONFIGURATION"; + } + }; + + private final BindingContext bindingContext; private final Throwable error; private final BodiesResolveContext bodiesResolveContext; @@ -61,7 +86,7 @@ public class AnalyzeExhaust { } public static AnalyzeExhaust error(@NotNull BindingContext bindingContext, @NotNull Throwable error) { - return new AnalyzeExhaust(bindingContext, ModuleConfiguration.EMPTY, null, error); + return new AnalyzeExhaust(bindingContext, ERROR_CONFIGURATION, null, error); } @Nullable diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/ModuleConfiguration.java b/compiler/frontend/src/org/jetbrains/jet/lang/ModuleConfiguration.java index 96be3d45fc8..1972553e040 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/ModuleConfiguration.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/ModuleConfiguration.java @@ -45,6 +45,11 @@ public interface ModuleConfiguration { public Collection getKotlinAnalogs(@NotNull FqNameUnsafe className) { return Collections.emptyList(); } + + @Override + public String toString() { + return "EMPTY"; + } }; void addDefaultImports(@NotNull Collection directives);