Skip to content

Commit f511fb2

Browse files
Merge pull request #8938 from dotty-staging/rename-quotecontext-nested
Rename QuoteContext.NestedContext to QuoteContext.Nested
2 parents 3937ddb + 861f22e commit f511fb2

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

library/src/scala/internal/quoted/CompileTime.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ object CompileTime {
1818
* `ctx` is the `QuoteContext` that the quote of this splice uses.
1919
*/
2020
@compileTimeOnly("Illegal reference to `scala.internal.quoted.CompileTime.exprNestedSplice`")
21-
def exprNestedSplice[T](ctx: QuoteContext)(x: ctx.NestedContext ?=> Expr[T]): T = ???
21+
def exprNestedSplice[T](ctx: QuoteContext)(x: ctx.Nested ?=> Expr[T]): T = ???
2222

2323
/** A type quote is desugared by the compiler into a call to this method */
2424
@compileTimeOnly("Illegal reference to `scala.internal.quoted.CompileTime.typeQuote`")

library/src/scala/quoted/QuoteContext.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ class QuoteContext(val tasty: scala.tasty.Reflection) { self =>
2020
*
2121
* ```scala
2222
* def run(using qctx: QuoteContext)(tree: qctx.tasty.Tree): Unit =
23-
* def nested()(using qctx.NestedContext): Expr[Int] = '{ ${ makeExpr(tree) } + 1 }
23+
* def nested()(using qctx.Nested): Expr[Int] = '{ ${ makeExpr(tree) } + 1 }
2424
* '{ ${ nested() } + 2 }
2525
* def makeExpr(using qctx: QuoteContext)(tree: qctx.tasty.Tree): Expr[Int] = ???
2626
* ```
2727
*/
28-
type NestedContext = QuoteContext {
28+
type Nested = QuoteContext {
2929
val tasty: self.tasty.type
3030
}
3131

tests/pos/i8045b.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import scala.quoted._
22
object Test
33
def run(using qctx: QuoteContext)(tree: qctx.tasty.Tree): Unit =
4-
def nested()(using qctx.NestedContext): Expr[Int] =
4+
def nested()(using qctx.Nested): Expr[Int] =
55
'{ ${ makeExpr(tree) } + 1 }
66
'{ ${ nested() } + 2 }
77

tests/pos/splice-with-explicit-context.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ def f(a: Expr[Int])(using qctx: QuoteContext): Unit =
44

55
'{ val x: Int = ${ (using qctx2) => a } }
66

7-
'{ val x: Int = ${ (using qctx2: qctx.NestedContext) => a } }
7+
'{ val x: Int = ${ (using qctx2: qctx.Nested) => a } }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
((qctx: scala.quoted.QuoteContext) ?=> {
22
val a: scala.quoted.Expr[scala.Int] = scala.internal.quoted.CompileTime.exprQuote[scala.Int](4).apply(using qctx)
3-
((evidence$2: qctx.NestedContext) ?=> a).asInstanceOf[scala.ContextFunction1[scala.quoted.QuoteContext, scala.quoted.Expr[scala.Int]]].apply(using qctx)
3+
((evidence$2: qctx.Nested) ?=> a).asInstanceOf[scala.ContextFunction1[scala.quoted.QuoteContext, scala.quoted.Expr[scala.Int]]].apply(using qctx)
44
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
((qctx: scala.quoted.QuoteContext) ?=> {
22
val a: scala.quoted.Expr[scala.Int] = scala.internal.quoted.CompileTime.exprQuote[scala.Int](4).apply(using qctx)
3-
((qctx2: scala.quoted.QuoteContext) ?=> ((evidence$3: qctx2.NestedContext) ?=> a).asInstanceOf[scala.ContextFunction1[scala.quoted.QuoteContext, scala.quoted.Expr[scala.Int]]].apply(using qctx2)).apply(using qctx)
3+
((qctx2: scala.quoted.QuoteContext) ?=> ((evidence$3: qctx2.Nested) ?=> a).asInstanceOf[scala.ContextFunction1[scala.quoted.QuoteContext, scala.quoted.Expr[scala.Int]]].apply(using qctx2)).apply(using qctx)
44
})

0 commit comments

Comments
 (0)