Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93ac153

Browse files
committed
Remove last tweaking use of global.isScala3Migration
1 parent ce9b345 commit 93ac153

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/compiler/scala/tools/nsc/Global.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,6 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
11841184
@nowarn("cat=deprecation")
11851185
val isScala3: Boolean = settings.isScala3.value
11861186
val isScala3ImplicitResolution: Boolean = settings.Yscala3ImplicitResolution.value
1187-
val isScala3Migration = settings.Xmigration.value != NoScalaVersion
11881187

11891188
// used in sbt
11901189
def uncheckedWarnings: List[(Position, String)] = reporting.uncheckedWarnings

src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,7 @@ trait NamesDefaults { self: Analyzer =>
554554
val NamedArg(Ident(name), rhs) = arg: @unchecked
555555
params.indexWhere(p => matchesName(p, name, argIndex)) match {
556556
case -1 =>
557-
val warnVariableInScope = (!currentRun.isScala3 || currentRun.isScala3Migration) && context0.lookupSymbol(name, _.isVariable).isSuccess
558-
UnknownParameterNameNamesDefaultError(arg, name, warnVariableInScope)
557+
UnknownParameterNameNamesDefaultError(arg, name, warnVariableInScope = context0.lookupSymbol(name, _.isVariable).isSuccess)
559558
case paramPos if argPos contains paramPos =>
560559
val existingArgIndex = argPos.indexWhere(_ == paramPos)
561560
val otherName = Some(args(paramPos)) collect {

test/files/neg/t12798.check

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
t12798.scala:11: error: unknown parameter name: z
2+
Note that assignments in argument position are no longer allowed since Scala 2.13.
3+
To express the assignment expression, wrap it in brackets, e.g., `{ z = ... }`.
24
f(42, z = 27)
35
^
46
t12798.scala:25: error: unary prefix operator definition with empty parameter list is unsupported: instead, remove () to declare as `def unary_- = -42`

0 commit comments

Comments
 (0)