Skip to content

Commit 704e551

Browse files
committed
Remove untested setting -Yoverride-vars and its effects.
There is no test covering that setting, and Scala 2.13 does not have it either.
1 parent 22e930f commit 704e551

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-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
@@ -138,7 +138,6 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings {
138138
}
139139

140140
/** -Y "Private" settings */
141-
val YoverrideVars: Setting[Boolean] = BooleanSetting("-Yoverride-vars", "Allow vars to be overridden.")
142141
val Yhelp: Setting[Boolean] = BooleanSetting("-Y", "Print a synopsis of private options.")
143142
val Ycheck: Setting[List[String]] = PhasesSetting("-Ycheck", "Check the tree at the end of")
144143
val YcheckMods: Setting[Boolean] = BooleanSetting("-Ycheck-mods", "Check that symbols and their defining trees have modifiers in sync.")

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,8 @@ object RefChecks {
413413
else if (other.is(AbsOverride) && other.isIncompleteIn(clazz) && !member.is(AbsOverride))
414414
overrideError("needs `abstract override` modifiers")
415415
else if (member.is(Override) && other.is(Accessor) &&
416-
other.accessedFieldOrGetter.is(Mutable, butNot = Lazy)) {
417-
// !?! this is not covered by the spec. We need to resolve this either by changing the spec or removing the test here.
418-
// !!! is there a !?! convention? I'm !!!ing this to make sure it turns up on my searches.
419-
if (!ctx.settings.YoverrideVars.value)
420-
overrideError("cannot override a mutable variable")
421-
}
416+
other.accessedFieldOrGetter.is(Mutable, butNot = Lazy))
417+
overrideError("cannot override a mutable variable")
422418
else if (member.isAnyOverride &&
423419
!(member.owner.thisType.baseClasses exists (_ isSubClass other.owner)) &&
424420
!member.is(Deferred) && !other.is(Deferred) &&

0 commit comments

Comments
 (0)