Skip to content

Commit 0e5b3e8

Browse files
Merge pull request #7253 from dotty-staging/use-new-given-syntax-in-scala-quoted
Use new given syntax in scala.quoted
2 parents e9111e2 + c087c15 commit 0e5b3e8

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

library/src/scala/quoted/Expr.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ package quoted {
6060
* Given list of statements `s1 :: s2 :: ... :: Nil` and an expression `e` the resulting expression
6161
* will be equivalent to `'{ $s1; $s2; ...; $e }`.
6262
*/
63-
def block[T](statements: List[Expr[_]], expr: Expr[T])(implicit qctx: QuoteContext): Expr[T] = {
63+
def block[T](statements: List[Expr[_]], expr: Expr[T])(given qctx: QuoteContext): Expr[T] = {
6464
import qctx.tasty._
6565
Block(statements.map(_.unseal), expr.unseal).seal.asInstanceOf[Expr[T]]
6666
}

library/src/scala/quoted/Type.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ package quoted {
77
type `$splice` = T
88

99
/** Show a source code like representation of this type without syntax highlight */
10-
def show(implicit qctx: QuoteContext): String = qctx.show(this, SyntaxHighlight.plain)
10+
def show(given qctx: QuoteContext): String = qctx.show(this, SyntaxHighlight.plain)
1111

1212
/** Show a source code like representation of this type */
13-
def show(syntaxHighlight: SyntaxHighlight)(implicit qctx: QuoteContext): String = qctx.show(this, syntaxHighlight)
13+
def show(syntaxHighlight: SyntaxHighlight)(given qctx: QuoteContext): String = qctx.show(this, syntaxHighlight)
1414

1515
}
1616

library/src/scala/quoted/ValueOfExpr.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ trait ValueOfExpr[T] {
1414

1515
object ValueOfExpr {
1616

17-
implicit val ValueOfExpr_Unit_delegate: ValueOfExpr[Unit] = new PrimitiveValueOfExpr
18-
implicit val ValueOfExpr_Boolean_delegate: ValueOfExpr[Boolean] = new PrimitiveValueOfExpr
19-
implicit val ValueOfExpr_Byte_delegate: ValueOfExpr[Byte] = new PrimitiveValueOfExpr
20-
implicit val ValueOfExpr_Short_delegate: ValueOfExpr[Short] = new PrimitiveValueOfExpr
21-
implicit val ValueOfExpr_Int_delegate: ValueOfExpr[Int] = new PrimitiveValueOfExpr
22-
implicit val ValueOfExpr_Long_delegate: ValueOfExpr[Long] = new PrimitiveValueOfExpr
23-
implicit val ValueOfExpr_Float_delegate: ValueOfExpr[Float] = new PrimitiveValueOfExpr
24-
implicit val ValueOfExpr_Double_delegate: ValueOfExpr[Double] = new PrimitiveValueOfExpr
25-
implicit val ValueOfExpr_Char_delegate: ValueOfExpr[Char] = new PrimitiveValueOfExpr
26-
implicit val ValueOfExpr_String_delegate: ValueOfExpr[String] = new PrimitiveValueOfExpr
17+
given ValueOfExpr_Unit_delegate: ValueOfExpr[Unit] = new PrimitiveValueOfExpr
18+
given ValueOfExpr_Boolean_delegate: ValueOfExpr[Boolean] = new PrimitiveValueOfExpr
19+
given ValueOfExpr_Byte_delegate: ValueOfExpr[Byte] = new PrimitiveValueOfExpr
20+
given ValueOfExpr_Short_delegate: ValueOfExpr[Short] = new PrimitiveValueOfExpr
21+
given ValueOfExpr_Int_delegate: ValueOfExpr[Int] = new PrimitiveValueOfExpr
22+
given ValueOfExpr_Long_delegate: ValueOfExpr[Long] = new PrimitiveValueOfExpr
23+
given ValueOfExpr_Float_delegate: ValueOfExpr[Float] = new PrimitiveValueOfExpr
24+
given ValueOfExpr_Double_delegate: ValueOfExpr[Double] = new PrimitiveValueOfExpr
25+
given ValueOfExpr_Char_delegate: ValueOfExpr[Char] = new PrimitiveValueOfExpr
26+
given ValueOfExpr_String_delegate: ValueOfExpr[String] = new PrimitiveValueOfExpr
2727

2828
private class PrimitiveValueOfExpr[T <: Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String] extends ValueOfExpr[T] {
2929
/** Lift a quoted primitive value `'{ n }` into `n` */

0 commit comments

Comments
 (0)