Skip to content

Commit 733b22a

Browse files
Merge pull request #9581 from adpi2/unchecked-match-rewrite
Remove -migration setting
2 parents 4594457 + eee0863 commit 733b22a

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class ScalaSettings extends Settings.SettingGroup {
2727

2828
/** Other settings */
2929
val deprecation: Setting[Boolean] = BooleanSetting("-deprecation", "Emit warning and location for usages of deprecated APIs.") withAbbreviation "--deprecation"
30-
val migration: Setting[Boolean] = BooleanSetting("-migration", "Emit warning and location for migration issues from Scala 2.") withAbbreviation "--migration"
3130
val encoding: Setting[String] = StringSetting("-encoding", "encoding", "Specify character encoding used by source files.", Properties.sourceEncoding) withAbbreviation "--encoding"
3231
val explainTypes: Setting[Boolean] = BooleanSetting("-explain-types", "Explain type errors in more detail.") withAbbreviation "--explain-types"
3332
val explain: Setting[Boolean] = BooleanSetting("-explain", "Explain errors in more detail.") withAbbreviation "--explain"

compiler/src/dotty/tools/dotc/reporting/Diagnostic.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ object Diagnostic:
7272
class MigrationWarning(
7373
msg: Message,
7474
pos: SourcePosition
75-
) extends Warning(msg, pos) {
76-
def enablingOption(using Context): Setting[Boolean] = ctx.settings.migration
77-
}
75+
) extends Warning(msg, pos)
7876

7977
class Diagnostic(
8078
val msg: Message,

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ class Typer extends Namer
13671367
tree.selector.removeAttachment(desugar.CheckIrrefutable) match {
13681368
case Some(checkMode) =>
13691369
val isPatDef = checkMode == desugar.MatchCheck.IrrefutablePatDef
1370-
if (!checkIrrefutable(pat, sel.tpe, isPatDef) && ctx.settings.migration.value)
1370+
if (!checkIrrefutable(pat, sel.tpe, isPatDef) && sourceVersion == `3.1-migration`)
13711371
if (isPatDef) patch(Span(pat.span.end), ": @unchecked")
13721372
else patch(Span(pat.span.start), "case ")
13731373
case _ =>

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ class CompilationTests extends ParallelTesting {
139139
compileFile("tests/neg-custom-args/implicit-conversions-old.scala", defaultOptions.and("-Xfatal-warnings", "-feature")),
140140
compileFile("tests/neg-custom-args/i3246.scala", scala2CompatMode),
141141
compileFile("tests/neg-custom-args/overrideClass.scala", scala2CompatMode),
142-
compileFile("tests/neg-custom-args/ovlazy.scala", scala2CompatMode.and("-migration", "-Xfatal-warnings")),
143-
compileFile("tests/neg-custom-args/newline-braces.scala", scala2CompatMode.and("-migration", "-Xfatal-warnings")),
142+
compileFile("tests/neg-custom-args/ovlazy.scala", scala2CompatMode.and("-Xfatal-warnings")),
143+
compileFile("tests/neg-custom-args/newline-braces.scala", scala2CompatMode.and("-Xfatal-warnings")),
144144
compileFile("tests/neg-custom-args/autoTuplingTest.scala", defaultOptions.andLanguageFeature("noAutoTupling")),
145145
compileFile("tests/neg-custom-args/nopredef.scala", defaultOptions.and("-Yno-predef")),
146146
compileFile("tests/neg-custom-args/noimports.scala", defaultOptions.and("-Yno-imports")),

0 commit comments

Comments
 (0)