diff --git a/community-build/community-projects/sourcecode b/community-build/community-projects/sourcecode index b9bfe02c73a7..1e02adad684a 160000 --- a/community-build/community-projects/sourcecode +++ b/community-build/community-projects/sourcecode @@ -1 +1 @@ -Subproject commit b9bfe02c73a754bf1a63cf3ae993db2cb651883c +Subproject commit 1e02adad684ae8ae1b6e3251f93759911311dfd5 diff --git a/library/src-3.x/scala/quoted/Type.scala b/library/src-3.x/scala/quoted/Type.scala index 2ef786907296..0f9b755a4962 100644 --- a/library/src-3.x/scala/quoted/Type.scala +++ b/library/src-3.x/scala/quoted/Type.scala @@ -11,20 +11,20 @@ sealed abstract class Type[T <: AnyKind] { /** Some basic type tags, currently incomplete */ object Type { - implicit class TypeOps[T](tpe: Type[T]) { + implicit object TypeOps { /** Show a source code like representation of this type */ - def show(implicit toolbox: Toolbox): String = toolbox.show(tpe.asInstanceOf[Type[Any]]) + def (tpe: Type[T]) show[T] given Toolbox: String = the[Toolbox].show(tpe.asInstanceOf[Type[Any]]) } - implicit def UnitTag: Type[Unit] = new TaggedType[Unit] - implicit def BooleanTag: Type[Boolean] = new TaggedType[Boolean] - implicit def ByteTag: Type[Byte] = new TaggedType[Byte] - implicit def CharTag: Type[Char] = new TaggedType[Char] - implicit def ShortTag: Type[Short] = new TaggedType[Short] - implicit def IntTag: Type[Int] = new TaggedType[Int] - implicit def LongTag: Type[Long] = new TaggedType[Long] - implicit def FloatTag: Type[Float] = new TaggedType[Float] - implicit def DoubleTag: Type[Double] = new TaggedType[Double] + implied UnitTag for Type[Unit] = new TaggedType[Unit] + implied BooleanTag for Type[Boolean] = new TaggedType[Boolean] + implied ByteTag for Type[Byte] = new TaggedType[Byte] + implied CharTag for Type[Char] = new TaggedType[Char] + implied ShortTag for Type[Short] = new TaggedType[Short] + implied IntTag for Type[Int] = new TaggedType[Int] + implied LongTag for Type[Long] = new TaggedType[Long] + implied FloatTag for Type[Float] = new TaggedType[Float] + implied DoubleTag for Type[Double] = new TaggedType[Double] } /** All implementations of Type[T]. diff --git a/library/src-3.x/scala/quoted/package.scala b/library/src-3.x/scala/quoted/package.scala index e96931214e41..b81b5350d11a 100644 --- a/library/src-3.x/scala/quoted/package.scala +++ b/library/src-3.x/scala/quoted/package.scala @@ -6,17 +6,13 @@ package object quoted { implicit def autoToExpr[T: Liftable](x: T): Expr[T] = x.toExpr } - implicit class LiftExprOps[T](val x: T) extends AnyVal { - def toExpr(implicit ev: Liftable[T]): Expr[T] = ev.toExpr(x) - } + implicit object ExprOps { + def (x: T) toExpr[T] given Liftable[T]: Expr[T] = the[Liftable[T]].toExpr(x) - implicit class ListOfExprOps[T](val list: List[Expr[T]]) extends AnyVal { - def toExprOfList(implicit ev: Type[T]): Expr[List[T]] = { - def rec(list: List[Expr[T]]): Expr[List[T]] = list match { - case x :: xs => '{ ($x) :: ${rec(xs)} } - case Nil => '{Nil} - } - rec(list) + def (list: List[Expr[T]]) toExprOfList[T] given Type[T]: Expr[List[T]] = list match { + case x :: xs => '{ $x :: ${xs.toExprOfList} } + case Nil => '{ Nil } } } + }