@NotNull public static ClassFileFactory generateFiles( @NotNull JetCoreEnvironment environment, @NotNull CodegenTestFiles files) { AnalyzeExhaust analyzeExhaust = AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationAndCheckForErrors( environment.getProject(), files.getPsiFiles(), files.getScriptParameterTypes(), Predicates.<PsiFile>alwaysTrue()); analyzeExhaust.throwIfError(); AnalyzingUtils.throwExceptionOnErrors(analyzeExhaust.getBindingContext()); CompilerConfiguration configuration = environment.getConfiguration(); GenerationState state = new GenerationState( environment.getProject(), ClassBuilderFactories.TEST, Progress.DEAF, analyzeExhaust.getBindingContext(), files.getPsiFiles(), configuration.get(JVMConfigurationKeys.GENERATE_NOT_NULL_ASSERTIONS, true), configuration.get(JVMConfigurationKeys.GENERATE_NOT_NULL_PARAMETER_ASSERTIONS, true), /*generateDeclaredClasses = */ true, configuration.get( JVMConfigurationKeys.ENABLE_INLINE, InlineUtil.DEFAULT_INLINE_FLAG_FOR_TEST)); KotlinCodegenFacade.compileCorrectFiles(state, CompilationErrorHandler.THROW_EXCEPTION); return state.getFactory(); }