diff options
author | Simon Ochsenreither <simon@ochsenreither.de> | 2013-07-05 14:37:48 +0200 |
---|---|---|
committer | Simon Ochsenreither <simon@ochsenreither.de> | 2013-08-15 13:15:35 +0200 |
commit | 7943084a2d06e21f112b4efd0ab70ec6e38ce510 (patch) | |
tree | 5ad72c62f9ab92b099c04cc3ac69ed684b15528e /src/reflect | |
parent | f17fb5eaa545490c761acd4f6979a619f919ac86 (diff) | |
download | scala-7943084a2d06e21f112b4efd0ab70ec6e38ce510.tar.gz scala-7943084a2d06e21f112b4efd0ab70ec6e38ce510.tar.bz2 scala-7943084a2d06e21f112b4efd0ab70ec6e38ce510.zip |
SI-7624 Fix -feature warnings and build with -feature
I added a language.existential import to LazyCombiner.scala which
should not be necessary, but causes a spurious warning otherwise:
scala/src/library/scala/collection/parallel/mutable/LazyCombiner.scala:33:
warning: the existential type
scala.collection.parallel.mutable.LazyCombiner[_$1,_$2,_$3] forSome {
type _$1; type _$2; type _$3 <: scala.collection.generic.Growable[_$1] with scala.collection.generic.Sizing },
which cannot be expressed by wildcards, should be enabled by making the implicit value scala.language.existentials visible.
if (other.isInstanceOf[LazyCombiner[_, _, _]]) {
^
I created ticket SI-7750 to track this issue.
Diffstat (limited to 'src/reflect')
4 files changed, 15 insertions, 13 deletions
diff --git a/src/reflect/scala/reflect/internal/Kinds.scala b/src/reflect/scala/reflect/internal/Kinds.scala index 46a95c7d26..315bf7e9c4 100644 --- a/src/reflect/scala/reflect/internal/Kinds.scala +++ b/src/reflect/scala/reflect/internal/Kinds.scala @@ -233,7 +233,7 @@ trait Kinds { /** * The data structure describing the kind of a given type. - * + * * Proper types are represented using ProperTypeKind. * * Type constructors are reprented using TypeConKind. @@ -251,7 +251,7 @@ trait Kinds { * it uses prescribed letters for each level: A, F, X, Y, Z. */ def scalaNotation: String - + /** Kind notation used in http://adriaanm.github.com/files/higher.pdf. * Proper types are expressed as *. * Type constructors are expressed * -> *(lo, hi) -(+)-> *. @@ -261,13 +261,13 @@ trait Kinds { /** Contains bounds either as part of itself or its arguments. */ def hasBounds: Boolean = !bounds.isEmptyBounds - + private[internal] def buildState(sym: Symbol, v: Variance)(s: StringState): StringState } object Kind { private[internal] sealed trait ScalaNotation private[internal] sealed case class Head(order: Int, n: Option[Int], alias: Option[String]) extends ScalaNotation { - override def toString: String = { + override def toString: String = { alias getOrElse { typeAlias(order) + n.map(_.toString).getOrElse("") } @@ -285,7 +285,7 @@ trait Kinds { } private[internal] sealed case class Text(value: String) extends ScalaNotation { override def toString: String = value - } + } private[internal] case class StringState(tokens: Seq[ScalaNotation]) { override def toString: String = tokens.mkString def append(value: String): StringState = StringState(tokens :+ Text(value)) @@ -310,7 +310,7 @@ trait Kinds { ts map { case Head(`o`, _, a) => Head(o, None, a) case t => t - } + } else ts }) } @@ -332,7 +332,7 @@ trait Kinds { val order = 0 private[internal] def buildState(sym: Symbol, v: Variance)(s: StringState): StringState = { s.append(v.symbolicString).appendHead(order, sym).append(bounds.scalaNotation(_.toString)) - } + } def scalaNotation: String = Kind.Head(order, None, None) + bounds.scalaNotation(_.toString) def starNotation: String = "*" + bounds.starNotation(_.toString) } @@ -344,7 +344,7 @@ trait Kinds { class TypeConKind(val bounds: TypeBounds, val args: Seq[TypeConKind.Argument]) extends Kind { import Kind.StringState - val order = (args map {_.kind.order} max) + 1 + val order = (args map (_.kind.order)).max + 1 def description: String = if (order == 1) "This is a type constructor: a 1st-order-kinded type." else "This is a type constructor that takes type constructor(s): a higher-kinded type." @@ -389,7 +389,7 @@ trait Kinds { */ object inferKind { import TypeConKind.Argument - + abstract class InferKind { protected def infer(tpe: Type, owner: Symbol, topLevel: Boolean): Kind protected def infer(sym: Symbol, topLevel: Boolean): Kind = infer(sym.tpeHK, sym.owner, topLevel) @@ -398,7 +398,7 @@ trait Kinds { } def apply(pre: Type): InferKind = new InferKind { - protected def infer(tpe: Type, owner: Symbol, topLevel: Boolean): Kind = { + protected def infer(tpe: Type, owner: Symbol, topLevel: Boolean): Kind = { val bounds = if (topLevel) TypeBounds.empty else tpe.asSeenFrom(pre, owner).bounds if(!tpe.isHigherKinded) ProperTypeKind(bounds) diff --git a/src/reflect/scala/reflect/internal/transform/Erasure.scala b/src/reflect/scala/reflect/internal/transform/Erasure.scala index 580ada8254..90ffe9d9e7 100644 --- a/src/reflect/scala/reflect/internal/transform/Erasure.scala +++ b/src/reflect/scala/reflect/internal/transform/Erasure.scala @@ -60,7 +60,7 @@ trait Erasure { */ protected def unboundedGenericArrayLevel(tp: Type): Int = tp match { case GenericArray(level, core) if !(core <:< AnyRefTpe) => level - case RefinedType(ps, _) if ps.nonEmpty => logResult(s"Unbounded generic level for $tp is")(ps map unboundedGenericArrayLevel max) + case RefinedType(ps, _) if ps.nonEmpty => logResult(s"Unbounded generic level for $tp is")((ps map unboundedGenericArrayLevel).max) case _ => 0 } diff --git a/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala b/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala index a7fd787dfc..63ea6e2c49 100644 --- a/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala +++ b/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala @@ -44,7 +44,7 @@ trait ScalaClassLoader extends JClassLoader { /** Create an instance of a class with this classloader */ def create(path: String): AnyRef = - tryToInitializeClass[AnyRef](path) map (_.newInstance()) orNull + tryToInitializeClass[AnyRef](path).map(_.newInstance()).orNull /** The actual bytes for a class file, or an empty array if it can't be found. */ def classBytes(className: String): Array[Byte] = classAsStream(className) match { @@ -116,7 +116,7 @@ object ScalaClassLoader { /** True if supplied class exists in supplied path */ def classExists(urls: Seq[URL], name: String): Boolean = - fromURLs(urls) tryToLoadClass name isDefined + (fromURLs(urls) tryToLoadClass name).isDefined /** Finding what jar a clazz or instance came from */ def originOfClass(x: Class[_]): Option[URL] = diff --git a/src/reflect/scala/reflect/internal/util/TriState.scala b/src/reflect/scala/reflect/internal/util/TriState.scala index c7a35d4637..4074d974d2 100644 --- a/src/reflect/scala/reflect/internal/util/TriState.scala +++ b/src/reflect/scala/reflect/internal/util/TriState.scala @@ -3,6 +3,8 @@ package reflect package internal package util +import scala.language.implicitConversions + import TriState._ /** A simple true/false/unknown value, for those days when |