Skip to content

Commit 207604b

Browse files
Reenable better-fors under '-source:3.7 -preview' settings (#23636)
Addendum to #23630 with missing adjustment for older source verisons
1 parent 1f148a1 commit 207604b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/config/SourceVersion.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ enum SourceVersion:
4343
def enablesClauseInterleaving = isAtLeast(`3.6`)
4444
def enablesNewGivens = isAtLeast(`3.6`)
4545
def enablesNamedTuples = isAtLeast(`3.7`)
46-
def enablesBetterFors = isAtLeast(`3.8`)
46+
def enablesBetterFors(using Context) = isAtLeast(`3.8`) || (isAtLeast(`3.7`) && isPreviewEnabled)
4747

4848
def requiresNewSyntax = isAtLeast(future)
4949

0 commit comments

Comments
 (0)