Skip to content

Commit 9d1e94c

Browse files
committed
add missing @unchecked for for patmat
1 parent 9453f6d commit 9d1e94c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ object desugar {
859859
case IdPattern(named, tpt) =>
860860
Function(derivedValDef(pat, named, tpt, EmptyTree, Modifiers(Param)) :: Nil, body)
861861
case _ =>
862-
makeCaseLambda(CaseDef(pat, EmptyTree, body) :: Nil, unchecked = false)
862+
makeCaseLambda(CaseDef(pat, EmptyTree, body) :: Nil)
863863
}
864864

865865
/** If `pat` is not an Identifier, a Typed(Ident, _), or a Bind, wrap

tests/patmat/for.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ object Test {
22
def foo[A, B](l: List[(A, B)]): List[A] = {
33
for ((a, b) <- l) yield a
44
}
5+
6+
def bar(xs: List[(Int, List[Int])]): Unit = for ( (_, x :: y :: xs) <- xs) yield x
57
}

0 commit comments

Comments
 (0)