Skip to content

chore: add language import in stdlib #23102

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

Draft
wants to merge 15 commits into
base: embed-stdlib
Choose a base branch
from
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions library/src/scala/AnyVal.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

/** `AnyVal` is the root class of all ''value types'', which describe values
* not implemented as objects in the underlying host system. Value classes
* are specified in Scala Language Specification, section 12.2.
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/AnyValCompanion.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

/** A common supertype for companion classes of primitive types.
*
* A common trait for /companion/ objects of primitive types comes handy
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/App.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ package scala

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

import scala.language.`2.13`

import scala.annotation.nowarn
import scala.collection.mutable.ListBuffer

Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Array.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

//import scala.collection.generic._
import scala.collection.{Factory, immutable, mutable}
import mutable.ArrayBuilder
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Boolean.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package scala

import scala.language.`2.13`

/** `Boolean` (equivalent to Java's `boolean` primitive type) is a
* subtype of [[scala.AnyVal]]. Instances of `Boolean` are not
* represented by an object in the underlying runtime system.
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Byte.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package scala

import scala.language.`2.13`

/** `Byte`, a 8-bit signed integer (equivalent to Java's `byte` primitive type) is a
* subtype of [[scala.AnyVal]]. Instances of `Byte` are not
* represented by an object in the underlying runtime system.
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Char.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package scala

import scala.language.`2.13`

/** `Char`, a 16-bit unsigned integer (equivalent to Java's `char` primitive type) is a
* subtype of [[scala.AnyVal]]. Instances of `Char` are not
* represented by an object in the underlying runtime system.
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Console.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

import java.io.{ BufferedReader, InputStream, InputStreamReader, OutputStream, PrintStream, Reader }
import scala.io.AnsiColor
import scala.util.DynamicVariable
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/DelayedInit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

/** Classes and objects (but note, not traits) inheriting the `DelayedInit`
* marker trait will have their initialization code rewritten as follows:
* `code` becomes `delayedInit(code)`.
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Double.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package scala

import scala.language.`2.13`

/** `Double`, a 64-bit IEEE-754 floating point number (equivalent to Java's `double` primitive type) is a
* subtype of [[scala.AnyVal]]. Instances of `Double` are not
* represented by an object in the underlying runtime system.
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/DummyImplicit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

/** A type for which there is always an implicit value. */
final class DummyImplicit private ()

Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Dynamic.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

/** A marker trait that enables dynamic invocations. Instances `x` of this
* trait allow method invocations `x.meth(args)` for arbitrary method
* names `meth` and argument lists `args` as well as field accesses
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Enumeration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

import scala.collection.{SpecificIterableFactory, StrictOptimizedIterableOps, View, immutable, mutable}
import java.lang.reflect.{Field => JField, Method => JMethod}

Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Equals.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

/** An interface containing operations for equality.
* The only method not already present in class `AnyRef` is `canEqual`.
*/
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Float.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package scala

import scala.language.`2.13`

/** `Float`, a 32-bit IEEE-754 floating point number (equivalent to Java's `float` primitive type) is a
* subtype of [[scala.AnyVal]]. Instances of `Float` are not
* represented by an object in the underlying runtime system.
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Function.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

/** A module defining utility methods for higher-order functional programming.
*/
object Function {
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function0.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

package scala

import scala.language.`2.13`

/** A function of 0 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

object Function1 {

Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function10.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 10 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function11.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 11 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function12.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 12 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function13.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 13 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function14.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 14 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function15.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 15 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function16.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 16 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function17.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 17 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function18.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 18 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function19.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 19 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 2 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function20.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 20 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function21.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 21 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function22.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 22 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function3.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 3 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function4.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 4 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function5.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 5 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function6.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 6 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function7.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 7 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function8.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 8 parameters.
*
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Function9.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package scala

import scala.language.`2.13`

/** A function of 9 parameters.
*
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Int.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package scala

import scala.language.`2.13`

/** `Int`, a 32-bit signed integer (equivalent to Java's `int` primitive type) is a
* subtype of [[scala.AnyVal]]. Instances of `Int` are not
* represented by an object in the underlying runtime system.
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Long.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package scala

import scala.language.`2.13`

/** `Long`, a 64-bit signed integer (equivalent to Java's `long` primitive type) is a
* subtype of [[scala.AnyVal]]. Instances of `Long` are not
* represented by an object in the underlying runtime system.
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/MatchError.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

/** This class implements errors which are thrown whenever an
* object doesn't match any pattern of a pattern matching
* expression.
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/NotImplementedError.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

/** Throwing this exception can be a temporary replacement for a method
* body that remains to be implemented. For instance, the exception is thrown by
* `Predef.???`.
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Option.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

object Option {

import scala.language.implicitConversions
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/PartialFunction.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package scala

import scala.language.`2.13`
import scala.annotation.nowarn

/** A partial function of type `PartialFunction[A, B]` is a unary function
Expand Down
1 change: 1 addition & 0 deletions library/src/scala/Predef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package scala

import scala.language.`2.13`
import scala.language.implicitConversions

import scala.collection.{mutable, immutable, ArrayOps, StringOps}, immutable.WrappedString
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/Product.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package scala

import scala.language.`2.13`

/** Base trait for all products, which in the standard library include at
* least [[scala.Product1]] through [[scala.Product22]] and therefore also
* their subclasses [[scala.Tuple1]] through [[scala.Tuple22]]. In addition,
Expand Down
Loading