File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3133,8 +3133,8 @@ object Parsers {
3133
3133
buf.toList
3134
3134
}
3135
3135
3136
- /** CaseClause ::= ‘case’ Pattern [Guard] (‘with’ SimpleExpr SubMatchClause | `=>' Block)
3137
- * ExprCaseClause ::= ‘case’ Pattern [Guard] (‘with’ SimpleExpr SubMatchClause | `=>' Expr)
3136
+ /** CaseClause ::= ‘case’ Pattern [Guard] (‘if’ InfixExpr MatchClause | `=>' Block)
3137
+ * ExprCaseClause ::= ‘case’ Pattern [Guard] (‘if’ InfixExpr MatchClause | `=>' Expr)
3138
3138
*/
3139
3139
def caseClause (exprOnly : Boolean = false ): CaseDef = atSpan(in.offset) {
3140
3140
val (pat, grd) = inSepRegion(InCase ) {
Original file line number Diff line number Diff line change @@ -566,7 +566,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
566
566
}
567
567
case CaseDef (pat, guard, body) =>
568
568
val bodyText = body match
569
- case t : SubMatch => keywordStr(" with " ) ~ toText(t)
569
+ case t : SubMatch => keywordStr(" if " ) ~ toText(t)
570
570
case t => " => " ~ caseBlockText(t)
571
571
keywordStr(" case " ) ~ inPattern(toText(pat)) ~ optText(guard)(keywordStr(" if " ) ~ _) ~ bodyText
572
572
case Labeled (bind, expr) =>
You can’t perform that action at this time.
0 commit comments