Skip to content

Commit 28d3469

Browse files
committed
Fix #7575: Drop support of -language:_
1 parent 32a3781 commit 28d3469

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

compiler/src/dotty/tools/dotc/core/TypeOps.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
491491
if (!sym.exists) ""
492492
else toPrefix(sym.owner) + sym.name + "."
493493
val featureName = toPrefix(owner) + feature
494-
ctx.base.settings.language.value exists (s => s == featureName || s == "_")
494+
ctx.base.settings.language.value exists (s => s == featureName)
495495
}
496496
hasOption || hasImport
497497
}

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ class CompilationTests extends ParallelTesting {
6060
compileFile("tests/pos-special/indent-colons.scala", defaultOptions.and("-Yindent-colons")),
6161
compileFile("tests/pos-special/i7296.scala", defaultOptions.and("-strict", "-deprecation", "-Xfatal-warnings")),
6262
compileFile("tests/pos-special/nullable.scala", defaultOptions.and("-Yexplicit-nulls")),
63-
compileDir("tests/pos-special/adhoc-extension", defaultOptions.and("-strict", "-feature", "-Xfatal-warnings"))
63+
compileDir("tests/pos-special/adhoc-extension", defaultOptions.and("-strict", "-feature", "-Xfatal-warnings")),
64+
compileFile("tests/pos-special/i7575.scala", defaultOptions.and("-language:dynamics")),
6465
).checkCompile()
6566
}
6667

@@ -145,7 +146,8 @@ class CompilationTests extends ParallelTesting {
145146
compileFile("tests/neg-custom-args/wildcards.scala", defaultOptions.and("-strict", "-deprecation", "-Xfatal-warnings")),
146147
compileFile("tests/neg-custom-args/indentRight.scala", defaultOptions.and("-noindent", "-Xfatal-warnings")),
147148
compileFile("tests/neg-custom-args/extmethods-tparams.scala", defaultOptions.and("-deprecation", "-Xfatal-warnings")),
148-
compileDir("tests/neg-custom-args/adhoc-extension", defaultOptions.and("-strict", "-feature", "-Xfatal-warnings"))
149+
compileDir("tests/neg-custom-args/adhoc-extension", defaultOptions.and("-strict", "-feature", "-Xfatal-warnings")),
150+
compileFile("tests/neg/i7575.scala", defaultOptions.and("-language:_")),
149151
).checkExpectedErrors()
150152
}
151153

tests/neg/i7575.scala

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Foo() extends Dynamic // error: extension of type scala.Dynamic needs to be enabled
2+
// tested as is and with -language:_

tests/neg/i7575b.scala

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import scala.language._
2+
class Foo() extends Dynamic // error: extension of type scala.Dynamic needs to be enabled

tests/pos-special/i7575.scala

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class Foo() extends Dynamic // tested with -language:dynamics

0 commit comments

Comments
 (0)