@@ -16,6 +16,7 @@ import dotty.tools.dotc.core.StdNames._
1616import dotty .tools .dotc .core .Symbols ._
1717import dotty .tools .dotc .core .Types ._
1818import dotty .tools .dotc .reporting ._
19+ import dotty .tools .dotc .transform .SymUtils .decorateSymbol
1920import dotty .tools .dotc .typer .Implicits ._
2021import dotty .tools .dotc .typer .Inferencing ._
2122import dotty .tools .dotc .typer .ProtoTypes ._
@@ -233,7 +234,7 @@ trait QuotesAndSplices {
233234 val freshTypeBindingsBuff = new mutable.ListBuffer [Tree ]
234235 val typePatBuf = new mutable.ListBuffer [Tree ]
235236 override def transform (tree : Tree )(using Context ) = tree match {
236- case Typed (Apply (fn, pat :: Nil ), tpt) if fn.symbol == defn. InternalQuoted_exprSplice && ! tpt.tpe.derivesFrom(defn.RepeatedParamClass ) =>
237+ case Typed (Apply (fn, pat :: Nil ), tpt) if fn.symbol.isExprSplice && ! tpt.tpe.derivesFrom(defn.RepeatedParamClass ) =>
237238 val tpt1 = transform(tpt) // Transform type bindings
238239 val exprTpt = AppliedTypeTree (TypeTree (defn.QuotedExprClass .typeRef), tpt1 :: Nil )
239240 val newSplice = ref(defn.InternalQuoted_exprSplice ).appliedToType(tpt1.tpe).appliedTo(Typed (pat, exprTpt))
@@ -246,15 +247,15 @@ trait QuotesAndSplices {
246247 val pat1 = if (patType eq patType1) pat else pat.withType(patType1)
247248 patBuf += pat1
248249 }
249- case Apply (fn, pat :: Nil ) if fn.symbol == defn. InternalQuoted_exprSplice =>
250+ case Apply (fn, pat :: Nil ) if fn.symbol.isExprSplice =>
250251 try ref(defn.InternalQuotedMatcher_patternHole .termRef).appliedToType(tree.tpe).withSpan(tree.span)
251252 finally {
252253 val patType = pat.tpe.widen
253254 val patType1 = patType.translateFromRepeated(toArray = false )
254255 val pat1 = if (patType eq patType1) pat else pat.withType(patType1)
255256 patBuf += pat1
256257 }
257- case Select (pat, _) if tree.symbol == defn. QuotedType_splice =>
258+ case Select (pat, _) if tree.symbol.isTypeSplice =>
258259 val sym = tree.tpe.dealias.typeSymbol
259260 if sym.exists then
260261 val tdef = TypeDef (sym.asType).withSpan(sym.span)
@@ -321,7 +322,7 @@ trait QuotesAndSplices {
321322 val isFreshTypeBindings = freshTypeBindings.map(_.symbol).toSet
322323 val typeMap = new TypeMap () {
323324 def apply (tp : Type ): Type = tp match {
324- case tp : TypeRef if tp.typeSymbol == defn. QuotedType_splice =>
325+ case tp : TypeRef if tp.typeSymbol.isTypeSplice =>
325326 val tp1 = tp.dealias
326327 if (isFreshTypeBindings(tp1.typeSymbol)) tp1
327328 else tp
@@ -402,7 +403,7 @@ trait QuotesAndSplices {
402403 class ReplaceBindings extends TypeMap () {
403404 override def apply (tp : Type ): Type = tp match {
404405 case tp : TypeRef =>
405- val tp1 = if (tp.typeSymbol == defn. QuotedType_splice ) tp.dealias else tp
406+ val tp1 = if (tp.typeSymbol.isTypeSplice ) tp.dealias else tp
406407 typeBindings.get(tp1.typeSymbol).fold(tp)(_.symbol.typeRef)
407408 case tp => mapOver(tp)
408409 }
0 commit comments