From 68e9e267e63f13ce2e99843df989a1306f91cd19 Mon Sep 17 00:00:00 2001 From: Den Shabalin Date: Fri, 11 Oct 2013 20:25:26 +0200 Subject: use concurrent hash map with atomic integers This should ensure that concurrent access to the fresh name creator is properly synchronized. --- src/compiler/scala/reflect/macros/contexts/Names.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/reflect/macros/contexts/Names.scala b/src/compiler/scala/reflect/macros/contexts/Names.scala index e535754a98..c2f14cf0f1 100644 --- a/src/compiler/scala/reflect/macros/contexts/Names.scala +++ b/src/compiler/scala/reflect/macros/contexts/Names.scala @@ -4,7 +4,7 @@ package contexts trait Names { self: Context => - lazy val freshNameCreator = callsiteTyper.context.unit.fresh + def freshNameCreator = callsiteTyper.context.unit.fresh def fresh(): String = freshName() @@ -16,7 +16,7 @@ trait Names { freshName[NameType](name) def freshName(): String = - freshNameCreator.newName() + freshName("fresh$") def freshName(name: String): String = freshNameCreator.newName(name) -- cgit v1.2.3