File tree 2 files changed +9
-2
lines changed
compiler/src/dotty/tools/dotc/quoted 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import dotty.tools.dotc.tastyreflect.ReflectionImpl
6
6
object QuoteContext {
7
7
8
8
def apply ()(using Context ): scala.quoted.QuoteContext =
9
- new scala.quoted. QuoteContext (ReflectionImpl (summon[Context ]))
9
+ new QuoteContext (ReflectionImpl (summon[Context ]))
10
10
11
11
type ScopeId = Int
12
12
@@ -19,3 +19,5 @@ object QuoteContext {
19
19
private [dotty] def scopeId (using Context ): ScopeId =
20
20
summon[Context ].outersIterator.toList.last.hashCode()
21
21
}
22
+
23
+ class QuoteContext (val tasty : scala.tasty.Reflection ) extends scala.quoted.QuoteContext
Original file line number Diff line number Diff line change @@ -10,7 +10,12 @@ import scala.quoted.show.SyntaxHighlight
10
10
*
11
11
* @param tasty Typed AST API. Usage: `def f(qctx: QuoteContext) = { import qctx.tasty._; ... }`.
12
12
*/
13
- class QuoteContext (val tasty : scala.tasty.Reflection ) { self =>
13
+ trait QuoteContext { self =>
14
+
15
+ /** Low-level Typed AST API `tasty` meta-programming API.
16
+ * This API does not have the static type guarantiees that `Expr` and `Type` provide.
17
+ */
18
+ val tasty : scala.tasty.Reflection
14
19
15
20
/** Type of a QuoteContext provided by a splice within a quote that took this context.
16
21
* It is only required if working with the reflection API.
You can’t perform that action at this time.
0 commit comments