Skip to content

Commit caa99e4

Browse files
committed
wip
1 parent 9cc0c57 commit caa99e4

File tree

515 files changed

+1538
-2016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

515 files changed

+1538
-2016
lines changed

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Names._, StdNames._, NameOps._, Symbols._
88
import typer.ConstFold
99
import reporting.trace
1010
import dotty.tools.dotc.transform.SymUtils._
11+
import dotty.tools.dotc.transform.TypeUtils._
1112
import Decorators._
1213
import Constants.Constant
1314

@@ -397,7 +398,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
397398
case New(_) | Closure(_, _, _) =>
398399
Pure
399400
case TypeApply(fn, _) =>
400-
if (fn.symbol.is(Erased) || fn.symbol == defn.QuotedTypeModule_apply || fn.symbol == defn.Predef_classOf) Pure else exprPurity(fn)
401+
if (fn.symbol.is(Erased) || fn.symbol == defn.ScopeTypeModule_apply || fn.symbol == defn.Predef_classOf) Pure else exprPurity(fn)
401402
case Apply(fn, args) =>
402403
def isKnownPureOp(sym: Symbol) =
403404
sym.owner.isPrimitiveValueClass
@@ -894,7 +895,8 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
894895
* will return a type tree.
895896
*/
896897
def unapply(tree: tpd.Select)(using Context): Option[tpd.Tree] =
897-
if tree.symbol.isTypeSplice then Some(tree.qualifier) else None
898+
if tree.tpe.isTypeSplice || (tree.qualifier.tpe.widenTermRefExpr.typeSymbol == defn.ScopeTypeClass && tree.name == tpnme.spliceType) then Some(tree.qualifier)
899+
else None
898900
}
899901

900902
/** Extractor for not-null assertions.

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -676,15 +676,18 @@ class Definitions {
676676
@tu lazy val ClassTagModule_apply: Symbol = ClassTagModule.requiredMethod(nme.apply)
677677
@tu lazy val ReflectPackageClass: Symbol = requiredPackage("scala.reflect.package").moduleClass
678678

679-
680-
@tu lazy val QuotedExprClass: ClassSymbol = requiredClass("scala.quoted.Expr")
681-
@tu lazy val QuotedExprModule: Symbol = QuotedExprClass.companionModule
679+
@tu lazy val QuotedExprModule: Symbol = requiredModule("scala.quoted.Expr")
682680
@tu lazy val QuotedExprModule_nullExpr: Symbol = QuotedExprModule.requiredMethod(nme.nullExpr)
683681
@tu lazy val QuotedExprModule_unitExpr: Symbol = QuotedExprModule.requiredMethod(nme.unitExpr)
684-
@tu lazy val QuotedExprModule_unsafeExpr: Symbol = QuotedExprModule.requiredMethod("unsafeExpr")
685682

686-
@tu lazy val QuoteContextClass: ClassSymbol = requiredClass("scala.quoted.QuoteContext")
683+
@tu lazy val TastyReflectionClass: ClassSymbol = requiredClass("scala.tasty.Reflection")
684+
687685
@tu lazy val ScopeClass: ClassSymbol = requiredClass("scala.quoted.Scope")
686+
@tu lazy val ScopeTypeModule: Symbol = ScopeClass.requiredMethod("Type")
687+
@tu lazy val ScopeTypeModule_apply: Symbol = ScopeTypeModule.requiredMethod(nme.apply)
688+
@tu lazy val ScopeExprClass: Symbol = ScopeClass.typeRef.select(tpnme.Expr).typeSymbol
689+
@tu lazy val ScopeTypeClass: Symbol = ScopeClass.typeRef.select(tpnme.Type).typeSymbol
690+
@tu lazy val Scope_Type_splice: Symbol = ScopeClass.typeRef.select(tpnme.Type).select(tpnme.spliceType).typeSymbol
688691

689692
@tu lazy val LiftableModule: Symbol = requiredModule("scala.quoted.Liftable")
690693
@tu lazy val LiftableModule_BooleanIsLiftable: Symbol = LiftableModule.requiredMethod("BooleanIsLiftable")
@@ -716,15 +719,6 @@ class Definitions {
716719
@tu lazy val InternalQuotedTypeModule: Symbol = requiredModule("scala.internal.quoted.Type")
717720
@tu lazy val InternalQuotedType_unapply: Symbol = InternalQuotedTypeModule.requiredMethod(nme.unapply)
718721

719-
@tu lazy val QuotedTypeClass: ClassSymbol = requiredClass("scala.quoted.Type")
720-
@tu lazy val QuotedType_splice: Symbol = QuotedTypeClass.requiredType(tpnme.spliceType)
721-
722-
@tu lazy val QuotedTypeModule: Symbol = QuotedTypeClass.companionModule
723-
@tu lazy val QuotedTypeModule_apply: Symbol = QuotedTypeModule.requiredMethod("apply")
724-
@tu lazy val QuotedTypeModule_unsafeType: Symbol = QuotedTypeModule.requiredMethod("unsafeType")
725-
726-
@tu lazy val TastyReflectionClass: ClassSymbol = requiredClass("scala.tasty.Reflection")
727-
728722
@tu lazy val Unpickler_unpickleExpr: Symbol = requiredMethod("scala.internal.quoted.Unpickler.unpickleExpr")
729723
@tu lazy val Unpickler_unpickleType: Symbol = requiredMethod("scala.internal.quoted.Unpickler.unpickleType")
730724

compiler/src/dotty/tools/dotc/core/StagingContext.scala

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ object StagingContext {
1717
private val QuotationLevel = new Property.Key[Int]
1818

1919
/** A key to be used in a context property that tracks the quoteation stack.
20-
* Stack containing the QuoteContext references recieved by the surrounding quotes.
20+
* Stack containing the Scope references recieved by the surrounding quotes.
2121
*/
22-
private val QuoteContextStack = new Property.Key[List[tpd.Tree]]
22+
private val ScopeStack = new Property.Key[List[tpd.Tree]]
2323

2424
private val TaggedTypes = new Property.Key[PCPCheckAndHeal.QuoteTypeTags]
2525

@@ -31,11 +31,11 @@ object StagingContext {
3131
def quoteContext(using Context): Context =
3232
ctx.fresh.setProperty(QuotationLevel, level + 1)
3333

34-
/** Context with an incremented quotation level and pushes a refecence to a QuoteContext on the quote context stack */
35-
def pushQuoteContext(scopeRef: tpd.Tree)(using Context): Context =
36-
val old = ctx.property(QuoteContextStack).getOrElse(List.empty)
34+
/** Context with an incremented quotation level and pushes a refecence to a Scope on the quote scope stack */
35+
def pushScope(scopeRef: tpd.Tree)(using Context): Context =
36+
val old = ctx.property(ScopeStack).getOrElse(List.empty)
3737
ctx.fresh.setProperty(QuotationLevel, level + 1)
38-
.setProperty(QuoteContextStack, scopeRef :: old)
38+
.setProperty(ScopeStack, scopeRef :: old)
3939

4040
/** Context with a decremented quotation level. */
4141
def spliceContext(using Context): Context =
@@ -47,22 +47,22 @@ object StagingContext {
4747
def getQuoteTypeTags(using Context): PCPCheckAndHeal.QuoteTypeTags =
4848
ctx.property(TaggedTypes).get
4949

50-
/** Context with a decremented quotation level and pops the Some of top of the quote context stack or None if the stack is empty.
50+
/** Context with a decremented quotation level and pops the Some of top of the quote scope stack or None if the stack is empty.
5151
* The quotation stack could be empty if we are in a top level splice or an eroneous splice directly witin a top level splice.
5252
*/
53-
def popQuoteContext()(using Context): (Option[tpd.Tree], Context) =
53+
def popScope()(using Context): (Option[tpd.Tree], Context) =
5454
val ctx1 = ctx.fresh.setProperty(QuotationLevel, level - 1)
5555
val head =
56-
ctx.property(QuoteContextStack) match
56+
ctx.property(ScopeStack) match
5757
case Some(x :: xs) =>
58-
ctx1.setProperty(QuoteContextStack, xs)
58+
ctx1.setProperty(ScopeStack, xs)
5959
Some(x)
6060
case _ =>
6161
None // Splice at level 0 or lower
6262
(head, ctx1)
6363

64-
def peekQuoteContext()(implicit ctx: Context): Option[tpd.Tree] =
65-
ctx.property(QuoteContextStack) match
64+
def peekScope()(implicit ctx: Context): Option[tpd.Tree] =
65+
ctx.property(ScopeStack) match
6666
case Some(x :: xs) => Some(x)
6767
case _ => None // Splice at level 0 or lower
6868

compiler/src/dotty/tools/dotc/core/quoted/PickledQuotes.scala

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import dotty.tools.dotc.core.tasty.TreePickler.Hole
1515
import dotty.tools.dotc.core.tasty.{ PositionPickler, TastyPickler, TastyPrinter }
1616
import dotty.tools.dotc.core.tasty.DottyUnpickler
1717
import dotty.tools.dotc.core.tasty.TreeUnpickler.UnpickleMode
18-
import dotty.tools.dotc.quoted.QuoteContext
18+
import dotty.tools.dotc.quoted.Scope
1919
import dotty.tools.dotc.tastyreflect.ReflectionImpl
2020

2121
import dotty.tools.tasty.TastyString
@@ -36,20 +36,6 @@ object PickledQuotes {
3636
TastyString.pickle(pickled)
3737
}
3838

39-
/** Transform the expression into its fully spliced Tree */
40-
def quotedExprToTree[T](expr: quoted.Expr[T])(using Context): Tree = {
41-
val expr1 = expr.asInstanceOf[scala.internal.quoted.Expr[Tree]]
42-
QuoteContext.checkScopeId(expr1.scopeId)
43-
healOwner(expr1.tree)
44-
}
45-
46-
/** Transform the expression into its fully spliced TypeTree */
47-
def quotedTypeToTree(tpe: quoted.Type[?])(using Context): Tree = {
48-
val tpe1 = tpe.asInstanceOf[scala.internal.quoted.Type[Tree]]
49-
QuoteContext.checkScopeId(tpe1.scopeId)
50-
healOwner(tpe1.typeTree)
51-
}
52-
5339
/** Unpickle the tree contained in the TastyExpr */
5440
def unpickleExpr(tasty: PickledQuote, splices: PickledArgs)(using Context): Tree = {
5541
val tastyBytes = TastyString.unpickle(tasty)
@@ -76,13 +62,13 @@ object PickledQuotes {
7662
override def transform(tree: tpd.Tree)(using Context): tpd.Tree = tree match {
7763
case Hole(isTerm, idx, args) =>
7864
val reifiedArgs = args.map { arg =>
79-
if (arg.isTerm) (using scope: scala.quoted.QuoteContext) => new scala.internal.quoted.Expr(arg, QuoteContext.scopeId)
80-
else new scala.internal.quoted.Type(arg, QuoteContext.scopeId)
65+
if (arg.isTerm) (using scope: scala.quoted.Scope) => arg
66+
else arg
8167
}
8268
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())
85-
val filled = PickledQuotes.quotedExprToTree(quotedExpr)
69+
val splice1 = splices(idx).asInstanceOf[Seq[Any] => scala.quoted.Scope ?=> Tree]
70+
val quotedExpr = splice1(reifiedArgs)(using dotty.tools.dotc.quoted.Scope())
71+
val filled = PickledQuotes.healOwner(quotedExpr)
8672

8773
// We need to make sure a hole is created with the source file of the surrounding context, even if
8874
// it filled with contents a different source file.
@@ -91,8 +77,8 @@ object PickledQuotes {
9177
else
9278
// Replaces type holes generated by ReifyQuotes (non-spliced types).
9379
// These are types defined in a quote and used at the same level in a nested quote.
94-
val quotedType = splices(idx).asInstanceOf[Seq[Any] => quoted.Type[?]](reifiedArgs)
95-
PickledQuotes.quotedTypeToTree(quotedType)
80+
val quotedType = splices(idx).asInstanceOf[Seq[Any] => Tree](reifiedArgs)
81+
PickledQuotes.healOwner(quotedType)
9682
case tree: Select =>
9783
// Retain selected members
9884
val qual = transform(tree.qualifier)
@@ -134,8 +120,8 @@ object PickledQuotes {
134120
assert(tdef.symbol.hasAnnotation(defn.InternalQuoted_QuoteTypeTagAnnot))
135121
val tree = tdef.rhs match
136122
case TypeBoundsTree(_, Hole(_, idx, args), _) =>
137-
val quotedType = splices(idx).asInstanceOf[Seq[Any] => quoted.Type[?]](args)
138-
PickledQuotes.quotedTypeToTree(quotedType)
123+
val quotedType = splices(idx).asInstanceOf[Seq[Any] => Tree](args)
124+
PickledQuotes.healOwner(quotedType)
139125
case TypeBoundsTree(_, tpt, _) =>
140126
tpt
141127
(tdef.symbol, tree.tpe)

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import scala.collection.mutable.ListBuffer
3838
import scala.collection.mutable
3939
import config.Printers.pickling
4040
import core.quoted.PickledQuotes
41-
import dotty.tools.dotc.quoted.QuoteContext
41+
import dotty.tools.dotc.quoted.Scope
4242

4343
import dotty.tools.tasty.TastyFormat._
4444

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
367367
else if (name.isTypeName) typeText(txt)
368368
else txt
369369
case tree @ Select(qual, name) =>
370-
if (!printDebug && tree.hasType && tree.symbol.isTypeSplice) typeText("${") ~ toTextLocal(qual) ~ typeText("}")
370+
if (!printDebug && tree.hasType && tree.tpe.asInstanceOf[Type].isTypeSplice) typeText("${") ~ toTextLocal(qual) ~ typeText("}")
371371
else if (qual.isType) toTextLocal(qual) ~ "#" ~ typeText(toText(name))
372372
else toTextLocal(qual) ~ ("." ~ nameIdText(tree) provided (name != nme.CONSTRUCTOR || printDebug))
373373
case tree: This =>
@@ -630,11 +630,11 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
630630
}
631631
case Number(digits, kind) =>
632632
digits
633-
case Quote(tree) if tree.isTerm =>
633+
case Quote(tree) if !printDebug && tree.isTerm =>
634634
keywordStr("'{") ~ toTextGlobal(dropBlock(tree)) ~ keywordStr("}")
635-
case Splice(tree) =>
635+
case Splice(tree) if !printDebug =>
636636
keywordStr("${") ~ toTextGlobal(dropBlock(tree)) ~ keywordStr("}")
637-
case TypSplice(tree) =>
637+
case TypSplice(tree) if !printDebug =>
638638
keywordStr("${") ~ toTextGlobal(dropBlock(tree)) ~ keywordStr("}")
639639
case tree: Applications.IntegratedTypeArgs =>
640640
toText(tree.app) ~ Str("(with integrated type args)").provided(printDebug)

compiler/src/dotty/tools/dotc/quoted/QuoteContext.scala

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package dotty.tools.dotc.quoted
2+
3+
import dotty.tools.dotc.core.Contexts._
4+
import dotty.tools.dotc.tastyreflect.ReflectionImpl
5+
6+
object Scope {
7+
8+
def apply()(using Context): scala.quoted.Scope =
9+
new Scope(ReflectionImpl(summon[Context]))
10+
11+
}
12+
13+
class Scope(val tasty: scala.tasty.Reflection) extends scala.quoted.Scope

compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import dotty.tools.dotc.core.Types._
1717
import dotty.tools.dotc.util.SourcePosition
1818
import dotty.tools.dotc.util.Spans._
1919
import dotty.tools.dotc.transform.SymUtils._
20+
import dotty.tools.dotc.transform.TypeUtils._
2021
import dotty.tools.dotc.transform.TreeMapWithStages._
2122
import dotty.tools.dotc.typer.Checking
2223
import dotty.tools.dotc.typer.Implicits.SearchFailureType
@@ -67,7 +68,6 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
6768
checkAnnotations(tree)
6869
super.transform(tree)
6970
else tree match {
70-
7171
case _: TypeTree | _: RefTree if tree.isType =>
7272
val healedType = healType(tree.sourcePos)(tree.tpe)
7373
if healedType == tree.tpe then tree
@@ -184,7 +184,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
184184
else tryHeal(tp.symbol, tp, pos)
185185
case prefix: ThisType if !tp.symbol.isStatic && level > levelOf(prefix.cls) =>
186186
tryHeal(tp.symbol, tp, pos)
187-
case prefix: TermRef if tp.symbol.isTypeSplice =>
187+
case prefix: TermRef if tp.isTypeSplice =>
188188
prefix.symbol.info.argInfos match
189189
case (tb: TypeBounds) :: _ =>
190190
report.error(em"Cannot splice $tp because it is a wildcard type", pos)
@@ -225,8 +225,9 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
225225
* Emits and error if `T` cannot be healed and returns `T`.
226226
*/
227227
protected def tryHeal(sym: Symbol, tp: TypeRef, pos: SourcePosition)(using Context): TypeRef = {
228-
val reqType = defn.QuotedTypeClass.typeRef.appliedTo(tp)
228+
val reqType = getCurrentScope.tpe.select(tpnme.Type).appliedTo(tp)
229229
val tag = ctx.typer.inferImplicitArg(reqType, pos.span)
230+
230231
tag.tpe match
231232

232233
case tp: TermRef =>

compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import util.Spans._
1414
import util.SourcePosition
1515
import tasty.TreePickler.Hole
1616
import SymUtils._
17+
import TypeUtils._
1718
import NameKinds._
1819
import dotty.tools.dotc.ast.tpd
1920
import typer.Implicits.SearchFailureType
@@ -79,7 +80,7 @@ class ReifyQuotes extends MacroTransform {
7980
case tree: RefTree if !Inliner.inInlineMethod =>
8081
assert(!tree.symbol.isQuote)
8182
assert(!tree.symbol.isExprSplice)
82-
assert(!tree.symbol.isTypeSplice)
83+
assert(!tree.tpe.isTypeSplice)
8384
case _ : TypeDef =>
8485
assert(!tree.symbol.hasAnnotation(defn.InternalQuoted_QuoteTypeTagAnnot),
8586
s"${tree.symbol} should have been removed by PickledQuotes because it has a @quoteTypeTag")
@@ -127,7 +128,7 @@ class ReifyQuotes extends MacroTransform {
127128
* core and splices as arguments.
128129
*/
129130
override protected def transformQuotation(body: Tree, quote: Tree)(using Context): Tree = {
130-
val isType = quote.symbol eq defn.QuotedTypeModule_apply
131+
val isType = quote.symbol eq defn.ScopeTypeModule_apply
131132
if (level > 0) {
132133
val body1 = nested(isQuote = true).transform(body)(using quoteContext)
133134
super.transformQuotation(body1, quote)
@@ -138,14 +139,14 @@ class ReifyQuotes extends MacroTransform {
138139
val body2 =
139140
if (body1.isType) body1
140141
else Inlined(Inliner.inlineCallTrace(ctx.owner, quote.sourcePos), Nil, body1)
141-
pickledQuote(body2, splices, body.tpe, isType).withSpan(quote.span)
142+
pickledQuote(body2, quote, splices, body.tpe, isType).withSpan(quote.span)
142143
}
143144
else
144145
body
145146
}
146147
}
147148

148-
private def pickledQuote(body: Tree, splices: List[Tree], originalTp: Type, isType: Boolean)(using Context) = {
149+
private def pickledQuote(body: Tree, quote: Tree, splices: List[Tree], originalTp: Type, isType: Boolean)(using Context) = {
149150
def pickleAsLiteral(lit: Literal) = {
150151
def liftedValue(lifter: Symbol) =
151152
ref(lifter).appliedToType(originalTp).select(nme.toExpr).appliedTo(lit)
@@ -174,9 +175,11 @@ class ReifyQuotes extends MacroTransform {
174175
}
175176

176177
if (isType) {
177-
def tag(tagName: String) = ref(defn.QuotedTypeModule).select(tagName.toTermName)
178-
if (splices.isEmpty && body.symbol.isPrimitiveValueClass) tag(s"${body.symbol.name}Tag")
179-
else pickleAsTasty()
178+
val TypeApply(Select(Select(scope, _), _), _) = quote
179+
if splices.isEmpty && body.symbol.isPrimitiveValueClass then
180+
scope.select("Type".toTermName).select(s"${body.symbol.name}Tag".toTermName)
181+
else
182+
pickleAsTasty().select(nme.apply).appliedTo(scope)
180183
}
181184
else getLiteral(body) match {
182185
// FIXME: support pickleAsLiteral
@@ -262,8 +265,8 @@ class ReifyQuotes extends MacroTransform {
262265
}
263266
assert(tpw.isInstanceOf[ValueType])
264267
val argTpe =
265-
if (tree.isType) defn.QuotedTypeClass.typeRef.appliedTo(tpw)
266-
else defn.FunctionType(1, isContextual = true).appliedTo(defn.ScopeClass.typeRef, defn.QuotedExprClass.typeRef.appliedTo(tpw))
268+
if (tree.isType) defn.ScopeTypeClass.typeRef.appliedTo(tpw)
269+
else defn.FunctionType(1, isContextual = true).appliedTo(defn.ScopeClass.typeRef, defn.ScopeExprClass.typeRef.appliedTo(tpw))
267270
val selectArg = arg.select(nme.apply).appliedTo(Literal(Constant(i))).cast(argTpe)
268271
val capturedArg = SyntheticValDef(UniqueName.fresh(tree.symbol.name.toTermName).toTermName, selectArg)
269272
i += 1
@@ -331,7 +334,7 @@ class ReifyQuotes extends MacroTransform {
331334
/** Remove references to local types that will not be defined in this quote */
332335
def getTypeHoleType(using Context) = new TypeMap() {
333336
override def apply(tp: Type): Type = tp match
334-
case tp: TypeRef if tp.typeSymbol.isTypeSplice =>
337+
case tp: TypeRef if tp.isTypeSplice =>
335338
apply(tp.dealias)
336339
case tp @ TypeRef(pre, _) if pre == NoPrefix || pre.termSymbol.isLocal =>
337340
val hiBound = tp.typeSymbol.info match
@@ -365,7 +368,7 @@ class ReifyQuotes extends MacroTransform {
365368
transform(tree)(using ctx.withSource(tree.source))
366369
else reporting.trace(i"Reifier.transform $tree at $level", show = true) {
367370
tree match {
368-
case Apply(Select(TypeApply(fn, (body: RefTree) :: Nil), _), _) if fn.symbol == defn.QuotedTypeModule_apply && isCaptured(body.symbol, level + 1) =>
371+
case Apply(Select(TypeApply(fn, (body: RefTree) :: Nil), _), _) if fn.symbol == defn.ScopeTypeModule_apply && isCaptured(body.symbol, level + 1) =>
369372
// Optimization: avoid the full conversion when capturing `x`
370373
// in '{ x } to '{ ${x$1} } and go directly to `x$1`
371374
capturers(body.symbol)(body)

0 commit comments

Comments
 (0)