summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Garcia <miguelalfredo.garcia@epfl.ch>2012-03-06 11:28:44 +0100
committerMiguel Garcia <miguelalfredo.garcia@epfl.ch>2012-03-06 11:28:44 +0100
commitd9a85b5e67092fba1c37d8facc6dd2d273c26a27 (patch)
tree30c87de86f87cacd57e7b95bcfcede23f832cee9
parentc9bee28c8f5aaa77005043e1491e4e06ec7bce5e (diff)
parent9ca7297588538c5f1ee6cd8e535be41dac9031a6 (diff)
downloadscala-d9a85b5e67092fba1c37d8facc6dd2d273c26a27.tar.gz
scala-d9a85b5e67092fba1c37d8facc6dd2d273c26a27.tar.bz2
scala-d9a85b5e67092fba1c37d8facc6dd2d273c26a27.zip
Merge branch 'master' into GenASM
-rw-r--r--src/compiler/scala/reflect/internal/Types.scala2
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala2
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala7
-rw-r--r--src/compiler/scala/tools/nsc/interactive/CompilerControl.scala23
-rw-r--r--src/compiler/scala/tools/nsc/interactive/Global.scala10
-rw-r--r--src/compiler/scala/tools/nsc/matching/MatchSupport.scala4
-rw-r--r--src/compiler/scala/tools/nsc/matching/Matrix.scala9
-rw-r--r--src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala16
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala2
-rw-r--r--src/compiler/scala/tools/nsc/matching/PatternBindings.scala5
-rw-r--r--src/compiler/scala/tools/nsc/matching/Patterns.scala61
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala155
-rw-r--r--src/library/scala/StringContext.scala13
-rw-r--r--src/library/scala/collection/parallel/TaskSupport.scala26
-rw-r--r--test/files/pos/t5541.scala61
-rw-r--r--test/files/presentation/shutdown-deadlock.check3
-rw-r--r--test/files/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala45
-rw-r--r--test/files/presentation/shutdown-deadlock/src/arrays.scala937
-rw-r--r--test/files/run/interpolation.check6
-rw-r--r--test/files/run/interpolation.scala6
-rw-r--r--test/files/run/interpolationMultiline2.check14
-rw-r--r--test/files/run/lub-visibility.check14
-rw-r--r--test/files/run/lub-visibility.scala8
-rw-r--r--test/files/run/t2296a.check2
-rw-r--r--test/files/run/t2296a/J.java7
-rw-r--r--test/files/run/t2296a/S.scala18
-rw-r--r--test/files/run/t2296b.check2
-rw-r--r--test/files/run/t2296b/J_1.java7
-rw-r--r--test/files/run/t2296b/S_2.scala18
-rw-r--r--test/files/run/t4147.scala (renamed from test/files/run/si4147.scala)0
-rw-r--r--test/files/run/t4777.check2
-rw-r--r--test/files/run/t4777.scala8
-rw-r--r--test/files/run/t5171.check (renamed from test/files/run/si5171.check)0
-rw-r--r--test/files/run/t5171.scala (renamed from test/files/run/si5171.scala)0
-rw-r--r--test/files/run/t5262.check (renamed from test/files/run/si5262.check)0
-rw-r--r--test/files/run/t5262.scala (renamed from test/files/run/si5262.scala)0
-rw-r--r--test/files/run/t5374.check (renamed from test/files/run/si5374.check)0
-rw-r--r--test/files/run/t5374.scala (renamed from test/files/run/si5374.scala)0
-rw-r--r--test/files/run/t5375.check (renamed from test/files/run/si5375.check)0
-rw-r--r--test/files/run/t5375.scala (renamed from test/files/run/si5375.scala)0
-rw-r--r--test/files/run/t5380.scala (renamed from test/files/run/si5380.scala)0
-rw-r--r--test/files/run/t5527.check86
-rw-r--r--test/files/run/t5527.scala70
-rw-r--r--test/pending/run/t3702.scala10
-rw-r--r--test/pending/run/t3705.scala17
-rw-r--r--test/pending/run/t3832.scala7
-rw-r--r--test/pending/run/t4098.scala9
-rw-r--r--test/pending/run/t4415.scala86
-rw-r--r--test/pending/run/t4460.scala12
49 files changed, 1646 insertions, 144 deletions
diff --git a/src/compiler/scala/reflect/internal/Types.scala b/src/compiler/scala/reflect/internal/Types.scala
index 0a9449226b..64edbdb8bd 100644
--- a/src/compiler/scala/reflect/internal/Types.scala
+++ b/src/compiler/scala/reflect/internal/Types.scala
@@ -5846,7 +5846,7 @@ trait Types extends api.Types { self: SymbolTable =>
}
}
- val initialBTSes = ts map (_.baseTypeSeq.toList filter (_.typeSymbol.isPublic))
+ val initialBTSes = ts map (_.baseTypeSeq.toList)
if (printLubs)
printLubMatrix(ts zip initialBTSes toMap, depth)
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 44dc2fe384..552479bc0b 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -773,7 +773,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb
* where the value compares unequal to the previous phase's value.
*/
def afterEachPhase[T](op: => T): List[(Phase, T)] = {
- phaseDescriptors.map(_.ownPhase).foldLeft(List[(Phase, T)]()) { (res, ph) =>
+ phaseDescriptors.map(_.ownPhase).filterNot(_ eq NoPhase).foldLeft(List[(Phase, T)]()) { (res, ph) =>
val value = afterPhase(ph)(op)
if (res.nonEmpty && res.head._2 == value) res
else ((ph, value)) :: res
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 0e5f9ee80e..077f0f9c0e 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -658,7 +658,8 @@ self =>
DocDef(doc, t) setPos {
if (t.pos.isDefined) {
val pos = doc.pos.withEnd(t.pos.endOrPoint)
- if (t.pos.isOpaqueRange) pos else pos.makeTransparent
+ // always make the position transparent
+ pos.makeTransparent
} else {
t.pos
}
@@ -2967,9 +2968,9 @@ self =>
val annots = annotations(true)
val pos = in.offset
val mods = (localModifiers() | implicitMod) withAnnotations annots
- val defs = joinComment( // for SI-5527
+ val defs =
if (!(mods hasFlag ~(Flags.IMPLICIT | Flags.LAZY))) defOrDcl(pos, mods)
- else List(tmplDef(pos, mods)))
+ else List(tmplDef(pos, mods))
in.token match {
case RBRACE | CASE => defs :+ (Literal(Constant()) setPos o2p(in.offset))
diff --git a/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala b/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
index f2d59206e0..1b91b06942 100644
--- a/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
+++ b/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
@@ -10,6 +10,8 @@ import scala.tools.nsc.io.AbstractFile
import scala.tools.nsc.util.{SourceFile, Position, WorkScheduler}
import scala.tools.nsc.symtab._
import scala.tools.nsc.ast._
+import scala.tools.nsc.util.FailedInterrupt
+import scala.tools.nsc.util.EmptyAction
/** Interface of interactive compiler to a client such as an IDE
* The model the presentation compiler consists of the following parts:
@@ -48,7 +50,7 @@ trait CompilerControl { self: Global =>
/** The scheduler by which client and compiler communicate
* Must be initialized before starting compilerRunner
*/
- protected[interactive] val scheduler = new WorkScheduler
+ @volatile protected[interactive] var scheduler = new WorkScheduler
/** Return the compilation unit attached to a source file, or None
* if source is not loaded.
@@ -374,6 +376,25 @@ trait CompilerControl { self: Global =>
response raise new MissingResponse
}
+ /** A do-nothing work scheduler that responds immediately with MissingResponse.
+ *
+ * Used during compiler shutdown.
+ */
+ class NoWorkScheduler extends WorkScheduler {
+
+ override def postWorkItem(action: Action) = synchronized {
+ action match {
+ case w: WorkItem => w.raiseMissing()
+ case e: EmptyAction => // do nothing
+ case _ => println("don't know what to do with this " + action.getClass)
+ }
+ }
+
+ override def doQuickly[A](op: () => A): A = {
+ throw new FailedInterrupt(new Exception("Posted a work item to a compiler that's shutting down"))
+ }
+ }
+
}
// ---------------- Interpreted exceptions -------------------
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala
index 477cec8c8e..166b38f503 100644
--- a/src/compiler/scala/tools/nsc/interactive/Global.scala
+++ b/src/compiler/scala/tools/nsc/interactive/Global.scala
@@ -357,6 +357,7 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
checkNoResponsesOutstanding()
log.flush();
+ scheduler = new NoWorkScheduler
throw ShutdownReq
}
@@ -609,6 +610,15 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
}
response raise ex
throw ex
+
+ case ex @ ShutdownReq =>
+ if (debugIDE) {
+ println("ShutdownReq thrown during response")
+ ex.printStackTrace()
+ }
+ response raise ex
+ throw ex
+
case ex =>
if (debugIDE) {
println("exception thrown during response: "+ex)
diff --git a/src/compiler/scala/tools/nsc/matching/MatchSupport.scala b/src/compiler/scala/tools/nsc/matching/MatchSupport.scala
index 5e46960d04..371f4bc4d8 100644
--- a/src/compiler/scala/tools/nsc/matching/MatchSupport.scala
+++ b/src/compiler/scala/tools/nsc/matching/MatchSupport.scala
@@ -115,6 +115,10 @@ trait MatchSupport extends ast.TreeDSL { self: ParallelMatching =>
println(fmt.format(xs: _*) + " == " + x)
x
}
+ private[nsc] def debugging[T](fmt: String, xs: Any*)(x: T): T = {
+ if (settings.debug.value) printing(fmt, xs: _*)(x)
+ else x
+ }
def indent(s: Any) = s.toString() split "\n" map (" " + _) mkString "\n"
def indentAll(s: Seq[Any]) = s map (" " + _.toString() + "\n") mkString
diff --git a/src/compiler/scala/tools/nsc/matching/Matrix.scala b/src/compiler/scala/tools/nsc/matching/Matrix.scala
index d81f05cd51..e1ff88557e 100644
--- a/src/compiler/scala/tools/nsc/matching/Matrix.scala
+++ b/src/compiler/scala/tools/nsc/matching/Matrix.scala
@@ -198,6 +198,10 @@ trait Matrix extends MatrixAdditions {
class PatternVar(val lhs: Symbol, val rhs: Tree, val checked: Boolean) {
def sym = lhs
def tpe = lhs.tpe
+ if (checked)
+ lhs resetFlag NO_EXHAUSTIVE
+ else
+ lhs setFlag NO_EXHAUSTIVE
// See #1427 for an example of a crash which occurs unless we retype:
// in that instance there is an existential in the pattern.
@@ -207,11 +211,6 @@ trait Matrix extends MatrixAdditions {
override def toString() = "%s: %s = %s".format(lhs, tpe, rhs)
}
- /** Sets the rhs to EmptyTree, which makes the valDef ignored in Scrutinee.
- */
- def specialVar(lhs: Symbol, checked: Boolean) =
- new PatternVar(lhs, EmptyTree, checked)
-
/** Given a tree, creates a new synthetic variable of the same type
* and assigns the tree to it.
*/
diff --git a/src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala b/src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala
index 24d3c38e74..e72a0007a0 100644
--- a/src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala
+++ b/src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala
@@ -131,23 +131,11 @@ trait MatrixAdditions extends ast.TreeDSL {
import Flags.{ MUTABLE, ABSTRACT, SEALED }
- private case class Combo(index: Int, sym: Symbol) {
- val isBaseClass = sym.tpe.baseClasses.toSet
-
- // is this combination covered by the given pattern?
- def isCovered(p: Pattern) = {
- def coversSym = isBaseClass(decodedEqualsType(p.tpe).typeSymbol)
-
- cond(p.tree) {
- case _: UnApply | _: ArrayValue => true
- case x => p.isDefault || coversSym
- }
- }
- }
+ private case class Combo(index: Int, sym: Symbol) { }
/* True if the patterns in 'row' cover the given type symbol combination, and has no guard. */
private def rowCoversCombo(row: Row, combos: List[Combo]) =
- row.guard.isEmpty && (combos forall (c => c isCovered row.pats(c.index)))
+ row.guard.isEmpty && combos.forall(c => row.pats(c.index) covers c.sym)
private def requiresExhaustive(sym: Symbol) = {
(sym.isMutable) && // indicates that have not yet checked exhaustivity
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
index 9d4c9b4411..1285e29d4a 100644
--- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
+++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
@@ -745,7 +745,7 @@ trait ParallelMatching extends ast.TreeDSL
(others.head :: _column.tail, make(_tvars, _rows))
def mix() = {
- val newScrut = new Scrutinee(specialVar(_pv.sym, _pv.checked))
+ val newScrut = new Scrutinee(new PatternVar(_pv.sym, EmptyTree, _pv.checked))
PatternMatch(newScrut, _ncol) mkRule _nrep
}
}
diff --git a/src/compiler/scala/tools/nsc/matching/PatternBindings.scala b/src/compiler/scala/tools/nsc/matching/PatternBindings.scala
index 5dd7d8f3ee..56297f0195 100644
--- a/src/compiler/scala/tools/nsc/matching/PatternBindings.scala
+++ b/src/compiler/scala/tools/nsc/matching/PatternBindings.scala
@@ -19,9 +19,10 @@ trait PatternBindings extends ast.TreeDSL
import Debug._
/** EqualsPattern **/
- def isEquals(tpe: Type) = cond(tpe) { case TypeRef(_, EqualsPatternClass, _) => true }
+ def isEquals(tpe: Type) = tpe.typeSymbol == EqualsPatternClass
def mkEqualsRef(tpe: Type) = typeRef(NoPrefix, EqualsPatternClass, List(tpe))
- def decodedEqualsType(tpe: Type) = condOpt(tpe) { case TypeRef(_, EqualsPatternClass, List(arg)) => arg } getOrElse (tpe)
+ def decodedEqualsType(tpe: Type) =
+ if (tpe.typeSymbol == EqualsPatternClass) tpe.typeArgs.head else tpe
// A subtype test which creates fresh existentials for type
// parameters on the right hand side.
diff --git a/src/compiler/scala/tools/nsc/matching/Patterns.scala b/src/compiler/scala/tools/nsc/matching/Patterns.scala
index 18409cfffe..a6d8556db3 100644
--- a/src/compiler/scala/tools/nsc/matching/Patterns.scala
+++ b/src/compiler/scala/tools/nsc/matching/Patterns.scala
@@ -26,19 +26,6 @@ trait Patterns extends ast.TreeDSL {
type PatternMatch = MatchMatrix#PatternMatch
private type PatternVar = MatrixContext#PatternVar
- // private def unapplyArgs(x: Any) = x match {
- // case UnApply(Apply(TypeApply(_, targs), args), _) => (targs map (_.symbol), args map (_.symbol))
- // case _ => (Nil, Nil)
- // }
- //
- // private def unapplyCall(x: Any) = x match {
- // case UnApply(t, _) => treeInfo.methPart(t).symbol
- // case _ => NoSymbol
- // }
-
- private lazy val dummyMethod =
- NoSymbol.newTermSymbol(newTermName("matching$dummy"))
-
// Fresh patterns
def emptyPatterns(i: Int): List[Pattern] = List.fill(i)(NoPattern)
def emptyTrees(i: Int): List[Tree] = List.fill(i)(EmptyTree)
@@ -56,13 +43,14 @@ trait Patterns extends ast.TreeDSL {
case class VariablePattern(tree: Ident) extends NamePattern {
lazy val Ident(name) = tree
require(isVarPattern(tree) && name != nme.WILDCARD)
-
+ override def covers(sym: Symbol) = true
override def description = "%s".format(name)
}
// 8.1.1 (b)
case class WildcardPattern() extends Pattern {
- def tree = EmptyTree
+ val tree = EmptyTree
+ override def covers(sym: Symbol) = true
override def isDefault = true
override def description = "_"
}
@@ -71,6 +59,8 @@ trait Patterns extends ast.TreeDSL {
case class TypedPattern(tree: Typed) extends Pattern {
lazy val Typed(expr, tpt) = tree
+ override def covers(sym: Symbol) = newMatchesPattern(sym, tpt.tpe)
+ override def sufficientType = tpt.tpe
override def subpatternsForVars: List[Pattern] = List(Pattern(expr))
override def simplify(pv: PatternVar) = Pattern(expr) match {
case ExtractorPattern(ua) if pv.sym.tpe <:< tpt.tpe => this rebindTo expr
@@ -115,6 +105,7 @@ trait Patterns extends ast.TreeDSL {
}
}
+ override def covers(sym: Symbol) = newMatchesPattern(sym, sufficientType)
override def simplify(pv: PatternVar) = this.rebindToObjectCheck()
override def description = backticked match {
case Some(s) => "this." + s
@@ -133,13 +124,15 @@ trait Patterns extends ast.TreeDSL {
case class ObjectPattern(tree: Apply) extends ApplyPattern { // NamePattern?
require(!fn.isType && isModule)
+ override def covers(sym: Symbol) = newMatchesPattern(sym, sufficientType)
override def sufficientType = tpe.narrow
override def simplify(pv: PatternVar) = this.rebindToObjectCheck()
override def description = "Obj(%s)".format(fn)
}
// 8.1.4 (e)
case class SimpleIdPattern(tree: Ident) extends NamePattern {
- lazy val Ident(name) = tree
+ val Ident(name) = tree
+ override def covers(sym: Symbol) = newMatchesPattern(sym, tpe.narrow)
override def description = "Id(%s)".format(name)
}
@@ -163,6 +156,11 @@ trait Patterns extends ast.TreeDSL {
if (args.isEmpty) this rebindToEmpty tree.tpe
else this
+ override def covers(sym: Symbol) = {
+ debugging("[constructor] Does " + this + " cover " + sym + " ? ") {
+ sym.tpe.typeSymbol == this.tpe.typeSymbol
+ }
+ }
override def description = {
if (isColonColon) "%s :: %s".format(Pattern(args(0)), Pattern(args(1)))
else "%s(%s)".format(name, toPats(args).mkString(", "))
@@ -175,17 +173,12 @@ trait Patterns extends ast.TreeDSL {
// 8.1.7 / 8.1.8 (unapply and unapplySeq calls)
case class ExtractorPattern(tree: UnApply) extends UnapplyPattern {
- override def simplify(pv: PatternVar) = {
- if (pv.sym hasFlag NO_EXHAUSTIVE) ()
- else {
- TRACE("Setting NO_EXHAUSTIVE on " + pv.sym + " due to extractor " + tree)
- pv.sym setFlag NO_EXHAUSTIVE
- }
+ private def uaTyped = Typed(tree, TypeTree(arg.tpe)) setType arg.tpe
+ override def simplify(pv: PatternVar) = {
if (pv.tpe <:< arg.tpe) this
else this rebindTo uaTyped
}
-
override def description = "Unapply(%s => %s)".format(necessaryType, resTypesString)
}
@@ -208,6 +201,7 @@ trait Patterns extends ast.TreeDSL {
private def listFolder(hd: Tree, tl: Tree): Tree = unbind(hd) match {
case t @ Star(_) => moveBindings(hd, WILD(t.tpe))
case _ =>
+ val dummyMethod = NoSymbol.newTermSymbol(newTermName("matching$dummy"))
val consType = MethodType(dummyMethod newSyntheticValueParams List(packedType, listRef), consRef)
Apply(TypeTree(consType), List(hd, tl)) setType consRef
@@ -376,7 +370,7 @@ trait Patterns extends ast.TreeDSL {
case _: This if isVariableName(name) => Some("`%s`".format(name))
case _ => None
}
-
+ override def covers(sym: Symbol) = newMatchesPattern(sym, tree.tpe)
protected def getPathSegments(t: Tree): List[Name] = t match {
case Select(q, name) => name :: getPathSegments(q)
case Apply(f, Nil) => getPathSegments(f)
@@ -395,7 +389,13 @@ trait Patterns extends ast.TreeDSL {
lazy val UnApply(unfn, args) = tree
lazy val Apply(fn, _) = unfn
lazy val MethodType(List(arg, _*), _) = fn.tpe
- protected def uaTyped = Typed(tree, TypeTree(arg.tpe)) setType arg.tpe
+
+ // Covers if the symbol matches the unapply method's argument type,
+ // and the return type of the unapply is Some.
+ override def covers(sym: Symbol) = newMatchesPattern(sym, arg.tpe)
+
+ // TODO: for alwaysCovers:
+ // fn.tpe.finalResultType.typeSymbol == SomeClass
override def necessaryType = arg.tpe
override def subpatternsForVars = args match {
@@ -419,6 +419,7 @@ trait Patterns extends ast.TreeDSL {
else emptyPatterns(sufficientType.typeSymbol.caseFieldAccessors.size)
def isConstructorPattern = fn.isType
+ override def covers(sym: Symbol) = newMatchesPattern(sym, fn.tpe)
}
sealed abstract class Pattern extends PatternBindingLogic {
@@ -443,6 +444,15 @@ trait Patterns extends ast.TreeDSL {
// the subpatterns for this pattern (at the moment, that means constructor arguments)
def subpatterns(pm: MatchMatrix#PatternMatch): List[Pattern] = pm.dummies
+ // if this pattern should be considered to cover the given symbol
+ def covers(sym: Symbol): Boolean = newMatchesPattern(sym, sufficientType)
+ def newMatchesPattern(sym: Symbol, pattp: Type) = {
+ debugging("[" + kindString + "] Does " + pattp + " cover " + sym + " ? ") {
+ (sym.isModuleClass && (sym.tpe.typeSymbol eq pattp.typeSymbol)) ||
+ (sym.tpe.baseTypeSeq exists (_ matchesPattern pattp))
+ }
+ }
+
def sym = tree.symbol
def tpe = tree.tpe
def isEmpty = tree.isEmpty
@@ -475,6 +485,7 @@ trait Patterns extends ast.TreeDSL {
final override def toString = description
def toTypeString() = "%s <: x <: %s".format(necessaryType, sufficientType)
+ def kindString = ""
}
/*** Extractors ***/
diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
index 5318268bf2..243e685b13 100644
--- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
@@ -24,7 +24,7 @@ import symtab.Flags._
*/
abstract class SuperAccessors extends transform.Transform with transform.TypingTransformers {
import global._
- import definitions.{ UnitClass, isRepeatedParamType, isByNameParamType, Any_asInstanceOf }
+ import definitions.{ UnitClass, ObjectClass, isRepeatedParamType, isByNameParamType, Any_asInstanceOf }
import analyzer.{ restrictionError }
/** the following two members override abstract members in Transform */
@@ -34,6 +34,12 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
new SuperAccTransformer(unit)
class SuperAccTransformer(unit: CompilationUnit) extends TypingTransformer(unit) {
+ /** validCurrentOwner arrives undocumented, but I reverse engineer it to be
+ * a flag for needsProtectedAccessor which is false while transforming either
+ * a by-name argument block or a closure. This excludes them from being
+ * considered able to access protected members via subclassing (why?) which in turn
+ * increases the frequency with which needsProtectedAccessor will be true.
+ */
private var validCurrentOwner = true
private val accDefs = mutable.Map[Symbol, ListBuffer[Tree]]()
@@ -41,6 +47,25 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
val buf = accDefs.getOrElse(clazz, sys.error("no acc def buf for "+clazz))
buf += typers(clazz) typed tree
}
+ private def ensureAccessor(sel: Select) = {
+ val Select(qual, name) = sel
+ val sym = sel.symbol
+ val clazz = qual.symbol
+ val supername = nme.superName(name)
+ val superAcc = clazz.info.decl(supername).suchThat(_.alias == sym) orElse {
+ debuglog("add super acc " + sym + sym.locationString + " to `" + clazz);//debug
+ val acc = clazz.newMethod(supername, sel.pos, SUPERACCESSOR | PRIVATE) setAlias sym
+ val tpe = clazz.thisType memberType sym match {
+ case t if sym.isModule && !sym.isMethod => NullaryMethodType(t)
+ case t => t
+ }
+ acc setInfoAndEnter (tpe cloneInfo acc)
+ storeAccessorDefinition(clazz, DefDef(acc, EmptyTree))
+ acc
+ }
+
+ atPos(sel.pos)(Select(gen.mkAttributedThis(clazz), superAcc) setType sel.tpe)
+ }
private def transformArgs(params: List[Symbol], args: List[Tree]) = {
treeInfo.mapMethodParamsAndArgs(params, args) { (param, arg) =>
@@ -88,42 +113,21 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
}
}
- private def transformSuperSelect(tree: Tree): Tree = tree match {
- case Select(sup @ Super(_, mix), name) =>
- val sym = tree.symbol
- val clazz = sup.symbol
-
- if (sym.isDeferred) {
- val member = sym.overridingSymbol(clazz);
- if (mix != tpnme.EMPTY || member == NoSymbol ||
- !((member hasFlag ABSOVERRIDE) && member.isIncompleteIn(clazz)))
- unit.error(tree.pos, ""+sym+sym.locationString+" is accessed from super. It may not be abstract "+
- "unless it is overridden by a member declared `abstract' and `override'");
- }
- if (tree.isTerm && mix == tpnme.EMPTY &&
- (clazz.isTrait || clazz != currentOwner.enclClass || !validCurrentOwner)) {
- val supername = nme.superName(sym.name)
- var superAcc = clazz.info.decl(supername).suchThat(_.alias == sym)
- if (superAcc == NoSymbol) {
- debuglog("add super acc " + sym + sym.locationString + " to `" + clazz);//debug
- superAcc = clazz.newMethod(supername, tree.pos, SUPERACCESSOR | PRIVATE) setAlias sym
- var superAccTpe = clazz.thisType.memberType(sym)
- if (sym.isModule && !sym.isMethod) {
- // the super accessor always needs to be a method. See #231
- superAccTpe = NullaryMethodType(superAccTpe)
- }
- superAcc setInfoAndEnter (superAccTpe cloneInfo superAcc)
- storeAccessorDefinition(clazz, DefDef(superAcc, EmptyTree))
- }
- atPos(sup.pos) {
- Select(gen.mkAttributedThis(clazz), superAcc) setType tree.tpe;
- }
- } else {
- tree
- }
- case _ =>
- assert(tree.tpe.isError, tree)
- tree
+ private def transformSuperSelect(sel: Select): Tree = {
+ val Select(sup @ Super(_, mix), name) = sel
+ val sym = sel.symbol
+ val clazz = sup.symbol
+
+ if (sym.isDeferred) {
+ val member = sym.overridingSymbol(clazz);
+ if (mix != tpnme.EMPTY || member == NoSymbol ||
+ !((member hasFlag ABSOVERRIDE) && member.isIncompleteIn(clazz)))
+ unit.error(sel.pos, ""+sym.fullLocationString+" is accessed from super. It may not be abstract "+
+ "unless it is overridden by a member declared `abstract' and `override'");
+ }
+ if (name.isTermName && mix == tpnme.EMPTY && (clazz.isTrait || clazz != currentClass || !validCurrentOwner))
+ ensureAccessor(sel)
+ else sel
}
// Disallow some super.XX calls targeting Any methods which would
@@ -156,9 +160,11 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
for (s <- decls) {
if (s.privateWithin.isClass && !s.isProtected && !s.privateWithin.isModuleClass &&
!s.hasFlag(EXPANDEDNAME) && !s.isConstructor) {
+ val savedName = s.name
decls.unlink(s)
s.expandName(s.privateWithin)
decls.enter(s)
+ log("Expanded '%s' to '%s' in %s".format(savedName, s.name, sym))
}
}
if (settings.verbose.value && forScaladoc && !sym.isAnonymousClass) {
@@ -218,24 +224,47 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
// direct calls to aliases of param accessors to the superclass in order to avoid
// duplicating fields.
if (sym.isParamAccessor && sym.alias != NoSymbol) {
- val result = localTyper.typed {
- Select(
- Super(qual, tpnme.EMPTY/*qual.symbol.info.parents.head.symbol.name*/) setPos qual.pos,
- sym.alias) setPos tree.pos
- }
+ val result = (localTyper.typedPos(tree.pos) {
+ Select(Super(qual, tpnme.EMPTY) setPos qual.pos, sym.alias)
+ }).asInstanceOf[Select]
debuglog("alias replacement: " + tree + " ==> " + result);//debug
localTyper.typed(gen.maybeMkAsInstanceOf(transformSuperSelect(result), sym.tpe, sym.alias.tpe, true))
}
- else mayNeedProtectedAccessor(sel, List(EmptyTree), false)
+ else {
+ /** A trait which extends a class and accesses a protected member
+ * of that class cannot implement the necessary accessor method
+ * because its implementation is in an implementation class (e.g.
+ * Foo$class) which inherits nothing, and jvm access restrictions
+ * require the call site to be in an actual subclass. So non-trait
+ * classes inspect their ancestors for any such situations and
+ * generate the accessors. See SI-2296.
+ */
+ // FIXME - this should be unified with needsProtectedAccessor, but some
+ // subtlety which presently eludes me is foiling my attempts.
+ val shouldEnsureAccessor = (
+ currentClass.isTrait
+ && sym.isProtected
+ && sym.enclClass != currentClass
+ && !sym.owner.isTrait
+ && (sym.owner.enclosingPackageClass != currentPackage)
+ && (qual.symbol.info.member(sym.name) ne NoSymbol)
+ )
+ if (shouldEnsureAccessor) {
+ log("Ensuring accessor for call to protected " + sym.fullLocationString + " from " + currentClass)
+ ensureAccessor(sel)
+ }
+ else
+ mayNeedProtectedAccessor(sel, List(EmptyTree), false)
+ }
- case Select(Super(_, mix), name) =>
+ case sel @ Select(Super(_, mix), name) =>
if (sym.isValue && !sym.isMethod || sym.hasAccessorFlag) {
unit.error(tree.pos, "super may be not be used on "+ sym.accessedOrSelf)
}
else if (isDisallowed(sym)) {
unit.error(tree.pos, "super not allowed here: use this." + name.decode + " instead")
}
- transformSuperSelect(tree)
+ transformSuperSelect(sel)
case TypeApply(sel @ Select(qual, name), args) =>
mayNeedProtectedAccessor(sel, args, true)
@@ -280,11 +309,10 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
}
private def withInvalidOwner[A](trans: => A): A = {
- val prevValidCurrentOwner = validCurrentOwner
+ val saved = validCurrentOwner
validCurrentOwner = false
- val result = trans
- validCurrentOwner = prevValidCurrentOwner
- result
+ try trans
+ finally validCurrentOwner = saved
}
/** Add a protected accessor, if needed, and return a tree that calls
@@ -294,7 +322,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
private def makeAccessor(tree: Select, targs: List[Tree]): Tree = {
val Select(qual, name) = tree
val sym = tree.symbol
- val clazz = hostForAccessorOf(sym, currentOwner.enclClass)
+ val clazz = hostForAccessorOf(sym, currentClass)
assert(clazz != NoSymbol, sym)
debuglog("Decided for host class: " + clazz)
@@ -373,7 +401,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
*/
private def makeSetter(tree: Select): Tree = {
val field = tree.symbol
- val clazz = hostForAccessorOf(field, currentOwner.enclClass)
+ val clazz = hostForAccessorOf(field, currentClass)
assert(clazz != NoSymbol, field)
debuglog("Decided for host class: " + clazz)
@@ -393,7 +421,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
atPos(tree.pos)(Select(This(clazz), protectedAccessor))
}
- /** Does `sym` need an accessor when accessed from `currentOwner`?
+ /** Does `sym` need an accessor when accessed from `currentClass`?
* A special case arises for classes with explicit self-types. If the
* self type is a Java class, and a protected accessor is needed, we issue
* an error. If the self type is a Scala class, we don't add an accessor.
@@ -407,23 +435,20 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
* classes, this has to be signaled as error.
*/
private def needsProtectedAccessor(sym: Symbol, pos: Position): Boolean = {
- val clazz = currentOwner.enclClass
+ val clazz = currentClass
def accessibleThroughSubclassing =
validCurrentOwner && clazz.thisSym.isSubClass(sym.owner) && !clazz.isTrait
- def packageAccessBoundry(sym: Symbol) = {
- val b = sym.accessBoundary(sym.owner)
- if (b.isPackageClass) b
- else b.enclosingPackageClass
- }
+ def packageAccessBoundry(sym: Symbol) =
+ sym.accessBoundary(sym.enclosingPackageClass)
val isCandidate = (
sym.isProtected
&& sym.isJavaDefined
&& !sym.isDefinedInPackage
&& !accessibleThroughSubclassing
- && (sym.owner.enclosingPackageClass != currentOwner.enclosingPackageClass)
- && (sym.owner.enclosingPackageClass == packageAccessBoundry(sym))
+ && (sym.enclosingPackageClass != currentPackage)
+ && (sym.enclosingPackageClass == sym.accessBoundary(sym.enclosingPackageClass))
)
val host = hostForAccessorOf(sym, clazz)
def isSelfType = !(host.tpe <:< host.typeOfThis) && {
@@ -433,15 +458,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
)
true
}
- def isJavaProtected = host.isTrait && sym.isJavaDefined && {
- restrictionError(pos, unit,
- """|%s accesses protected %s inside a concrete trait method.
- |Add an accessor in a class extending %s as a workaround.""".stripMargin.format(
- clazz, sym, sym.enclClass)
- )
- true
- }
- isCandidate && !host.isPackageClass && !isSelfType && !isJavaProtected
+ isCandidate && !host.isPackageClass && !isSelfType
}
/** Return the innermost enclosing class C of referencingClass for which either
diff --git a/src/library/scala/StringContext.scala b/src/library/scala/StringContext.scala
index 8ca312afc5..1b01355108 100644
--- a/src/library/scala/StringContext.scala
+++ b/src/library/scala/StringContext.scala
@@ -46,10 +46,10 @@ case class StringContext(parts: String*) {
checkLengths(args: _*)
val pi = parts.iterator
val ai = args.iterator
- val bldr = new java.lang.StringBuilder(treatEscapes(pi.next))
+ val bldr = new java.lang.StringBuilder(treatEscapes(pi.next()))
while (ai.hasNext) {
bldr append ai.next
- bldr append treatEscapes(pi.next)
+ bldr append treatEscapes(pi.next())
}
bldr.toString
}
@@ -89,11 +89,12 @@ case class StringContext(parts: String*) {
val bldr = new java.lang.StringBuilder
val args1 = new ArrayBuffer[Any]
def copyString(first: Boolean): Unit = {
- val str = treatEscapes(pi.next)
+ val str = treatEscapes(pi.next())
+ val strIsEmpty = str.length == 0
var start = 0
var idx = 0
if (!first) {
- if ((str charAt 0) != '%')
+ if (strIsEmpty || (str charAt 0) != '%')
bldr append "%s"
idx = 1
}
@@ -106,11 +107,11 @@ case class StringContext(parts: String*) {
}
idx += 1
}
- bldr append (str substring (start, idx))
+ if (!strIsEmpty) bldr append (str substring (start, idx))
}
copyString(first = true)
while (pi.hasNext) {
- args1 += ai.next
+ args1 += ai.next()
copyString(first = false)
}
bldr.toString format (args1: _*)
diff --git a/src/library/scala/collection/parallel/TaskSupport.scala b/src/library/scala/collection/parallel/TaskSupport.scala
index fc99347316..59b75f523f 100644
--- a/src/library/scala/collection/parallel/TaskSupport.scala
+++ b/src/library/scala/collection/parallel/TaskSupport.scala
@@ -17,18 +17,38 @@ import scala.concurrent.ExecutionContext
+/** A trait implementing the scheduling of
+ * a parallel collection operation.
+ *
+ * Task support objects handle how a task is split and
+ * distributed across processors. A task support object can be
+ * changed in a parallel collection after it has been created,
+ * but only during a quiescent period, i.e. while there are no
+ * concurrent invocations to parallel collection methods.
+ */
trait TaskSupport extends Tasks
-private[collection] class ForkJoinTaskSupport(val environment: ForkJoinPool = ForkJoinTasks.defaultForkJoinPool)
+/** A task support that uses a fork join pool to schedule tasks */
+class ForkJoinTaskSupport(val environment: ForkJoinPool = ForkJoinTasks.defaultForkJoinPool)
extends TaskSupport with AdaptiveWorkStealingForkJoinTasks
-private[collection] class ThreadPoolTaskSupport(val environment: ThreadPoolExecutor = ThreadPoolTasks.defaultThreadPool)
+/** A task support that uses a thread pool executor to schedule tasks */
+class ThreadPoolTaskSupport(val environment: ThreadPoolExecutor = ThreadPoolTasks.defaultThreadPool)
extends TaskSupport with AdaptiveWorkStealingThreadPoolTasks
-private[collection] class ExecutionContextTaskSupport(val environment: ExecutionContext = scala.concurrent.executionContext)
+/** A task support that uses an execution context to schedule tasks.
+ *
+ * It can be used with the default execution context implementation in the `scala.concurrent` package.
+ * It internally forwards the call to either a forkjoin based task support or a thread pool executor one,
+ * depending on what the execution context uses.
+ *
+ * By default, parallel collections are parametrized with this task support object, so parallel collections
+ * share the same execution context backend as the rest of the `scala.concurrent` package.
+ */
+class ExecutionContextTaskSupport(val environment: ExecutionContext = scala.concurrent.executionContext)
extends TaskSupport with ExecutionContextTasks
diff --git a/test/files/pos/t5541.scala b/test/files/pos/t5541.scala
new file mode 100644
index 0000000000..39682a2fff
--- /dev/null
+++ b/test/files/pos/t5541.scala
@@ -0,0 +1,61 @@
+package philips.adolf.paul
+
+trait Sys[ S <: Sys[ S ]] {
+ type Tx
+}
+
+object HASkipList {
+ sealed trait NodeLike[ S <: Sys[ S ], @specialized( Int ) A ] {
+ def size : Int
+ def key( i: Int ): A
+ }
+ sealed trait Node[ S <: Sys[ S ], @specialized( Int ) A ] extends NodeLike[ S, A ] {
+ def isLeaf : Boolean
+ def isBranch : Boolean
+ def asBranch : Branch[ S, A ]
+ }
+ sealed trait BranchLike[ S <: Sys[ S ], @specialized( Int ) A ] extends NodeLike[ S, A ] {
+ def down( i: Int )( implicit tx: S#Tx ) : Node[ S, A ] = sys.error("")
+ }
+ sealed trait HeadOrBranch[ S <: Sys[ S ], A ]
+ final class Branch[ S <: Sys[ S ], @specialized( Int ) A ]()
+ extends BranchLike[ S, A ] with HeadOrBranch[ S, A ] with Node[ S, A ] {
+ def size:Int=1234
+ def key(i: Int):A=sys.error("TODO")
+ def isLeaf : Boolean = false
+ def isBranch : Boolean = true
+ def asBranch : Branch[ S, A ] = this
+ }
+}
+sealed trait HASkipList[ S <: Sys[ S ], @specialized( Int ) A ]
+
+class HASkipListView[ S <: Sys[ S ], A ]( private val l: HASkipList[ S, A ])( implicit system: S ) {
+ import HASkipList.Node
+ private def buildBoxMap( n: Node[ S, A ], isRight: Boolean )( implicit tx: S#Tx ) : (Box, NodeBox) = {
+ val sz = n.size
+ val szm = sz - 1
+ val keys = IndexedSeq.tabulate( sz ) { i =>
+ val key = n.key( i )
+ (key, if( isRight && i == szm ) "M" else key.toString)
+ }
+ val chbo = if( n.isLeaf ) None else {
+ val nb = n.asBranch
+ Some( IndexedSeq.tabulate( sz )( i => buildBoxMap( nb.down( i ), isRight && (i == szm) )))
+ }
+ val b = NodeBox( n, keys, chbo.map( _.map( _._2 )))
+ val bb = chbo match {
+ case Some( chbt ) =>
+ val chb = chbt.map( _._1 )
+ val h = Horiz( bs = chb )
+ Vert( bs = IndexedSeq[Box]( b, h ))
+ case None => b
+ }
+
+ (bb, b)
+ }
+
+ private trait Box
+ private case class Horiz( spacing: Int = 20, bs: IndexedSeq[ Box ]) extends Box
+ private final case class Vert( spacing: Int = 20, bs: IndexedSeq[ Box ]) extends Box
+ private final case class NodeBox( n: Node[ S, A ], keys: IndexedSeq[ (A, String) ], downs: Option[ IndexedSeq[ NodeBox ]]) extends Box
+}
diff --git a/test/files/presentation/shutdown-deadlock.check b/test/files/presentation/shutdown-deadlock.check
new file mode 100644
index 0000000000..ddcb4ff59b
--- /dev/null
+++ b/test/files/presentation/shutdown-deadlock.check
@@ -0,0 +1,3 @@
+reload: arrays.scala
+reload: arrays.scala
+No timeouts
diff --git a/test/files/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala b/test/files/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala
new file mode 100644
index 0000000000..53af84541a
--- /dev/null
+++ b/test/files/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala
@@ -0,0 +1,45 @@
+import scala.tools.nsc.interactive._
+import tests._
+
+object Test extends InteractiveTest {
+ val Reps = 30
+ import compiler._
+
+ def askSomething(): Response[Tree] = {
+ // println("*")
+ Thread.sleep(50)
+ ask { compiler.askStructure(true)(sourceFiles.head, _) }
+ }
+
+ def fireAsks() {
+ val jobs1 = for (i <- 1 until Reps) yield {
+ if (i % 10 == 0) {
+ askReload(sourceFiles)
+ }
+ askSomething
+ }
+
+ for ((j, i) <- jobs1.zipWithIndex) {
+ j.get(5000) match {
+ case None =>
+ println(i + ": TIMEOUT")
+ exit(1) // no need to delay the test any longer
+ case r =>
+ }
+ }
+ compiler.askShutdown()
+
+ println("No timeouts")
+ }
+
+ override def main(args: Array[String]) {
+ new Thread("Asking") {
+ override def run() {
+ fireAsks()
+ }
+ }.start()
+
+ Thread.sleep(800)
+ compiler.askShutdown()
+ }
+} \ No newline at end of file
diff --git a/test/files/presentation/shutdown-deadlock/src/arrays.scala b/test/files/presentation/shutdown-deadlock/src/arrays.scala
new file mode 100644
index 0000000000..ecebc78a6f
--- /dev/null
+++ b/test/files/presentation/shutdown-deadlock/src/arrays.scala
@@ -0,0 +1,937 @@
+//############################################################################
+// Arrays
+//############################################################################
+
+//############################################################################
+
+object Test {
+
+ //##########################################################################
+ // Types
+
+ type Strings = List[String]
+ type Map = scala.collection.Map[Int, Any]
+ type HashMap = scala.collection.mutable.HashMap[Int, Any]
+ type TreeMap = scala.collection.immutable.TreeMap[Int, Any]
+
+ //##########################################################################
+ // Identity Functions
+
+ def id_Ta_T[T <: Any ](x: T): T = x;
+ def id_Tr_T[T <: AnyRef ](x: T): T = x;
+ def id_To_T[T <: Object ](x: T): T = x;
+
+ def id_Ta_a[T <: Any ](x: T): Any = x;
+ def id_Tr_a[T <: AnyRef ](x: T): Any = x;
+ def id_To_a[T <: Object ](x: T): Any = x;
+
+ def id_Tr_r[T <: AnyRef ](x: T): AnyRef = x;
+ def id_To_r[T <: Object ](x: T): AnyRef = x;
+
+ def id_To_o[T <: Object ](x: T): Object = x;
+
+ def id_TSa_T [S <: Any , T <: Array[S]](x: T): T = x;
+ def id_TSv_T [S <: AnyVal , T <: Array[S]](x: T): T = x;
+ def id_TSr_T [S <: AnyRef , T <: Array[S]](x: T): T = x;
+ def id_TSo_T [S <: Object , T <: Array[S]](x: T): T = x;
+ def id_TSm_T [S <: Map , T <: Array[S]](x: T): T = x;
+ def id_TSn_T [S <: Strings, T <: Array[S]](x: T): T = x;
+
+ def id_TSa_Ss[S <: Any , T <: Array[S]](x: T): Array[S] = x;
+ def id_TSv_Ss[S <: AnyVal , T <: Array[S]](x: T): Array[S] = x;
+ def id_TSr_Ss[S <: AnyRef , T <: Array[S]](x: T): Array[S] = x;
+ def id_TSo_Ss[S <: Object , T <: Array[S]](x: T): Array[S] = x;
+ def id_TSm_Ss[S <: Map , T <: Array[S]](x: T): Array[S] = x;
+ def id_TSn_Ss[S <: Strings, T <: Array[S]](x: T): Array[S] = x;
+
+ def id_TSa_a [S <: Any , T <: Array[S]](x: T): Any = x;
+ def id_TSv_a [S <: AnyVal , T <: Array[S]](x: T): Any = x;
+ def id_TSr_a [S <: AnyRef , T <: Array[S]](x: T): Any = x;
+ def id_TSo_a [S <: Object , T <: Array[S]](x: T): Any = x;
+ def id_TSm_a [S <: Map , T <: Array[S]](x: T): Any = x;
+ def id_TSn_a [S <: Strings, T <: Array[S]](x: T): Any = x;
+
+ def id_TSa_r [S <: Any , T <: Array[S]](x: T): AnyRef = x;
+ def id_TSv_r [S <: AnyVal , T <: Array[S]](x: T): AnyRef = x;
+ def id_TSr_r [S <: AnyRef , T <: Array[S]](x: T): AnyRef = x;
+ def id_TSo_r [S <: Object , T <: Array[S]](x: T): AnyRef = x;
+ def id_TSm_r [S <: Map , T <: Array[S]](x: T): AnyRef = x;
+ def id_TSn_r [S <: Strings, T <: Array[S]](x: T): AnyRef = x;
+
+ def id_TSa_o [S <: Any , T <: Array[S]](x: T): Object = x;
+ def id_TSv_o [S <: AnyVal , T <: Array[S]](x: T): Object = x;
+ def id_TSr_o [S <: AnyRef , T <: Array[S]](x: T): Object = x;
+ def id_TSo_o [S <: Object , T <: Array[S]](x: T): Object = x;
+ def id_TSm_o [S <: Map , T <: Array[S]](x: T): Object = x;
+ def id_TSn_o [S <: Strings, T <: Array[S]](x: T): Object = x;
+
+ def id_Sas_Ss[S <: Any ](xs: Array[S]): Array[S] = xs;
+ def id_Svs_Ss[S <: AnyVal ](xs: Array[S]): Array[S] = xs;
+ def id_Srs_Ss[S <: AnyRef ](xs: Array[S]): Array[S] = xs;
+ def id_Sos_Ss[S <: Object ](xs: Array[S]): Array[S] = xs;
+ def id_Sms_Ss[S <: Map ](xs: Array[S]): Array[S] = xs;
+ def id_Sns_Ss[S <: Strings](xs: Array[S]): Array[S] = xs;
+
+ def id_Sas_a [S <: Any ](xs: Array[S]): Any = xs;
+ def id_Svs_a [S <: AnyVal ](xs: Array[S]): Any = xs;
+ def id_Srs_a [S <: AnyRef ](xs: Array[S]): Any = xs;
+ def id_Sos_a [S <: Object ](xs: Array[S]): Any = xs;
+ def id_Sms_a [S <: Map ](xs: Array[S]): Any = xs;
+ def id_Sns_a [S <: Strings](xs: Array[S]): Any = xs;
+
+ def id_Sas_r [S <: Any ](xs: Array[S]): AnyRef = xs;
+ def id_Svs_r [S <: AnyVal ](xs: Array[S]): AnyRef = xs;
+ def id_Srs_r [S <: AnyRef ](xs: Array[S]): AnyRef = xs;
+ def id_Sos_r [S <: Object ](xs: Array[S]): AnyRef = xs;
+ def id_Sms_r [S <: Map ](xs: Array[S]): AnyRef = xs;
+ def id_Sns_r [S <: Strings](xs: Array[S]): AnyRef = xs;
+
+ def id_Sas_o [S <: Any ](xs: Array[S]): Object = xs;
+ def id_Svs_o [S <: AnyVal ](xs: Array[S]): Object = xs;
+ def id_Srs_o [S <: AnyRef ](xs: Array[S]): Object = xs;
+ def id_Sos_o [S <: Object ](xs: Array[S]): Object = xs;
+ def id_Sms_o [S <: Map ](xs: Array[S]): Object = xs;
+ def id_Sns_o [S <: Strings](xs: Array[S]): Object = xs;
+
+ //##########################################################################
+ // Generic Checks
+
+ type Check[T] = Array[T] => Unit;
+
+ var checks: Int = 0;
+
+ def check(test0: Boolean, actual: Any, expected: Any) {
+ val test1: Boolean = actual == expected;
+ if (!test0 || !test1) {
+ val s0 = if (test0) "ok" else "KO";
+ val s1 = if (test1) "ok" else "KO";
+ val s2 = actual.toString();
+ val s3 = expected.toString();
+ error(s0 + " - " + s1 + ": " + s2 + " != " + s3);
+ }
+ checks += 1
+ }
+
+ def check_Ta[T <: Any ](xs: Array[T], l: Int, x0: T, c: Check[T]) {
+ check(xs.length == l, xs.length, l);
+ check(xs(0) == x0, xs(0), x0);
+ c(xs);
+ }
+
+ def check_Tv[T <: AnyVal ](xs: Array[T], l: Int, x0: T, c: Check[T]) {
+ check(xs.length == l, xs.length, l);
+ check(xs(0) == x0, xs(0), x0);
+ check_Ta(xs, l, x0, c);
+ c(xs);
+ }
+
+ def check_Tr[T <: AnyRef ](xs: Array[T], l: Int, x0: T, c: Check[T]) {
+ check(xs.length == l, xs.length, l);
+ check(xs(0) == x0, xs(0), x0);
+ check_Ta(xs, l, x0, c);
+ c(xs);
+ }
+
+ def check_To[T <: Object ](xs: Array[T], l: Int, x0: T, c: Check[T]) {
+ check(xs.length == l, xs.length, l);
+ check(xs(0) == x0, xs(0), x0);
+ check_Ta(xs, l, x0, c);
+ check_Tr(xs, l, x0, c);
+ c(xs);
+ }
+
+ def check_Tm[T <: Map ](xs: Array[T], l: Int, x0: T, c: Check[T]) {
+ check(xs.length == l, xs.length, l)
+ check(xs(0) == x0, xs(0), x0)
+ check_Ta(xs, l, x0, c)
+ check_Tr(xs, l, x0, c)
+ check_To(xs, l, x0, c)
+ c(xs)
+ }
+
+ def check_Tn[T <: Strings](xs: Array[T], l: Int, x0: T, c: Check[T]) {
+ check(xs.length == l, xs.length, l)
+ check(xs(0) == x0, xs(0), x0)
+ check_Ta(xs, l, x0, c)
+ check_Tr(xs, l, x0, c)
+ check_To(xs, l, x0, c)
+ c(xs)
+ }
+
+ def checkT2368() {
+ val arr = Array(1, 2, 3)
+ arr(0) += 1
+ assert(arr(0) == 2)
+ }
+
+ //##########################################################################
+ // Values
+
+ val u0: Unit = ();
+ val u1: Unit = ();
+
+ val z0: Boolean = false;
+ val z1: Boolean = true;
+
+ val b0: Byte = Byte.MinValue;
+ val b1: Byte = 1;
+ val b2: Byte = Byte.MaxValue;
+
+ val s0: Short = Short.MinValue;
+ val s1: Short = 2;
+ val s2: Short = Short.MaxValue;
+
+ val c0: Char = Char.MinValue;
+ val c1: Char = '3';
+ val c2: Char = Char.MaxValue;
+
+ val i0: Int = Int.MinValue;
+ val i1: Int = 4;
+ val i2: Int = Int.MinValue;
+
+ val l0: Long = Long.MinValue;
+ val l1: Int = 5;
+ val l2: Long = Long.MaxValue;
+
+ val f0: Float = Float.MinValue;
+ val f1: Int = 6;
+ val f2: Float = Float.MaxValue;
+
+ val d0: Double = Double.MinValue;
+ val d1: Int = 7;
+ val d2: Double = Double.MaxValue;
+
+ val a0: Unit = ();
+ val a1: Boolean = false;
+ val a2: Int = 0;
+ val a3: Null = null;
+ val a4: String = "a-z";
+ val a5: Symbol = 'token;
+ val a6: HashMap = new HashMap();
+ val a7: TreeMap = scala.collection.immutable.TreeMap.empty[Int, Any];
+ val a8: Strings = List("a", "z");
+
+ val v0: Unit = ();
+ val v1: Boolean = false;
+ val v2: Int = 0;
+ val v3: Long = l2;
+ val v4: Float = f2;
+ val v5: Double = d2;
+
+ val r0: Null = a3;
+ val r1: String = a4;
+ val r2: Symbol = a5;
+ val r3: HashMap = a6;
+ val r4: TreeMap = a7;
+ val r5: Strings = a8;
+
+ val o0: Null = r0;
+ val o1: String = r1;
+ val o2: Symbol = r2;
+ val o3: HashMap = r3;
+ val o4: TreeMap = r4;
+ val o5: Strings = r5;
+
+ val m0: Null = r0;
+ val m1: HashMap = r3;
+ val m2: TreeMap = r4;
+
+ val n0: Null = r0;
+ val n1: Strings = r5;
+ val n2: Nil.type= Nil;
+
+ //##########################################################################
+ // Specific Checks
+
+ def ucheck(xs: Array[Unit ]): Unit = {
+ check(xs.length == 2, xs.length, 2);
+ check(xs(0) == u0, xs(0), u0);
+ check(xs(1) == u1, xs(1), u1);
+ }
+
+ def zcheck(xs: Array[Boolean]): Unit = {
+ check(xs.length == 2, xs.length, 2);
+ check(xs(0) == z0, xs(0), z0);
+ check(xs(1) == z1, xs(1), z1);
+ }
+
+ def bcheck(xs: Array[Byte ]): Unit = {
+ check(xs.length == 3, xs.length, 3);
+ check(xs(0) == b0, xs(0), b0);
+ check(xs(1) == b1, xs(1), b1);
+ check(xs(2) == b2, xs(2), b2);
+ }
+
+ def scheck(xs: Array[Short ]): Unit = {
+ check(xs.length == 3, xs.length, 3);
+ check(xs(0) == s0, xs(0), s0);
+ check(xs(1) == s1, xs(1), s1);
+ check(xs(2) == s2, xs(2), s2);
+ }
+
+ def ccheck(xs: Array[Char ]): Unit = {
+ check(xs.length == 3, xs.length, 3);
+ check(xs(0) == c0, xs(0), c0);
+ check(xs(1) == c1, xs(1), c1);
+ check(xs(2) == c2, xs(2), c2);
+ }
+
+ def icheck(xs: Array[Int ]): Unit = {
+ check(xs.length == 3, xs.length, 3);
+ check(xs(0) == i0, xs(0), i0);
+ check(xs(1) == i1, xs(1), i1);
+ check(xs(2) == i2, xs(2), i2);
+ }
+
+ def lcheck(xs: Array[Long ]): Unit = {
+ check(xs.length == 3, xs.length, 3);
+ check(xs(0) == l0, xs(0), l0);
+ check(xs(1) == l1, xs(1), l1: Long); // !!! : Long
+ check(xs(2) == l2, xs(2), l2);
+ }
+
+ def fcheck(xs: Array[Float ]): Unit = {
+ check(xs.length == 3, xs.length, 3);
+ check(xs(0) == f0, xs(0), f0);
+ check(xs(1) == f1, xs(1), f1: Float); // !!! : Float
+ check(xs(2) == f2, xs(2), f2);
+ }
+
+ def dcheck(xs: Array[Double ]): Unit = {
+ check(xs.length == 3, xs.length, 3);
+ check(xs(0) == d0, xs(0), d0);
+ check(xs(1) == d1, xs(1), d1: Double); // !!! : Double
+ check(xs(2) == d2, xs(2), d2);
+ }
+
+ def rcheck(xs: Array[AnyRef ]): Unit = {
+ check(xs.length == 6, xs.length, 6);
+ check(xs(0) == r0, xs(0), r0);
+ check(xs(1) == r1, xs(1), r1);
+ check(xs(2) == r2, xs(2), r2);
+ check(xs(3) == r3, xs(3), r3);
+ check(xs(4) == r4, xs(4), r4);
+ check(xs(5) == r5, xs(5), r5);
+ }
+
+ def ocheck(xs: Array[Object ]): Unit = {
+ check(xs.length == 6, xs.length, 6);
+ check(xs(0) == o0, xs(0), o0);
+ check(xs(1) == o1, xs(1), o1);
+ check(xs(2) == o2, xs(2), o2);
+ check(xs(3) == o3, xs(3), o3);
+ check(xs(4) == o4, xs(4), o4);
+ check(xs(5) == o5, xs(5), o5);
+ }
+
+ def mcheck(xs: Array[Map ]): Unit = {
+ check(xs.length == 3, xs.length, 3);
+ check(xs(0) == m0, xs(0), m0);
+ check(xs(1) == m1, xs(1), m1);
+ check(xs(2) == m2, xs(2), m2);
+ }
+
+ def ncheck(xs: Array[Strings]) {
+ check(xs.length == 3, xs.length, 3)
+ check(xs(0) == n0, xs(0), n0)
+ check(xs(1) == n1, xs(1), n1)
+ check(xs(2) == n2, xs(2), n2)
+ }
+
+ //##########################################################################
+ // Miscellaneous checks
+
+ def checkZip {
+ val zipped = Array("a", "b", "c").zip(Array(1, 2))
+ val expected = Array(("a",1), ("b",2))
+ check(zipped sameElements expected, zipped.toList, expected.toList)
+ }
+
+ def checkConcat { // ticket #713
+ val x1 = Array.concat(Array(1, 2), Array(3, 4))
+ val y1 = Array(1, 2, 3, 4)
+ check(x1 sameElements y1, x1.toList, y1.toList)
+ }
+
+ //##########################################################################
+ // Arrays
+
+ val uarray: Array[Unit ] = Array(u0, u1);
+ val zarray: Array[Boolean] = Array(z0, z1);
+ val barray: Array[Byte ] = Array(b0, b1, b2);
+ val sarray: Array[Short ] = Array(s0, s1, s2);
+ val carray: Array[Char ] = Array(c0, c1, c2);
+ val iarray: Array[Int ] = Array(i0, i1, i2);
+ val larray: Array[Long ] = Array(l0, l1, l2);
+ val farray: Array[Float ] = Array(f0, f1, f2);
+ val darray: Array[Double ] = Array(d0, d1, d2);
+ val rarray: Array[AnyRef ] = Array(r0, r1, r2, r4, r4, r5);
+ val oarray: Array[Object ] = Array(o0, o1, o2, o4, o4, o5);
+ val marray: Array[Map ] = Array(m0, m1, m2);
+ val narray: Array[Strings] = Array(n0, n1, n2);
+
+ //##########################################################################
+ // Main
+
+ def main(args: Array[String]): Unit = {
+
+ //######################################################################
+
+ ucheck(uarray);
+ zcheck(zarray);
+ bcheck(barray);
+ scheck(sarray);
+ ccheck(carray);
+ icheck(iarray);
+ lcheck(larray);
+ fcheck(farray);
+ dcheck(darray);
+ rcheck(rarray);
+ ocheck(oarray);
+ mcheck(marray);
+ ncheck(narray);
+
+ //######################################################################
+
+ ucheck(id_Ta_T(uarray));
+ zcheck(id_Ta_T(zarray));
+ bcheck(id_Ta_T(barray));
+ scheck(id_Ta_T(sarray));
+ ccheck(id_Ta_T(carray));
+ icheck(id_Ta_T(iarray));
+ lcheck(id_Ta_T(larray));
+ fcheck(id_Ta_T(farray));
+ dcheck(id_Ta_T(darray));
+ rcheck(id_Ta_T(rarray));
+ ocheck(id_Ta_T(oarray));
+ mcheck(id_Ta_T(marray));
+ ncheck(id_Ta_T(narray));
+
+ ucheck(id_Tr_T(uarray));
+ zcheck(id_Tr_T(zarray));
+ bcheck(id_Tr_T(barray));
+ scheck(id_Tr_T(sarray));
+ ccheck(id_Tr_T(carray));
+ icheck(id_Tr_T(iarray));
+ lcheck(id_Tr_T(larray));
+ fcheck(id_Tr_T(farray));
+ dcheck(id_Tr_T(darray));
+ rcheck(id_Tr_T(rarray));
+ ocheck(id_Tr_T(oarray));
+ mcheck(id_Tr_T(marray));
+ ncheck(id_Tr_T(narray));
+
+ ucheck(id_To_T(uarray));
+ zcheck(id_To_T(zarray));
+ bcheck(id_To_T(barray));
+ scheck(id_To_T(sarray));
+ ccheck(id_To_T(carray));
+ icheck(id_To_T(iarray));
+ lcheck(id_To_T(larray));
+ fcheck(id_To_T(farray));
+ dcheck(id_To_T(darray));
+ rcheck(id_To_T(rarray));
+ ocheck(id_To_T(oarray));
+ mcheck(id_To_T(marray));
+ ncheck(id_To_T(narray));
+
+ ucheck(id_Ta_a(uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_Ta_a(zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_Ta_a(barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_Ta_a(sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_Ta_a(carray).asInstanceOf[Array[Char ]]);
+ icheck(id_Ta_a(iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_Ta_a(larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_Ta_a(farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_Ta_a(darray).asInstanceOf[Array[Double ]]);
+ rcheck(id_Ta_a(rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_Ta_a(oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_Ta_a(marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_Ta_a(narray).asInstanceOf[Array[Strings]]);
+
+ ucheck(id_Tr_a(uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_Tr_a(zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_Tr_a(barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_Tr_a(sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_Tr_a(carray).asInstanceOf[Array[Char ]]);
+ icheck(id_Tr_a(iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_Tr_a(larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_Tr_a(farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_Tr_a(darray).asInstanceOf[Array[Double ]]);
+ rcheck(id_Tr_a(rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_Tr_a(oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_Tr_a(marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_Tr_a(narray).asInstanceOf[Array[Strings]]);
+
+ ucheck(id_To_a(uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_To_a(zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_To_a(barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_To_a(sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_To_a(carray).asInstanceOf[Array[Char ]]);
+ icheck(id_To_a(iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_To_a(larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_To_a(farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_To_a(darray).asInstanceOf[Array[Double ]]);
+ rcheck(id_To_a(rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_To_a(oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_To_a(marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_To_a(narray).asInstanceOf[Array[Strings]]);
+
+ ucheck(id_Tr_r(uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_Tr_r(zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_Tr_r(barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_Tr_r(sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_Tr_r(carray).asInstanceOf[Array[Char ]]);
+ icheck(id_Tr_r(iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_Tr_r(larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_Tr_r(farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_Tr_r(darray).asInstanceOf[Array[Double ]]);
+ rcheck(id_Tr_r(rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_Tr_r(oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_Tr_r(marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_Tr_r(narray).asInstanceOf[Array[Strings]]);
+
+ ucheck(id_To_r(uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_To_r(zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_To_r(barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_To_r(sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_To_r(carray).asInstanceOf[Array[Char ]]);
+ icheck(id_To_r(iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_To_r(larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_To_r(farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_To_r(darray).asInstanceOf[Array[Double ]]);
+ rcheck(id_To_r(rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_To_r(oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_To_r(marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_To_r(narray).asInstanceOf[Array[Strings]]);
+
+ ucheck(id_To_o(uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_To_o(zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_To_o(barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_To_o(sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_To_o(carray).asInstanceOf[Array[Char ]]);
+ icheck(id_To_o(iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_To_o(larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_To_o(farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_To_o(darray).asInstanceOf[Array[Double ]]);
+ rcheck(id_To_o(rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_To_o(oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_To_o(marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_To_o(narray).asInstanceOf[Array[Strings]]);
+
+ //######################################################################
+
+ ucheck(id_TSa_T [Unit , Array[Unit ]](uarray));
+ zcheck(id_TSa_T [Boolean, Array[Boolean]](zarray));
+ bcheck(id_TSa_T [Byte , Array[Byte ]](barray));
+ scheck(id_TSa_T [Short , Array[Short ]](sarray));
+ ccheck(id_TSa_T [Char , Array[Char ]](carray));
+ icheck(id_TSa_T [Int , Array[Int ]](iarray));
+ lcheck(id_TSa_T [Long , Array[Long ]](larray));
+ fcheck(id_TSa_T [Float , Array[Float ]](farray));
+ dcheck(id_TSa_T [Double , Array[Double ]](darray));
+ rcheck(id_TSa_T [AnyRef , Array[AnyRef ]](rarray));
+ ocheck(id_TSa_T [Object , Array[Object ]](oarray));
+ mcheck(id_TSa_T [Map , Array[Map ]](marray));
+ ncheck(id_TSa_T [Strings, Array[Strings]](narray));
+
+ ucheck(id_TSv_T [Unit , Array[Unit ]](uarray));
+ zcheck(id_TSv_T [Boolean, Array[Boolean]](zarray));
+ bcheck(id_TSv_T [Byte , Array[Byte ]](barray));
+ scheck(id_TSv_T [Short , Array[Short ]](sarray));
+ ccheck(id_TSv_T [Char , Array[Char ]](carray));
+ icheck(id_TSv_T [Int , Array[Int ]](iarray));
+ lcheck(id_TSv_T [Long , Array[Long ]](larray));
+ fcheck(id_TSv_T [Float , Array[Float ]](farray));
+ dcheck(id_TSv_T [Double , Array[Double ]](darray));
+
+ rcheck(id_TSr_T [AnyRef , Array[AnyRef ]](rarray));
+ ocheck(id_TSr_T [Object , Array[Object ]](oarray));
+ mcheck(id_TSr_T [Map , Array[Map ]](marray));
+ ncheck(id_TSr_T [Strings, Array[Strings]](narray));
+
+ rcheck(id_TSo_T [AnyRef , Array[AnyRef ]](rarray));
+ ocheck(id_TSo_T [Object , Array[Object ]](oarray));
+ mcheck(id_TSo_T [Map , Array[Map ]](marray));
+ ncheck(id_TSo_T [Strings, Array[Strings]](narray));
+
+ mcheck(id_TSm_T [Map , Array[Map ]](marray));
+
+ ncheck(id_TSn_T [Strings, Array[Strings]](narray));
+
+ //######################################################################
+
+ ucheck(id_TSa_Ss[Unit , Array[Unit ]](uarray));
+ zcheck(id_TSa_Ss[Boolean, Array[Boolean]](zarray));
+ bcheck(id_TSa_Ss[Byte , Array[Byte ]](barray));
+ scheck(id_TSa_Ss[Short , Array[Short ]](sarray));
+ ccheck(id_TSa_Ss[Char , Array[Char ]](carray));
+ icheck(id_TSa_Ss[Int , Array[Int ]](iarray));
+ lcheck(id_TSa_Ss[Long , Array[Long ]](larray));
+ fcheck(id_TSa_Ss[Float , Array[Float ]](farray));
+ dcheck(id_TSa_Ss[Double , Array[Double ]](darray));
+ rcheck(id_TSa_Ss[AnyRef , Array[AnyRef ]](rarray));
+ ocheck(id_TSa_Ss[Object , Array[Object ]](oarray));
+ mcheck(id_TSa_Ss[Map , Array[Map ]](marray));
+ ncheck(id_TSa_Ss[Strings, Array[Strings]](narray));
+
+ ucheck(id_TSv_Ss[Unit , Array[Unit ]](uarray));
+ zcheck(id_TSv_Ss[Boolean, Array[Boolean]](zarray));
+ bcheck(id_TSv_Ss[Byte , Array[Byte ]](barray));
+ scheck(id_TSv_Ss[Short , Array[Short ]](sarray));
+ ccheck(id_TSv_Ss[Char , Array[Char ]](carray));
+ icheck(id_TSv_Ss[Int , Array[Int ]](iarray));
+ lcheck(id_TSv_Ss[Long , Array[Long ]](larray));
+ fcheck(id_TSv_Ss[Float , Array[Float ]](farray));
+ dcheck(id_TSv_Ss[Double , Array[Double ]](darray));
+
+ rcheck(id_TSr_Ss[AnyRef , Array[AnyRef ]](rarray));
+ ocheck(id_TSr_Ss[Object , Array[Object ]](oarray));
+ mcheck(id_TSr_Ss[Map , Array[Map ]](marray));
+ ncheck(id_TSr_Ss[Strings, Array[Strings]](narray));
+
+ rcheck(id_TSo_Ss[AnyRef , Array[AnyRef ]](rarray));
+ ocheck(id_TSo_Ss[Object , Array[Object ]](oarray));
+ mcheck(id_TSo_Ss[Map , Array[Map ]](marray));
+ ncheck(id_TSo_Ss[Strings, Array[Strings]](narray));
+
+ mcheck(id_TSm_Ss[Map , Array[Map ]](marray));
+
+ ncheck(id_TSn_Ss[Strings, Array[Strings]](narray));
+
+ //######################################################################
+
+ ucheck(id_TSa_a [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_TSa_a [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_TSa_a [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_TSa_a [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_TSa_a [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]);
+ icheck(id_TSa_a [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_TSa_a [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_TSa_a [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_TSa_a [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]);
+ rcheck(id_TSa_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSa_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSa_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSa_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ ucheck(id_TSv_a [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_TSv_a [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_TSv_a [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_TSv_a [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_TSv_a [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]);
+ icheck(id_TSv_a [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_TSv_a [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_TSv_a [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_TSv_a [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]);
+
+ rcheck(id_TSr_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSr_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSr_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSr_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ rcheck(id_TSo_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSo_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSo_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSo_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ mcheck(id_TSm_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+
+ ncheck(id_TSn_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ //######################################################################
+
+ ucheck(id_TSa_r [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_TSa_r [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_TSa_r [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_TSa_r [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_TSa_r [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]);
+ icheck(id_TSa_r [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_TSa_r [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_TSa_r [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_TSa_r [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]);
+ rcheck(id_TSa_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSa_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSa_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSa_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ ucheck(id_TSv_r [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_TSv_r [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_TSv_r [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_TSv_r [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_TSv_r [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]);
+ icheck(id_TSv_r [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_TSv_r [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_TSv_r [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_TSv_r [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]);
+
+ rcheck(id_TSr_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSr_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSr_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSr_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ rcheck(id_TSo_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSo_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSo_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSo_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ mcheck(id_TSm_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+
+ ncheck(id_TSn_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ //######################################################################
+
+ ucheck(id_TSa_o [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_TSa_o [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_TSa_o [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_TSa_o [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_TSa_o [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]);
+ icheck(id_TSa_o [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_TSa_o [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_TSa_o [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_TSa_o [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]);
+ rcheck(id_TSa_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSa_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSa_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSa_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ ucheck(id_TSv_o [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_TSv_o [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_TSv_o [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_TSv_o [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_TSv_o [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]);
+ icheck(id_TSv_o [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_TSv_o [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_TSv_o [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_TSv_o [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]);
+
+ rcheck(id_TSr_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSr_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSr_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSr_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ rcheck(id_TSo_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSo_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSo_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSo_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ mcheck(id_TSm_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+
+ ncheck(id_TSn_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ //######################################################################
+
+ ucheck(id_Sas_Ss[Unit ](uarray));
+ zcheck(id_Sas_Ss[Boolean](zarray));
+ bcheck(id_Sas_Ss[Byte ](barray));
+ scheck(id_Sas_Ss[Short ](sarray));
+ ccheck(id_Sas_Ss[Char ](carray));
+ icheck(id_Sas_Ss[Int ](iarray));
+ lcheck(id_Sas_Ss[Long ](larray));
+ fcheck(id_Sas_Ss[Float ](farray));
+ dcheck(id_Sas_Ss[Double ](darray));
+ rcheck(id_Sas_Ss[AnyRef ](rarray));
+ ocheck(id_Sas_Ss[Object ](oarray));
+ mcheck(id_Sas_Ss[Map ](marray));
+ ncheck(id_Sas_Ss[Strings](narray));
+
+ ucheck(id_Svs_Ss[Unit ](uarray));
+ zcheck(id_Svs_Ss[Boolean](zarray));
+ bcheck(id_Svs_Ss[Byte ](barray));
+ scheck(id_Svs_Ss[Short ](sarray));
+ ccheck(id_Svs_Ss[Char ](carray));
+ icheck(id_Svs_Ss[Int ](iarray));
+ lcheck(id_Svs_Ss[Long ](larray));
+ fcheck(id_Svs_Ss[Float ](farray));
+ dcheck(id_Svs_Ss[Double ](darray));
+
+ rcheck(id_Srs_Ss[AnyRef ](rarray));
+ ocheck(id_Srs_Ss[Object ](oarray));
+ mcheck(id_Srs_Ss[Map ](marray));
+ ncheck(id_Srs_Ss[Strings](narray));
+
+ rcheck(id_Sos_Ss[AnyRef ](rarray));
+ ocheck(id_Sos_Ss[Object ](oarray));
+ mcheck(id_Sos_Ss[Map ](marray));
+ ncheck(id_Sos_Ss[Strings](narray));
+
+ mcheck(id_Sms_Ss[Map ](marray));
+
+ ncheck(id_Sns_Ss[Strings](narray));
+
+ //######################################################################
+
+ ucheck(id_TSa_a [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_TSa_a [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_TSa_a [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_TSa_a [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_TSa_a [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]);
+ icheck(id_TSa_a [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_TSa_a [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_TSa_a [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_TSa_a [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]);
+ rcheck(id_TSa_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSa_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSa_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSa_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ ucheck(id_TSv_a [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_TSv_a [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_TSv_a [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_TSv_a [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_TSv_a [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]);
+ icheck(id_TSv_a [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_TSv_a [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_TSv_a [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_TSv_a [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]);
+
+ rcheck(id_TSr_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSr_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSr_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSr_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ rcheck(id_TSo_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSo_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSo_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSo_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ mcheck(id_TSm_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+
+ ncheck(id_TSn_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ //######################################################################
+
+ ucheck(id_TSa_r [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_TSa_r [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_TSa_r [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_TSa_r [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_TSa_r [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]);
+ icheck(id_TSa_r [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_TSa_r [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_TSa_r [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_TSa_r [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]);
+ rcheck(id_TSa_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSa_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSa_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSa_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ ucheck(id_TSv_r [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_TSv_r [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_TSv_r [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_TSv_r [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_TSv_r [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]);
+ icheck(id_TSv_r [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_TSv_r [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_TSv_r [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_TSv_r [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]);
+
+ rcheck(id_TSr_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSr_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSr_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSr_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ rcheck(id_TSo_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSo_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSo_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSo_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ mcheck(id_TSm_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+
+ ncheck(id_TSn_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ //######################################################################
+
+ ucheck(id_TSa_o [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_TSa_o [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_TSa_o [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_TSa_o [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_TSa_o [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]);
+ icheck(id_TSa_o [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_TSa_o [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_TSa_o [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_TSa_o [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]);
+ rcheck(id_TSa_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSa_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSa_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSa_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ ucheck(id_TSv_o [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]);
+ zcheck(id_TSv_o [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]);
+ bcheck(id_TSv_o [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]);
+ scheck(id_TSv_o [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]);
+ ccheck(id_TSv_o [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]);
+ icheck(id_TSv_o [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]);
+ lcheck(id_TSv_o [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]);
+ fcheck(id_TSv_o [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]);
+ dcheck(id_TSv_o [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]);
+
+ rcheck(id_TSr_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSr_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSr_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSr_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ rcheck(id_TSo_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]);
+ ocheck(id_TSo_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]);
+ mcheck(id_TSo_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+ ncheck(id_TSo_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ mcheck(id_TSm_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]);
+
+ ncheck(id_TSn_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]);
+
+ //######################################################################
+
+ check_Ta(uarray, 2, u0, ucheck)
+ check_Ta(zarray, 2, z0, zcheck)
+ check_Ta(barray, 3, b0, bcheck)
+ check_Ta(sarray, 3, s0, scheck)
+ check_Ta(carray, 3, c0, ccheck)
+ check_Ta(iarray, 3, i0, icheck)
+ check_Ta(larray, 3, l0, lcheck)
+ check_Ta(farray, 3, f0, fcheck)
+ check_Ta(darray, 3, d0, dcheck)
+ check_Ta(rarray, 6, r0, rcheck)
+ check_Ta(oarray, 6, o0, ocheck)
+ check_Ta(marray, 3, m0, mcheck)
+ check_Ta(narray, 3, n0, ncheck)
+
+ check_Tv(uarray, 2, u0, ucheck)
+ check_Tv(zarray, 2, z0, zcheck)
+ check_Tv(barray, 3, b0, bcheck)
+ check_Tv(sarray, 3, s0, scheck)
+ check_Tv(carray, 3, c0, ccheck)
+ check_Tv(iarray, 3, i0, icheck)
+ check_Tv(larray, 3, l0, lcheck)
+ check_Tv(farray, 3, f0, fcheck)
+ check_Tv(darray, 3, d0, dcheck)
+
+ check_Tr(rarray, 6, r0, rcheck)
+ check_Tr(oarray, 6, o0, ocheck)
+ check_Tr(marray, 3, m0, mcheck)
+ check_Tr(narray, 3, n0, ncheck)
+
+ check_To(rarray, 6, r0, rcheck)
+ check_To(oarray, 6, o0, ocheck)
+ check_To(marray, 3, m0, mcheck)
+ check_To(narray, 3, n0, ncheck)
+
+ check_Tm(marray, 3, m0, mcheck)
+
+ check_Tn(narray, 3, n0, ncheck)
+
+ //######################################################################
+
+ checkZip
+ checkConcat
+ checkT2368()
+
+ //######################################################################
+
+ println("checks: " + checks)
+
+ //######################################################################
+ }
+
+ //##########################################################################
+}
+
diff --git a/test/files/run/interpolation.check b/test/files/run/interpolation.check
index 09579a800a..997abb4497 100644
--- a/test/files/run/interpolation.check
+++ b/test/files/run/interpolation.check
@@ -24,3 +24,9 @@ Best price: 13.345
Best price: 13.35
13.345% discount included
13.35% discount included
+
+0
+00
+
+0
+00
diff --git a/test/files/run/interpolation.scala b/test/files/run/interpolation.scala
index a0a185eaab..f443bd5feb 100644
--- a/test/files/run/interpolation.scala
+++ b/test/files/run/interpolation.scala
@@ -23,4 +23,10 @@ object Test extends App {
test2(10.0f)
test2(13.345f)
+ println(s"")
+ println(s"${0}")
+ println(s"${0}${0}")
+ println(f"")
+ println(f"${0}")
+ println(f"${0}${0}")
}
diff --git a/test/files/run/interpolationMultiline2.check b/test/files/run/interpolationMultiline2.check
index 7584aee9f7..2218c93a99 100644
--- a/test/files/run/interpolationMultiline2.check
+++ b/test/files/run/interpolationMultiline2.check
@@ -1,26 +1,26 @@
Bob is 1 years old!
-java.lang.StringIndexOutOfBoundsException: String index out of range: 0
Bob is 1 years old!
-java.lang.StringIndexOutOfBoundsException: String index out of range: 0
+Bob is 1 years old!
+Bob is 1 years old!
Bob is 1 years old!
Bob is 1%2d years old!
Bob is 1 years old!
Bob is 1%2d years old!
===============
Bob is 12 years old!
-java.lang.StringIndexOutOfBoundsException: String index out of range: 0
Bob is 12 years old!
-java.lang.StringIndexOutOfBoundsException: String index out of range: 0
+Bob is 12 years old!
+Bob is 12 years old!
Bob is 12 years old!
Bob is 12%2d years old!
Bob is 12 years old!
Bob is 12%2d years old!
===============
Bob is 123 years old!
-java.lang.StringIndexOutOfBoundsException: String index out of range: 0
Bob is 123 years old!
-java.lang.StringIndexOutOfBoundsException: String index out of range: 0
+Bob is 123 years old!
+Bob is 123 years old!
Bob is 123 years old!
Bob is 123%2d years old!
Bob is 123 years old!
-Bob is 123%2d years old! \ No newline at end of file
+Bob is 123%2d years old!
diff --git a/test/files/run/lub-visibility.check b/test/files/run/lub-visibility.check
new file mode 100644
index 0000000000..3461d1bf6b
--- /dev/null
+++ b/test/files/run/lub-visibility.check
@@ -0,0 +1,14 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> // should infer List[scala.collection.immutable.Seq[Nothing]]
+
+scala> // but reverted that for SI-5534.
+
+scala> val x = List(List(), Vector())
+x: List[scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]{def companion: scala.collection.generic.GenericCompanion[scala.collection.immutable.Seq with scala.collection.AbstractSeq{def dropRight(n: Int): scala.collection.immutable.Seq[Any] with scala.collection.AbstractSeq[Any]; def takeRight(n: Int): scala.collection.immutable.Seq[Any] with scala.collection.AbstractSeq[Any]; def drop(n: Int): scala.collection.immutable.Seq[Any] with scala.collection.AbstractSeq[Any]; def take(n: Int): scala.collection.immutable.Seq[Any] with scala.collection.AbstractSeq[Any]; def slice(from: Int,until: Int): scala.collection.immutable.Seq[Any] with scala.collection.AbstractSeq[Any]}]; def dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.Ab...
+scala>
+
+scala>
diff --git a/test/files/run/lub-visibility.scala b/test/files/run/lub-visibility.scala
new file mode 100644
index 0000000000..8d5d3ae11a
--- /dev/null
+++ b/test/files/run/lub-visibility.scala
@@ -0,0 +1,8 @@
+import scala.tools.partest.ReplTest
+object Test extends ReplTest {
+ def code = """
+ |// should infer List[scala.collection.immutable.Seq[Nothing]]
+ |// but reverted that for SI-5534.
+ |val x = List(List(), Vector())
+ """.stripMargin
+}
diff --git a/test/files/run/t2296a.check b/test/files/run/t2296a.check
new file mode 100644
index 0000000000..f75aec9d81
--- /dev/null
+++ b/test/files/run/t2296a.check
@@ -0,0 +1,2 @@
+J.foo()
+J.foo()
diff --git a/test/files/run/t2296a/J.java b/test/files/run/t2296a/J.java
new file mode 100644
index 0000000000..78ff3e9804
--- /dev/null
+++ b/test/files/run/t2296a/J.java
@@ -0,0 +1,7 @@
+package j;
+
+public class J {
+ protected void foo() {
+ System.out.println("J.foo()");
+ }
+} \ No newline at end of file
diff --git a/test/files/run/t2296a/S.scala b/test/files/run/t2296a/S.scala
new file mode 100644
index 0000000000..532d038a42
--- /dev/null
+++ b/test/files/run/t2296a/S.scala
@@ -0,0 +1,18 @@
+package s {
+ import j.J
+
+ trait S extends J {
+ def bar() {
+ foo()
+ }
+ }
+
+ class SC extends J with S
+}
+
+object Test {
+ def main(args : Array[String]) {
+ (new s.SC).bar()
+ (new s.S { }).bar()
+ }
+} \ No newline at end of file
diff --git a/test/files/run/t2296b.check b/test/files/run/t2296b.check
new file mode 100644
index 0000000000..f75aec9d81
--- /dev/null
+++ b/test/files/run/t2296b.check
@@ -0,0 +1,2 @@
+J.foo()
+J.foo()
diff --git a/test/files/run/t2296b/J_1.java b/test/files/run/t2296b/J_1.java
new file mode 100644
index 0000000000..4c91d47073
--- /dev/null
+++ b/test/files/run/t2296b/J_1.java
@@ -0,0 +1,7 @@
+package j;
+
+public class J_1 {
+ protected void foo() {
+ System.out.println("J.foo()");
+ }
+} \ No newline at end of file
diff --git a/test/files/run/t2296b/S_2.scala b/test/files/run/t2296b/S_2.scala
new file mode 100644
index 0000000000..6cdb0cfaba
--- /dev/null
+++ b/test/files/run/t2296b/S_2.scala
@@ -0,0 +1,18 @@
+package s {
+ import j.J_1
+
+ trait S extends J_1 {
+ def bar() {
+ foo()
+ }
+ }
+
+ class SC extends J_1 with S
+}
+
+object Test {
+ def main(args : Array[String]) {
+ (new s.SC).bar()
+ (new s.S { }).bar()
+ }
+}
diff --git a/test/files/run/si4147.scala b/test/files/run/t4147.scala
index c1e2d746a9..c1e2d746a9 100644
--- a/test/files/run/si4147.scala
+++ b/test/files/run/t4147.scala
diff --git a/test/files/run/t4777.check b/test/files/run/t4777.check
new file mode 100644
index 0000000000..11f1f59d43
--- /dev/null
+++ b/test/files/run/t4777.check
@@ -0,0 +1,2 @@
+28
+28
diff --git a/test/files/run/t4777.scala b/test/files/run/t4777.scala
new file mode 100644
index 0000000000..4a811d3b9a
--- /dev/null
+++ b/test/files/run/t4777.scala
@@ -0,0 +1,8 @@
+class A(val a: Int = 13)
+class DefaultsTest(x: Int = 25) extends A(28)
+object DefaultsTest extends DefaultsTest(12)
+
+object Test extends App {
+ println(new DefaultsTest() a)
+ println(DefaultsTest a)
+}
diff --git a/test/files/run/si5171.check b/test/files/run/t5171.check
index 159606d35c..159606d35c 100644
--- a/test/files/run/si5171.check
+++ b/test/files/run/t5171.check
diff --git a/test/files/run/si5171.scala b/test/files/run/t5171.scala
index eb8029df80..eb8029df80 100644
--- a/test/files/run/si5171.scala
+++ b/test/files/run/t5171.scala
diff --git a/test/files/run/si5262.check b/test/files/run/t5262.check
index 4c7a875de5..4c7a875de5 100644
--- a/test/files/run/si5262.check
+++ b/test/files/run/t5262.check
diff --git a/test/files/run/si5262.scala b/test/files/run/t5262.scala
index fc4e57aa96..fc4e57aa96 100644
--- a/test/files/run/si5262.scala
+++ b/test/files/run/t5262.scala
diff --git a/test/files/run/si5374.check b/test/files/run/t5374.check
index 6be88d77ec..6be88d77ec 100644
--- a/test/files/run/si5374.check
+++ b/test/files/run/t5374.check
diff --git a/test/files/run/si5374.scala b/test/files/run/t5374.scala
index 9b1671e795..9b1671e795 100644
--- a/test/files/run/si5374.scala
+++ b/test/files/run/t5374.scala
diff --git a/test/files/run/si5375.check b/test/files/run/t5375.check
index 7d3002ffda..7d3002ffda 100644
--- a/test/files/run/si5375.check
+++ b/test/files/run/t5375.check
diff --git a/test/files/run/si5375.scala b/test/files/run/t5375.scala
index e4b329deae..e4b329deae 100644
--- a/test/files/run/si5375.scala
+++ b/test/files/run/t5375.scala
diff --git a/test/files/run/si5380.scala b/test/files/run/t5380.scala
index 6083161a9b..6083161a9b 100644
--- a/test/files/run/si5380.scala
+++ b/test/files/run/t5380.scala
diff --git a/test/files/run/t5527.check b/test/files/run/t5527.check
index bdd5ac8295..4a8a9ce602 100644
--- a/test/files/run/t5527.check
+++ b/test/files/run/t5527.check
@@ -1,11 +1,12 @@
[[syntax trees at end of parser]]// Scala source: newSource1
package <empty> {
- abstract trait Test extends scala.ScalaObject {
- def $init$() = {
+ object UselessComments extends scala.ScalaObject {
+ def <init>() = {
+ super.<init>();
()
};
- def sth: scala.Unit = {
- /** Some comment here */
+ var z = 0;
+ def test1 = {
object Maybe extends scala.ScalaObject {
def <init>() = {
super.<init>();
@@ -15,6 +16,83 @@ package <empty> {
def nothing() = ()
};
()
+ };
+ def test2 = {
+ var x = 4;
+ if (true)
+ {
+ x = 5;
+ val y = 6;
+ ()
+ }
+ else
+ ()
+ };
+ def test3 = {
+ if (true)
+ z = 3
+ else
+ ();
+ val t = 4;
+ 0.to(4).foreach(((i) => println(i)))
+ };
+ val test4 = 'a' match {
+ case ('0'| '1'| '2'| '3'| '4'| '5'| '6'| '7'| '8'| '9') => true
+ case _ => false
+ }
+ };
+ /** comments that we should keep */
+ object UsefulComments extends scala.ScalaObject {
+ def <init>() = {
+ super.<init>();
+ ()
+ };
+ /** class A */
+ class A extends scala.ScalaObject {
+ def <init>() = {
+ super.<init>();
+ ()
+ };
+ /** f */
+ def f(i: Int) = i;
+ /** v */
+ val v = 1;
+ /** u */
+ var u = 2
+ };
+ /** trait B */
+ abstract trait B extends scala.ScalaObject {
+ def $init$() = {
+ ()
+ };
+ /** T */
+ type T >: _root_.scala.Nothing <: _root_.scala.Any;
+ /** f */
+ def f(i: Int): scala.Unit;
+ /** v */
+ val v = 1;
+ /** u */
+ var u = 2
+ };
+ /** object C */
+ object C extends scala.ScalaObject {
+ def <init>() = {
+ super.<init>();
+ ()
+ };
+ /** f */
+ def f(i: Int) = i;
+ /** v */
+ val v = 1;
+ /** u */
+ var u = 2
+ };
+ /** class D */
+ @new deprecated("use ... instead", "2.10.0") class D extends scala.ScalaObject {
+ def <init>() = {
+ super.<init>();
+ ()
+ }
}
}
}
diff --git a/test/files/run/t5527.scala b/test/files/run/t5527.scala
index 8280ee06ba..2449ff60c3 100644
--- a/test/files/run/t5527.scala
+++ b/test/files/run/t5527.scala
@@ -11,14 +11,80 @@ object Test extends DirectTest {
override def code = """
// SI-5527
- trait Test {
- def sth {
+ object UselessComments {
+
+ var z = 0
+
+ def test1 = {
/** Some comment here */
object Maybe {
/** Some comment inside */
def nothing() = ()
}
}
+
+ def test2 = {
+ var x = 4
+ if (true) {
+ /** Testing 123 */
+ x = 5
+ val y = 6
+ }
+ }
+
+ def test3 = {
+ if (true)
+ z = 3
+
+ /** Calculate this result. */
+ val t = 4
+ for (i <- 0 to 4)
+ println(i)
+ }
+
+ val test4 = ('a') match {
+ /** Another digit is a giveaway. */
+ case '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' =>
+ true
+ case _ =>
+ false
+ }
+ }
+
+ /** comments that we should keep */
+ object UsefulComments {
+ /** class A */
+ class A {
+ /** f */
+ def f(i: Int) = i
+ /** v */
+ val v = 1
+ /** u */
+ var u = 2
+ }
+ /** trait B */
+ trait B {
+ /** T */
+ type T
+ /** f */
+ def f(i: Int)
+ /** v */
+ val v = 1
+ /** u */
+ var u = 2
+ }
+ /** object C */
+ object C {
+ /** f */
+ def f(i: Int) = i
+ /** v */
+ val v = 1
+ /** u */
+ var u = 2
+ }
+ /** class D */
+ @deprecated("use ... instead", "2.10.0")
+ class D
}
""".trim
diff --git a/test/pending/run/t3702.scala b/test/pending/run/t3702.scala
new file mode 100644
index 0000000000..e08fc12e76
--- /dev/null
+++ b/test/pending/run/t3702.scala
@@ -0,0 +1,10 @@
+object Test {
+ def main(args: Array[String]) {
+ foo(Nil, Nil)
+ }
+
+ def foo(h: Any, t: List[Any]) = h match {
+ case 5 :: _ => ()
+ case List(from) => List(from, from, from)
+ }
+}
diff --git a/test/pending/run/t3705.scala b/test/pending/run/t3705.scala
new file mode 100644
index 0000000000..fcc020f28c
--- /dev/null
+++ b/test/pending/run/t3705.scala
@@ -0,0 +1,17 @@
+// package foo
+
+import scala.xml._
+object Test {
+ def updateNodes(ns: Seq[Node]): Seq[Node] =
+ for(subnode <- ns) yield subnode match {
+ case <d>{_}</d> if true => <d>abc</d>
+ case Elem(prefix, label, attribs, scope, children @ _*) =>
+ Elem(prefix, label, attribs, scope, updateNodes(children) : _*)
+ case other => other
+ }
+ def main(args: Array[String]): Unit = {
+ updateNodes(<b />)
+
+ }
+}
+
diff --git a/test/pending/run/t3832.scala b/test/pending/run/t3832.scala
new file mode 100644
index 0000000000..f081d5b3af
--- /dev/null
+++ b/test/pending/run/t3832.scala
@@ -0,0 +1,7 @@
+class Test {
+ def this(un: Int) = {
+ this()
+ def test(xs: List[Int]) = xs map (x => x)
+ ()
+ }
+} \ No newline at end of file
diff --git a/test/pending/run/t4098.scala b/test/pending/run/t4098.scala
new file mode 100644
index 0000000000..b74ccf9bff
--- /dev/null
+++ b/test/pending/run/t4098.scala
@@ -0,0 +1,9 @@
+class A(a: Any) {
+ def this() = { this(b) ; def b = new {} }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ new A ("")
+ }
+}
diff --git a/test/pending/run/t4415.scala b/test/pending/run/t4415.scala
new file mode 100644
index 0000000000..f96031d650
--- /dev/null
+++ b/test/pending/run/t4415.scala
@@ -0,0 +1,86 @@
+/**
+ * Demonstration of issue with Extractors. If lines 15/16 are not present, get at runtime:
+ *
+ * Exception in thread "main" java.lang.VerifyError: (class: ExtractorIssue$$, method: convert signature: (LTopProperty;)LMyProp;) Accessing value from uninitialized register 5
+ * at ExtractorIssue.main(ExtractorIssue.scala)
+ * at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)]
+ *
+ * If lines 15/16 are present, the compiler crashes:
+ *
+ * fatal error (server aborted): not enough arguments for method body%3: (val p: MyProp[java.lang.String])MyProp[_33].
+ * Unspecified value parameter p.
+ */
+object Test {
+
+ def main(args: Array[String]) {
+ convert(new SubclassProperty)
+ }
+
+ def convert(prop: TopProperty): MyProp[_] = {
+ prop match {
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ //case SubclassSecondMatch(p) => p // if these lines are present, the compiler crashes. If commented, unsafe byte
+ //case SecondMatch(p) => p // byte code is generated, which causes a java.lang.VerifyError at runtime
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ case SubclassMatch(p) => p
+ case StandardMatch(p) => p
+ }
+ }
+}
+
+class TopProperty
+
+class StandardProperty extends TopProperty
+class SubclassProperty extends StandardProperty
+
+class SecondProperty extends TopProperty
+class SubclassSecondProperty extends StandardProperty
+
+trait MyProp[T]
+case class MyPropImpl[T] extends MyProp[T]
+
+object SubclassMatch {
+
+ def unapply(prop: SubclassProperty) : Option[MyProp[String]] = {
+ Some(new MyPropImpl)
+ }
+
+ def apply(prop: MyProp[String]) : SubclassProperty = {
+ new SubclassProperty()
+ }
+}
+
+object StandardMatch {
+
+ def unapply(prop: StandardProperty) : Option[MyProp[String]] = {
+ Some(new MyPropImpl)
+ }
+
+ def apply(prop: MyProp[String]) : StandardProperty = {
+ new StandardProperty()
+ }
+}
+
+object SubclassSecondMatch {
+
+ def unapply(prop: SubclassSecondProperty) : Option[MyProp[BigInt]] = {
+ Some(new MyPropImpl)
+ }
+
+ def apply(prop: MyProp[String]) : SubclassSecondProperty = {
+ new SubclassSecondProperty()
+ }
+}
+
+object SecondMatch {
+
+ def unapply(prop: SecondProperty) : Option[MyProp[BigInt]] = {
+ Some(new MyPropImpl)
+ }
+
+ def apply(prop: MyProp[String]) : SecondProperty = {
+ new SecondProperty()
+ }
+} \ No newline at end of file
diff --git a/test/pending/run/t4460.scala b/test/pending/run/t4460.scala
new file mode 100644
index 0000000000..324e2f5bef
--- /dev/null
+++ b/test/pending/run/t4460.scala
@@ -0,0 +1,12 @@
+trait A
+
+class B(val x: Int) {
+ self: A =>
+
+ def this() = this()
+}
+
+object Test extends B(2) with A {
+ def main(args: Array[String]) { }
+}
+