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:
Alexander Udalov
2014-05-12 19:56:50 +04:00
parent b27b8bf8b2
commit 357fe5cb17
14 changed files with 49 additions and 54 deletions
@@ -48,14 +48,18 @@ public class GenerationUtils {
public static GenerationState compileManyFilesGetGenerationStateForTest(@NotNull Project project, @NotNull List<JetFile> files) {
AnalyzeExhaust analyzeExhaust = JvmResolveUtil.analyzeFilesWithJavaIntegrationAndCheckForErrors(
project, files, Predicates.<PsiFile>alwaysTrue());
return compileFilesGetGenerationState(project,analyzeExhaust, files);
return compileFilesGetGenerationState(project, analyzeExhaust, files);
}
@NotNull
public static GenerationState compileFilesGetGenerationState(@NotNull Project project, @NotNull AnalyzeExhaust analyzeExhaust, @NotNull List<JetFile> files) {
public static GenerationState compileFilesGetGenerationState(
@NotNull Project project,
@NotNull AnalyzeExhaust analyzeExhaust,
@NotNull List<JetFile> files
) {
analyzeExhaust.throwIfError();
GenerationState state = new GenerationState(project, ClassBuilderFactories.TEST, analyzeExhaust.getBindingContext(), files);
GenerationState state = new GenerationState(project, ClassBuilderFactories.TEST, analyzeExhaust.getModuleDescriptor(),
analyzeExhaust.getBindingContext(), files);
KotlinCodegenFacade.compileCorrectFiles(state, CompilationErrorHandler.THROW_EXCEPTION);
return state;
}