File tree 2 files changed +5
-4
lines changed
compiler/src/dotty/tools/dotc/typer 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -101,9 +101,7 @@ trait QuotesAndSplices {
101
101
// * Provide meaningful names for QuoteContext synthesized by within `${ ... }`
102
102
val qctxParamName = NameKinds .UniqueName .fresh(s " qctx ${level - 1 }_ " .toTermName)
103
103
val qctxParamTpe = topQuoteContext match {
104
- case Some (qctxRef) =>
105
- val reflectTpe = qctxRef.tpe.select(defn.QuoteContextClass .requiredValue(" tasty" ))
106
- RefinedType (defn.QuoteContextClass .typeRef, " tasty" .toTermName, reflectTpe)
104
+ case Some (qctxRef) => qctxRef.tpe.select(" NestedContext" .toTypeName)
107
105
case _ => defn.QuoteContextClass .typeRef
108
106
}
109
107
val qctxParamTpt = untpd.TypedSplice (TypeTree (qctxParamTpe))
Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ import scala.quoted.show.SyntaxHighlight
10
10
*
11
11
* @param tasty Typed AST API. Usage: `def f(qctx: QuoteContext) = { import qctx.tasty.{_, given}; ... }`.
12
12
*/
13
- class QuoteContext (val tasty : scala.tasty.Reflection ) {
13
+ class QuoteContext (val tasty : scala.tasty.Reflection ) { self =>
14
+
15
+ // TODO
16
+ type NestedContext = QuoteContext { val tasty : self.tasty.type }
14
17
15
18
def show (expr : Expr [_], syntaxHighlight : SyntaxHighlight ): String = {
16
19
import tasty .{_ , given }
You can’t perform that action at this time.
0 commit comments