1
- package dotty .tools .dotc .core . quoted
1
+ package dotty .tools .dotc .quoted
2
2
3
3
import dotty .tools .dotc .ast .Trees ._
4
4
import dotty .tools .dotc .ast .{TreeTypeMap , tpd }
@@ -15,14 +15,13 @@ import dotty.tools.dotc.core.tasty.TreePickler.Hole
15
15
import dotty .tools .dotc .core .tasty .{ PositionPickler , TastyPickler , TastyPrinter }
16
16
import dotty .tools .dotc .core .tasty .DottyUnpickler
17
17
import dotty .tools .dotc .core .tasty .TreeUnpickler .UnpickleMode
18
- import dotty .tools .dotc .quoted .QuoteContext
19
- import dotty .tools .dotc .tastyreflect .ReflectionImpl
20
18
21
19
import dotty .tools .tasty .TastyString
22
20
23
21
import scala .reflect .ClassTag
24
22
25
23
import scala .internal .quoted .Unpickler ._
24
+ import scala .quoted .QuoteContext
26
25
27
26
object PickledQuotes {
28
27
import tpd ._
@@ -39,14 +38,14 @@ object PickledQuotes {
39
38
/** Transform the expression into its fully spliced Tree */
40
39
def quotedExprToTree [T ](expr : quoted.Expr [T ])(using Context ): Tree = {
41
40
val expr1 = expr.asInstanceOf [scala.internal.quoted.Expr [Tree ]]
42
- QuoteContext .checkScopeId(expr1.scopeId)
41
+ QuoteContextImpl .checkScopeId(expr1.scopeId)
43
42
healOwner(expr1.tree)
44
43
}
45
44
46
45
/** Transform the expression into its fully spliced TypeTree */
47
46
def quotedTypeToTree (tpe : quoted.Type [? ])(using Context ): Tree = {
48
47
val tpe1 = tpe.asInstanceOf [scala.internal.quoted.Type [Tree ]]
49
- QuoteContext .checkScopeId(tpe1.scopeId)
48
+ QuoteContextImpl .checkScopeId(tpe1.scopeId)
50
49
healOwner(tpe1.typeTree)
51
50
}
52
51
@@ -76,12 +75,12 @@ object PickledQuotes {
76
75
override def transform (tree : tpd.Tree )(using Context ): tpd.Tree = tree match {
77
76
case Hole (isTerm, idx, args) =>
78
77
val reifiedArgs = args.map { arg =>
79
- if (arg.isTerm) (using qctx : scala.quoted. QuoteContext ) => new scala.internal.quoted.Expr (arg, QuoteContext .scopeId)
80
- else new scala.internal.quoted.Type (arg, QuoteContext .scopeId)
78
+ if (arg.isTerm) (using qctx : QuoteContext ) => new scala.internal.quoted.Expr (arg, QuoteContextImpl .scopeId)
79
+ else new scala.internal.quoted.Type (arg, QuoteContextImpl .scopeId)
81
80
}
82
81
if isTerm then
83
- val splice1 = splices(idx).asInstanceOf [Seq [Any ] => scala.quoted. QuoteContext ?=> quoted.Expr [? ]]
84
- val quotedExpr = splice1(reifiedArgs)(using dotty.tools.dotc.quoted.QuoteContext ())
82
+ val splice1 = splices(idx).asInstanceOf [Seq [Any ] => QuoteContext ?=> quoted.Expr [? ]]
83
+ val quotedExpr = splice1(reifiedArgs)(using dotty.tools.dotc.quoted.QuoteContextImpl ())
85
84
val filled = PickledQuotes .quotedExprToTree(quotedExpr)
86
85
87
86
// We need to make sure a hole is created with the source file of the surrounding context, even if
0 commit comments