Skip to content

Commit 6b709a6

Browse files
Remove import language.Scala2
1 parent f88aebd commit 6b709a6

File tree

6 files changed

+6
-12
lines changed

6 files changed

+6
-12
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ object desugar {
472472
New(classTypeRef, vparamss.nestedMap(refOfDef))
473473
}
474474

475-
val copiedAccessFlags = if (ctx.scala2Setting) EmptyFlags else AccessFlags
475+
val copiedAccessFlags = if (ctx.scala2Mode) EmptyFlags else AccessFlags
476476

477477
// Methods to add to a case class C[..](p1: T1, ..., pN: Tn)(moreParams)
478478
// def _1: T1 = this.p1

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,6 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
397397
def canAutoTuple: Boolean =
398398
!featureEnabled(defn.LanguageModuleClass, nme.noAutoTupling)
399399

400-
def scala2Mode: Boolean =
401-
featureEnabled(defn.LanguageModuleClass, nme.Scala2)
402-
403400
def dynamicsEnabled: Boolean =
404401
featureEnabled(defn.LanguageModuleClass, nme.dynamics)
405402

@@ -414,7 +411,7 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
414411
/** Is option -language:Scala2 set?
415412
* This test is used when we are too early in the pipeline to consider imports.
416413
*/
417-
def scala2Setting = ctx.settings.language.value.contains(nme.Scala2.toString)
414+
def scala2Mode: Boolean = ctx.settings.language.value.contains(nme.Scala2.toString)
418415

419416
/** Refine child based on parent
420417
*

compiler/src/dotty/tools/dotc/parsing/Scanners.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ object Scanners {
242242

243243
// Scala 2 compatibility
244244

245-
val isScala2Mode: Boolean = ctx.scala2Setting
245+
val isScala2Mode: Boolean = ctx.scala2Mode
246246

247247
/** Cannot use ctx.featureEnabled because accessing the context would force too much */
248248
def testScala2Mode(msg: String, span: Span = Span(offset)): Boolean = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ trait Reporting { this: Context =>
5858
if (this.settings.deprecation.value) reportWarning(new DeprecationWarning(msg, pos))
5959

6060
def migrationWarning(msg: => Message, pos: SourcePosition = NoSourcePosition): Unit =
61-
reportWarning(new MigrationWarning(msg, pos))
61+
deprecationWarning(msg, pos)
6262

6363
def uncheckedWarning(msg: => Message, pos: SourcePosition = NoSourcePosition): Unit =
6464
reportWarning(new UncheckedWarning(msg, pos))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class CompilationTests extends ParallelTesting {
3434
// @Test // enable to test compileStdLib separately with detailed stats
3535
def compileStdLibOnly: Unit = {
3636
implicit val testGroup: TestGroup = TestGroup("compileStdLibOnly")
37-
compileList("compileStdLib", TestSources.stdLibSources, scala2Mode.and("-migration", "-Yno-inline", "-Ydetailed-stats"))
37+
compileList("compileStdLib", TestSources.stdLibSources, scala2Mode.and("-migration", "-Yno-inline"))
3838
}.checkCompile()
3939

4040
@Test def pos: Unit = {

library/src/scalaShadowing/language.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ package scalaShadowing
2828
*
2929
* and, for dotty:
3030
*
31-
* - [[Scala2 `Scala2`] backwards compatibility mode for Scala2
3231
* - [[noAtoTupling `noAutoTupling`]] disable auto-tupling
32+
* - [[strictEquality `strictEquality`]] enable strick equality
3333
*
3434
* @groupname production Language Features
3535
* @groupname experimental Experimental Language Features
@@ -211,9 +211,6 @@ object language {
211211
@volatile implicit lazy val macros: macros = languageFeature.experimental.macros
212212
}
213213

214-
/** Where imported, a backwards compatibility mode for Scala2 is enabled */
215-
object Scala2
216-
217214
/** Where imported, auto-tupling is disabled */
218215
object noAutoTupling
219216

0 commit comments

Comments
 (0)