diff options
Diffstat (limited to 'test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala')
-rw-r--r-- | test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala b/test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala index b2bce124ee..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 { @@ -59,7 +58,7 @@ trait Helpers { } def assertThrows[T <: AnyRef](f: => Any)(implicit manifest: Manifest[T]): Unit = { - val clazz = manifest.erasure.asInstanceOf[Class[T]] + val clazz = manifest.runtimeClass.asInstanceOf[Class[T]] val thrown = try { f |