Pass module to GenerationState
- get rid of a hack there which was used to obtain any module, to be used in ReflectionTypes - delete unused getError() in LightClassConstructionContext which was always null - fix some minor warnings
This commit is contained in:
+3
-6
@@ -53,7 +53,6 @@ import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.types.lang.InlineUtil;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -262,10 +261,6 @@ public class KotlinJavaFileStubProvider<T extends WithFileStub> implements Cache
|
||||
checkForBuiltIns(packageFqName, files);
|
||||
|
||||
LightClassConstructionContext context = stubGenerationStrategy.getContext(files);
|
||||
Throwable error = context.getError();
|
||||
if (error != null) {
|
||||
throw new IllegalStateException("failed to analyze: " + error, error);
|
||||
}
|
||||
|
||||
PsiJavaFileStub javaFileStub = createJavaFileStub(packageFqName, getRepresentativeVirtualFile(files));
|
||||
BindingContext bindingContext;
|
||||
@@ -277,11 +272,13 @@ public class KotlinJavaFileStubProvider<T extends WithFileStub> implements Cache
|
||||
project,
|
||||
new KotlinLightClassBuilderFactory(stubStack),
|
||||
Progress.DEAF,
|
||||
context.getModule(),
|
||||
context.getBindingContext(),
|
||||
Lists.newArrayList(files),
|
||||
/*not-null assertions*/false, false,
|
||||
/*generateClassFilter=*/stubGenerationStrategy.getGenerateClassFilter(),
|
||||
/*to generate inline flag on methods*/true);
|
||||
/*to generate inline flag on methods*/true
|
||||
);
|
||||
state.beforeCompile();
|
||||
|
||||
bindingContext = state.getBindingContext();
|
||||
|
||||
+7
-7
@@ -17,16 +17,16 @@
|
||||
package org.jetbrains.jet.asJava;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.ModuleDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
|
||||
public class LightClassConstructionContext {
|
||||
private final BindingContext bindingContext;
|
||||
private final Throwable error;
|
||||
private final ModuleDescriptor module;
|
||||
|
||||
public LightClassConstructionContext(@NotNull BindingContext bindingContext, @Nullable Throwable error) {
|
||||
public LightClassConstructionContext(@NotNull BindingContext bindingContext, @NotNull ModuleDescriptor module) {
|
||||
this.bindingContext = bindingContext;
|
||||
this.error = error;
|
||||
this.module = module;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -34,8 +34,8 @@ public class LightClassConstructionContext {
|
||||
return bindingContext;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Throwable getError() {
|
||||
return error;
|
||||
@NotNull
|
||||
public ModuleDescriptor getModule() {
|
||||
return module;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user