Skip to content

Commit 3b866b1

Browse files
authored
Merge pull request #15602 from dotty-staging/backport-15593
Backport #15593 to 3.2.0
2 parents 097ccd2 + 2c5719a commit 3b866b1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2574,8 +2574,8 @@ object Parsers {
25742574
atSpan(startOffset(pat), accept(LARROW)) {
25752575
val checkMode =
25762576
if casePat then GenCheckMode.FilterAlways
2577-
else if sourceVersion.isAtLeast(`3.2`) then GenCheckMode.CheckAndFilter
25782577
else if sourceVersion.isAtLeast(`future`) then GenCheckMode.Check
2578+
else if sourceVersion.isAtLeast(`3.2`) then GenCheckMode.CheckAndFilter
25792579
else GenCheckMode.FilterNow // filter on source version < 3.2, for backward compat
25802580
GenFrom(pat, subExpr(), checkMode)
25812581
}

tests/pos/i15579.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// scalac: -source:future
2+
3+
trait Foo[A]:
4+
def map[B](f: A => B): Foo[B] = ???
5+
6+
def baz: Foo[(Int, String)] = ???
7+
8+
@main def main =
9+
for (x, y) <- baz
10+
yield ()

0 commit comments

Comments
 (0)