Skip to content

Commit 2dc8bfa

Browse files
committed
Change closureWithDef to closureDef
1 parent 52c445f commit 2dc8bfa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -534,18 +534,18 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
534534
}
535535
}
536536

537-
/** An extractor for closures with their def contained in a block. */
538-
object closureWithDef {
539-
def unapply(tree: Tree): Option[(DefDef, Closure)] = tree match {
537+
/** An extractor for def of a closure contained the block of the closure. */
538+
object closureDef {
539+
def unapply(tree: Tree): Option[DefDef] = tree match {
540540
case Block((meth @ DefDef(nme.ANON_FUN, _, _, _, _)) :: Nil, closure: Closure) =>
541-
Some(meth, closure)
541+
Some(meth)
542542
case _ => None
543543
}
544544
}
545545

546546
/** If tree is a closure, its body, otherwise tree itself */
547547
def closureBody(tree: Tree)(implicit ctx: Context): Tree = tree match {
548-
case closureWithDef(meth, _) => meth.rhs
548+
case closureDef(meth) => meth.rhs
549549
case _ => tree
550550
}
551551

compiler/src/dotty/tools/dotc/core/quoted/PickledQuotes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ object PickledQuotes {
126126
val x1 = SyntheticValDef(NameKinds.UniqueName.fresh("x".toTermName), x)
127127
def x1Ref() = ref(x1.symbol)
128128
def rec(f: Tree): Tree = f match {
129-
case closureWithDef(ddef, _) =>
129+
case closureDef(ddef) =>
130130
new TreeMap() {
131131
private val paramSym = ddef.vparamss.head.head.symbol
132132
override def transform(tree: tpd.Tree)(implicit ctx: Context): tpd.Tree = tree match {

0 commit comments

Comments
 (0)