From 8932d98c4dcb6eb840cf640bc636982236613a16 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 19 Nov 2016 17:51:08 +0100 Subject: Recreate FreshNameCreator for each run. Previously only the FrontEnd got a fresh FreshNameCreator for each run, the other phases used a global one instead. This means that compiling the same file several times would create different synthetic names and classes on each run. --- src/dotty/tools/dotc/typer/FrontEnd.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/typer/FrontEnd.scala') diff --git a/src/dotty/tools/dotc/typer/FrontEnd.scala b/src/dotty/tools/dotc/typer/FrontEnd.scala index 4f8bc55d8..c444631ae 100644 --- a/src/dotty/tools/dotc/typer/FrontEnd.scala +++ b/src/dotty/tools/dotc/typer/FrontEnd.scala @@ -12,7 +12,6 @@ import config.Printers.{typr, default} import util.Stats._ import scala.util.control.NonFatal import ast.Trees._ -import util.FreshNameCreator class FrontEnd extends Phase { @@ -66,7 +65,7 @@ class FrontEnd extends Phase { override def runOn(units: List[CompilationUnit])(implicit ctx: Context): List[CompilationUnit] = { val unitContexts = for (unit <- units) yield { ctx.inform(s"compiling ${unit.source}") - ctx.fresh.setCompilationUnit(unit).setFreshNames(new FreshNameCreator.Default) + ctx.fresh.setCompilationUnit(unit) } unitContexts foreach (parse(_)) record("parsedTrees", ast.Trees.ntrees) -- cgit v1.2.3