Check REPL snippet syntax before calling analysis
restores the behaviour of the GenericRepl implementation and fixes issues then invalid code is being compiled #KT-34888 fixed
This commit is contained in:
+3
@@ -96,6 +96,9 @@ class KJvmReplCompilerImpl(val hostConfiguration: ScriptingHostConfiguration) :
|
||||
)
|
||||
.valueOr { return it }
|
||||
|
||||
val syntaxErrorReport = AnalyzerWithCompilerReport.reportSyntaxErrors(snippetKtFile, errorHolder)
|
||||
if (syntaxErrorReport.isHasErrors) return failure(messageCollector)
|
||||
|
||||
val (sourceFiles, sourceDependencies) = collectRefinedSourcesAndUpdateEnvironment(
|
||||
context,
|
||||
snippetKtFile,
|
||||
|
||||
Reference in New Issue
Block a user