summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala2
-rw-r--r--src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala2
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/Power.scala9
-rw-r--r--src/compiler/scala/tools/nsc/symtab/NameManglers.scala4
-rw-r--r--src/compiler/scala/tools/nsc/symtab/StdNames.scala1
-rw-r--r--src/compiler/scala/tools/nsc/symtab/SymbolTrackers.scala10
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Symbols.scala110
-rw-r--r--src/compiler/scala/tools/nsc/symtab/TypeDebugging.scala10
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala67
-rw-r--r--src/compiler/scala/tools/nsc/transform/AddInterfaces.scala4
-rw-r--r--src/library/scala/collection/immutable/Range.scala2
-rw-r--r--src/library/scala/collection/immutable/TrieIterator.scala4
-rw-r--r--test/files/buildmanager/t2649/t2649.check4
-rw-r--r--test/files/buildmanager/t2790/t2790.check4
-rw-r--r--test/files/neg/abstract-class-error.check2
-rw-r--r--test/files/neg/names-defaults-neg.check16
-rw-r--r--test/files/neg/t3115.check4
-rw-r--r--test/files/neg/t3774.check2
-rw-r--r--test/files/neg/tcpoly_infer_ticket1162.check2
-rw-r--r--test/files/neg/varargs.check6
-rw-r--r--test/files/run/t1500.check2
21 files changed, 152 insertions, 115 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index bdf9718e2a..6af7fe991f 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -881,7 +881,7 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
atPhase(phase.next) {
trackers foreach { t =>
t.snapshot()
- inform(t.show())
+ inform(t.show("Heading from " + phase.prev.name + " to " + phase.name))
}
}
}
diff --git a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
index 405da29a57..db616e9657 100644
--- a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
+++ b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
@@ -449,7 +449,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { thisFactory
else if (bSym.isMethod && !bSym.hasAccessorFlag && !bSym.isConstructor && !bSym.isModule) {
val cSym = { // This unsightly hack closes issue #4086.
if (bSym == definitions.Object_synchronized) {
- val cSymInfo = bSym.info match {
+ val cSymInfo = (bSym.info: @unchecked) match {
case PolyType(ts, MethodType(List(bp), mt)) =>
val cp = bp.cloneSymbol.setInfo(appliedType(definitions.ByNameParamClass.typeConstructor, List(bp.info)))
PolyType(ts, MethodType(List(cp), mt))
diff --git a/src/compiler/scala/tools/nsc/interpreter/Power.scala b/src/compiler/scala/tools/nsc/interpreter/Power.scala
index 8e546519e5..5a0830841d 100644
--- a/src/compiler/scala/tools/nsc/interpreter/Power.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/Power.scala
@@ -106,11 +106,12 @@ abstract class Power[G <: Global](
val modClass = pkgSymbol.moduleClass
/** Looking for dwindling returns */
- def droppedEnough() = unseenHistory.size >= 4 && (
- unseenHistory.takeRight(4).sliding(2) map (_.toList) forall {
- case List(a, b) => a > b
+ def droppedEnough() = unseenHistory.size >= 4 && {
+ unseenHistory takeRight 4 sliding 2 forall { it =>
+ val List(a, b) = it.toList
+ a > b
}
- )
+ }
def isRecur(sym: Symbol) = true
def isIgnore(sym: Symbol) = sym.isAnonOrRefinementClass || (sym.name.toString contains "$mc")
diff --git a/src/compiler/scala/tools/nsc/symtab/NameManglers.scala b/src/compiler/scala/tools/nsc/symtab/NameManglers.scala
index ce372b6e50..c40e1765ce 100644
--- a/src/compiler/scala/tools/nsc/symtab/NameManglers.scala
+++ b/src/compiler/scala/tools/nsc/symtab/NameManglers.scala
@@ -66,6 +66,7 @@ trait NameManglers {
self: nme.type =>
val IMPL_CLASS_SUFFIX = "$class"
+ val SINGLETON_SUFFIX = ".type"
val LOCALDUMMY_PREFIX = "<local " // owner of local blocks
val PROTECTED_PREFIX = "protected$"
val PROTECTED_SET_PREFIX = PROTECTED_PREFIX + "set"
@@ -84,6 +85,7 @@ trait NameManglers {
def isProtectedAccessorName(name: Name) = name startsWith PROTECTED_PREFIX
def isSetterName(name: Name) = name endsWith SETTER_SUFFIX
def isTraitSetterName(name: Name) = isSetterName(name) && (name containsName TRAIT_SETTER_SEPARATOR_STRING)
+ def isSingletonName(name: Name) = name endsWith SINGLETON_SUFFIX
def isOpAssignmentName(name: Name) = name match {
case raw.NE | raw.LE | raw.GE | EMPTY => false
@@ -152,6 +154,8 @@ trait NameManglers {
else name
}
+ def dropSingletonName(name: Name): TypeName = name stripEnd SINGLETON_SUFFIX toTypeName
+ def singletonName(name: Name): TypeName = name append SINGLETON_SUFFIX toTypeName
def implClassName(name: Name): TypeName = name append IMPL_CLASS_SUFFIX toTypeName
def interfaceName(implname: Name): TypeName = implname stripEnd IMPL_CLASS_SUFFIX toTypeName
def localDummyName(clazz: Symbol): TermName = newTermName(LOCALDUMMY_PREFIX + clazz.name + ">")
diff --git a/src/compiler/scala/tools/nsc/symtab/StdNames.scala b/src/compiler/scala/tools/nsc/symtab/StdNames.scala
index f60bd17b32..4a7f52f2b5 100644
--- a/src/compiler/scala/tools/nsc/symtab/StdNames.scala
+++ b/src/compiler/scala/tools/nsc/symtab/StdNames.scala
@@ -191,7 +191,6 @@ trait StdNames extends reflect.generic.StdNames with NameManglers {
val copy: NameType = "copy"
val delayedInit: NameType = "delayedInit"
val delayedInitArg: NameType = "delayedInit$body"
- val dottype: NameType = ".type"
val drop: NameType = "drop"
val elem: NameType = "elem"
val eq: NameType = "eq"
diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolTrackers.scala b/src/compiler/scala/tools/nsc/symtab/SymbolTrackers.scala
index 870787a9ea..1f32355bf7 100644
--- a/src/compiler/scala/tools/nsc/symtab/SymbolTrackers.scala
+++ b/src/compiler/scala/tools/nsc/symtab/SymbolTrackers.scala
@@ -131,7 +131,11 @@ trait SymbolTrackers {
else " (" + Flags.flagsToString(masked) + ")"
}
def symString(sym: Symbol) = (
- sym + changedOwnerString + flagSummaryString
+ if (settings.debug.value && sym.hasRawInfo && sym.rawInfo.isComplete) {
+ val s = sym.defString take 240
+ if (s.length == 240) s + "..." else s
+ }
+ else sym + changedOwnerString + flagSummaryString
)
def flatten = children.foldLeft(Set(root))(_ ++ _.flatten)
@@ -173,7 +177,7 @@ trait SymbolTrackers {
prevFlags = current map (s => (s, (s.flags & flagsMask))) toMap;
history = change :: history
}
- def show(): String = {
+ def show(label: String): String = {
val hierarchy = Node(current)
val Change(added, removed, symMap, owners, flags) = history.head
def detailString(sym: Symbol) = {
@@ -194,7 +198,7 @@ trait SymbolTrackers {
"" + hierarchy + (
if (removed.isEmpty) ""
- else "\n\n!!! %s symbols vanished:\n".format(removed.size) + removedString
+ else "\n\n!!! " + label + ", " + removed.size + " symbols vanished:\n" + removedString
)
}
}
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
index 5eb8b1ced4..faa698bfe8 100644
--- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
@@ -339,8 +339,9 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
final def isCapturedVariable = isVariable && hasFlag(CAPTURED)
final def isGetter = isTerm && hasAccessorFlag && !nme.isSetterName(name)
+ // todo: make independent of name, as this can be forged.
final def isSetter = isTerm && hasAccessorFlag && nme.isSetterName(name)
- //todo: make independent of name, as this can be forged.
+ def isSetterParameter = isValueParameter && owner.isSetter
final def hasGetter = isTerm && nme.isLocalName(name)
@@ -1561,7 +1562,7 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
// ToString -------------------------------------------------------------------
/** A tag which (in the ideal case) uniquely identifies class symbols */
- final def tag: Int = fullName.hashCode()
+ final def tag = fullName.##
/** The simple name of this Symbol */
final def simpleName: Name = name
@@ -1571,7 +1572,7 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
* (the initial Name) before falling back on id, which varies depending
* on exactly when a symbol is loaded.
*/
- final def sealedSortName: String = initName.toString + "#" + id
+ final def sealedSortName = initName + "#" + id
/** String representation of symbol's definition key word */
final def keyString: String =
@@ -1586,12 +1587,21 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
else if (isTerm && (!isParameter || isParamAccessor)) "val"
else ""
- /** String representation of symbol's kind */
- final def kindString: String =
- if (isPackageClass)
- if (settings.debug.value) "package class" else "package"
- else if (isModuleClass)
- if (settings.debug.value) "singleton class" else "object"
+ /** Accurate string representation of symbols' kind, suitable for developers. */
+ final def accurateKindString: String =
+ if (isPackage) "package"
+ else if (isPackageClass) "package class"
+ else if (isPackageObject) "package object"
+ else if (isPackageObjectClass) "package object class"
+ else if (isRefinementClass) "refinement class"
+ else if (isModule) "module"
+ else if (isModuleClass) "module class"
+ else sanitizedKindString
+
+ /** String representation of symbol's kind, suitable for the masses. */
+ private def sanitizedKindString: String =
+ if (isPackage || isPackageClass) "package"
+ else if (isModule || isModuleClass) "object"
else if (isAnonymousClass) "anonymous class"
else if (isRefinementClass) ""
else if (isTrait) "trait"
@@ -1599,42 +1609,61 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
else if (isType) "type"
else if (isTerm && isLazy) "lazy value"
else if (isVariable) "variable"
- else if (isPackage) "package"
- else if (isModule) "object"
else if (isClassConstructor) "constructor"
else if (isSourceMethod) "method"
else if (isTerm) "value"
else ""
+ final def kindString: String =
+ if (settings.debug.value) accurateKindString
+ else sanitizedKindString
+
+ /** If the name of the symbol's owner should be used when you care about
+ * seeing an interesting name: in such cases this symbol is e.g. a method
+ * parameter with a synthetic name, a constructor named "this", an object
+ * "package", etc. The kind string, if non-empty, will be phrased relative
+ * to the name of the owner.
+ */
+ def hasMeaninglessName = (
+ isSetterParameter // x$1
+ || isClassConstructor // this
+ || isPackageObject // package
+ || isPackageObjectClass // package$
+ || isRefinementClass // <refinement>
+ )
+
/** String representation of symbol's simple name.
* If !settings.debug translates expansions of operators back to operator symbol.
* E.g. $eq => =.
- * If settings.uniquId adds id.
+ * If settings.uniqid, adds id.
*/
- def nameString: String = decodedName + idString
+ def nameString = decodedName + idString
/** If settings.uniqid is set, the symbol's id, else "" */
- final def idString: String =
- if (settings.uniqid.value) "#"+id // +" in "+owner.name+"#"+owner.id // DEBUG
- else ""
+ final def idString = if (settings.uniqid.value) "#"+id else ""
- /** String representation, including symbol's kind
- * e.g., "class Foo", "method Bar".
+ /** String representation, including symbol's kind e.g., "class Foo", "method Bar".
+ * If hasMeaninglessName is true, uses the owner's name to disambiguate identity.
*/
- override def toString(): String =
- if (isValueParameter && owner.isSetter)
- "parameter of setter "+owner.nameString
- else if (isPackageObject || isPackageObjectClass)
- "package object "+owner.nameString
- else
- compose(List(kindString,
- if (isClassConstructor) owner.simpleName.decode+idString else nameString))
+ override def toString = compose(
+ kindString,
+ if (hasMeaninglessName) owner.nameString else nameString
+ )
- /** String representation of location. */
- def locationString: String = {
+ /** String representation of location.
+ */
+ def ownsString = {
val owns = owner.skipPackageObject
- if (!owns.isClass || (owns.printWithoutPrefix && owns != ScalaPackageClass)) ""
- else " in " + owns
+ if (owns.isClass && !owns.printWithoutPrefix && !isScalaPackageClass) "" + owns
+ else ""
+ }
+
+ /** String representation of location, plus a preposition. Doesn't do much,
+ * for backward compatibility reasons.
+ */
+ def locationString = ownsString match {
+ case "" => ""
+ case s => " in " + s
}
def fullLocationString = toString + locationString
@@ -1696,23 +1725,24 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
def defaultFlagString = hasFlagsToString(defaultFlagMask)
/** String representation of symbol's definition */
- def defString: String = {
- compose(List(defaultFlagString, keyString, varianceString + nameString +
- (if (hasRawInfo) infoString(rawInfo) else "<_>")))
- }
+ def defString = compose(
+ defaultFlagString,
+ keyString,
+ varianceString + nameString + (
+ if (hasRawInfo) infoString(rawInfo) else "<_>"
+ )
+ )
/** Concatenate strings separated by spaces */
- private def compose(ss: List[String]): String =
- ss.filter("" !=).mkString("", " ", "")
+ private def compose(ss: String*) = ss filter (_ != "") mkString " "
- def isSingletonExistential: Boolean =
- (name endsWith nme.dottype) && (info.bounds.hi.typeSymbol isSubClass SingletonClass)
+ def isSingletonExistential =
+ nme.isSingletonName(name) && (info.bounds.hi.typeSymbol isSubClass SingletonClass)
/** String representation of existentially bound variable */
def existentialToString =
if (isSingletonExistential && !settings.debug.value)
- "val "+name.subName(0, name.length - nme.dottype.length)+": "+
- dropSingletonType(info.bounds.hi)
+ "val " + nme.dropSingletonName(name) + ": " + dropSingletonType(info.bounds.hi)
else defString
}
diff --git a/src/compiler/scala/tools/nsc/symtab/TypeDebugging.scala b/src/compiler/scala/tools/nsc/symtab/TypeDebugging.scala
index 5ed7344bd8..62e812704b 100644
--- a/src/compiler/scala/tools/nsc/symtab/TypeDebugging.scala
+++ b/src/compiler/scala/tools/nsc/symtab/TypeDebugging.scala
@@ -14,6 +14,7 @@ trait TypeDebugging {
// @M toString that is safe during debugging (does not normalize, ...)
object TypeDebugStrings {
object str {
+ def parentheses(xs: List[_]): String = xs.mkString("(", ", ", ")")
def brackets(xs: List[_]): String = if (xs.isEmpty) "" else xs.mkString("[", ", ", "]")
def tparams(tparams: List[Type]): String = brackets(tparams map debug)
def parents(ps: List[Type]): String = (ps map debug).mkString(" with ")
@@ -47,7 +48,7 @@ trait TypeDebugging {
println("toLongString = " + toLongString)
}
- def debug(tp: Type): String = tp match {
+ private def debug(tp: Type): String = tp match {
case TypeRef(pre, sym, args) => debug(pre) + "." + sym.nameString + str.tparams(args)
case ThisType(sym) => sym.nameString + ".this"
case SingleType(pre, sym) => debug(pre) +"."+ sym.nameString +".type"
@@ -59,8 +60,13 @@ trait TypeDebugging {
case ExistentialType(tparams, qtpe) => "forSome "+ str.brackets(tparams) + " " + debug(qtpe)
case _ => tp.toString
}
+ def debugString(tp: Type) = debug(tp)
}
+ private def TDS = TypeDebugStrings
- def debugString(tp: Type) = TypeDebugStrings.debug(tp)
+ def paramString(tp: Type) = TDS.str parentheses (tp.params map (_.defString))
+ def typeParamsString(tp: Type) = TDS.str brackets (tp.typeParams map (_.defString))
+ def typeArgsString(tp: Type) = TDS.str brackets (tp.typeArgs map (_.safeToString))
+ def debugString(tp: Type) = TDS debugString tp
}
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 7f2a7f42bd..61e1d118c5 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -1372,7 +1372,7 @@ trait Types extends reflect.generic.Types { self: SymbolTable =>
// parents forall (p => p.isNullable && !p.typeSymbol.isAbstractType);
override def safeToString: String =
- parents.mkString("", " with ", "") +
+ parents.mkString(" with ") +
(if (settings.debug.value || parents.isEmpty || (decls.elems ne null))
decls.mkString("{", "; ", "}") else "")
}
@@ -1910,8 +1910,6 @@ A type's typeSymbol should never be inspected directly.
pre.prefixString + sym.nameString
var str = monopart + (if (args.isEmpty) "" else args.mkString("[", ",", "]"))
- //if (sym.nameString startsWith "moduleType")
- // str += ("_in_"+sym.ownerChain)
if (sym.isPackageClass)
packagePrefix + str
else if (sym.isModuleClass)
@@ -1930,19 +1928,19 @@ A type's typeSymbol should never be inspected directly.
else str
}
- override def prefixString =
+ override def prefixString = "" + (
if (settings.debug.value)
super.prefixString
else if (sym.printWithoutPrefix)
""
else if (sym.isPackageClass)
sym.fullName + "."
- else if (isStable && (sym.name endsWith ".type"))
- sym.name.toString dropRight 4
+ else if (isStable && nme.isSingletonName(sym.name))
+ nme.dropSingletonName(sym.name) + "."
else
super.prefixString
-
- override def kind = "TypeRef"
+ )
+ override def kind = "TypeRef"
}
object TypeRef extends TypeRefExtractor {
@@ -2006,8 +2004,7 @@ A type's typeSymbol should never be inspected directly.
override def finalResultType: Type = resultType.finalResultType
- override def safeToString: String =
- params.map(_.defString).mkString("(", ",", ")") + resultType
+ override def safeToString = paramString(this) + resultType
override def cloneInfo(owner: Symbol) = {
val vparams = cloneSymbols(params, owner)
@@ -2099,8 +2096,7 @@ A type's typeSymbol should never be inspected directly.
override def isHigherKinded = !typeParams.isEmpty
- override def safeToString: String =
- (typeParams map (_.defString) mkString ("[", ",", "]"))+ resultType
+ override def safeToString = typeParamsString(this) + resultType
override def cloneInfo(owner: Symbol) = {
val tparams = cloneSymbols(typeParams, owner)
@@ -2451,32 +2447,31 @@ A type's typeSymbol should never be inspected directly.
}
}
- override val isHigherKinded = typeArgs.isEmpty && !params.isEmpty
+ override val isHigherKinded = typeArgs.isEmpty && params.nonEmpty
override def normalize: Type =
- if (constr.instValid) constr.inst
- else if (isHigherKinded) { // get here when checking higher-order subtyping of the typevar by itself (TODO: check whether this ever happens?)
- typeFun(params, applyArgs(params map (_.typeConstructor)))
- } else {
- super.normalize
- }
+ if (constr.instValid) constr.inst
+ // get here when checking higher-order subtyping of the typevar by itself
+ // TODO: check whether this ever happens?
+ else if (isHigherKinded) typeFun(params, applyArgs(params map (_.typeConstructor)))
+ else super.normalize
override def typeSymbol = origin.typeSymbol
- override def safeToString: String = {
- def varString = "?"+(if (settings.explaintypes.value) level else "")+
- origin+
- (if(typeArgs.isEmpty) "" else (typeArgs map (_.safeToString)).mkString("[ ", ", ", " ]")) // +"#"+tid //DEBUG
- if (constr.inst eq null) "<null " + origin + ">"
- // else if (settings.debug.value) varString+"(@"+constr.## +")"+constr.toString
- else if (constr.inst eq NoType) varString
- else constr.inst.toString
- }
override def isStable = origin.isStable
override def isVolatile = origin.isVolatile
+
+ private def levelString = if (settings.explaintypes.value) level else ""
+ override def safeToString = constr.inst match {
+ case null => "<null " + origin + ">"
+ case NoType => "?" + levelString + origin + typeArgsString(this)
+ case x => "" + x
+ }
override def kind = "TypeVar"
def cloneInternal = {
- assert(!suspended) // cloning a suspended type variable when it's suspended will cause the clone to never be resumed with the current implementation
+ // cloning a suspended type variable when it's suspended will cause the clone
+ // to never be resumed with the current implementation
+ assert(!suspended)
TypeVar(origin, constr cloneInternal, typeArgs, params) // @M TODO: clone args/params?
}
}
@@ -2523,14 +2518,12 @@ A type's typeSymbol should never be inspected directly.
override def withSelfsym(sym: Symbol) =
AnnotatedType(annotations, underlying, sym)
- /** Drop the annotations on the bounds, unless but the low and high bounds are
- * exactly tp. */
- override def bounds: TypeBounds = {
- val oftp = underlying.bounds
- oftp match {
- case TypeBounds(lo, hi) if ((lo eq this) && (hi eq this)) => TypeBounds(this,this)
- case _ => oftp
- }
+ /** Drop the annotations on the bounds, unless but the low and high
+ * bounds are exactly tp.
+ */
+ override def bounds: TypeBounds = underlying.bounds match {
+ case TypeBounds(_: this.type, _: this.type) => TypeBounds(this, this)
+ case oftp => oftp
}
// ** Replace formal type parameter symbols with actual type arguments. * /
diff --git a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala
index fcf5c077d7..78541db82a 100644
--- a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala
+++ b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala
@@ -48,8 +48,8 @@ abstract class AddInterfaces extends InfoTransform {
private val implMethodMap = new mutable.HashMap[Symbol, Symbol]
override def newPhase(prev: scala.tools.nsc.Phase): StdPhase = {
- implClassMap.clear
- implMethodMap.clear
+ implClassMap.clear()
+ implMethodMap.clear()
super.newPhase(prev)
}
diff --git a/src/library/scala/collection/immutable/Range.scala b/src/library/scala/collection/immutable/Range.scala
index 2b1e4bff13..7bd3764e3e 100644
--- a/src/library/scala/collection/immutable/Range.scala
+++ b/src/library/scala/collection/immutable/Range.scala
@@ -328,7 +328,7 @@ object Range {
def inclusive(start: Int, end: Int, step: Int) = NumericRange.inclusive(start, end, step)
}
- @deprecated("use Range instead")
+ @deprecated("use Range instead", "2.9.0")
trait ByOne extends Range {
@bridge override def foreach[@specialized(Unit) U](f: Int => U) =
super.foreach(f)
diff --git a/src/library/scala/collection/immutable/TrieIterator.scala b/src/library/scala/collection/immutable/TrieIterator.scala
index 088b280b8a..c2cd0b2efd 100644
--- a/src/library/scala/collection/immutable/TrieIterator.scala
+++ b/src/library/scala/collection/immutable/TrieIterator.scala
@@ -37,8 +37,8 @@ private[collection] abstract class TrieIterator[+T](elems: Array[Iterable[T]]) e
private[this] var subIter = initSubIter
private[this] def getElems(x: Iterable[T]): Array[Iterable[T]] = (x match {
- case x: HashTrieMap[a, b] => x.elems
- case x: HashTrieSet[T] => x.elems
+ case x: HashTrieMap[_, _] => x.elems
+ case x: HashTrieSet[_] => x.elems
}).asInstanceOf[Array[Iterable[T]]]
private[this] def collisionToArray(x: Iterable[T]): Array[Iterable[T]] = (x match {
diff --git a/test/files/buildmanager/t2649/t2649.check b/test/files/buildmanager/t2649/t2649.check
index 5b698ec03f..390f284fd3 100644
--- a/test/files/buildmanager/t2649/t2649.check
+++ b/test/files/buildmanager/t2649/t2649.check
@@ -3,7 +3,7 @@ compiling Set(A.scala, B.scala)
Changes: Map()
builder > A.scala
compiling Set(A.scala)
-Changes: Map(object A -> List(Changed(Definition(A.x))[method x changed from (zz: Int,yy: Int)Int to (yy: Int,zz: Int)Int flags: <method>]))
-invalidate B.scala because it references changed definition [Changed(Definition(A.x))[method x changed from (zz: Int,yy: Int)Int to (yy: Int,zz: Int)Int flags: <method>]]
+Changes: Map(object A -> List(Changed(Definition(A.x))[method x changed from (zz: Int, yy: Int)Int to (yy: Int, zz: Int)Int flags: <method>]))
+invalidate B.scala because it references changed definition [Changed(Definition(A.x))[method x changed from (zz: Int, yy: Int)Int to (yy: Int, zz: Int)Int flags: <method>]]
compiling Set(B.scala)
Changes: Map(object B -> List())
diff --git a/test/files/buildmanager/t2790/t2790.check b/test/files/buildmanager/t2790/t2790.check
index 3a57d28817..9d37ccea29 100644
--- a/test/files/buildmanager/t2790/t2790.check
+++ b/test/files/buildmanager/t2790/t2790.check
@@ -3,8 +3,8 @@ compiling Set(A.scala, B.scala)
Changes: Map()
builder > A.scala
compiling Set(A.scala)
-Changes: Map(object A -> List(Added(Definition(A.x)), Changed(Definition(A.x))[value x changed from (f: java.lang.String,g: Int)Int to (f: java.lang.String,g: Int)Int <and> (f: Int,g: Int)Int flags: <method>]))
-invalidate B.scala because it references changed definition [Changed(Definition(A.x))[value x changed from (f: java.lang.String,g: Int)Int to (f: java.lang.String,g: Int)Int <and> (f: Int,g: Int)Int flags: <method>]]
+Changes: Map(object A -> List(Added(Definition(A.x)), Changed(Definition(A.x))[value x changed from (f: java.lang.String, g: Int)Int to (f: java.lang.String, g: Int)Int <and> (f: Int, g: Int)Int flags: <method>]))
+invalidate B.scala because it references changed definition [Changed(Definition(A.x))[value x changed from (f: java.lang.String, g: Int)Int to (f: java.lang.String, g: Int)Int <and> (f: Int, g: Int)Int flags: <method>]]
compiling Set(B.scala)
B.scala:2: error: type mismatch;
found : Int(5)
diff --git a/test/files/neg/abstract-class-error.check b/test/files/neg/abstract-class-error.check
index b8a0c6e70b..87d148ecc5 100644
--- a/test/files/neg/abstract-class-error.check
+++ b/test/files/neg/abstract-class-error.check
@@ -1,4 +1,4 @@
-S.scala:1: error: class S needs to be abstract, since method g in class J of type (y: Int,z: java.util.List)Int is not defined
+S.scala:1: error: class S needs to be abstract, since method g in class J of type (y: Int, z: java.util.List)Int is not defined
(Note that java.util.List does not match java.util.List[String]. To implement a raw type, use java.util.List[_])
class S extends J {
^
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check
index 5d409f18a8..d2bd2d123b 100644
--- a/test/files/neg/names-defaults-neg.check
+++ b/test/files/neg/names-defaults-neg.check
@@ -1,4 +1,4 @@
-names-defaults-neg.scala:65: error: not enough arguments for method apply: (a: Int,b: String)(c: Int*)Fact in object Fact.
+names-defaults-neg.scala:65: error: not enough arguments for method apply: (a: Int, b: String)(c: Int*)Fact in object Fact.
Unspecified value parameter b.
val fac = Fact(1)(2, 3)
^
@@ -40,8 +40,8 @@ names-defaults-neg.scala:26: error: Int does not take parameters
test3(b = 3, a = 1)(3)
^
names-defaults-neg.scala:35: error: ambiguous reference to overloaded definition,
-both method f in object t1 of type (b: String,a: Int)java.lang.String
-and method f in object t1 of type (a: Int,b: String)java.lang.String
+both method f in object t1 of type (b: String, a: Int)java.lang.String
+and method f in object t1 of type (a: Int, b: String)java.lang.String
match argument types (b: java.lang.String,a: Int)
t1.f(b = "dkljf", a = 1)
^
@@ -59,7 +59,7 @@ match argument types (Int)
^
names-defaults-neg.scala:49: error: ambiguous reference to overloaded definition,
both method g in object t7 of type (a: B)java.lang.String
-and method g in object t7 of type (a: C,b: Int*)java.lang.String
+and method g in object t7 of type (a: C, b: Int*)java.lang.String
match argument types (C)
t7.g(new C()) // ambigous reference
^
@@ -73,19 +73,19 @@ names-defaults-neg.scala:55: error: when using named arguments, the vararg param
test5(b = "dlkj")
^
names-defaults-neg.scala:61: error: ambiguous reference to overloaded definition,
-both method f in object t8 of type (b: String,a: Int)java.lang.String
-and method f in object t8 of type (a: Int,b: java.lang.Object)java.lang.String
+both method f in object t8 of type (b: String, a: Int)java.lang.String
+and method f in object t8 of type (a: Int, b: java.lang.Object)java.lang.String
match argument types (a: Int,b: java.lang.String) and expected result type Any
println(t8.f(a = 0, b = "1")) // ambigous reference
^
-names-defaults-neg.scala:69: error: wrong number of arguments for <none>: (x: Int,y: String)A1
+names-defaults-neg.scala:69: error: wrong number of arguments for <none>: (x: Int, y: String)A1
A1() match { case A1(_) => () }
^
names-defaults-neg.scala:76: error: no type parameters for method test4: (x: T[T[List[T[X forSome { type X }]]]])T[T[List[T[X forSome { type X }]]]] exist so that it can be applied to arguments (List[Int])
--- because ---
argument expression's type is not compatible with formal parameter type;
found : List[Int]
- required: ?T[ ?T[ List[?T[ X forSome { type X } ]] ] ]
+ required: ?T[?T[List[?T[X forSome { type X }]]]]
Error occurred in an application involving default arguments.
test4()
^
diff --git a/test/files/neg/t3115.check b/test/files/neg/t3115.check
index 3da8c8d1c6..c128ff5f3f 100644
--- a/test/files/neg/t3115.check
+++ b/test/files/neg/t3115.check
@@ -1,11 +1,11 @@
t3115.scala:6: error: object Math in object sc is deprecated:
println(sc.Math)
^
-t3115.scala:7: error: object Math in package scala is deprecated: use the scala.math package object instead.
+t3115.scala:7: error: object Math is deprecated: use the scala.math package object instead.
(Example package object usage: scala.math.Pi )
println(scala.Math)
^
-t3115.scala:8: error: object Math in package scala is deprecated: use the scala.math package object instead.
+t3115.scala:8: error: object Math is deprecated: use the scala.math package object instead.
(Example package object usage: scala.math.Pi )
scala.Math.Pi
^
diff --git a/test/files/neg/t3774.check b/test/files/neg/t3774.check
index ea35c50541..cce2d7076c 100644
--- a/test/files/neg/t3774.check
+++ b/test/files/neg/t3774.check
@@ -1,6 +1,6 @@
t3774.scala:4: error: overloaded method value ++ with alternatives:
[B1 >: List[Int]](xs: scala.collection.GenTraversableOnce[((Int, Int), B1)])scala.collection.immutable.Map[(Int, Int),B1] <and>
- [B >: ((Int, Int), List[Int]),That](that: scala.collection.GenTraversableOnce[B])(implicit bf: scala.collection.generic.CanBuildFrom[scala.collection.immutable.Map[(Int, Int),List[Int]],B,That])That
+ [B >: ((Int, Int), List[Int]), That](that: scala.collection.GenTraversableOnce[B])(implicit bf: scala.collection.generic.CanBuildFrom[scala.collection.immutable.Map[(Int, Int),List[Int]],B,That])That
cannot be applied to (scala.collection.immutable.IndexedSeq[((Int, Int), scala.collection.immutable.Range.Inclusive)])
Map[(Int,Int),List[Int]]() ++ (for(x <- 0 to 1 ; y <- 0 to 1) yield {(x,y)-> (0 to 1)})
^
diff --git a/test/files/neg/tcpoly_infer_ticket1162.check b/test/files/neg/tcpoly_infer_ticket1162.check
index 03334222c1..67b79e7f3c 100644
--- a/test/files/neg/tcpoly_infer_ticket1162.check
+++ b/test/files/neg/tcpoly_infer_ticket1162.check
@@ -1,4 +1,4 @@
-tcpoly_infer_ticket1162.scala:6: error: wrong number of type parameters for method apply: [A,B,F[_]]()Test.Lift[A,B,F] in object Lift
+tcpoly_infer_ticket1162.scala:6: error: wrong number of type parameters for method apply: [A, B, F[_]]()Test.Lift[A,B,F] in object Lift
def simplify[A,B]: Expression[A,B] = Lift[A,B]()
^
one error found
diff --git a/test/files/neg/varargs.check b/test/files/neg/varargs.check
index 1352dd968c..676a611341 100644
--- a/test/files/neg/varargs.check
+++ b/test/files/neg/varargs.check
@@ -1,10 +1,10 @@
-varargs.scala:16: error: A method with a varargs annotation produces a forwarder method with the same signature (a: Int,b: Array[java.lang.String])Int as an existing method.
+varargs.scala:16: error: A method with a varargs annotation produces a forwarder method with the same signature (a: Int, b: Array[java.lang.String])Int as an existing method.
@varargs def v1(a: Int, b: String*) = a + b.length
^
varargs.scala:19: error: A method without repeated parameters cannot be annotated with the `varargs` annotation.
@varargs def nov(a: Int) = 0
^
-varargs.scala:21: error: A method with a varargs annotation produces a forwarder method with the same signature (a: Int,b: Array[java.lang.String])Int as an existing method.
+varargs.scala:21: error: A method with a varargs annotation produces a forwarder method with the same signature (a: Int, b: Array[java.lang.String])Int as an existing method.
@varargs def v2(a: Int, b: String*) = 0
^
-three errors found \ No newline at end of file
+three errors found
diff --git a/test/files/run/t1500.check b/test/files/run/t1500.check
index 1032649f20..94a169333b 100644
--- a/test/files/run/t1500.check
+++ b/test/files/run/t1500.check
@@ -1,3 +1,3 @@
defined class posingAs
-resolve: [A,B](x: A @posingAs[B])B
+resolve: [A, B](x: A @posingAs[B])B
x: Any = 7