Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/report.scala
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ object report:

def errorOrMigrationWarning(msg: Message, pos: SrcPos, migrationVersion: MigrationVersion)(using Context): Unit =
if sourceVersion.isAtLeast(migrationVersion.errorFrom) then
if !sourceVersion.isMigrating then error(msg, pos)
if sourceVersion != migrationVersion.errorFrom.prevMigrating then error(msg, pos)
else if ctx.settings.rewrite.value.isEmpty then migrationWarning(msg, pos)
else if sourceVersion.isAtLeast(migrationVersion.warnFrom) then warning(msg, pos)

Expand Down
5 changes: 5 additions & 0 deletions tests/neg/migrate-once.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//> using options -source:3.5-migration

object Test:
for Some(x) <- Seq(Option(1)) yield x // error
// was warn before changes, but should warn only until 3.4-migration
Loading