Skip to content

Commit f5bb1c7

Browse files
authored
[stdlib] Add scala.language.2.13 to the scala 2 files (#23537)
This is a port of #23102 to the actual `main` branch. --- In this PR, we add the import `scala.language.2.13` to each and every file in the stdlib that originated from Scala 2.13. The flag changes the behavior of certain part of the compiler to produce code as if we were compiling with Scala 2.13's semantics.
2 parents 57db77a + b3ca332 commit f5bb1c7

File tree

540 files changed

+808
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

540 files changed

+808
-14
lines changed

library/src/scala/AnyVal.scala.ignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
package scala
1414

15+
import scala.language.`2.13`
16+
1517
/** `AnyVal` is the root class of all ''value types'', which describe values
1618
* not implemented as objects in the underlying host system. Value classes
1719
* are specified in Scala Language Specification, section 12.2.

library/src/scala/AnyValCompanion.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
package scala
1414

15+
import scala.language.`2.13`
16+
1517
/** A common supertype for companion classes of primitive types.
1618
*
1719
* A common trait for /companion/ objects of primitive types comes handy

library/src/scala/App.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ package scala
1414

1515
import java.lang.System.{currentTimeMillis => currentTime}
1616

17+
import scala.language.`2.13`
18+
1719
import scala.annotation.nowarn
1820
import scala.collection.mutable.ListBuffer
1921

library/src/scala/Array.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
package scala
1414

15+
import scala.language.`2.13`
16+
1517
//import scala.collection.generic._
1618
import scala.collection.{Factory, immutable, mutable}
1719
import mutable.ArrayBuilder

library/src/scala/Boolean.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package scala
1818

19+
import scala.language.`2.13`
20+
1921
/** `Boolean` (equivalent to Java's `boolean` primitive type) is a
2022
* subtype of [[scala.AnyVal]]. Instances of `Boolean` are not
2123
* represented by an object in the underlying runtime system.

library/src/scala/Byte.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package scala
1818

19+
import scala.language.`2.13`
20+
1921
/** `Byte`, a 8-bit signed integer (equivalent to Java's `byte` primitive type) is a
2022
* subtype of [[scala.AnyVal]]. Instances of `Byte` are not
2123
* represented by an object in the underlying runtime system.

library/src/scala/Char.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package scala
1818

19+
import scala.language.`2.13`
20+
1921
/** `Char`, a 16-bit unsigned integer (equivalent to Java's `char` primitive type) is a
2022
* subtype of [[scala.AnyVal]]. Instances of `Char` are not
2123
* represented by an object in the underlying runtime system.

library/src/scala/Console.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
package scala
1414

15+
import scala.language.`2.13`
16+
1517
import java.io.{ BufferedReader, InputStream, InputStreamReader, OutputStream, PrintStream, Reader }
1618
import scala.io.AnsiColor
1719
import scala.util.DynamicVariable

library/src/scala/DelayedInit.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
package scala
1414

15+
import scala.language.`2.13`
16+
1517
/** Classes and objects (but note, not traits) inheriting the `DelayedInit`
1618
* marker trait will have their initialization code rewritten as follows:
1719
* `code` becomes `delayedInit(code)`.

library/src/scala/Double.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package scala
1818

19+
import scala.language.`2.13`
20+
1921
/** `Double`, a 64-bit IEEE-754 floating point number (equivalent to Java's `double` primitive type) is a
2022
* subtype of [[scala.AnyVal]]. Instances of `Double` are not
2123
* represented by an object in the underlying runtime system.

0 commit comments

Comments
 (0)