Skip to content

Commit cf516f8

Browse files
committed
Remove tpd.Splice.unapply
1 parent ff476f7 commit cf516f8

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,10 +1233,6 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
12331233
else defn.NothingType
12341234
ref(defn.InternalQuoted_exprSplice).appliedToTypes(List(argType, defn.QuoteContextClass.typeRef)).appliedTo(tree)
12351235
}
1236-
def unapply(tree: Tree)(implicit ctx: Context): Option[Tree] = tree match {
1237-
case Apply(fn, arg :: Nil) if fn.symbol == defn.InternalQuoted_exprSplice => Some(arg)
1238-
case _ => None
1239-
}
12401236
}
12411237

12421238
/** A key to be used in a context property that tracks enclosing inlined calls */

compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,11 @@ trait QuotesAndSplices {
205205
val freshTypeBindingsBuff = new mutable.ListBuffer[Tree]
206206
val typePatBuf = new mutable.ListBuffer[Tree]
207207
override def transform(tree: Tree)(implicit ctx: Context) = tree match {
208-
case Typed(Splice(pat), tpt) if !tpt.tpe.derivesFrom(defn.RepeatedParamClass) =>
208+
case Typed(Apply(fn, pat :: Nil), tpt) if fn.symbol == defn.InternalQuoted_exprSplice && !tpt.tpe.derivesFrom(defn.RepeatedParamClass) =>
209209
val tpt1 = transform(tpt) // Transform type bindings
210210
val exprTpt = AppliedTypeTree(TypeTree(defn.QuotedExprClass.typeRef), tpt1 :: Nil)
211211
transform(Splice(Typed(pat, exprTpt)))
212-
case Splice(pat) =>
212+
case Apply(fn, pat :: Nil) if fn.symbol == defn.InternalQuoted_exprSplice =>
213213
try ref(defn.InternalQuoted_patternHole.termRef).appliedToType(tree.tpe).withSpan(tree.span)
214214
finally {
215215
val patType = pat.tpe.widen

0 commit comments

Comments
 (0)