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:
+1
-1
@@ -117,7 +117,7 @@ public class CliLightClassGenerationSupport extends LightClassGenerationSupport
|
||||
|
||||
@NotNull
|
||||
private LightClassConstructionContext getContext() {
|
||||
return new LightClassConstructionContext(getTrace().getBindingContext(), null);
|
||||
return new LightClassConstructionContext(getTrace().getBindingContext(), getModule());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+2
-1
@@ -304,7 +304,8 @@ public class KotlinToJVMBytecodeCompiler {
|
||||
private static GenerationState generate(@NotNull JetCoreEnvironment environment, @NotNull AnalyzeExhaust exhaust) {
|
||||
CompilerConfiguration configuration = environment.getConfiguration();
|
||||
GenerationState generationState = new GenerationState(
|
||||
environment.getProject(), ClassBuilderFactories.BINARIES, Progress.DEAF, exhaust.getBindingContext(), environment.getSourceFiles(),
|
||||
environment.getProject(), ClassBuilderFactories.BINARIES, Progress.DEAF,
|
||||
exhaust.getModuleDescriptor(), exhaust.getBindingContext(), environment.getSourceFiles(),
|
||||
configuration.get(JVMConfigurationKeys.GENERATE_NOT_NULL_ASSERTIONS, false),
|
||||
configuration.get(JVMConfigurationKeys.GENERATE_NOT_NULL_PARAMETER_ASSERTIONS, false),
|
||||
GenerationState.GenerateClassFilter.GENERATE_ALL,
|
||||
|
||||
@@ -249,7 +249,7 @@ public class ReplInterpreter {
|
||||
|
||||
BindingContext bindingContext = AnalyzeExhaust.success(trace.getBindingContext(), module).getBindingContext();
|
||||
GenerationState generationState = new GenerationState(psiFile.getProject(), ClassBuilderFactories.BINARIES,
|
||||
bindingContext, Collections.singletonList(psiFile));
|
||||
module, bindingContext, Collections.singletonList(psiFile));
|
||||
|
||||
compileScript(psiFile.getScript(), scriptClassType, earlierScripts, generationState,
|
||||
CompilationErrorHandler.THROW_EXCEPTION);
|
||||
|
||||
Reference in New Issue
Block a user