diff options
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/internal/util/FreshNameCreator.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/internal/util/FreshNameCreator.scala b/src/reflect/scala/reflect/internal/util/FreshNameCreator.scala index 8fe4a715f3..c8347cfeaa 100644 --- a/src/reflect/scala/reflect/internal/util/FreshNameCreator.scala +++ b/src/reflect/scala/reflect/internal/util/FreshNameCreator.scala @@ -7,6 +7,7 @@ package scala.reflect.internal package util import scala.collection.mutable +import scala.reflect.NameTransformer class FreshNameCreator { protected var counter = 0 @@ -18,9 +19,8 @@ class FreshNameCreator { * call to this function (provided the prefix does not end in a digit). */ def newName(prefix: String): String = { - val safePrefix = prefix.replaceAll("""[<>]""", """\$""") + val safePrefix = NameTransformer.encode(prefix) counters(safePrefix) += 1 - safePrefix + counters(safePrefix) } |