@@ -15,6 +15,7 @@ import dotty.tools.dotc.core.StdNames._
1515import dotty .tools .dotc .core .Symbols ._
1616import dotty .tools .dotc .core .Types ._
1717import dotty .tools .dotc .reporting ._
18+ import dotty .tools .dotc .transform .SymUtils .decorateSymbol
1819import dotty .tools .dotc .typer .Implicits ._
1920import dotty .tools .dotc .typer .Inferencing ._
2021import dotty .tools .dotc .typer .ProtoTypes ._
@@ -232,7 +233,7 @@ trait QuotesAndSplices {
232233 val freshTypeBindingsBuff = new mutable.ListBuffer [Tree ]
233234 val typePatBuf = new mutable.ListBuffer [Tree ]
234235 override def transform (tree : Tree )(using Context ) = tree match {
235- case Typed (Apply (fn, pat :: Nil ), tpt) if fn.symbol == defn. InternalQuoted_exprSplice && ! tpt.tpe.derivesFrom(defn.RepeatedParamClass ) =>
236+ case Typed (Apply (fn, pat :: Nil ), tpt) if fn.symbol.isExprSplice && ! tpt.tpe.derivesFrom(defn.RepeatedParamClass ) =>
236237 val tpt1 = transform(tpt) // Transform type bindings
237238 val exprTpt = AppliedTypeTree (TypeTree (defn.QuotedExprClass .typeRef), tpt1 :: Nil )
238239 val newSplice = ref(defn.InternalQuoted_exprSplice ).appliedToType(tpt1.tpe).appliedTo(Typed (pat, exprTpt))
@@ -245,15 +246,15 @@ trait QuotesAndSplices {
245246 val pat1 = if (patType eq patType1) pat else pat.withType(patType1)
246247 patBuf += pat1
247248 }
248- case Apply (fn, pat :: Nil ) if fn.symbol == defn. InternalQuoted_exprSplice =>
249+ case Apply (fn, pat :: Nil ) if fn.symbol.isExprSplice =>
249250 try ref(defn.InternalQuotedMatcher_patternHole .termRef).appliedToType(tree.tpe).withSpan(tree.span)
250251 finally {
251252 val patType = pat.tpe.widen
252253 val patType1 = patType.translateFromRepeated(toArray = false )
253254 val pat1 = if (patType eq patType1) pat else pat.withType(patType1)
254255 patBuf += pat1
255256 }
256- case Select (pat, _) if tree.symbol == defn. QuotedType_splice =>
257+ case Select (pat, _) if tree.symbol.isTypeSplice =>
257258 val sym = tree.tpe.dealias.typeSymbol
258259 if sym.exists then
259260 val tdef = TypeDef (sym.asType).withSpan(sym.span)
@@ -320,7 +321,7 @@ trait QuotesAndSplices {
320321 val isFreshTypeBindings = freshTypeBindings.map(_.symbol).toSet
321322 val typeMap = new TypeMap () {
322323 def apply (tp : Type ): Type = tp match {
323- case tp : TypeRef if tp.typeSymbol == defn. QuotedType_splice =>
324+ case tp : TypeRef if tp.typeSymbol.isTypeSplice =>
324325 val tp1 = tp.dealias
325326 if (isFreshTypeBindings(tp1.typeSymbol)) tp1
326327 else tp
@@ -401,7 +402,7 @@ trait QuotesAndSplices {
401402 class ReplaceBindings extends TypeMap () {
402403 override def apply (tp : Type ): Type = tp match {
403404 case tp : TypeRef =>
404- val tp1 = if (tp.typeSymbol == defn. QuotedType_splice ) tp.dealias else tp
405+ val tp1 = if (tp.typeSymbol.isTypeSplice ) tp.dealias else tp
405406 typeBindings.get(tp1.typeSymbol).fold(tp)(_.symbol.typeRef)
406407 case tp => mapOver(tp)
407408 }
0 commit comments