@@ -35,9 +35,9 @@ trait QuotesAndSplices { self: Typer =>
35
35
* while tracking the quotation level in the context.
36
36
*/
37
37
def typedQuote (tree : untpd.Quote , pt : Type )(implicit ctx : Context ): Tree = track(" typedQuote" ) {
38
- val qctx = inferImplicitArg(defn.QuoteContextType , tree.span)
38
+ val qctx = inferImplicitArg(defn.QuoteContextClass .typeRef , tree.span)
39
39
if (level == 0 && qctx.tpe.isInstanceOf [SearchFailureType ])
40
- ctx.error(missingArgMsg(qctx, defn.QuoteContextType , " " ), ctx.source.atSpan(tree.span))
40
+ ctx.error(missingArgMsg(qctx, defn.QuoteContextClass .typeRef , " " ), ctx.source.atSpan(tree.span))
41
41
42
42
tree.quoted match {
43
43
case untpd.Splice (innerExpr) if tree.isTerm =>
@@ -49,9 +49,9 @@ trait QuotesAndSplices { self: Typer =>
49
49
case quoted =>
50
50
ctx.compilationUnit.needsStaging = true
51
51
val tree1 =
52
- if (quoted.isType) typedTypeApply(untpd.TypeApply (untpd.ref(defn.InternalQuoted_typeQuoteR ), quoted :: Nil ), pt)(quoteContext)
52
+ if (quoted.isType) typedTypeApply(untpd.TypeApply (untpd.ref(defn.InternalQuoted_typeQuote .termRef ), quoted :: Nil ), pt)(quoteContext)
53
53
else if (ctx.mode.is(Mode .Pattern ) && level == 0 ) typedQuotePattern(quoted, pt, qctx)
54
- else typedApply(untpd.Apply (untpd.ref(defn.InternalQuoted_exprQuoteR ), quoted), pt)(quoteContext)
54
+ else typedApply(untpd.Apply (untpd.ref(defn.InternalQuoted_exprQuote .termRef ), quoted), pt)(quoteContext)
55
55
tree1.withSpan(tree.span)
56
56
}
57
57
}
@@ -69,7 +69,7 @@ trait QuotesAndSplices { self: Typer =>
69
69
if (isFullyDefined(pt, ForceDegree .all)) {
70
70
def spliceOwner (ctx : Context ): Symbol =
71
71
if (ctx.mode.is(Mode .QuotedPattern )) spliceOwner(ctx.outer) else ctx.owner
72
- val pat = typedPattern(expr, defn.QuotedExprType .appliedTo(pt))(
72
+ val pat = typedPattern(expr, defn.QuotedExprClass .typeRef .appliedTo(pt))(
73
73
spliceContext.retractMode(Mode .QuotedPattern ).withOwner(spliceOwner(ctx)))
74
74
Splice (pat)
75
75
} else {
@@ -86,7 +86,7 @@ trait QuotesAndSplices { self: Typer =>
86
86
else if (! c.outer.owner.is(Package )) markAsMacro(c.outer)
87
87
markAsMacro(ctx)
88
88
}
89
- typedApply(untpd.Apply (untpd.ref(defn.InternalQuoted_exprSpliceR ), tree.expr), pt)(spliceContext).withSpan(tree.span)
89
+ typedApply(untpd.Apply (untpd.ref(defn.InternalQuoted_exprSplice .termRef ), tree.expr), pt)(spliceContext).withSpan(tree.span)
90
90
}
91
91
}
92
92
}
@@ -115,7 +115,7 @@ trait QuotesAndSplices { self: Typer =>
115
115
}
116
116
val typeSym = ctx.newSymbol(spliceOwner(ctx), name, EmptyFlags , TypeBounds .empty, NoSymbol , expr.span)
117
117
typeSym.addAnnotation(Annotation (New (ref(defn.InternalQuoted_patternBindHoleAnnot .typeRef)).withSpan(expr.span)))
118
- val pat = typedPattern(expr, defn.QuotedTypeType .appliedTo(typeSym.typeRef))(
118
+ val pat = typedPattern(expr, defn.QuotedTypeClass .typeRef .appliedTo(typeSym.typeRef))(
119
119
spliceContext.retractMode(Mode .QuotedPattern ).withOwner(spliceOwner(ctx)))
120
120
pat.select(tpnme.splice)
121
121
}
@@ -175,10 +175,10 @@ trait QuotesAndSplices { self: Typer =>
175
175
override def transform (tree : Tree )(implicit ctx : Context ) = tree match {
176
176
case Typed (Splice (pat), tpt) if ! tpt.tpe.derivesFrom(defn.RepeatedParamClass ) =>
177
177
val tpt1 = transform(tpt) // Transform type bindings
178
- val exprTpt = AppliedTypeTree (TypeTree (defn.QuotedExprType ), tpt1 :: Nil )
178
+ val exprTpt = AppliedTypeTree (TypeTree (defn.QuotedExprClass .typeRef ), tpt1 :: Nil )
179
179
transform(Splice (Typed (pat, exprTpt)))
180
180
case Splice (pat) =>
181
- try ref(defn.InternalQuoted_patternHoleR ).appliedToType(tree.tpe).withSpan(tree.span)
181
+ try ref(defn.InternalQuoted_patternHole .termRef ).appliedToType(tree.tpe).withSpan(tree.span)
182
182
finally {
183
183
val patType = pat.tpe.widen
184
184
val patType1 = patType.underlyingIfRepeated(isJava = false )
@@ -202,7 +202,7 @@ trait QuotesAndSplices { self: Typer =>
202
202
x => t.resType.subst(t, x).toFunctionType())
203
203
case t => t
204
204
}
205
- val bindingExprTpe = AppliedType (defn.QuotedMatchingBindingType , bindingType :: Nil )
205
+ val bindingExprTpe = AppliedType (defn.QuotedMatchingBindingClass .typeRef , bindingType :: Nil )
206
206
assert(ddef.name.startsWith(" $" ))
207
207
val bindName = ddef.name.toString.stripPrefix(" $" ).toTermName
208
208
val sym = ctx0.newPatternBoundSymbol(bindName, bindingExprTpe, ddef.span)
@@ -217,7 +217,7 @@ trait QuotesAndSplices { self: Typer =>
217
217
218
218
def transformTypeBindingTypeDef (tdef : TypeDef , buff : mutable.Builder [Tree , List [Tree ]]): Tree = {
219
219
val bindingType = getBinding(tdef.symbol).symbol.typeRef
220
- val bindingTypeTpe = AppliedType (defn.QuotedTypeType , bindingType :: Nil )
220
+ val bindingTypeTpe = AppliedType (defn.QuotedTypeClass .typeRef , bindingType :: Nil )
221
221
assert(tdef.name.startsWith(" $" ))
222
222
val bindName = tdef.name.toString.stripPrefix(" $" ).toTermName
223
223
val sym = ctx0.newPatternBoundSymbol(bindName, bindingTypeTpe, tdef.span, flags = ImplicitTerm )
@@ -347,13 +347,13 @@ trait QuotesAndSplices { self: Typer =>
347
347
val splicePat = typed(untpd.Tuple (splices.map(x => untpd.TypedSplice (replaceBindingsInTree.transform(x)))).withSpan(quoted.span), patType)
348
348
349
349
UnApply (
350
- fun = ref(defn.InternalQuotedMatcher_unapplyR ).appliedToTypeTrees(typeBindingsTuple :: TypeTree (patType) :: Nil ),
350
+ fun = ref(defn.InternalQuotedMatcher_unapply .termRef ).appliedToTypeTrees(typeBindingsTuple :: TypeTree (patType) :: Nil ),
351
351
implicits =
352
- ref(defn.InternalQuoted_exprQuoteR ).appliedToType(shape.tpe).appliedTo(shape) ::
352
+ ref(defn.InternalQuoted_exprQuote .termRef ).appliedToType(shape.tpe).appliedTo(shape) ::
353
353
Literal (Constant (typeBindings.nonEmpty)) ::
354
354
qctx :: Nil ,
355
355
patterns = splicePat :: Nil ,
356
- proto = defn.QuotedExprType .appliedTo(replaceBindings(quoted1.tpe) & quotedPt))
356
+ proto = defn.QuotedExprClass .typeRef .appliedTo(replaceBindings(quoted1.tpe) & quotedPt))
357
357
}
358
358
359
359
}
0 commit comments