Skip to content

Commit 6afa1bd

Browse files
authored
Merge pull request #8242 from dotty-staging/update-to-given-as-syntax
Update to `given ..: T` to `given .. as T` syntax
2 parents c5c71c9 + 3988ba1 commit 6afa1bd

File tree

5 files changed

+118
-118
lines changed

5 files changed

+118
-118
lines changed

library/src/scala/quoted/Liftable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ object Liftable {
103103
else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) }
104104
}
105105

106-
given iArrayIsLiftable[T: Type](using ltArray: Liftable[Array[T]]): Liftable[IArray[T]] {
106+
given iArrayIsLiftable[T: Type](using ltArray: Liftable[Array[T]]) as Liftable[IArray[T]] {
107107
def toExpr(iarray: IArray[T]): QuoteContext ?=> Expr[IArray[T]] =
108108
'{ ${ltArray.toExpr(iarray.asInstanceOf[Array[T]])}.asInstanceOf[IArray[T]] }
109109
}

library/src/scala/quoted/Type.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,47 +17,47 @@ class Type[T <: AnyKind] private[scala] {
1717
/** Some basic type tags, currently incomplete */
1818
object Type {
1919

20-
given UnitTag(using qctx: QuoteContext): Type[Unit] = {
20+
given UnitTag(using qctx: QuoteContext) as Type[Unit] = {
2121
import qctx.tasty.{_, given}
2222
defn.UnitType.seal.asInstanceOf[quoted.Type[Unit]]
2323
}
2424

25-
given BooleanTag(using qctx: QuoteContext): Type[Boolean] = {
25+
given BooleanTag(using qctx: QuoteContext) as Type[Boolean] = {
2626
import qctx.tasty.{_, given}
2727
defn.BooleanType.seal.asInstanceOf[quoted.Type[Boolean]]
2828
}
2929

30-
given ByteTag(using qctx: QuoteContext): Type[Byte] = {
30+
given ByteTag(using qctx: QuoteContext) as Type[Byte] = {
3131
import qctx.tasty.{_, given}
3232
defn.ByteType.seal.asInstanceOf[quoted.Type[Byte]]
3333
}
3434

35-
given CharTag(using qctx: QuoteContext): Type[Char] = {
35+
given CharTag(using qctx: QuoteContext) as Type[Char] = {
3636
import qctx.tasty.{_, given}
3737
defn.CharType.seal.asInstanceOf[quoted.Type[Char]]
3838
}
3939

40-
given ShortTag(using qctx: QuoteContext): Type[Short] = {
40+
given ShortTag(using qctx: QuoteContext) as Type[Short] = {
4141
import qctx.tasty.{_, given}
4242
defn.ShortType.seal.asInstanceOf[quoted.Type[Short]]
4343
}
4444

45-
given IntTag(using qctx: QuoteContext): Type[Int] = {
45+
given IntTag(using qctx: QuoteContext) as Type[Int] = {
4646
import qctx.tasty.{_, given}
4747
defn.IntType.seal.asInstanceOf[quoted.Type[Int]]
4848
}
4949

50-
given LongTag(using qctx: QuoteContext): Type[Long] = {
50+
given LongTag(using qctx: QuoteContext) as Type[Long] = {
5151
import qctx.tasty.{_, given}
5252
defn.LongType.seal.asInstanceOf[quoted.Type[Long]]
5353
}
5454

55-
given FloatTag(using qctx: QuoteContext): Type[Float] = {
55+
given FloatTag(using qctx: QuoteContext) as Type[Float] = {
5656
import qctx.tasty.{_, given}
5757
defn.FloatType.seal.asInstanceOf[quoted.Type[Float]]
5858
}
5959

60-
given DoubleTag(using qctx: QuoteContext): Type[Double] = {
60+
given DoubleTag(using qctx: QuoteContext) as Type[Double] = {
6161
import qctx.tasty.{_, given}
6262
defn.DoubleType.seal.asInstanceOf[quoted.Type[Double]]
6363
}

0 commit comments

Comments
 (0)