Skip to content

Commit 1aa4fab

Browse files
committed
Simplify refchecks now that it succeeds patmat
1 parent 967bdc1 commit 1aa4fab

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/compiler/scala/tools/nsc/typechecker/RefChecks.scala

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,26 +1822,6 @@ abstract class RefChecks extends Transform {
18221822
transform(pat)
18231823
}
18241824
treeCopy.CaseDef(tree, pat1, transform(guard), transform(body))
1825-
case LabelDef(_, _, _) if treeInfo.hasSynthCaseSymbol(result) =>
1826-
savingInPattern {
1827-
inPattern = true
1828-
deriveLabelDef(result)(transform)
1829-
}
1830-
case Apply(fun, args) if fun.symbol.isLabel && treeInfo.isSynthCaseSymbol(fun.symbol) =>
1831-
savingInPattern {
1832-
// scala/bug#7756 If we were in a translated pattern, we can now switch out of pattern mode, as the label apply signals
1833-
// that we are in the user-supplied code in the case body.
1834-
//
1835-
// Relies on the translation of:
1836-
// (null: Any) match { case x: List[_] => x; x.reverse; case _ => }'
1837-
// to:
1838-
// <synthetic> val x2: List[_] = (x1.asInstanceOf[List[_]]: List[_]);
1839-
// matchEnd4({ x2; x2.reverse}) // case body is an argument to a label apply.
1840-
inPattern = false
1841-
super.transform(result)
1842-
}
1843-
case ValDef(_, _, _, _) if treeInfo.hasSynthCaseSymbol(result) =>
1844-
deriveValDef(result)(transform) // scala/bug#7716 Don't refcheck the tpt of the synthetic val that holds the selector.
18451825
case _ =>
18461826
result.transform(this)
18471827
}

0 commit comments

Comments
 (0)