Skip to content

Fix #7575: Drop support of -language:_ #7585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2019
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/core/TypeOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
if (!sym.exists) ""
else toPrefix(sym.owner) + sym.name + "."
val featureName = toPrefix(owner) + feature
ctx.base.settings.language.value exists (s => s == featureName || s == "_")
ctx.base.settings.language.value exists (s => s == featureName)
}
hasOption || hasImport
}
Expand Down
6 changes: 4 additions & 2 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class CompilationTests extends ParallelTesting {
compileFile("tests/pos-special/indent-colons.scala", defaultOptions.and("-Yindent-colons")),
compileFile("tests/pos-special/i7296.scala", defaultOptions.and("-strict", "-deprecation", "-Xfatal-warnings")),
compileFile("tests/pos-special/nullable.scala", defaultOptions.and("-Yexplicit-nulls")),
compileDir("tests/pos-special/adhoc-extension", defaultOptions.and("-strict", "-feature", "-Xfatal-warnings"))
compileDir("tests/pos-special/adhoc-extension", defaultOptions.and("-strict", "-feature", "-Xfatal-warnings")),
compileFile("tests/pos-special/i7575.scala", defaultOptions.and("-language:dynamics")),
).checkCompile()
}

Expand Down Expand Up @@ -145,7 +146,8 @@ class CompilationTests extends ParallelTesting {
compileFile("tests/neg-custom-args/wildcards.scala", defaultOptions.and("-strict", "-deprecation", "-Xfatal-warnings")),
compileFile("tests/neg-custom-args/indentRight.scala", defaultOptions.and("-noindent", "-Xfatal-warnings")),
compileFile("tests/neg-custom-args/extmethods-tparams.scala", defaultOptions.and("-deprecation", "-Xfatal-warnings")),
compileDir("tests/neg-custom-args/adhoc-extension", defaultOptions.and("-strict", "-feature", "-Xfatal-warnings"))
compileDir("tests/neg-custom-args/adhoc-extension", defaultOptions.and("-strict", "-feature", "-Xfatal-warnings")),
compileFile("tests/neg/i7575.scala", defaultOptions.and("-language:_")),
).checkExpectedErrors()
}

Expand Down
2 changes: 2 additions & 0 deletions tests/neg/i7575.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Foo() extends Dynamic // error: extension of type scala.Dynamic needs to be enabled
// tested as is and with -language:_
2 changes: 2 additions & 0 deletions tests/neg/i7575b.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import scala.language._
class Foo() extends Dynamic // error: extension of type scala.Dynamic needs to be enabled
1 change: 1 addition & 0 deletions tests/pos-special/i7575.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
class Foo() extends Dynamic // tested with -language:dynamics