diff --git a/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/CliLightClassGenerationSupport.java b/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/CliLightClassGenerationSupport.java index df1064d872b..8e3460e7f4c 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/CliLightClassGenerationSupport.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/CliLightClassGenerationSupport.java @@ -72,21 +72,7 @@ public class CliLightClassGenerationSupport extends LightClassGenerationSupport @NotNull public BindingTrace getTrace() { if (trace == null) { - trace = new BindingTraceContext() { - @Override - public void record(WritableSlice slice, K key, V value) { - if (slice == BindingContext.RESOLUTION_SCOPE || slice == BindingContext.TYPE_RESOLUTION_SCOPE) { - // In the compiler there's no need to keep scopes - return; - } - super.record(slice, key, value); - } - - @Override - public String toString() { - return "Filtering trace for the CLI compiler: does not save scopes"; - } - }; + trace = new BindingTraceContextWithoutScopeRecording(); } return trace; } @@ -199,4 +185,20 @@ public class CliLightClassGenerationSupport extends LightClassGenerationSupport public PsiClass getPsiClass(@NotNull JetClassOrObject classOrObject) { return KotlinLightClassForExplicitDeclaration.create(classOrObject.getManager(), classOrObject); } + + public static class BindingTraceContextWithoutScopeRecording extends BindingTraceContext { + @Override + public void record(WritableSlice slice, K key, V value) { + if (slice == BindingContext.RESOLUTION_SCOPE || slice == BindingContext.TYPE_RESOLUTION_SCOPE) { + // In the compiler there's no need to keep scopes + return; + } + super.record(slice, key, value); + } + + @Override + public String toString() { + return "Filtering trace for the CLI compiler: does not save scopes"; + } + } }