diff options
author | Simon Ochsenreither <simon@ochsenreither.de> | 2013-07-29 16:16:38 +0200 |
---|---|---|
committer | Simon Ochsenreither <simon@ochsenreither.de> | 2013-08-15 13:16:02 +0200 |
commit | f670e28d4da648511063c6825905c4960ee94445 (patch) | |
tree | c231d86582e3e09c7ba3f300098a131a1de8366f /src/compiler | |
parent | 91fcafe282c5e9e1a45638247a480d1f215a504f (diff) | |
download | scala-f670e28d4da648511063c6825905c4960ee94445.tar.gz scala-f670e28d4da648511063c6825905c4960ee94445.tar.bz2 scala-f670e28d4da648511063c6825905c4960ee94445.zip |
SI-7624 Fix -Xlint warnings in AnyVal-related code
The changes are actually pretty small:
scala.language.implicitConversions is moved around so that it is only
emitted to the source file if there is an actual implicit conversion.
The rest of the diff are mostly the new generated source files
reflecting that change.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/cmd/gen/AnyVals.scala | 8 | ||||
-rw-r--r-- | src/compiler/scala/tools/cmd/gen/Codegen.scala | 6 |
2 files changed, 5 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/cmd/gen/AnyVals.scala b/src/compiler/scala/tools/cmd/gen/AnyVals.scala index ce2019725f..842851b4f6 100644 --- a/src/compiler/scala/tools/cmd/gen/AnyVals.scala +++ b/src/compiler/scala/tools/cmd/gen/AnyVals.scala @@ -20,7 +20,9 @@ trait AnyValReps { s"implicit def @javaequiv@2${to.javaEquiv}(x: @name@): ${to.name} = x.to${to.name}" ) } - def coercionComment = """/** Language mandated coercions from @name@ to "wider" types. */""" + def coercionComment = +"""/** Language mandated coercions from @name@ to "wider" types. */ +import scala.language.implicitConversions""" def implicitCoercions: List[String] = { val coercions = this match { @@ -285,8 +287,6 @@ trait AnyValTemplates { package scala -import scala.language.implicitConversions - """ def classDocTemplate = (""" @@ -482,5 +482,3 @@ override def getClass(): Class[Boolean] = null def make() = values map (x => (x.name, x.make())) } - -object AnyVals extends AnyVals { } diff --git a/src/compiler/scala/tools/cmd/gen/Codegen.scala b/src/compiler/scala/tools/cmd/gen/Codegen.scala index b49322ab4a..c3aa527ef2 100644 --- a/src/compiler/scala/tools/cmd/gen/Codegen.scala +++ b/src/compiler/scala/tools/cmd/gen/Codegen.scala @@ -6,11 +6,9 @@ package scala.tools.cmd package gen -import scala.language.postfixOps - class Codegen(args: List[String]) extends { val parsed = CodegenSpec(args: _*) -} with CodegenSpec with Instance { } +} with CodegenSpec with Instance object Codegen { def echo(msg: String) = Console println msg @@ -31,7 +29,7 @@ object Codegen { val av = new AnyVals { } av.make() foreach { case (name, code ) => - val file = out / (name + ".scala") toFile; + val file = (out / (name + ".scala")).toFile echo("Writing: " + file) file writeAll code } |