File tree 4 files changed +13
-8
lines changed
compiler/src/dotty/tools/dotc 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -884,7 +884,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
884
884
* will return a term tree.
885
885
*/
886
886
def unapply (tree : tpd.Apply )(using Context ): Option [tpd.Tree ] =
887
- if tree.symbol.isSplice then Some (tree.args.head) else None
887
+ if tree.symbol.isExprSplice then Some (tree.args.head) else None
888
888
}
889
889
890
890
/** Extractors for type splices */
@@ -894,7 +894,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
894
894
* will return a type tree.
895
895
*/
896
896
def unapply (tree : tpd.Select )(using Context ): Option [tpd.Tree ] =
897
- if tree.symbol.isSplice then Some (tree.qualifier) else None
897
+ if tree.symbol.isTypeSplice then Some (tree.qualifier) else None
898
898
}
899
899
900
900
/** Extractor for not-null assertions.
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
179
179
tryHeal(tp.symbol, tp, pos)
180
180
case prefix : ThisType if ! tp.symbol.isStatic && level > levelOf(prefix.cls) =>
181
181
tryHeal(tp.symbol, tp, pos)
182
- case prefix : TermRef if tp.symbol.isSplice =>
182
+ case prefix : TermRef if tp.symbol.isTypeSplice =>
183
183
prefix.symbol.info.argInfos match
184
184
case (tb : TypeBounds ) :: _ =>
185
185
ctx.error(em " Cannot splice $tp because it is a wildcard type " , pos)
Original file line number Diff line number Diff line change @@ -78,7 +78,8 @@ class ReifyQuotes extends MacroTransform {
78
78
tree match {
79
79
case tree : RefTree if ! Inliner .inInlineMethod =>
80
80
assert(! tree.symbol.isQuote)
81
- assert(! tree.symbol.isSplice)
81
+ assert(! tree.symbol.isExprSplice)
82
+ assert(! tree.symbol.isTypeSplice)
82
83
case _ : TypeDef =>
83
84
assert(! tree.symbol.hasAnnotation(defn.InternalQuoted_QuoteTypeTagAnnot ),
84
85
s " ${tree.symbol} should have been removed by PickledQuotes because it has a @quoteTypeTag " )
@@ -329,7 +330,7 @@ class ReifyQuotes extends MacroTransform {
329
330
/** Remove references to local types that will not be defined in this quote */
330
331
def getTypeHoleType (using ctx : Context ) = new TypeMap () {
331
332
override def apply (tp : Type ): Type = tp match
332
- case tp : TypeRef if tp.typeSymbol.isSplice =>
333
+ case tp : TypeRef if tp.typeSymbol.isTypeSplice =>
333
334
apply(tp.dealias)
334
335
case tp @ TypeRef (pre, _) if pre == NoPrefix || pre.termSymbol.isLocal =>
335
336
val hiBound = tp.typeSymbol.info match
Original file line number Diff line number Diff line change @@ -208,9 +208,13 @@ class SymUtils(val self: Symbol) extends AnyVal {
208
208
def isQuote (using Context ): Boolean =
209
209
self == defn.InternalQuoted_exprQuote || self == defn.InternalQuoted_typeQuote
210
210
211
- /** Is symbol a splice operation? */
212
- def isSplice (using Context ): Boolean =
213
- self == defn.InternalQuoted_exprSplice || self == defn.InternalQuoted_exprNestedSplice || self == defn.QuotedType_splice
211
+ /** Is symbol a term splice operation? */
212
+ def isExprSplice (using Context ): Boolean =
213
+ self == defn.InternalQuoted_exprSplice || self == defn.InternalQuoted_exprNestedSplice
214
+
215
+ /** Is symbol a type splice operation? */
216
+ def isTypeSplice (using Context ): Boolean =
217
+ self == defn.QuotedType_splice
214
218
215
219
/** Is symbol an extension method? Accessors are excluded since
216
220
* after the getters phase collective extension objects become accessors
You can’t perform that action at this time.
0 commit comments