summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/Kinds.scala
diff options
context:
space:
mode:
authorSimon Ochsenreither <simon@ochsenreither.de>2013-07-05 14:37:48 +0200
committerSimon Ochsenreither <simon@ochsenreither.de>2013-08-15 13:15:35 +0200
commit7943084a2d06e21f112b4efd0ab70ec6e38ce510 (patch)
tree5ad72c62f9ab92b099c04cc3ac69ed684b15528e /src/reflect/scala/reflect/internal/Kinds.scala
parentf17fb5eaa545490c761acd4f6979a619f919ac86 (diff)
downloadscala-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/scala/reflect/internal/Kinds.scala')
-rw-r--r--src/reflect/scala/reflect/internal/Kinds.scala20
1 files changed, 10 insertions, 10 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)