Skip to content

Commit fc4135d

Browse files
authored
Merge pull request #8471 from dotty-staging/use-givens
Update to given in scala.quoted
2 parents 15e95c2 + 16751ce commit fc4135d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

library/src/scala/internal/quoted/Matcher.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private[quoted] object Matcher {
3030
class SymBinding(val sym: Symbol, val fromAbove: Boolean)
3131

3232
def termMatch(scrutineeTerm: Term, patternTerm: Term, hasTypeSplices: Boolean): Option[Tuple] = {
33-
implicit val env: Env = Map.empty
33+
given Env = Map.empty
3434
if (hasTypeSplices) {
3535
val ctx: Context = internal.Context_GADT_setFreshGADTBounds(rootContext)
3636
given Context = ctx
@@ -51,7 +51,7 @@ private[quoted] object Matcher {
5151

5252
// TODO factor out common logic with `termMatch`
5353
def typeTreeMatch(scrutineeTypeTree: TypeTree, patternTypeTree: TypeTree, hasTypeSplices: Boolean): Option[Tuple] = {
54-
implicit val env: Env = Map.empty
54+
given Env = Map.empty
5555
if (hasTypeSplices) {
5656
val ctx: Context = internal.Context_GADT_setFreshGADTBounds(rootContext)
5757
given Context = ctx

library/src/scala/quoted/Expr.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import scala.quoted.show.SyntaxHighlight
66
class Expr[+T] private[scala] {
77

88
/** Show a source code like representation of this expression without syntax highlight */
9-
def show(implicit qctx: QuoteContext): String = qctx.show(this, SyntaxHighlight.plain)
9+
def show(using qctx: QuoteContext): String = qctx.show(this, SyntaxHighlight.plain)
1010

1111
/** Show a source code like representation of this expression */
12-
def show(syntaxHighlight: SyntaxHighlight)(implicit qctx: QuoteContext): String = qctx.show(this, syntaxHighlight)
12+
def show(syntaxHighlight: SyntaxHighlight)(using qctx: QuoteContext): String = qctx.show(this, syntaxHighlight)
1313

1414
/** Return the value of this expression.
1515
*

library/src/scala/quoted/util/ExprMap.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ trait ExprMap {
2828
def localCtx(definition: Definition): Context = definition.symbol.localContext
2929
tree match {
3030
case tree: ValDef =>
31-
implicit val ctx = localCtx(tree)
31+
given Context = localCtx(tree)
3232
val rhs1 = tree.rhs.map(x => transformTerm(x, tree.tpt.tpe))
3333
ValDef.copy(tree)(tree.name, tree.tpt, rhs1)
3434
case tree: DefDef =>
35-
implicit val ctx = localCtx(tree)
35+
given Context = localCtx(tree)
3636
DefDef.copy(tree)(tree.name, tree.typeParams, tree.paramss, tree.returnTpt, tree.rhs.map(x => transformTerm(x, tree.returnTpt.tpe)))
3737
case tree: TypeDef =>
3838
tree

0 commit comments

Comments
 (0)