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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user