diff options
Diffstat (limited to 'test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala')
-rw-r--r-- | test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala b/test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala index 88a677b913..b331c4b6b6 100644 --- a/test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala +++ b/test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala @@ -18,13 +18,12 @@ trait Helpers { object simplify extends Transformer { object SimplifiedName { - def unapply[T <: Name](name: T): Option[T] = - name.toString.split("\\$").toSeq match { - case first :+ last if scala.util.Try(last.toInt).isSuccess && first.nonEmpty => - val value = first.mkString("", "$", "$") - Some((if (name.isTermName) TermName(value) else TypeName(value)).asInstanceOf[T]) - case _ => None - } + val st = scala.reflect.runtime.universe.asInstanceOf[scala.reflect.internal.SymbolTable] + val FreshName = new st.FreshNameExtractor + def unapply[T <: Name](name: T): Option[T] = name.asInstanceOf[st.Name] match { + case FreshName(prefix) => + Some((if (name.isTermName) TermName(prefix) else TypeName(prefix)).asInstanceOf[T]) + } } override def transform(tree: Tree): Tree = tree match { |