Skip to content

Commit 3fb9d9a

Browse files
committed
Tighten match pattern in shortcutImplicits again
It was not necessary to widen it, after all.
1 parent 7d3e86b commit 3fb9d9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/transform/ShortcutImplicits.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class ShortcutImplicits extends MiniPhase with IdentityDenotTransformer { thisTr
136136

137137
def splitClosure(tree: Tree): (List[Type] => List[List[Tree]] => Tree, Tree) = tree match {
138138
case Block(Nil, expr) => splitClosure(expr)
139-
case Block((meth @ DefDef(nme.ANON_FUN, Nil, clparams :: Nil, _, _)) :: rest, cl: Closure) =>
139+
case Block((meth @ DefDef(nme.ANON_FUN, Nil, clparams :: Nil, _, _)) :: Nil, cl: Closure) =>
140140
val tparamSyms = mdef.tparams.map(_.symbol)
141141
val vparamSymss = mdef.vparamss.map(_.map(_.symbol))
142142
val clparamSyms = clparams.map(_.symbol)
@@ -149,7 +149,7 @@ class ShortcutImplicits extends MiniPhase with IdentityDenotTransformer { thisTr
149149
val forwarder = ref(direct)
150150
.appliedToTypeTrees(tparamSyms.map(ref(_)))
151151
.appliedToArgss(vparamSymss.map(_.map(ref(_))) :+ clparamSyms.map(ref(_)))
152-
val fwdClosure = cpy.Block(tree)(cpy.DefDef(meth)(rhs = forwarder) :: rest, cl)
152+
val fwdClosure = cpy.Block(tree)(cpy.DefDef(meth)(rhs = forwarder) :: Nil, cl)
153153
(remappedCore, fwdClosure)
154154
case EmptyTree =>
155155
(_ => _ => EmptyTree, EmptyTree)

0 commit comments

Comments
 (0)