Skip to content

Commit fb15590

Browse files
committed
chore: add scala.language.2 to files in scala
1 parent 7a75a09 commit fb15590

File tree

117 files changed

+179
-3
lines changed

Some content is hidden

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

117 files changed

+179
-3
lines changed

library/src/scala/AnyVal.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`
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`
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: 4 additions & 2 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`
18+
1719
import scala.annotation.nowarn
1820
import scala.collection.mutable.ListBuffer
1921

@@ -71,9 +73,9 @@ trait App extends DelayedInit {
7173
*/
7274
protected final def args: Array[String] = _args
7375

74-
private[this] var _args: Array[String] = _
76+
private var _args: Array[String] = compiletime.uninitialized
7577

76-
private[this] val initCode = new ListBuffer[() => Unit]
78+
private val initCode = new ListBuffer[() => Unit]
7779

7880
/** The init hook. This saves all initialization code for execution within `main`.
7981
* This method is normally never called directly from user code.

library/src/scala/Array.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
package scala
1414

15+
import scala.language.`2`
16+
1517
//import scala.collection.generic._
1618
import scala.collection.{Factory, immutable, mutable}
1719
import mutable.ArrayBuilder
@@ -149,7 +151,7 @@ object Array {
149151
*
150152
* @see `java.util.Arrays#copyOf`
151153
*/
152-
def copyAs[A](original: Array[_], newLength: Int)(implicit ct: ClassTag[A]): Array[A] = {
154+
def copyAs[A](original: Array[?], newLength: Int)(implicit ct: ClassTag[A]): Array[A] = {
153155
val runtimeClass = ct.runtimeClass
154156
if (runtimeClass == Void.TYPE) newUnitArray(newLength).asInstanceOf[Array[A]]
155157
else {

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`
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`
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`
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`
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`
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`
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)