mirror of https://github.com/sbt/sbt.git
Workaround for scala/bug#10605
templateStats() is not thread-safe in 2.12.x (at least up to 2.12.4)
This commit is contained in:
parent
ee4dcee7cf
commit
a050b73a46
|
|
@ -142,7 +142,9 @@ private[sbt] object SbtParser {
|
|||
val wrapperFile = new BatchSourceFile(reporterId, code)
|
||||
val unit = new CompilationUnit(wrapperFile)
|
||||
val parser = new syntaxAnalyzer.UnitParser(unit)
|
||||
val parsedTrees = parser.templateStats()
|
||||
val parsedTrees = SbtParser.synchronized { // see https://github.com/scala/bug/issues/10605
|
||||
parser.templateStats()
|
||||
}
|
||||
parser.accept(scala.tools.nsc.ast.parser.Tokens.EOF)
|
||||
globalReporter.throwParserErrorsIfAny(reporter, filePath)
|
||||
parsedTrees -> reporterId
|
||||
|
|
|
|||
Loading…
Reference in New Issue