summaryrefslogtreecommitdiff
path: root/src/build
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-08-07 13:19:57 +0200
committerVlad Ureche <vlad.ureche@gmail.com>2012-08-07 18:01:34 +0200
commitcc3badae17e160a446c3a160ab83a11348f75546 (patch)
treed08f697057b079649978c378f3bbad83dc205c28 /src/build
parent86c159a7fcd2136b0c05ee0a40e51bceb085b03b (diff)
downloadscala-cc3badae17e160a446c3a160ab83a11348f75546.tar.gz
scala-cc3badae17e160a446c3a160ab83a11348f75546.tar.bz2
scala-cc3badae17e160a446c3a160ab83a11348f75546.zip
Removes AnyRef specialization from library
As discussed in #999, #1025 and https://groups.google.com/forum/?hl=en&fromgroups#!topic/scala-internals/5P5TS9ZWe_w instrumented.jar is generated from the current source, there's no need for a bootstrap commit. Review by @paulp.
Diffstat (limited to 'src/build')
-rw-r--r--src/build/genprod.scala16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/build/genprod.scala b/src/build/genprod.scala
index 8c91128de0..83a65e6876 100644
--- a/src/build/genprod.scala
+++ b/src/build/genprod.scala
@@ -6,6 +6,8 @@
** |/ **
\* */
+import language.postfixOps
+
/** This program generates the ProductN, TupleN, FunctionN,
* and AbstractFunctionN, where 0 <= N <= MAX_ARITY.
*
@@ -75,7 +77,7 @@ package %s
if (args.length != 1) {
println("please give path of output directory")
- exit(-1)
+ sys.exit(-1)
}
val out = args(0)
def writeFile(node: scala.xml.Node) {
@@ -96,7 +98,7 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz */
object FunctionZero extends Function(0) {
override def genprodString = "\n// genprod generated these sources at: " + new java.util.Date()
- override def covariantSpecs = "@specialized "
+ override def covariantSpecs = "@specialized(Specializable.Primitives) "
override def descriptiveComment = " " + functionNTemplate.format("javaVersion", "anonfun0",
"""
* val javaVersion = () => sys.props("java.version")
@@ -111,8 +113,8 @@ object FunctionZero extends Function(0) {
object FunctionOne extends Function(1) {
override def classAnnotation = "@annotation.implicitNotFound(msg = \"No implicit view available from ${T1} => ${R}.\")\n"
- override def contravariantSpecs = "@specialized(scala.Int, scala.Long, scala.Float, scala.Double, scala.AnyRef) "
- override def covariantSpecs = "@specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double, scala.AnyRef) "
+ override def contravariantSpecs = "@specialized(scala.Int, scala.Long, scala.Float, scala.Double/*, scala.AnyRef*/) "
+ override def covariantSpecs = "@specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double/*, scala.AnyRef*/) "
override def descriptiveComment = " " + functionNTemplate.format("succ", "anonfun1",
"""
@@ -169,7 +171,7 @@ object Function {
class Function(val i: Int) extends Group("Function") with Arity {
def descriptiveComment = ""
- def functionNTemplate =
+ def functionNTemplate =
"""
* In the following example, the definition of %s is a
* shorthand for the anonymous class definition %s:
@@ -226,7 +228,7 @@ class Function(val i: Int) extends Group("Function") with Arity {
}
def tupleMethod = {
- def comment =
+ def comment =
""" /** Creates a tupled version of this function: instead of %d arguments,
* it accepts a single [[scala.Tuple%d]] argument.
*
@@ -275,7 +277,7 @@ object TupleOne extends Tuple(1)
object TupleTwo extends Tuple(2)
{
override def imports = Tuple.zipImports
- override def covariantSpecs = "@specialized(Int, Long, Double, Char, Boolean, AnyRef) "
+ override def covariantSpecs = "@specialized(Int, Long, Double, Char, Boolean/*, AnyRef*/) "
override def moreMethods = """
/** Swaps the elements of this `Tuple`.
* @return a new Tuple where the first element is the second element of this Tuple and the