diff --git a/docs/SyntaxSummary.txt b/docs/SyntaxSummary.txt index 764275f92046..11f23da9455e 100644 --- a/docs/SyntaxSummary.txt +++ b/docs/SyntaxSummary.txt @@ -129,7 +129,7 @@ grammar. | `_' ExprInParens ::= PostfixExpr `:' Type | Expr - BlockResult ::= (FunParams | [`implicit'] id `:' InfixType) => Block + BlockResult ::= (FunParams | [`implicit'] id `:' InfixType) `=>' Block | Expr1 Expr1 ::= `if' `(' Expr `)' {nl} Expr [[semi] else Expr] If(Parens(cond), thenp, elsep?) | `if' Expr `then' Expr [[semi] else Expr] If(cond, thenp, elsep?) diff --git a/src/dotty/tools/dotc/ast/Desugar.scala b/src/dotty/tools/dotc/ast/Desugar.scala index 12f3e44068c1..87694843ad6a 100644 --- a/src/dotty/tools/dotc/ast/Desugar.scala +++ b/src/dotty/tools/dotc/ast/Desugar.scala @@ -403,7 +403,8 @@ object desugar { // implicit wrapper is typechecked in same scope as constructor, so // we can reuse the constructor parameters; no derived params are needed. DefDef(name.toTermName, constrTparams, constrVparamss, classTypeRef, creatorExpr) - .withFlags(Synthetic | Implicit) :: Nil + .withFlags(Synthetic | Implicit) + .withPos(cdef.pos) :: Nil val self1 = { @@ -801,7 +802,7 @@ object desugar { tree match { case SymbolLit(str) => Apply( - Select(ref(defn.SymbolClass.companionModule.termRef), nme.apply), + ref(defn.SymbolClass.companionModule.termRef), Literal(Constant(str)) :: Nil) case InterpolatedString(id, strs, elems) => Apply(Select(Apply(Ident(nme.StringContext), strs), id), elems) diff --git a/src/dotty/tools/dotc/ast/untpd.scala b/src/dotty/tools/dotc/ast/untpd.scala index 28a3cf1ff405..85052a4da950 100644 --- a/src/dotty/tools/dotc/ast/untpd.scala +++ b/src/dotty/tools/dotc/ast/untpd.scala @@ -234,12 +234,13 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo { * parameter, the reference will be a repeated argument. */ def refOfDef(tree: MemberDef)(implicit ctx: Context) = tree match { - case ValDef(_, PostfixOp(_, nme.raw.STAR), _) => - Typed(Ident(tree.name), Ident(tpnme.WILDCARD_STAR)) - case _ => - Ident(tree.name) + case ValDef(_, PostfixOp(_, nme.raw.STAR), _) => repeated(Ident(tree.name)) + case _ => Ident(tree.name) } + /** A repeated argument such as `arg: _*` */ + def repeated(arg: Tree)(implicit ctx: Context) = Typed(arg, Ident(tpnme.WILDCARD_STAR)) + // ------- Decorators ------------------------------------------------- implicit class UntypedTreeDecorator(val self: Tree) extends AnyVal { diff --git a/src/dotty/tools/dotc/config/Config.scala b/src/dotty/tools/dotc/config/Config.scala index 7e3615416b85..cf43d277ea2c 100644 --- a/src/dotty/tools/dotc/config/Config.scala +++ b/src/dotty/tools/dotc/config/Config.scala @@ -87,6 +87,15 @@ object Config { /** Check that certain types cannot be created in erasedTypes phases */ final val checkUnerased = true + /** In `derivedSelect`, rewrite + * + * (S & T)#A --> S#A & T#A + * (S | T)#A --> S#A | T#A + * + * Not sure whether this is useful. Preliminary measurements show a slowdown of about + * 7% for the build when this option is enabled. + */ + final val splitProjections = false /** Initial size of superId table */ final val InitialSuperIdsSize = 4096 diff --git a/src/dotty/tools/dotc/config/ScalaSettings.scala b/src/dotty/tools/dotc/config/ScalaSettings.scala index 62b0713724ab..b1f6ca61a206 100644 --- a/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -173,6 +173,7 @@ class ScalaSettings extends Settings.SettingGroup { val Ypatmatdebug = BooleanSetting("-Ypatmat-debug", "Trace pattern matching translation.") val Yexplainlowlevel = BooleanSetting("-Yexplain-lowlevel", "When explaining type errors, show types at a lower level.") val YnoDoubleBindings = BooleanSetting("-Yno-double-bindings", "Assert no namedtype is bound twice (should be enabled only if program is error-free).") + val YshowVarBounds = BooleanSetting("-YshowVarBounds", "Print type variables with their bounds") val optimise = BooleanSetting("-optimise", "Generates faster bytecode by applying optimisations to the program") withAbbreviation "-optimize" diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala index 5f794f2d51de..a7fecce8ec24 100644 --- a/src/dotty/tools/dotc/core/Definitions.scala +++ b/src/dotty/tools/dotc/core/Definitions.scala @@ -589,10 +589,7 @@ class Definitions { } def isBottomClass(cls: Symbol) = cls == NothingClass || cls == NullClass - def isBottomType(tp: Type) = tp match { - case tp: TypeRef => isBottomClass(tp.symbol) - case _ => false - } + def isBottomType(tp: Type) = tp.derivesFrom(NothingClass) || tp.derivesFrom(NullClass) def isFunctionClass(cls: Symbol) = isVarArityClass(cls, tpnme.Function) def isAbstractFunctionClass(cls: Symbol) = isVarArityClass(cls, tpnme.AbstractFunction) diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala index fbab4ee39744..7d1b36db0694 100644 --- a/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/src/dotty/tools/dotc/core/TypeApplications.scala @@ -173,8 +173,45 @@ object TypeApplications { if (tparams.isEmpty) args else args.zipWithConserve(tparams)((arg, tparam) => arg.etaExpandIfHK(tparam.infoOrCompleter)) + /** The references `.this.$hk0, ..., .this.$hk`. */ def argRefs(rt: RefinedType, n: Int)(implicit ctx: Context) = List.range(0, n).map(i => RefinedThis(rt).select(tpnme.hkArg(i))) + + /** Merge `tp1` and `tp2` under a common lambda, combining them with `op`. + * @param tparams1 The type parameters of `tp1` + * @param tparams2 The type parameters of `tp2` + * Produces the type lambda + * + * [v1 X1 B1, ..., vn Xn Bn] -> op(tp1[X1, ..., Xn], tp2[X1, ..., Xn]) + * + * where + * + * - variances `vi` are the variances of corresponding type parameters for `tp1` + * or `tp2`, or are 0 of the latter disagree. + * - bounds `Bi` are the intersection of the corresponding type parameter bounds + * of `tp1` and `tp2`. + */ + def hkCombine(tp1: Type, tp2: Type, + tparams1: List[TypeSymbol], tparams2: List[TypeSymbol], op: (Type, Type) => Type) + (implicit ctx: Context): Type = { + val variances = (tparams1, tparams2).zipped.map { (tparam1, tparam2) => + val v1 = tparam1.variance + val v2 = tparam2.variance + if (v1 == v2) v1 else 0 + } + val bounds: List[RefinedType => TypeBounds] = + (tparams1, tparams2).zipped.map { (tparam1, tparam2) => + val b1: RefinedType => TypeBounds = + tp1.memberInfo(tparam1).bounds.internalizeFrom(tparams1) + val b2: RefinedType => TypeBounds = + tp2.memberInfo(tparam2).bounds.internalizeFrom(tparams2) + (rt: RefinedType) => b1(rt) & b2(rt) + } + val app1: RefinedType => Type = rt => tp1.appliedTo(argRefs(rt, tparams1.length)) + val app2: RefinedType => Type = rt => tp2.appliedTo(argRefs(rt, tparams2.length)) + val body = (rt: RefinedType) => op(app1(rt), app2(rt)) + TypeLambda(variances, bounds, body) + } } import TypeApplications._ @@ -273,6 +310,14 @@ class TypeApplications(val self: Type) extends AnyVal { false } + /** Replace references to type parameters with references to hk arguments `this.$hk_i` + * Care is needed not to cause cyclic reference errors, hence `SafeSubstMap`. + */ + private[TypeApplications] def internalizeFrom[T <: Type](tparams: List[Symbol])(implicit ctx: Context): RefinedType => T = + (rt: RefinedType) => + new ctx.SafeSubstMap(tparams , argRefs(rt, tparams.length)) + .apply(self).asInstanceOf[T] + /** Lambda abstract `self` with given type parameters. Examples: * * type T[X] = U becomes type T = [X] -> U @@ -328,14 +373,10 @@ class TypeApplications(val self: Type) extends AnyVal { //.ensuring(res => res.EtaReduce =:= self, s"res = $res, core = ${res.EtaReduce}, self = $self, hc = ${res.hashCode}") } - /** Eta expand the prefix in front of any refinements. - * @param tparamsForBottom Type parameters to use if core is a bottom type - */ - def EtaExpandCore(tparamsForBottom: List[TypeSymbol])(implicit ctx: Context): Type = self.stripTypeVar match { + /** Eta expand the prefix in front of any refinements. */ + def EtaExpandCore(implicit ctx: Context): Type = self.stripTypeVar match { case self: RefinedType => - self.derivedRefinedType(self.parent.EtaExpandCore(tparamsForBottom), self.refinedName, self.refinedInfo) - case tp: TypeRef if defn.isBottomClass(tp.symbol) => - self.LambdaAbstract(tparamsForBottom) + self.derivedRefinedType(self.parent.EtaExpandCore, self.refinedName, self.refinedInfo) case _ => self.EtaExpand(self.typeParams) } diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala index 163fa4919bef..d5d8115428a5 100644 --- a/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/src/dotty/tools/dotc/core/TypeComparer.scala @@ -124,7 +124,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { pendingSubTypes = new mutable.HashSet[(Type, Type)] ctx.log(s"!!! deep subtype recursion involving ${tp1.show} <:< ${tp2.show}, constraint = ${state.constraint.show}") ctx.log(s"!!! constraint = ${constraint.show}") - if (ctx.settings.YnoDeepSubtypes.value) throw new Error("deep subtype") + assert(!ctx.settings.YnoDeepSubtypes.value) //throw new Error("deep subtype") if (Config.traceDeepSubTypeRecursions && !this.isInstanceOf[ExplainingTypeComparer]) ctx.log(TypeComparer.explained(implicit ctx => ctx.typeComparer.isSubType(tp1, tp2))) } @@ -144,49 +144,43 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { def compareNamed(tp1: Type, tp2: NamedType): Boolean = { implicit val ctx: Context = this.ctx tp2.info match { - case info2: TypeAlias if tp2.prefix.isStable => - // If prefix is not stable (i.e. is not a path), then we have a true - // projection `T # A` which is treated as the existential type - // `ex(x: T)x.A`. We need to deal with the existential first before - // following the alias. If we did follow the alias we could be - // unsound as well as incomplete. An example of this was discovered in Iter2.scala. - // It failed to validate the subtype test - // - // (([+X] -> Seq[X]) & C)[SA] <: C[SA] - // - // Both sides are projections of $Apply. The left $Apply does have an - // aliased info, namely, Seq[SA]. But that is not a subtype of C[SA]. - // The problem is that, with the prefix not being a path, an aliased info - // does not necessarily give all of the information of the original projection. - // So we can't follow the alias without a backup strategy. If the alias - // would appear on the right then I believe this can be turned into a case - // of unsoundness. - isSubType(tp1, info2.alias) + case info2: TypeAlias => isSubType(tp1, info2.alias) case _ => tp1 match { case tp1: NamedType => tp1.info match { - case info1: TypeAlias if tp1.prefix.isStable => - isSubType(info1.alias, tp2) + case info1: TypeAlias => + if (isSubType(info1.alias, tp2)) return true + if (tp1.prefix.isStable) return false + // If tp1.prefix is stable, the alias does contain all information about the original ref, so + // there's no need to try something else. (This is important for performance). + // To see why we cannot in general stop here, consider: + // + // trait C { type A } + // trait D { type A = String } + // (C & D)#A <: C#A + // + // Following the alias leads to the judgment `String <: C#A` which is false. + // However the original judgment should be true. case _ => - val sym1 = tp1.symbol - if ((sym1 ne NoSymbol) && (sym1 eq tp2.symbol)) - ctx.erasedTypes || - sym1.isStaticOwner || - isSubType(tp1.prefix, tp2.prefix) || - thirdTryNamed(tp1, tp2) - else - ( (tp1.name eq tp2.name) - && isSubType(tp1.prefix, tp2.prefix) - && tp1.signature == tp2.signature - && !tp1.isInstanceOf[WithFixedSym] - && !tp2.isInstanceOf[WithFixedSym] - ) || - compareHK(tp1, tp2, inOrder = true) || - compareHK(tp2, tp1, inOrder = false) || - thirdTryNamed(tp1, tp2) } + val sym1 = tp1.symbol + if ((sym1 ne NoSymbol) && (sym1 eq tp2.symbol)) + ctx.erasedTypes || + sym1.isStaticOwner || + isSubType(tp1.prefix, tp2.prefix) || + thirdTryNamed(tp1, tp2) + else + ( (tp1.name eq tp2.name) + && isSubType(tp1.prefix, tp2.prefix) + && tp1.signature == tp2.signature + && !tp1.isInstanceOf[WithFixedSym] + && !tp2.isInstanceOf[WithFixedSym] + ) || + compareHkApply(tp1, tp2, inOrder = true) || + compareHkApply(tp2, tp1, inOrder = false) || + thirdTryNamed(tp1, tp2) case _ => - compareHK(tp2, tp1, inOrder = false) || + compareHkApply(tp2, tp1, inOrder = false) || secondTry(tp1, tp2) } } @@ -258,11 +252,13 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { private def secondTry(tp1: Type, tp2: Type): Boolean = tp1 match { case tp1: NamedType => tp1.info match { - case info1: TypeAlias => isSubType(info1.alias, tp2) + case info1: TypeAlias => + if (isSubType(info1.alias, tp2)) return true + if (tp1.prefix.isStable) return false case _ => - compareHK(tp1, tp2, inOrder = true) || - thirdTry(tp1, tp2) } + compareHkApply(tp1, tp2, inOrder = true) || + thirdTry(tp1, tp2) case tp1: PolyParam => def flagNothingBound = { if (!frozenConstraint && tp2.isRef(defn.NothingClass) && state.isGlobalCommittable) { @@ -356,8 +352,6 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { isSubType(tp1, tp2.parent) && (name2 == nme.WILDCARD || hasMatchingMember(name2, tp1, tp2)) } - def etaExpandedSubType(tp1: Type) = - isSubType(tp1.typeConstructor.EtaExpand(tp2.typeParams), tp2) def compareRefined: Boolean = { val tp1w = tp1.widen val skipped2 = skipMatching(tp1w, tp2) @@ -371,7 +365,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { case _ => compareRefinedSlow || fourthTry(tp1, tp2) || - needsEtaLift(tp1, tp2) && testLifted(tp1, tp2, tp2.typeParams, etaExpandedSubType) + compareHkLambda(tp2, tp1, inOrder = false) } else // fast path, in particular for refinements resulting from parameterization. isSubType(tp1, skipped2) && @@ -491,10 +485,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { } isNewSubType(tp1.underlying.widenExpr, tp2) || comparePaths case tp1: RefinedType => - isNewSubType(tp1.parent, tp2) || - needsEtaLift(tp2, tp1) && - tp2.typeParams.length == tp1.typeParams.length && - isSubType(tp1, tp2.EtaExpand(tp1.typeParams)) + isNewSubType(tp1.parent, tp2) || compareHkLambda(tp1, tp2, inOrder = true) case AndType(tp11, tp12) => // Rewrite (T111 | T112) & T12 <: T2 to (T111 & T12) <: T2 and (T112 | T12) <: T2 // and analogously for T11 & (T121 | T122) & T12 <: T2 @@ -525,14 +516,6 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { false } - /** Does `tp` need to be eta lifted to be comparable to `target`? - * This is the case if: - * - target is a type lambda, and - * - `tp` is eta-expandable (i.e. is a non-lambda class ref) - */ - private def needsEtaLift(tp: Type, target: RefinedType): Boolean = - target.refinedName == tpnme.hkApply && tp.isEtaExpandable - /** Test whether `tp1` has a base type of the form `B[T1, ..., Tn]` where * - `B` derives from one of the class symbols of `tp2`, * - the type parameters of `B` match one-by-one the variances of `tparams`, @@ -574,7 +557,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { * * (4) If `inOrder`, test `projection <: other` else test `other <: projection`. */ - def compareHK(projection: NamedType, other: Type, inOrder: Boolean): Boolean = { + def compareHkApply(projection: NamedType, other: Type, inOrder: Boolean): Boolean = { def tryInfer(tp: Type): Boolean = ctx.traceIndented(i"compareHK($projection, $other, inOrder = $inOrder, constr = $tp)", subtyping) { tp match { case tp: TypeVar => tryInfer(tp.underlying) @@ -609,6 +592,22 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { tryInfer(projection.prefix.typeConstructor.dealias) } + /** Compare type lambda with non-lambda type. */ + def compareHkLambda(rt: RefinedType, other: Type, inOrder: Boolean) = rt match { + case TypeLambda(vs, args, body) => + other.isInstanceOf[TypeRef] && + args.length == other.typeParams.length && { + val applied = other.appliedTo(argRefs(rt, args.length)) + if (inOrder) isSubType(body, applied) + else body match { + case body: TypeBounds => body.contains(applied) + case _ => isSubType(applied, body) + } + } + case _ => + false + } + /** Returns true iff either `tp11 <:< tp21` or `tp12 <:< tp22`, trying at the same time * to keep the constraint as wide as possible. Specifically, if * @@ -1007,12 +1006,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { val t2 = distributeAnd(tp2, tp1) if (t2.exists) t2 else if (erased) erasedGlb(tp1, tp2, isJava = false) - else { - //if (isHKRef(tp1)) tp2 - //else if (isHKRef(tp2)) tp1 - //else - AndType(tp1, tp2) - } + else liftIfHK(tp1, tp2, AndType(_, _)) } } @@ -1036,14 +1030,23 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { val t2 = distributeOr(tp2, tp1) if (t2.exists) t2 else if (erased) erasedLub(tp1, tp2) - else - //if (isHKRef(tp1)) tp1 - //else if (isHKRef(tp2)) tp2 - //else - OrType(tp1, tp2) + else liftIfHK(tp1, tp2, OrType(_, _)) } } + /** `op(tp1, tp2)` unless `tp1` and `tp2` are type-constructors. + * In the latter case, combine `tp1` and `tp2` under a type lambda like this: + * + * [X1, ..., Xn] -> op(tp1[X1, ..., Xn], tp2[X1, ..., Xn]) + */ + private def liftIfHK(tp1: Type, tp2: Type, op: (Type, Type) => Type) = { + val tparams1 = tp1.typeParams + val tparams2 = tp2.typeParams + if (tparams1.isEmpty || tparams2.isEmpty) op(tp1, tp2) + else if (tparams1.length != tparams2.length) mergeConflict(tp1, tp2) + else hkCombine(tp1, tp2, tparams1, tparams2, op) + } + /** Try to distribute `&` inside type, detect and handle conflicts */ private def distributeAnd(tp1: Type, tp2: Type): Type = tp1 match { // opportunistically merge same-named refinements @@ -1106,18 +1109,15 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { NoType } - /** Try to distribute `|` inside type, detect and handle conflicts */ + /** Try to distribute `|` inside type, detect and handle conflicts + * Note that, unlike for `&`, a disjunction cannot be pushed into + * a refined or applied type. Example: + * + * List[T] | List[U] is not the same as List[T | U]. + * + * The rhs is a proper supertype of the lhs. + */ private def distributeOr(tp1: Type, tp2: Type): Type = tp1 match { - case tp1: RefinedType => - tp2 match { - case tp2: RefinedType if tp1.refinedName == tp2.refinedName => - tp1.derivedRefinedType( - tp1.parent | tp2.parent, - tp1.refinedName, - tp1.refinedInfo | tp2.refinedInfo.substRefinedThis(tp2, RefinedThis(tp1))) - case _ => - NoType - } case tp1: TypeBounds => tp2 match { case tp2: TypeBounds => tp1 | tp2 @@ -1237,7 +1237,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { /** Show subtype goal that led to an assertion failure */ def showGoal(tp1: Type, tp2: Type)(implicit ctx: Context) = { - ctx.println(disambiguated(implicit ctx => s"assertion failure for ${tp1.show} <:< ${tp2.show}, frozen = $frozenConstraint")) + println(disambiguated(implicit ctx => s"assertion failure for ${tp1.show} <:< ${tp2.show}, frozen = $frozenConstraint")) def explainPoly(tp: Type) = tp match { case tp: PolyParam => ctx.println(s"polyparam ${tp.show} found in ${tp.binder.show}") case tp: TypeRef if tp.symbol.exists => ctx.println(s"typeref ${tp.show} found in ${tp.symbol.owner.show}") @@ -1325,12 +1325,19 @@ class ExplainingTypeComparer(initctx: Context) extends TypeComparer(initctx) { override def copyIn(ctx: Context) = new ExplainingTypeComparer(ctx) - override def compareHK(projection: NamedType, other: Type, inOrder: Boolean) = + override def compareHkApply(projection: NamedType, other: Type, inOrder: Boolean) = if (projection.name == tpnme.hkApply) - traceIndented(i"compareHK $projection, $other, $inOrder") { - super.compareHK(projection, other, inOrder) + traceIndented(i"compareHkApply $projection, $other, $inOrder") { + super.compareHkApply(projection, other, inOrder) + } + else super.compareHkApply(projection, other, inOrder) + + override def compareHkLambda(rt: RefinedType, other: Type, inOrder: Boolean) = + if (rt.refinedName == tpnme.hkApply) + traceIndented(i"compareHkLambda $rt, $other, $inOrder") { + super.compareHkLambda(rt, other, inOrder) } - else super.compareHK(projection, other, inOrder) + else super.compareHkLambda(rt, other, inOrder) override def toString = "Subtype trace:" + { try b.toString finally b.clear() } } diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 21b74e07b866..13f1ff9a9a3c 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1533,19 +1533,53 @@ object Types { ctx.underlyingRecursions -= 1 } + /** A selection of the same kind, but with potentially a differet prefix. + * The following normalizations are performed for type selections T#A: + * + * T#A --> B if A is bound to an alias `= B` in T + * + * If Config.splitProjections is set: + * + * (S & T)#A --> S#A if T does not have a member named A + * --> T#A if S does not have a member named A + * --> S#A & T#A otherwise + * (S | T)#A --> S#A | T#A + */ def derivedSelect(prefix: Type)(implicit ctx: Context): Type = if (prefix eq this.prefix) this - else { + else if (isType) { val res = prefix.lookupRefined(name) if (res.exists) res else if (name == tpnme.hkApply && prefix.classNotLambda) { // After substitution we might end up with a type like // `C { type hk$0 = T0; ...; type hk$n = Tn } # $Apply` // where C is a class. In that case we eta expand `C`. - derivedSelect(prefix.EtaExpandCore(this.prefix.typeConstructor.typeParams)) + if (defn.isBottomType(prefix)) prefix.classSymbol.typeRef + else derivedSelect(prefix.EtaExpandCore) } + else if (Config.splitProjections) + prefix match { + case prefix: AndType => + def isMissing(tp: Type) = tp match { + case tp: TypeRef => !tp.info.exists + case _ => false + } + val derived1 = derivedSelect(prefix.tp1) + val derived2 = derivedSelect(prefix.tp2) + return ( + if (isMissing(derived1)) derived2 + else if (isMissing(derived2)) derived1 + else prefix.derivedAndType(derived1, derived2)) + case prefix: OrType => + val derived1 = derivedSelect(prefix.tp1) + val derived2 = derivedSelect(prefix.tp2) + return prefix.derivedOrType(derived1, derived2) + case _ => + newLikeThis(prefix) + } else newLikeThis(prefix) } + else newLikeThis(prefix) /** Create a NamedType of the same kind as this type, but with a new prefix. */ @@ -2774,7 +2808,7 @@ object Types { } override def toString = - if (lo eq hi) s"TypeAlias($lo)" else s"TypeBounds($lo, $hi)" + if (lo eq hi) s"TypeAlias($lo, $variance)" else s"TypeBounds($lo, $hi)" } class RealTypeBounds(lo: Type, hi: Type) extends TypeBounds(lo, hi) { diff --git a/src/dotty/tools/dotc/parsing/Parsers.scala b/src/dotty/tools/dotc/parsing/Parsers.scala index 71a03b9e2299..d59e087cb2a5 100644 --- a/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/src/dotty/tools/dotc/parsing/Parsers.scala @@ -1156,7 +1156,8 @@ object Parsers { */ def block(): Tree = { val stats = blockStatSeq() - if (stats.nonEmpty && !stats.last.isDef) Block(stats.init, stats.last) + def isExpr(stat: Tree) = !(stat.isDef || stat.isInstanceOf[Import]) + if (stats.nonEmpty && isExpr(stats.last)) Block(stats.init, stats.last) else Block(stats, EmptyTree) } diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala index 9e5ab5d8ccbe..8f9d70d4c4db 100644 --- a/src/dotty/tools/dotc/printing/PlainPrinter.scala +++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala @@ -170,7 +170,8 @@ class PlainPrinter(_ctx: Context) extends Printer { val bounds = if (constr.contains(tp)) constr.fullBounds(tp.origin)(ctx.addMode(Mode.Printing)) else TypeBounds.empty - "(" ~ toText(tp.origin) ~ "?" ~ toText(bounds) ~ ")" + if (ctx.settings.YshowVarBounds.value) "(" ~ toText(tp.origin) ~ "?" ~ toText(bounds) ~ ")" + else toText(tp.origin) } case tp: LazyRef => "LazyRef(" ~ toTextGlobal(tp.ref) ~ ")" diff --git a/src/dotty/tools/dotc/transform/Splitter.scala b/src/dotty/tools/dotc/transform/Splitter.scala index 62a080f37001..410b412e05d9 100644 --- a/src/dotty/tools/dotc/transform/Splitter.scala +++ b/src/dotty/tools/dotc/transform/Splitter.scala @@ -47,7 +47,10 @@ class Splitter extends MiniPhaseTransform { thisTransform => if (!mbr.isOverloaded) mbr.asSingleDenotation else tree.tpe match { case tref: TermRefWithSignature => mbr.atSignature(tref.sig) - case _ => ctx.error(s"cannot disambiguate overloaded member $mbr"); NoDenotation + case _ => + def alts = mbr.alternatives.map(alt => i"$alt: ${alt.info}").mkString(", ") + ctx.error(s"cannot disambiguate overloaded members $alts", tree.pos) + NoDenotation } } diff --git a/src/dotty/tools/dotc/transform/SuperAccessors.scala b/src/dotty/tools/dotc/transform/SuperAccessors.scala index 2febd267386b..ae9c493ae812 100644 --- a/src/dotty/tools/dotc/transform/SuperAccessors.scala +++ b/src/dotty/tools/dotc/transform/SuperAccessors.scala @@ -112,7 +112,7 @@ class SuperAccessors(thisTransformer: DenotTransformer) { ctx.error( i"${sym.showLocated} is accessed from super. It may not be abstract unless it is overridden by a member declared `abstract' and `override'", sel.pos) - else println(i"ok super $sel ${sym.showLocated} $member $clazz ${member.isIncompleteIn(clazz)}") + else ctx.log(i"ok super $sel ${sym.showLocated} $member $clazz ${member.isIncompleteIn(clazz)}") } else if (mix == tpnme.EMPTY && !(sym.owner is Trait)) // SI-4989 Check if an intermediate class between `clazz` and `sym.owner` redeclares the method as abstract. diff --git a/src/dotty/tools/dotc/typer/EtaExpansion.scala b/src/dotty/tools/dotc/typer/EtaExpansion.scala index 89415024e74c..aa210e6ed40a 100644 --- a/src/dotty/tools/dotc/typer/EtaExpansion.scala +++ b/src/dotty/tools/dotc/typer/EtaExpansion.scala @@ -141,8 +141,9 @@ object EtaExpansion { else mt.paramTypes map TypeTree val params = (mt.paramNames, paramTypes).zipped.map((name, tpe) => ValDef(name, TypeTree(tpe), EmptyTree).withFlags(Synthetic | Param).withPos(tree.pos)) - val ids = mt.paramNames map (name => - Ident(name).withPos(tree.pos)) + var ids: List[Tree] = mt.paramNames map (name => Ident(name).withPos(tree.pos)) + if (mt.paramTypes.nonEmpty && mt.paramTypes.last.isRepeatedParam) + ids = ids.init :+ repeated(ids.last) val body = Apply(lifted, ids) val fn = untpd.Function(params, body) if (defs.nonEmpty) untpd.Block(defs.toList map untpd.TypedSplice, fn) else fn diff --git a/src/dotty/tools/dotc/typer/RefChecks.scala b/src/dotty/tools/dotc/typer/RefChecks.scala index 00518278c20a..7ccb3d10398e 100644 --- a/src/dotty/tools/dotc/typer/RefChecks.scala +++ b/src/dotty/tools/dotc/typer/RefChecks.scala @@ -211,7 +211,7 @@ object RefChecks { if (!(hasErrors && member.is(Synthetic) && member.is(Module))) { // suppress errors relating toi synthetic companion objects if other override // errors (e.g. relating to the companion class) have already been reported. - if (member.owner == clazz) ctx.error(fullmsg, member.pos) + if (member.owner == clazz) ctx.error(fullmsg+", member = $member", member.pos) else mixinOverrideErrors += new MixinOverrideError(member, fullmsg) hasErrors = true } @@ -221,6 +221,11 @@ object RefChecks { emitOverrideError(overrideErrorMsg(msg)) } + def autoOverride(sym: Symbol) = + sym.is(Synthetic) && ( + desugar.isDesugaredCaseClassMethodName(member.name) || // such names are added automatically, can't have an override preset. + sym.is(Module)) // synthetic companion + def overrideAccessError() = { ctx.log(i"member: ${member.showLocated} ${member.flags}") // DEBUG ctx.log(i"other: ${other.showLocated} ${other.flags}") // DEBUG @@ -300,7 +305,7 @@ object RefChecks { !member.isAnyOverride) { // (*) Exclusion for default getters, fixes SI-5178. We cannot assign the Override flag to // the default getter: one default getter might sometimes override, sometimes not. Example in comment on ticket. - if (member.is(Synthetic) && desugar.isDesugaredCaseClassMethodName(member.name)) // such names are added automatically, can't have an override preset. + if (autoOverride(member)) member.setFlag(Override) else if (member.owner != clazz && other.owner != clazz && !(other.owner derivesFrom member.owner)) emitOverrideError( diff --git a/src/dotty/tools/dotc/typer/TypeAssigner.scala b/src/dotty/tools/dotc/typer/TypeAssigner.scala index 2b7eb3936d00..42ee513cd8d1 100644 --- a/src/dotty/tools/dotc/typer/TypeAssigner.scala +++ b/src/dotty/tools/dotc/typer/TypeAssigner.scala @@ -282,7 +282,7 @@ trait TypeAssigner { else if (!mix.isEmpty) findMixinSuper(cls.info) else if (inConstrCall || ctx.erasedTypes) cls.info.firstParent else { - val ps = cls.info.parents + val ps = cls.classInfo.instantiatedParents if (ps.isEmpty) defn.AnyType else ps.reduceLeft((x: Type, y: Type) => x & y) } tree.withType(SuperType(cls.thisType, owntype)) diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index e5509d50f1cb..182eab0ef21b 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -165,7 +165,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit tree.pos) found } - val Name = name.toTermName + val Name = name.toTermName.decode selectors match { case Pair(Ident(from), Ident(Name)) :: rest => val selName = if (name.isTypeName) from.toTypeName else from diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index f5012efe92f4..895bf89a7334 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -100,8 +100,6 @@ class tests extends CompilerTest { @Test def pos_all = compileFiles(posDir) // twice omitted to make tests run faster - @Test def pos_sets = compileFile(posSpecialDir, "sets")(allowDeepSubtypes) - @Test def pos_t2613 = compileFile(posSpecialDir, "t2613")(allowDeepSubtypes) @Test def pos_i871 = compileFile(posSpecialDir, "i871", scala2mode) @Test def pos_variancesConstr = compileFile(posSpecialDir, "variances-constr", scala2mode) @@ -150,6 +148,7 @@ class tests extends CompilerTest { @Test def neg_boundspropagation = compileFile(negDir, "boundspropagation", xerrors = 5) @Test def neg_refinedSubtyping = compileFile(negDir, "refinedSubtyping", xerrors = 2) @Test def neg_hklower = compileFile(negDir, "hklower", xerrors = 3) + @Test def neg_Iter2 = compileFile(negDir, "Iter2", xerrors = 2) @Test def neg_i0091_infpaths = compileFile(negDir, "i0091-infpaths", xerrors = 3) @Test def neg_i0248_inherit_refined = compileFile(negDir, "i0248-inherit-refined", xerrors = 4) @Test def neg_i0281 = compileFile(negDir, "i0281-null-primitive-conforms", xerrors = 3) diff --git a/tests/pending/pos/IterableSelfRec.scala b/tests/invalid/pos/IterableSelfRec.scala similarity index 95% rename from tests/pending/pos/IterableSelfRec.scala rename to tests/invalid/pos/IterableSelfRec.scala index a97833991785..7fd235f1211d 100644 --- a/tests/pending/pos/IterableSelfRec.scala +++ b/tests/invalid/pos/IterableSelfRec.scala @@ -1,3 +1,4 @@ +// This does not currently work because it mixes higher-kinded types and raw type constructors. package dotty.collection package immutable diff --git a/tests/pending/pos/contrib701.scala b/tests/invalid/pos/contrib701.scala similarity index 100% rename from tests/pending/pos/contrib701.scala rename to tests/invalid/pos/contrib701.scala diff --git a/tests/pending/pos/cycle-jsoup.flags b/tests/invalid/pos/cycle-jsoup.flags similarity index 100% rename from tests/pending/pos/cycle-jsoup.flags rename to tests/invalid/pos/cycle-jsoup.flags diff --git a/tests/pending/pos/cycle-jsoup.scala b/tests/invalid/pos/cycle-jsoup.scala similarity index 100% rename from tests/pending/pos/cycle-jsoup.scala rename to tests/invalid/pos/cycle-jsoup.scala diff --git a/tests/pending/pos/depexists.scala b/tests/invalid/pos/depexists.scala similarity index 100% rename from tests/pending/pos/depexists.scala rename to tests/invalid/pos/depexists.scala diff --git a/tests/pending/pos/dotless-targs.scala b/tests/invalid/pos/dotless-targs.scala similarity index 75% rename from tests/pending/pos/dotless-targs.scala rename to tests/invalid/pos/dotless-targs.scala index 8c0e244e4e8e..7394f361acaa 100644 --- a/tests/pending/pos/dotless-targs.scala +++ b/tests/invalid/pos/dotless-targs.scala @@ -1,3 +1,4 @@ +// Type arguments on infix operators are not supported by the syntax class A { def fn1 = List apply 1 def fn2 = List apply[Int] 2 diff --git a/tests/pending/pos/five-dot-f.flags b/tests/invalid/pos/five-dot-f.flags similarity index 100% rename from tests/pending/pos/five-dot-f.flags rename to tests/invalid/pos/five-dot-f.flags diff --git a/tests/pending/pos/five-dot-f.scala b/tests/invalid/pos/five-dot-f.scala similarity index 100% rename from tests/pending/pos/five-dot-f.scala rename to tests/invalid/pos/five-dot-f.scala diff --git a/tests/pending/pos/functions.scala b/tests/invalid/pos/functions.scala similarity index 100% rename from tests/pending/pos/functions.scala rename to tests/invalid/pos/functions.scala diff --git a/tests/pending/pos/generic-sigs.scala b/tests/invalid/pos/generic-sigs.scala similarity index 100% rename from tests/pending/pos/generic-sigs.scala rename to tests/invalid/pos/generic-sigs.scala diff --git a/tests/pending/pos/patmat.scala b/tests/invalid/pos/patmat.scala similarity index 100% rename from tests/pending/pos/patmat.scala rename to tests/invalid/pos/patmat.scala diff --git a/tests/pending/pos/pos-bug1241.scala b/tests/invalid/pos/pos-bug1241.scala similarity index 100% rename from tests/pending/pos/pos-bug1241.scala rename to tests/invalid/pos/pos-bug1241.scala diff --git a/tests/pending/pos/specializes-sym-crash.scala b/tests/invalid/pos/specializes-sym-crash.scala similarity index 75% rename from tests/pending/pos/specializes-sym-crash.scala rename to tests/invalid/pos/specializes-sym-crash.scala index 7778ba277b0f..e0e458170929 100644 --- a/tests/pending/pos/specializes-sym-crash.scala +++ b/tests/invalid/pos/specializes-sym-crash.scala @@ -1,3 +1,4 @@ +// This relies on the naming of the transformed classes which will have to change in the new stdlib. import scala.collection._ trait Foo[+A, @@ -6,12 +7,12 @@ trait Foo[+A, extends Seq[A] with SeqLike[A, This] with IterableView[A, Coll] with IterableViewLike[A, Coll, This] { self => - trait Transformed[+B] extends SeqView[B, Coll] with super.Transformed[B] { + trait TransformedFoo[+B] extends SeqView[B, Coll] with super.Transformed[B] { def length: Int def apply(idx: Int): B override def toString = viewToString } - trait Reversed extends Transformed[A] { + trait Reversed extends TransformedFoo[A] { override def iterator: Iterator[A] = createReversedIterator def length: Int = self.length def apply(idx: Int): A = self.apply(length - 1 - idx) diff --git a/tests/pending/pos/t2782.scala b/tests/invalid/pos/t2782.scala similarity index 100% rename from tests/pending/pos/t2782.scala rename to tests/invalid/pos/t2782.scala diff --git a/tests/pending/pos/t3577.scala b/tests/invalid/pos/t3577.scala similarity index 79% rename from tests/pending/pos/t3577.scala rename to tests/invalid/pos/t3577.scala index 1ac1786c1157..e94b69b4b3ab 100644 --- a/tests/pending/pos/t3577.scala +++ b/tests/invalid/pos/t3577.scala @@ -5,6 +5,9 @@ case class C2(checks: Check[_]*); object C { def m(x : C2): Any = (null: Any) match { case C2(_, rest : _*) => { + // Invalid: Vararg pattern cannot be split between normal and :_* patterns. + // This split also does not work for vararg arguments, so there's no + // good argument it should work for patterns rest.map(_.value) } } diff --git a/tests/invalid/pos/t3856.scala b/tests/invalid/pos/t3856.scala new file mode 100644 index 000000000000..8dfcccb5a8f1 --- /dev/null +++ b/tests/invalid/pos/t3856.scala @@ -0,0 +1,16 @@ +case class C[T](x: T) + +case class CS(xs: C[_]*) + +// t3856 +object Test { + val x = CS(C(5), C("abc")) match { case CS(C(5), xs : _*) => xs } + // Invalid: Vararg pattern cannot be split between normal and :_* patterns. + // This split also does not work for vararg arguments, so there's no + // good argument it should work for patterns + println(x) + + def foo(xs: Int*) = () + val xs = List(1, 2, 3) + foo(1, xs:_*) +} diff --git a/tests/pending/pos/t4202.scala b/tests/invalid/pos/t4202.scala similarity index 69% rename from tests/pending/pos/t4202.scala rename to tests/invalid/pos/t4202.scala index b2a0c0120a05..1bf0bf6ebdd4 100644 --- a/tests/pending/pos/t4202.scala +++ b/tests/invalid/pos/t4202.scala @@ -1,3 +1,5 @@ +// Invalid because syntax has changed; +// template statements cannot be lambdas. object t4202_1 { () => { trait T { diff --git a/tests/pending/pos/t4237.scala b/tests/invalid/pos/t4237.scala similarity index 88% rename from tests/pending/pos/t4237.scala rename to tests/invalid/pos/t4237.scala index 44bc814626fa..45a5050040a4 100644 --- a/tests/pending/pos/t4237.scala +++ b/tests/invalid/pos/t4237.scala @@ -1,3 +1,4 @@ +// Invalid because structural types are not supported. class A { (new { def field = 0; def field_=(i: Int) = () }).field = 5 // compiles as expected (new { def field(implicit i: Int) = 0; def field_=(i: Int) = () }).field = 5 // compiles even with implicit params on getter diff --git a/tests/pending/pos/t4363.scala b/tests/invalid/pos/t4363.scala similarity index 71% rename from tests/pending/pos/t4363.scala rename to tests/invalid/pos/t4363.scala index 64cdcd9356ef..e0ffa8fd9fbf 100644 --- a/tests/pending/pos/t4363.scala +++ b/tests/invalid/pos/t4363.scala @@ -1,3 +1,4 @@ +// Invalid because lambdas can no longer be tenmplate statements. object Test { trait Suite { def bar() = () } diff --git a/tests/pending/pos/t4365/a_1.scala b/tests/invalid/pos/t4365/a_1.scala similarity index 86% rename from tests/pending/pos/t4365/a_1.scala rename to tests/invalid/pos/t4365/a_1.scala index a24b57772d5b..0be5ca8a19e9 100644 --- a/tests/pending/pos/t4365/a_1.scala +++ b/tests/invalid/pos/t4365/a_1.scala @@ -1,3 +1,4 @@ +// Invalid because it relies on internal traits of views that will change their names. import scala.collection._ trait SeqViewLike[+A, diff --git a/tests/pending/pos/t4365/b_1.scala b/tests/invalid/pos/t4365/b_1.scala similarity index 100% rename from tests/pending/pos/t4365/b_1.scala rename to tests/invalid/pos/t4365/b_1.scala diff --git a/tests/pending/pos/t4553.scala b/tests/invalid/pos/t4553.scala similarity index 84% rename from tests/pending/pos/t4553.scala rename to tests/invalid/pos/t4553.scala index e9bef4099428..48846a369c03 100644 --- a/tests/pending/pos/t4553.scala +++ b/tests/invalid/pos/t4553.scala @@ -1,3 +1,4 @@ +// Invalid because hk type parameters may not appear in lower bounds trait VectorLike[+T, +V[A] <: Vector[A]] { def +[S, VResult[S] >: V[S]](v: VResult[S]): Unit } diff --git a/tests/pending/pos/t5022.scala b/tests/invalid/pos/t5022.scala similarity index 100% rename from tests/pending/pos/t5022.scala rename to tests/invalid/pos/t5022.scala diff --git a/tests/pending/pos/t5119.scala b/tests/invalid/pos/t5119.scala similarity index 100% rename from tests/pending/pos/t5119.scala rename to tests/invalid/pos/t5119.scala diff --git a/tests/pending/pos/t5130.scala b/tests/invalid/pos/t5130.scala similarity index 100% rename from tests/pending/pos/t5130.scala rename to tests/invalid/pos/t5130.scala diff --git a/tests/pending/pos/t5156.scala b/tests/invalid/pos/t5156.scala similarity index 100% rename from tests/pending/pos/t5156.scala rename to tests/invalid/pos/t5156.scala diff --git a/tests/pending/pos/t533.scala b/tests/invalid/pos/t533.scala similarity index 100% rename from tests/pending/pos/t533.scala rename to tests/invalid/pos/t533.scala diff --git a/tests/pending/pos/t5626.scala b/tests/invalid/pos/t5626.scala similarity index 100% rename from tests/pending/pos/t5626.scala rename to tests/invalid/pos/t5626.scala diff --git a/tests/pending/pos/t5654.scala b/tests/invalid/pos/t5654.scala similarity index 100% rename from tests/pending/pos/t5654.scala rename to tests/invalid/pos/t5654.scala diff --git a/tests/pending/pos/t6169/Exist.java b/tests/invalid/pos/t6169/Exist.java similarity index 100% rename from tests/pending/pos/t6169/Exist.java rename to tests/invalid/pos/t6169/Exist.java diff --git a/tests/pending/pos/t6169/ExistF.java b/tests/invalid/pos/t6169/ExistF.java similarity index 100% rename from tests/pending/pos/t6169/ExistF.java rename to tests/invalid/pos/t6169/ExistF.java diff --git a/tests/pending/pos/t6169/ExistIndir.java b/tests/invalid/pos/t6169/ExistIndir.java similarity index 100% rename from tests/pending/pos/t6169/ExistIndir.java rename to tests/invalid/pos/t6169/ExistIndir.java diff --git a/tests/pending/pos/t6169/OP.java b/tests/invalid/pos/t6169/OP.java similarity index 100% rename from tests/pending/pos/t6169/OP.java rename to tests/invalid/pos/t6169/OP.java diff --git a/tests/pending/pos/t6169/Skin.java b/tests/invalid/pos/t6169/Skin.java similarity index 100% rename from tests/pending/pos/t6169/Skin.java rename to tests/invalid/pos/t6169/Skin.java diff --git a/tests/pending/pos/t6169/Skinnable.java b/tests/invalid/pos/t6169/Skinnable.java similarity index 100% rename from tests/pending/pos/t6169/Skinnable.java rename to tests/invalid/pos/t6169/Skinnable.java diff --git a/tests/pending/pos/t6169/skinnable.scala b/tests/invalid/pos/t6169/skinnable.scala similarity index 100% rename from tests/pending/pos/t6169/skinnable.scala rename to tests/invalid/pos/t6169/skinnable.scala diff --git a/tests/pending/pos/t6169/t6169.scala b/tests/invalid/pos/t6169/t6169.scala similarity index 100% rename from tests/pending/pos/t6169/t6169.scala rename to tests/invalid/pos/t6169/t6169.scala diff --git a/tests/pending/pos/t6367.scala b/tests/invalid/pos/t6367.scala similarity index 100% rename from tests/pending/pos/t6367.scala rename to tests/invalid/pos/t6367.scala diff --git a/tests/pending/pos/t711.scala b/tests/invalid/pos/t711.scala similarity index 100% rename from tests/pending/pos/t711.scala rename to tests/invalid/pos/t711.scala diff --git a/tests/pending/pos/t7505.scala b/tests/invalid/pos/t7505.scala similarity index 100% rename from tests/pending/pos/t7505.scala rename to tests/invalid/pos/t7505.scala diff --git a/tests/pending/pos/t8023.scala b/tests/invalid/pos/t8023.scala similarity index 86% rename from tests/pending/pos/t8023.scala rename to tests/invalid/pos/t8023.scala index 502b5c55dfb0..9ce5619dbe39 100644 --- a/tests/pending/pos/t8023.scala +++ b/tests/invalid/pos/t8023.scala @@ -1,3 +1,4 @@ +// Invalid because nested hk type parameters are no longer allowed import language._ diff --git a/tests/pending/pos/t8219b.scala b/tests/invalid/pos/t8219b.scala similarity index 100% rename from tests/pending/pos/t8219b.scala rename to tests/invalid/pos/t8219b.scala diff --git a/tests/pending/pos/t8224.scala b/tests/invalid/pos/t8224.scala similarity index 80% rename from tests/pending/pos/t8224.scala rename to tests/invalid/pos/t8224.scala index 2fae925df3e4..d893f66307fd 100644 --- a/tests/pending/pos/t8224.scala +++ b/tests/invalid/pos/t8224.scala @@ -1,3 +1,4 @@ +// Invalid because nested hk type parameters are no longer allowed import language.higherKinds trait P [N1, +E1[X <: N1]] diff --git a/tests/pending/pos/ticket2251.scala b/tests/invalid/pos/ticket2251.scala similarity index 100% rename from tests/pending/pos/ticket2251.scala rename to tests/invalid/pos/ticket2251.scala diff --git a/tests/pending/pos/typesafecons.scala b/tests/invalid/pos/typesafecons.scala similarity index 100% rename from tests/pending/pos/typesafecons.scala rename to tests/invalid/pos/typesafecons.scala diff --git a/tests/pending/pos/unapplySeq.scala b/tests/invalid/pos/unapplySeq.scala similarity index 100% rename from tests/pending/pos/unapplySeq.scala rename to tests/invalid/pos/unapplySeq.scala diff --git a/tests/neg/Iter2.scala b/tests/neg/Iter2.scala new file mode 100644 index 000000000000..d938f0379b02 --- /dev/null +++ b/tests/neg/Iter2.scala @@ -0,0 +1,40 @@ +// NOTE: this test case is very fragile, removing seemingly unrelated code like +// the "Dummy" trait somehow changes how the types of cget and dget are inferred +// and avoids the bug. + +object Test { + trait Dummy { + def foo: Unit = { + var i = 0 + i += 1 + } + } + + trait FromIterator[+C[X] <: Iterable[X]] { + def get(): C[Int] + } + + trait Iterable[+IA] extends FromIterator[Iterable] + trait SubIterable[+IA] extends Iterable[IA] with FromIterator[SubIterable] + + class IterableC extends Iterable[Int] { def get() = this } + class SubIterableC extends SubIterable[Int] { def get() = this } + + + implicit class IterableTransforms[A, C[X] <: Iterable[X], D[X] <: SubIterable[X]] + (val dummy: Unit) { + def foo(c: Iterable[A] with FromIterator[C], d: Iterable[A] with FromIterator[D]): Unit = { + var cget = c.get() + var dget = d.get() + dget = cget // error + cget = dget // error + } + } + + def main(args: Array[String]): Unit = { + new IterableTransforms(()).foo(new IterableC, new SubIterableC) + // java.lang.ClassCastException: Test$IterableC cannot be cast to Test$SubIterable + } +} + + diff --git a/tests/pending/pos/imports-pos.scala b/tests/new/imports-pos.scala similarity index 100% rename from tests/pending/pos/imports-pos.scala rename to tests/new/imports-pos.scala diff --git a/tests/pending/pos/infer2-pos.scala b/tests/new/infer2-pos.scala similarity index 100% rename from tests/pending/pos/infer2-pos.scala rename to tests/new/infer2-pos.scala diff --git a/tests/pending/pos/looping-jsig.scala b/tests/new/looping-jsig.scala similarity index 100% rename from tests/pending/pos/looping-jsig.scala rename to tests/new/looping-jsig.scala diff --git a/tests/pending/pos/matthias1.scala b/tests/new/matthias1.scala similarity index 100% rename from tests/pending/pos/matthias1.scala rename to tests/new/matthias1.scala diff --git a/tests/pending/pos/michel6.scala b/tests/new/michel6.scala similarity index 100% rename from tests/pending/pos/michel6.scala rename to tests/new/michel6.scala diff --git a/tests/pending/pos/moduletrans.scala b/tests/new/moduletrans.scala similarity index 100% rename from tests/pending/pos/moduletrans.scala rename to tests/new/moduletrans.scala diff --git a/tests/pending/pos/package-implicit/ActorRef.scala b/tests/new/package-implicit/ActorRef.scala similarity index 100% rename from tests/pending/pos/package-implicit/ActorRef.scala rename to tests/new/package-implicit/ActorRef.scala diff --git a/tests/pending/pos/package-implicit/DataFlow.scala b/tests/new/package-implicit/DataFlow.scala similarity index 100% rename from tests/pending/pos/package-implicit/DataFlow.scala rename to tests/new/package-implicit/DataFlow.scala diff --git a/tests/pending/pos/package-implicit/package.scala b/tests/new/package-implicit/package.scala similarity index 100% rename from tests/pending/pos/package-implicit/package.scala rename to tests/new/package-implicit/package.scala diff --git a/tests/pending/pos/patterns.scala b/tests/new/patterns.scala similarity index 100% rename from tests/pending/pos/patterns.scala rename to tests/new/patterns.scala diff --git a/tests/pending/pos/patterns1.scala b/tests/new/patterns1.scala similarity index 100% rename from tests/pending/pos/patterns1.scala rename to tests/new/patterns1.scala diff --git a/tests/pending/pos/pmbug.scala b/tests/new/pmbug.scala similarity index 100% rename from tests/pending/pos/pmbug.scala rename to tests/new/pmbug.scala diff --git a/tests/pending/pos/private-types-after-typer.scala b/tests/new/private-types-after-typer.scala similarity index 100% rename from tests/pending/pos/private-types-after-typer.scala rename to tests/new/private-types-after-typer.scala diff --git a/tests/pending/pos/selftails.scala b/tests/new/selftails.scala similarity index 100% rename from tests/pending/pos/selftails.scala rename to tests/new/selftails.scala diff --git a/tests/pending/pos/seqtest2.scala b/tests/new/seqtest2.scala similarity index 100% rename from tests/pending/pos/seqtest2.scala rename to tests/new/seqtest2.scala diff --git a/tests/pending/pos/sammy_poly.flags b/tests/pending/pos/sammy_poly.flags deleted file mode 100644 index 48fd867160ba..000000000000 --- a/tests/pending/pos/sammy_poly.flags +++ /dev/null @@ -1 +0,0 @@ --Xexperimental diff --git a/tests/pending/pos/sealed-final.flags b/tests/pending/pos/sealed-final.flags deleted file mode 100644 index cfabf7a5b451..000000000000 --- a/tests/pending/pos/sealed-final.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Yinline-warnings -optimise \ No newline at end of file diff --git a/tests/pending/pos/t5545/S_1.scala b/tests/pending/pos/spec-t5545/S_1.scala similarity index 100% rename from tests/pending/pos/t5545/S_1.scala rename to tests/pending/pos/spec-t5545/S_1.scala diff --git a/tests/pending/pos/t5545/S_2.scala b/tests/pending/pos/spec-t5545/S_2.scala similarity index 100% rename from tests/pending/pos/t5545/S_2.scala rename to tests/pending/pos/spec-t5545/S_2.scala diff --git a/tests/pending/pos/t1843.scala b/tests/pending/pos/t1843.scala deleted file mode 100644 index 871b21346cc2..000000000000 --- a/tests/pending/pos/t1843.scala +++ /dev/null @@ -1,24 +0,0 @@ -/** -* Scala Compiler Will Crash On this File -* ... Or Will It? -* -*/ -object Crash { - trait UpdateType[A] - case class StateUpdate[A](updateType : UpdateType[A], value : A) - case object IntegerUpdateType extends UpdateType[Integer] - - //However this method will cause a crash - def crash(updates: List[StateUpdate[_]]): Unit = { - updates match { - case Nil => - case u::us => - u match { - //Line below seems to be the crashing line - case StateUpdate(key, newValue) if (key == IntegerUpdateType) => - println("Requires a statement to induce the crash") - case _ => - } - } - } -} diff --git a/tests/pending/pos/t2613.scala b/tests/pending/pos/t2613.scala deleted file mode 100644 index 3a64dbc28222..000000000000 --- a/tests/pending/pos/t2613.scala +++ /dev/null @@ -1,11 +0,0 @@ -import language.existentials - -object Test { - class Row - - abstract class MyRelation [R <: Row, +Relation <: MyRelation[R, Relation]] - - type M = MyRelation[R, Relation] forSome {type R <: Row; type Relation <: MyRelation[R, Relation]} - - var (x,y): (String, M) = null -} diff --git a/tests/pending/pos/t3252.flags b/tests/pending/pos/t3252.flags deleted file mode 100644 index eb4d19bcb91a..000000000000 --- a/tests/pending/pos/t3252.flags +++ /dev/null @@ -1 +0,0 @@ --optimise \ No newline at end of file diff --git a/tests/pending/pos/t3856.scala b/tests/pending/pos/t3856.scala deleted file mode 100644 index 6b38edc52cbe..000000000000 --- a/tests/pending/pos/t3856.scala +++ /dev/null @@ -1,9 +0,0 @@ -case class C[T](x: T) - -case class CS(xs: C[_]*) - -// t3856 -object Test { - val x = CS(C(5), C("abc")) match { case CS(C(5), xs : _*) => xs } - println(x) -} diff --git a/tests/untried/pos/t3862.scala b/tests/pending/pos/t3862.scala similarity index 71% rename from tests/untried/pos/t3862.scala rename to tests/pending/pos/t3862.scala index 8ca4a0586120..0d978caa41e3 100644 --- a/tests/untried/pos/t3862.scala +++ b/tests/pending/pos/t3862.scala @@ -1,3 +1,5 @@ +// Currently takes a very long time (more than a minute) and then +// does not find an alternative. object OverloadingShapeType { // comment out this, and the other alternative is chosen. def blerg(f: String): Unit = {} diff --git a/tests/pending/pos/t4176b.scala b/tests/pending/pos/t4176b.scala deleted file mode 100644 index f7d83365c653..000000000000 --- a/tests/pending/pos/t4176b.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test { - def foo(a: String*) = a - val fooEta = foo _ - (foo: Seq[String] => Seq[String]) -} diff --git a/tests/pending/pos/t4269.scala b/tests/pending/pos/t4269.scala index 99a30785b4d1..fe0c20103c19 100644 --- a/tests/pending/pos/t4269.scala +++ b/tests/pending/pos/t4269.scala @@ -1,5 +1,5 @@ class A { PartialFunction.condOpt(Nil) { - case items@List(_*) if true => + case items@List(_: _*) if true => } } diff --git a/tests/pending/pos/t5845.scala b/tests/pending/pos/t5845.scala index 823c722c145d..b747a025e7d5 100644 --- a/tests/pending/pos/t5845.scala +++ b/tests/pending/pos/t5845.scala @@ -4,13 +4,13 @@ class Num[T] { } class A { - implicit def infixOps[T, CC[X] <: Num[X]](lhs: T)(implicit num: CC[T]) = num.mkOps - implicit val n1 = new Num[Int] { } - println(5 +++ 5) + implicit def infixOps[T, CC[X] <: Num[X]](lhs: T)(implicit num: CC[T]): num.Ops = num.mkOps + implicit val n1: Num[Int] = new Num[Int] { } + println(5 +++ 5) // should dependent be implicits forbidden? } class B { implicit def infixOps[T, CC[X] <: Num[X]](lhs: T)(implicit num: CC[T]) : CC[T]#Ops = num.mkOps - implicit val n1 = new Num[Int] {} + implicit val n1: Num[Int] = new Num[Int] {} println(5 +++ 5) } diff --git a/tests/pending/pos/t6976/Exts_1.scala b/tests/pending/pos/t6976/Exts_1.scala index 9b3a69edd9aa..f5eaeea45531 100644 --- a/tests/pending/pos/t6976/Exts_1.scala +++ b/tests/pending/pos/t6976/Exts_1.scala @@ -6,5 +6,5 @@ object Exts { trait Exts { import language.implicitConversions - implicit def AnyExts[T](o: T) = Exts.AnyExts(o) + implicit def AnyExts[T](o: T): Exts.AnyExts[T] = Exts.AnyExts(o) } diff --git a/tests/pending/pos/t7517.scala b/tests/pending/pos/t7517.scala index df4f40130450..d0462c48dfbb 100644 --- a/tests/pending/pos/t7517.scala +++ b/tests/pending/pos/t7517.scala @@ -1,3 +1,4 @@ +// Invalid because nested hk type parameters are no longer allowed trait Box[ K[A[x]] ] object Box { diff --git a/tests/pending/pos/t7902.scala b/tests/pending/pos/t7902.scala index 47c525c1795d..7793d3723039 100644 --- a/tests/pending/pos/t7902.scala +++ b/tests/pending/pos/t7902.scala @@ -1,3 +1,4 @@ +// Invalid because nested hk type parameters are no longer allowed import scala.language.higherKinds object Bug { diff --git a/tests/pending/pos/t7919.scala b/tests/pending/pos/t7919.scala deleted file mode 100644 index 64f261ec1608..000000000000 --- a/tests/pending/pos/t7919.scala +++ /dev/null @@ -1,6 +0,0 @@ - -object X { - val x = s"" - val y = true -} - diff --git a/tests/new/conforms.scala b/tests/pos/conforms.scala similarity index 100% rename from tests/new/conforms.scala rename to tests/pos/conforms.scala diff --git a/tests/pending/pos/constfold.scala b/tests/pos/constfold.scala similarity index 100% rename from tests/pending/pos/constfold.scala rename to tests/pos/constfold.scala diff --git a/tests/pending/pos/contextbounds-implicits-new.scala b/tests/pos/contextbounds-implicits-new.scala similarity index 100% rename from tests/pending/pos/contextbounds-implicits-new.scala rename to tests/pos/contextbounds-implicits-new.scala diff --git a/tests/pending/pos/delambdafy-lambdalift.scala b/tests/pos/delambdafy-lambdalift.scala similarity index 100% rename from tests/pending/pos/delambdafy-lambdalift.scala rename to tests/pos/delambdafy-lambdalift.scala diff --git a/tests/pending/pos/exbound.scala b/tests/pos/exbound.scala similarity index 100% rename from tests/pending/pos/exbound.scala rename to tests/pos/exbound.scala diff --git a/tests/pending/pos/hklub0.scala b/tests/pos/hklub0.scala similarity index 100% rename from tests/pending/pos/hklub0.scala rename to tests/pos/hklub0.scala diff --git a/tests/new/implicits.scala b/tests/pos/implicits.scala similarity index 100% rename from tests/new/implicits.scala rename to tests/pos/implicits.scala diff --git a/tests/pending/pos/philippe4.scala b/tests/pos/philippe4.scala similarity index 100% rename from tests/pending/pos/philippe4.scala rename to tests/pos/philippe4.scala diff --git a/tests/pos-special/sets.scala b/tests/pos/sets.scala similarity index 100% rename from tests/pos-special/sets.scala rename to tests/pos/sets.scala diff --git a/tests/pending/pos/t1048.scala b/tests/pos/t1048.scala similarity index 100% rename from tests/pending/pos/t1048.scala rename to tests/pos/t1048.scala diff --git a/tests/pos/t1843.scala b/tests/pos/t1843.scala index 5e8554a93862..871b21346cc2 100644 --- a/tests/pos/t1843.scala +++ b/tests/pos/t1843.scala @@ -3,10 +3,9 @@ * ... Or Will It? * */ - object Crash { - trait UpdateType[+A] - case class StateUpdate[+A](updateType : UpdateType[A], value : A) + trait UpdateType[A] + case class StateUpdate[A](updateType : UpdateType[A], value : A) case object IntegerUpdateType extends UpdateType[Integer] //However this method will cause a crash diff --git a/tests/pos-special/t2613.scala b/tests/pos/t2613.scala similarity index 100% rename from tests/pos-special/t2613.scala rename to tests/pos/t2613.scala diff --git a/tests/untried/pos/t3048.scala b/tests/pos/t3048.scala similarity index 100% rename from tests/untried/pos/t3048.scala rename to tests/pos/t3048.scala diff --git a/tests/untried/pos/t3071.scala b/tests/pos/t3071.scala similarity index 100% rename from tests/untried/pos/t3071.scala rename to tests/pos/t3071.scala diff --git a/tests/untried/pos/t3079.scala b/tests/pos/t3079.scala similarity index 100% rename from tests/untried/pos/t3079.scala rename to tests/pos/t3079.scala diff --git a/tests/untried/pos/t3136.scala b/tests/pos/t3136.scala similarity index 100% rename from tests/untried/pos/t3136.scala rename to tests/pos/t3136.scala diff --git a/tests/untried/pos/t3160.scala b/tests/pos/t3160.scala similarity index 100% rename from tests/untried/pos/t3160.scala rename to tests/pos/t3160.scala diff --git a/tests/untried/pos/t3174b.scala b/tests/pos/t3174b.scala similarity index 100% rename from tests/untried/pos/t3174b.scala rename to tests/pos/t3174b.scala diff --git a/tests/untried/pos/t318.scala b/tests/pos/t318.scala similarity index 100% rename from tests/untried/pos/t318.scala rename to tests/pos/t318.scala diff --git a/tests/untried/pos/t3272.scala b/tests/pos/t3272.scala similarity index 100% rename from tests/untried/pos/t3272.scala rename to tests/pos/t3272.scala diff --git a/tests/pending/pos/t3274.scala b/tests/pos/t3274.scala similarity index 100% rename from tests/pending/pos/t3274.scala rename to tests/pos/t3274.scala diff --git a/tests/untried/pos/t3312.scala b/tests/pos/t3312.scala similarity index 100% rename from tests/untried/pos/t3312.scala rename to tests/pos/t3312.scala diff --git a/tests/untried/pos/t3371.scala b/tests/pos/t3371.scala similarity index 100% rename from tests/untried/pos/t3371.scala rename to tests/pos/t3371.scala diff --git a/tests/untried/pos/t3373.scala b/tests/pos/t3373.scala similarity index 100% rename from tests/untried/pos/t3373.scala rename to tests/pos/t3373.scala diff --git a/tests/untried/pos/t3374.scala b/tests/pos/t3374.scala similarity index 100% rename from tests/untried/pos/t3374.scala rename to tests/pos/t3374.scala diff --git a/tests/untried/pos/t3384.scala b/tests/pos/t3384.scala similarity index 100% rename from tests/untried/pos/t3384.scala rename to tests/pos/t3384.scala diff --git a/tests/untried/pos/t3420.scala b/tests/pos/t3420.scala similarity index 100% rename from tests/untried/pos/t3420.scala rename to tests/pos/t3420.scala diff --git a/tests/untried/pos/t3430.scala b/tests/pos/t3430.scala similarity index 100% rename from tests/untried/pos/t3430.scala rename to tests/pos/t3430.scala diff --git a/tests/untried/pos/t3440.scala b/tests/pos/t3440.scala similarity index 100% rename from tests/untried/pos/t3440.scala rename to tests/pos/t3440.scala diff --git a/tests/untried/pos/t3452f.scala b/tests/pos/t3452f.scala similarity index 100% rename from tests/untried/pos/t3452f.scala rename to tests/pos/t3452f.scala diff --git a/tests/pending/pos/t3477.scala b/tests/pos/t3477.scala similarity index 100% rename from tests/pending/pos/t3477.scala rename to tests/pos/t3477.scala diff --git a/tests/pending/pos/t3480.scala b/tests/pos/t3480.scala similarity index 100% rename from tests/pending/pos/t3480.scala rename to tests/pos/t3480.scala diff --git a/tests/untried/pos/t348plus.scala b/tests/pos/t348plus.scala similarity index 100% rename from tests/untried/pos/t348plus.scala rename to tests/pos/t348plus.scala diff --git a/tests/untried/pos/t3495.scala b/tests/pos/t3495.scala similarity index 100% rename from tests/untried/pos/t3495.scala rename to tests/pos/t3495.scala diff --git a/tests/pending/pos/t3498-new.scala b/tests/pos/t3498-new.scala similarity index 100% rename from tests/pending/pos/t3498-new.scala rename to tests/pos/t3498-new.scala diff --git a/tests/untried/pos/t3528.scala b/tests/pos/t3528.scala similarity index 100% rename from tests/untried/pos/t3528.scala rename to tests/pos/t3528.scala diff --git a/tests/pending/pos/t3534.scala b/tests/pos/t3534.scala similarity index 100% rename from tests/pending/pos/t3534.scala rename to tests/pos/t3534.scala diff --git a/tests/untried/pos/t3560.scala b/tests/pos/t3560.scala similarity index 100% rename from tests/untried/pos/t3560.scala rename to tests/pos/t3560.scala diff --git a/tests/pending/pos/t3568.scala b/tests/pos/t3568.scala similarity index 100% rename from tests/pending/pos/t3568.scala rename to tests/pos/t3568.scala diff --git a/tests/untried/pos/t3570.scala b/tests/pos/t3570.scala similarity index 100% rename from tests/untried/pos/t3570.scala rename to tests/pos/t3570.scala diff --git a/tests/untried/pos/t3578.scala b/tests/pos/t3578.scala similarity index 100% rename from tests/untried/pos/t3578.scala rename to tests/pos/t3578.scala diff --git a/tests/untried/pos/t3582.scala b/tests/pos/t3582.scala similarity index 100% rename from tests/untried/pos/t3582.scala rename to tests/pos/t3582.scala diff --git a/tests/pending/pos/t3582b.scala b/tests/pos/t3582b.scala similarity index 100% rename from tests/pending/pos/t3582b.scala rename to tests/pos/t3582b.scala diff --git a/tests/untried/pos/t359.scala b/tests/pos/t359.scala similarity index 100% rename from tests/untried/pos/t359.scala rename to tests/pos/t359.scala diff --git a/tests/pending/pos/t360.scala b/tests/pos/t360.scala similarity index 100% rename from tests/pending/pos/t360.scala rename to tests/pos/t360.scala diff --git a/tests/untried/pos/t361.scala b/tests/pos/t361.scala similarity index 100% rename from tests/untried/pos/t361.scala rename to tests/pos/t361.scala diff --git a/tests/pending/pos/t3612.scala b/tests/pos/t3612.scala similarity index 100% rename from tests/pending/pos/t3612.scala rename to tests/pos/t3612.scala diff --git a/tests/untried/pos/t3636.scala b/tests/pos/t3636.scala similarity index 100% rename from tests/untried/pos/t3636.scala rename to tests/pos/t3636.scala diff --git a/tests/untried/pos/t3670.scala b/tests/pos/t3670.scala similarity index 100% rename from tests/untried/pos/t3670.scala rename to tests/pos/t3670.scala diff --git a/tests/untried/pos/t3671.scala b/tests/pos/t3671.scala similarity index 100% rename from tests/untried/pos/t3671.scala rename to tests/pos/t3671.scala diff --git a/tests/untried/pos/t3672.scala b/tests/pos/t3672.scala similarity index 100% rename from tests/untried/pos/t3672.scala rename to tests/pos/t3672.scala diff --git a/tests/untried/pos/t3676.scala b/tests/pos/t3676.scala similarity index 100% rename from tests/untried/pos/t3676.scala rename to tests/pos/t3676.scala diff --git a/tests/pending/pos/t3688.scala b/tests/pos/t3688.scala similarity index 100% rename from tests/pending/pos/t3688.scala rename to tests/pos/t3688.scala diff --git a/tests/untried/pos/t372.scala b/tests/pos/t372.scala similarity index 100% rename from tests/untried/pos/t372.scala rename to tests/pos/t372.scala diff --git a/tests/untried/pos/t3731.scala b/tests/pos/t3731.scala similarity index 100% rename from tests/untried/pos/t3731.scala rename to tests/pos/t3731.scala diff --git a/tests/untried/pos/t374.scala b/tests/pos/t374.scala similarity index 100% rename from tests/untried/pos/t374.scala rename to tests/pos/t374.scala diff --git a/tests/untried/pos/t3774.scala b/tests/pos/t3774.scala similarity index 100% rename from tests/untried/pos/t3774.scala rename to tests/pos/t3774.scala diff --git a/tests/pending/pos/t3777.scala b/tests/pos/t3777.scala similarity index 100% rename from tests/pending/pos/t3777.scala rename to tests/pos/t3777.scala diff --git a/tests/untried/pos/t3792.scala b/tests/pos/t3792.scala similarity index 100% rename from tests/untried/pos/t3792.scala rename to tests/pos/t3792.scala diff --git a/tests/untried/pos/t3808.scala b/tests/pos/t3808.scala similarity index 100% rename from tests/untried/pos/t3808.scala rename to tests/pos/t3808.scala diff --git a/tests/untried/pos/t3833.scala b/tests/pos/t3833.scala similarity index 100% rename from tests/untried/pos/t3833.scala rename to tests/pos/t3833.scala diff --git a/tests/untried/pos/t3836.scala b/tests/pos/t3836.scala similarity index 100% rename from tests/untried/pos/t3836.scala rename to tests/pos/t3836.scala diff --git a/tests/untried/pos/t3837.scala b/tests/pos/t3837.scala similarity index 100% rename from tests/untried/pos/t3837.scala rename to tests/pos/t3837.scala diff --git a/tests/pending/pos/t3859.scala b/tests/pos/t3859.scala similarity index 100% rename from tests/pending/pos/t3859.scala rename to tests/pos/t3859.scala diff --git a/tests/untried/pos/t3861.scala b/tests/pos/t3861.scala similarity index 100% rename from tests/untried/pos/t3861.scala rename to tests/pos/t3861.scala diff --git a/tests/untried/pos/t3866.scala b/tests/pos/t3866.scala similarity index 100% rename from tests/untried/pos/t3866.scala rename to tests/pos/t3866.scala diff --git a/tests/pending/pos/t3869.scala b/tests/pos/t3869.scala similarity index 100% rename from tests/pending/pos/t3869.scala rename to tests/pos/t3869.scala diff --git a/tests/untried/pos/t3883.scala b/tests/pos/t3883.scala similarity index 100% rename from tests/untried/pos/t3883.scala rename to tests/pos/t3883.scala diff --git a/tests/untried/pos/t389.scala b/tests/pos/t389.scala similarity index 100% rename from tests/untried/pos/t389.scala rename to tests/pos/t389.scala diff --git a/tests/untried/pos/t3890.scala b/tests/pos/t3890.scala similarity index 100% rename from tests/untried/pos/t3890.scala rename to tests/pos/t3890.scala diff --git a/tests/untried/pos/t3898.scala b/tests/pos/t3898.scala similarity index 100% rename from tests/untried/pos/t3898.scala rename to tests/pos/t3898.scala diff --git a/tests/untried/pos/t3924.scala b/tests/pos/t3924.scala similarity index 100% rename from tests/untried/pos/t3924.scala rename to tests/pos/t3924.scala diff --git a/tests/untried/pos/t3927.scala b/tests/pos/t3927.scala similarity index 100% rename from tests/untried/pos/t3927.scala rename to tests/pos/t3927.scala diff --git a/tests/pending/pos/t3960.scala b/tests/pos/t3960.scala similarity index 100% rename from tests/pending/pos/t3960.scala rename to tests/pos/t3960.scala diff --git a/tests/untried/pos/t397.scala b/tests/pos/t397.scala similarity index 100% rename from tests/untried/pos/t397.scala rename to tests/pos/t397.scala diff --git a/tests/untried/pos/t3972.scala b/tests/pos/t3972.scala similarity index 100% rename from tests/untried/pos/t3972.scala rename to tests/pos/t3972.scala diff --git a/tests/pending/pos/t3986.scala b/tests/pos/t3986.scala similarity index 100% rename from tests/pending/pos/t3986.scala rename to tests/pos/t3986.scala diff --git a/tests/pending/pos/t404.scala b/tests/pos/t404.scala similarity index 100% rename from tests/pending/pos/t404.scala rename to tests/pos/t404.scala diff --git a/tests/pending/pos/t415.scala b/tests/pos/t415.scala similarity index 100% rename from tests/pending/pos/t415.scala rename to tests/pos/t415.scala diff --git a/tests/pending/pos/t4176.scala b/tests/pos/t4176.scala similarity index 100% rename from tests/pending/pos/t4176.scala rename to tests/pos/t4176.scala diff --git a/tests/pos/t4176b.scala b/tests/pos/t4176b.scala new file mode 100644 index 000000000000..eebb5dda583d --- /dev/null +++ b/tests/pos/t4176b.scala @@ -0,0 +1,5 @@ +object Test { + def foo(a1: String*) = a1 +// val fooEta = foo _ + (foo: Seq[String] => Seq[String]) +} diff --git a/tests/pending/pos/t430-feb09.scala b/tests/pos/t430-feb09.scala similarity index 100% rename from tests/pending/pos/t430-feb09.scala rename to tests/pos/t430-feb09.scala diff --git a/tests/pending/pos/t4336.scala b/tests/pos/t4336.scala similarity index 100% rename from tests/pending/pos/t4336.scala rename to tests/pos/t4336.scala diff --git a/tests/pending/pos/t4345.scala b/tests/pos/t4345.scala similarity index 100% rename from tests/pending/pos/t4345.scala rename to tests/pos/t4345.scala diff --git a/tests/pending/pos/t4545.scala b/tests/pos/t4545.scala similarity index 100% rename from tests/pending/pos/t4545.scala rename to tests/pos/t4545.scala diff --git a/tests/pending/pos/t4579.scala b/tests/pos/t4579.scala similarity index 100% rename from tests/pending/pos/t4579.scala rename to tests/pos/t4579.scala diff --git a/tests/pending/pos/t460.scala b/tests/pos/t460.scala similarity index 100% rename from tests/pending/pos/t460.scala rename to tests/pos/t460.scala diff --git a/tests/pending/pos/t4760.scala b/tests/pos/t4760.scala similarity index 99% rename from tests/pending/pos/t4760.scala rename to tests/pos/t4760.scala index d4407a86b496..039f08368070 100644 --- a/tests/pending/pos/t4760.scala +++ b/tests/pos/t4760.scala @@ -32,3 +32,4 @@ class Test { case 1 => import scala.concurrent._ } } + diff --git a/tests/pending/pos/t4853.scala b/tests/pos/t4853.scala similarity index 100% rename from tests/pending/pos/t4853.scala rename to tests/pos/t4853.scala diff --git a/tests/pending/pos/t4859.scala b/tests/pos/t4859.scala similarity index 100% rename from tests/pending/pos/t4859.scala rename to tests/pos/t4859.scala diff --git a/tests/pos/t4911.flags b/tests/pos/t4911.flags new file mode 100644 index 000000000000..a5c112f5a7e7 --- /dev/null +++ b/tests/pos/t4911.flags @@ -0,0 +1 @@ +-language:Scala2 \ No newline at end of file diff --git a/tests/pending/pos/t4911.scala b/tests/pos/t4911.scala similarity index 100% rename from tests/pending/pos/t4911.scala rename to tests/pos/t4911.scala diff --git a/tests/pending/pos/t4975.scala b/tests/pos/t4975.scala similarity index 100% rename from tests/pending/pos/t4975.scala rename to tests/pos/t4975.scala diff --git a/tests/pending/pos/t5012.scala b/tests/pos/t5012.scala similarity index 100% rename from tests/pending/pos/t5012.scala rename to tests/pos/t5012.scala diff --git a/tests/pending/pos/t5029.scala b/tests/pos/t5029.scala similarity index 100% rename from tests/pending/pos/t5029.scala rename to tests/pos/t5029.scala diff --git a/tests/pending/pos/t5041.scala b/tests/pos/t5041.scala similarity index 100% rename from tests/pending/pos/t5041.scala rename to tests/pos/t5041.scala diff --git a/tests/pending/pos/t5082.scala b/tests/pos/t5082.scala similarity index 100% rename from tests/pending/pos/t5082.scala rename to tests/pos/t5082.scala diff --git a/tests/pending/pos/t5541.scala b/tests/pos/t5541.scala similarity index 100% rename from tests/pending/pos/t5541.scala rename to tests/pos/t5541.scala diff --git a/tests/pending/pos/t566.scala b/tests/pos/t566.scala similarity index 100% rename from tests/pending/pos/t566.scala rename to tests/pos/t566.scala diff --git a/tests/pending/pos/t5720-ownerous.scala b/tests/pos/t5720-ownerous.scala similarity index 100% rename from tests/pending/pos/t5720-ownerous.scala rename to tests/pos/t5720-ownerous.scala diff --git a/tests/pending/pos/t5729.scala b/tests/pos/t5729.scala similarity index 100% rename from tests/pending/pos/t5729.scala rename to tests/pos/t5729.scala diff --git a/tests/pending/pos/t573.scala b/tests/pos/t573.scala similarity index 100% rename from tests/pending/pos/t573.scala rename to tests/pos/t573.scala diff --git a/tests/pending/pos/t5859.scala b/tests/pos/t5859.scala similarity index 100% rename from tests/pending/pos/t5859.scala rename to tests/pos/t5859.scala diff --git a/tests/pending/pos/t5877.scala b/tests/pos/t5877.scala similarity index 100% rename from tests/pending/pos/t5877.scala rename to tests/pos/t5877.scala diff --git a/tests/pending/pos/t5877b.scala b/tests/pos/t5877b.scala similarity index 100% rename from tests/pending/pos/t5877b.scala rename to tests/pos/t5877b.scala diff --git a/tests/pending/pos/t5900a.scala b/tests/pos/t5900a.scala similarity index 100% rename from tests/pending/pos/t5900a.scala rename to tests/pos/t5900a.scala diff --git a/tests/pending/pos/t5932.scala b/tests/pos/t5932.scala similarity index 100% rename from tests/pending/pos/t5932.scala rename to tests/pos/t5932.scala diff --git a/tests/pending/pos/t596.scala b/tests/pos/t596.scala similarity index 100% rename from tests/pending/pos/t596.scala rename to tests/pos/t596.scala diff --git a/tests/pending/pos/t5967.scala b/tests/pos/t5967.scala similarity index 100% rename from tests/pending/pos/t5967.scala rename to tests/pos/t5967.scala diff --git a/tests/pending/pos/t6014.scala b/tests/pos/t6014.scala similarity index 100% rename from tests/pending/pos/t6014.scala rename to tests/pos/t6014.scala diff --git a/tests/pending/pos/t604.scala b/tests/pos/t604.scala similarity index 100% rename from tests/pending/pos/t604.scala rename to tests/pos/t604.scala diff --git a/tests/pending/pos/t6089b.scala b/tests/pos/t6089b.scala similarity index 100% rename from tests/pending/pos/t6089b.scala rename to tests/pos/t6089b.scala diff --git a/tests/pending/pos/t6117.scala b/tests/pos/t6117.scala similarity index 100% rename from tests/pending/pos/t6117.scala rename to tests/pos/t6117.scala diff --git a/tests/pending/pos/t6123-explaintypes-implicits.scala b/tests/pos/t6123-explaintypes-implicits.scala similarity index 100% rename from tests/pending/pos/t6123-explaintypes-implicits.scala rename to tests/pos/t6123-explaintypes-implicits.scala diff --git a/tests/pending/pos/t6145.scala b/tests/pos/t6145.scala similarity index 100% rename from tests/pending/pos/t6145.scala rename to tests/pos/t6145.scala diff --git a/tests/pending/pos/t6184.scala b/tests/pos/t6184.scala similarity index 100% rename from tests/pending/pos/t6184.scala rename to tests/pos/t6184.scala diff --git a/tests/pending/pos/t6208.scala b/tests/pos/t6208.scala similarity index 100% rename from tests/pending/pos/t6208.scala rename to tests/pos/t6208.scala diff --git a/tests/pending/pos/t6225.scala b/tests/pos/t6225.scala similarity index 100% rename from tests/pending/pos/t6225.scala rename to tests/pos/t6225.scala diff --git a/tests/pending/pos/t6231.scala b/tests/pos/t6231.scala similarity index 100% rename from tests/pending/pos/t6231.scala rename to tests/pos/t6231.scala diff --git a/tests/pending/pos/t6231b.scala b/tests/pos/t6231b.scala similarity index 100% rename from tests/pending/pos/t6231b.scala rename to tests/pos/t6231b.scala diff --git a/tests/pending/pos/t6335.scala b/tests/pos/t6335.scala similarity index 100% rename from tests/pending/pos/t6335.scala rename to tests/pos/t6335.scala diff --git a/tests/pending/pos/t6575a.scala b/tests/pos/t6575a.scala similarity index 100% rename from tests/pending/pos/t6575a.scala rename to tests/pos/t6575a.scala diff --git a/tests/pending/pos/t6600.scala b/tests/pos/t6600.scala similarity index 100% rename from tests/pending/pos/t6600.scala rename to tests/pos/t6600.scala diff --git a/tests/pending/pos/t661.scala b/tests/pos/t661.scala similarity index 88% rename from tests/pending/pos/t661.scala rename to tests/pos/t661.scala index 3a447241fe12..f2b76ee2f894 100644 --- a/tests/pending/pos/t661.scala +++ b/tests/pos/t661.scala @@ -9,7 +9,7 @@ object test { } trait B extends A { type N; - trait C extends super.C { + trait CC extends super.C { type M = N; override def foo(n : M) : Unit = super.foo(n); } diff --git a/tests/pending/pos/t6664b.scala b/tests/pos/t6664b.scala similarity index 100% rename from tests/pending/pos/t6664b.scala rename to tests/pos/t6664b.scala diff --git a/tests/pending/pos/t697.scala b/tests/pos/t697.scala similarity index 100% rename from tests/pending/pos/t697.scala rename to tests/pos/t697.scala diff --git a/tests/pending/pos/t6994.scala b/tests/pos/t6994.scala similarity index 100% rename from tests/pending/pos/t6994.scala rename to tests/pos/t6994.scala diff --git a/tests/pending/pos/t7011.scala b/tests/pos/t7011.scala similarity index 100% rename from tests/pending/pos/t7011.scala rename to tests/pos/t7011.scala diff --git a/tests/pending/pos/t703.scala b/tests/pos/t703.scala similarity index 100% rename from tests/pending/pos/t703.scala rename to tests/pos/t703.scala diff --git a/tests/pending/pos/t704.scala b/tests/pos/t704.scala similarity index 100% rename from tests/pending/pos/t704.scala rename to tests/pos/t704.scala diff --git a/tests/pending/pos/t7126.scala b/tests/pos/t7126.scala similarity index 100% rename from tests/pending/pos/t7126.scala rename to tests/pos/t7126.scala diff --git a/tests/pending/pos/t7226.scala b/tests/pos/t7226.scala similarity index 100% rename from tests/pending/pos/t7226.scala rename to tests/pos/t7226.scala diff --git a/tests/pending/pos/t7285a.scala b/tests/pos/t7285a.scala similarity index 94% rename from tests/pending/pos/t7285a.scala rename to tests/pos/t7285a.scala index 34e79c741b5b..23b52f5950bb 100644 --- a/tests/pending/pos/t7285a.scala +++ b/tests/pos/t7285a.scala @@ -23,12 +23,15 @@ object Test1 { case object Up extends Base { } + locally { + (d1: Base, d2: Base) => (d1, d2) match { case (Up, Up) | (Down, Down) => false case (Down, Up) => true case (Up, Down) => false } + } } } @@ -42,10 +45,12 @@ object Test2 { case object Up extends Base { } + locally { (d1: Base, d2: Base) => (d1) match { case Up | Down => false } + } } } @@ -55,10 +60,12 @@ object Test3 { object Base { case object Down extends Base + locally { (d1: Base, d2: Base) => (d1, d2) match { case (Down, Down) => false } + } } } @@ -74,10 +81,12 @@ object Test4 { } import Test4.Base._ + locally { (d1: Base, d2: Base) => (d1, d2) match { case (Up, Up) | (Down, Down) => false case (Down, Test4.Base.Up) => true case (Up, Down) => false } + } } diff --git a/tests/pending/pos/t7475a.scala b/tests/pos/t7475a.scala similarity index 100% rename from tests/pending/pos/t7475a.scala rename to tests/pos/t7475a.scala diff --git a/tests/pending/pos/t7475b.scala b/tests/pos/t7475b.scala similarity index 100% rename from tests/pending/pos/t7475b.scala rename to tests/pos/t7475b.scala diff --git a/tests/pending/pos/t7520.scala b/tests/pos/t7520.scala similarity index 100% rename from tests/pending/pos/t7520.scala rename to tests/pos/t7520.scala diff --git a/tests/pending/pos/t758.scala b/tests/pos/t758.scala similarity index 100% rename from tests/pending/pos/t758.scala rename to tests/pos/t758.scala diff --git a/tests/pending/pos/t7591/Demo.scala b/tests/pos/t7591.scala similarity index 100% rename from tests/pending/pos/t7591/Demo.scala rename to tests/pos/t7591.scala diff --git a/tests/pending/pos/t7782.scala b/tests/pos/t7782.scala similarity index 100% rename from tests/pending/pos/t7782.scala rename to tests/pos/t7782.scala diff --git a/tests/pending/pos/t7782b.scala b/tests/pos/t7782b.scala similarity index 100% rename from tests/pending/pos/t7782b.scala rename to tests/pos/t7782b.scala diff --git a/tests/pending/pos/t7785.scala b/tests/pos/t7785.scala similarity index 100% rename from tests/pending/pos/t7785.scala rename to tests/pos/t7785.scala diff --git a/tests/pending/pos/t7853.scala b/tests/pos/t7853.scala similarity index 100% rename from tests/pending/pos/t7853.scala rename to tests/pos/t7853.scala diff --git a/tests/pending/pos/t788.scala b/tests/pos/t788.scala similarity index 100% rename from tests/pending/pos/t788.scala rename to tests/pos/t788.scala diff --git a/tests/pending/pos/t7928.scala b/tests/pos/t7928.scala similarity index 100% rename from tests/pending/pos/t7928.scala rename to tests/pos/t7928.scala diff --git a/tests/pending/pos/t796.scala b/tests/pos/t796.scala similarity index 100% rename from tests/pending/pos/t796.scala rename to tests/pos/t796.scala diff --git a/tests/pending/pos/t7983.scala b/tests/pos/t7983.scala similarity index 100% rename from tests/pending/pos/t7983.scala rename to tests/pos/t7983.scala diff --git a/tests/pending/pos/t802.scala b/tests/pos/t802.scala similarity index 87% rename from tests/pending/pos/t802.scala rename to tests/pos/t802.scala index 2dea7036d657..50a948251517 100644 --- a/tests/pending/pos/t802.scala +++ b/tests/pos/t802.scala @@ -8,12 +8,12 @@ trait Test { } abstract class ParensImpl extends BracesImpl { type Brace <: Singleton with BraceImpl; - trait BraceImpl extends super.BraceImpl; + trait BraceImpl2 extends super.BraceImpl; } val parens : ParensImpl; abstract class BracksImpl extends BracesImpl { type Brace <: Singleton with BraceImpl; - trait BraceImpl extends super.BraceImpl; + trait BraceImpl2 extends super.BraceImpl; } val bracks : BracksImpl; trait File { diff --git a/tests/pending/pos/t8023b.scala b/tests/pos/t8023b.scala similarity index 100% rename from tests/pending/pos/t8023b.scala rename to tests/pos/t8023b.scala diff --git a/tests/pending/pos/t8045.scala b/tests/pos/t8045.scala similarity index 100% rename from tests/pending/pos/t8045.scala rename to tests/pos/t8045.scala diff --git a/tests/pending/pos/t805.scala b/tests/pos/t805.scala similarity index 76% rename from tests/pending/pos/t805.scala rename to tests/pos/t805.scala index 37bf6b5ef87f..a1260a834f73 100644 --- a/tests/pending/pos/t805.scala +++ b/tests/pos/t805.scala @@ -5,11 +5,11 @@ trait MatcherYYY { } } trait BraceMatcherXXX extends MatcherYYY { - trait NodeImpl extends super.NodeImpl { + trait NodeImpl2 extends super.NodeImpl { def doMatch (braces : BracePair) : Unit } trait BracePair { - trait BraceImpl extends NodeImpl with Matchable { + trait BraceImpl extends NodeImpl2 with Matchable { override def doMatch : Unit = { super.doMatch; (); diff --git a/tests/pending/pos/t8128.scala b/tests/pos/t8128.scala similarity index 100% rename from tests/pending/pos/t8128.scala rename to tests/pos/t8128.scala diff --git a/tests/pending/pos/t8177a.scala b/tests/pos/t8177a.scala similarity index 100% rename from tests/pending/pos/t8177a.scala rename to tests/pos/t8177a.scala diff --git a/tests/pending/pos/t8187.scala b/tests/pos/t8187.scala similarity index 100% rename from tests/pending/pos/t8187.scala rename to tests/pos/t8187.scala diff --git a/tests/pending/pos/t8219.scala b/tests/pos/t8219.scala similarity index 100% rename from tests/pending/pos/t8219.scala rename to tests/pos/t8219.scala diff --git a/tests/pending/pos/t8367.scala b/tests/pos/t8367.scala similarity index 100% rename from tests/pending/pos/t8367.scala rename to tests/pos/t8367.scala diff --git a/tests/pending/pos/t8369a.scala b/tests/pos/t8369a.scala similarity index 100% rename from tests/pending/pos/t8369a.scala rename to tests/pos/t8369a.scala diff --git a/tests/pending/pos/t873.scala b/tests/pos/t873.scala similarity index 100% rename from tests/pending/pos/t873.scala rename to tests/pos/t873.scala diff --git a/tests/pending/pos/t911.scala b/tests/pos/t911.scala similarity index 100% rename from tests/pending/pos/t911.scala rename to tests/pos/t911.scala diff --git a/tests/pending/pos/tcpoly_infer_ticket1864.scala b/tests/pos/tcpoly_infer_ticket1864.scala similarity index 100% rename from tests/pending/pos/tcpoly_infer_ticket1864.scala rename to tests/pos/tcpoly_infer_ticket1864.scala diff --git a/tests/pending/pos/tcpoly_ticket2096.scala b/tests/pos/tcpoly_ticket2096.scala similarity index 100% rename from tests/pending/pos/tcpoly_ticket2096.scala rename to tests/pos/tcpoly_ticket2096.scala diff --git a/tests/pending/pos/tcpoly_variance_pos.scala b/tests/pos/tcpoly_variance_pos.scala similarity index 100% rename from tests/pending/pos/tcpoly_variance_pos.scala rename to tests/pos/tcpoly_variance_pos.scala diff --git a/tests/pending/pos/ted.scala b/tests/pos/ted.scala similarity index 100% rename from tests/pending/pos/ted.scala rename to tests/pos/ted.scala diff --git a/tests/pending/pos/test4.scala b/tests/pos/test4.scala similarity index 100% rename from tests/pending/pos/test4.scala rename to tests/pos/test4.scala diff --git a/tests/pending/pos/test5.scala b/tests/pos/test5.scala similarity index 100% rename from tests/pending/pos/test5.scala rename to tests/pos/test5.scala diff --git a/tests/pending/pos/test5refine.scala b/tests/pos/test5refine.scala similarity index 100% rename from tests/pending/pos/test5refine.scala rename to tests/pos/test5refine.scala diff --git a/tests/pending/pos/typealiases.scala b/tests/pos/typealiases.scala similarity index 100% rename from tests/pending/pos/typealiases.scala rename to tests/pos/typealiases.scala diff --git a/tests/pending/pos/typerep-stephane.scala b/tests/pos/typerep-stephane.scala similarity index 100% rename from tests/pending/pos/typerep-stephane.scala rename to tests/pos/typerep-stephane.scala diff --git a/tests/pending/pos/virtpatmat_alts_subst.scala b/tests/pos/virtpatmat_alts_subst.scala similarity index 100% rename from tests/pending/pos/virtpatmat_alts_subst.scala rename to tests/pos/virtpatmat_alts_subst.scala diff --git a/tests/pending/pos/virtpatmat_exist1.scala b/tests/pos/virtpatmat_exist1.scala similarity index 100% rename from tests/pending/pos/virtpatmat_exist1.scala rename to tests/pos/virtpatmat_exist1.scala diff --git a/tests/pending/pos/virtpatmat_exist3.scala b/tests/pos/virtpatmat_exist3.scala similarity index 100% rename from tests/pending/pos/virtpatmat_exist3.scala rename to tests/pos/virtpatmat_exist3.scala diff --git a/tests/pending/pos/virtpatmat_exist_uncurry.scala b/tests/pos/virtpatmat_exist_uncurry.scala similarity index 100% rename from tests/pending/pos/virtpatmat_exist_uncurry.scala rename to tests/pos/virtpatmat_exist_uncurry.scala diff --git a/tests/untried/pos/t2619.scala b/tests/untried/pos/t2619.scala deleted file mode 100644 index 283d93bf2b97..000000000000 --- a/tests/untried/pos/t2619.scala +++ /dev/null @@ -1,80 +0,0 @@ -abstract class F { - final def apply(x: Int): AnyRef = null -} -abstract class AbstractModule { - def as: List[AnyRef] - def ms: List[AbstractModule] - def fs: List[F] = Nil - def rs(x: Int): List[AnyRef] = fs.map(_(x)) -} -abstract class ModuleType1 extends AbstractModule {} -abstract class ModuleType2 extends AbstractModule {} - -object ModuleAE extends ModuleType1 { - def as = Nil - def ms = Nil -} -object ModuleAF extends ModuleType2 { - def as = Nil - def ms = List(ModuleAE) -} -object ModuleAG extends ModuleType1 { - def as = List("") - def ms = Nil -} -object ModuleAI extends ModuleType1 { - def as = Nil - def ms = List(ModuleAE) -} -object ModuleAK extends ModuleType2 { - def as = Nil - def ms = List(ModuleAF) -} -object ModuleAL extends ModuleType1 { - def as = Nil - def ms = List( - ModuleAG, - ModuleAI - ) -} -object ModuleAM extends ModuleType1 { - def as = Nil - def ms = List( - ModuleAL, - ModuleAE - ) ::: List(ModuleAK) -} -object ModuleBE extends ModuleType1 { - def as = Nil - def ms = Nil -} -object ModuleBF extends ModuleType2 { - def as = Nil - def ms = List(ModuleBE) -} -object ModuleBG extends ModuleType1 { - def as = List("") - def ms = Nil -} -object ModuleBI extends ModuleType1 { - def as = Nil - def ms = List(ModuleBE) -} -object ModuleBK extends ModuleType2 { - def as = Nil - def ms = List(ModuleBF) -} -object ModuleBL extends ModuleType1 { - def as = Nil - def ms = List( - ModuleBG, - ModuleBI - ) -} -object ModuleBM extends ModuleType1 { - def as = Nil - def ms = List( - ModuleBL, - ModuleBE - ) ::: List(ModuleBK) -} diff --git a/tests/untried/pos/t262.scala b/tests/untried/pos/t262.scala deleted file mode 100644 index 9f7686a8f342..000000000000 --- a/tests/untried/pos/t262.scala +++ /dev/null @@ -1,14 +0,0 @@ -object O { - abstract class A { - def f:A; - } - class B extends A { - def f = if (1 == 2) new C else new D; - } - class C extends A { - def f = this; - } - class D extends A { - def f = this; - } -} diff --git a/tests/untried/pos/t2635.scala b/tests/untried/pos/t2635.scala deleted file mode 100644 index 7cd55313561a..000000000000 --- a/tests/untried/pos/t2635.scala +++ /dev/null @@ -1,16 +0,0 @@ -abstract class Base - -object Test -{ - def run(c: Class[_ <: Base]): Unit = { - } - - def main(args: Array[String]): Unit = - { - val sc: Option[Class[_ <: Base]] = Some(classOf[Base]) - sc match { - case Some(c) => run(c) - case None => - } - } -} diff --git a/tests/untried/pos/t2664.scala b/tests/untried/pos/t2664.scala deleted file mode 100644 index 7b667d0106e2..000000000000 --- a/tests/untried/pos/t2664.scala +++ /dev/null @@ -1,9 +0,0 @@ -package pkg1 { - class C { - private[pkg1] def foo: Int = 1 - } - - trait T extends C { - private[pkg1] abstract override def foo = super.foo + 1 - } -} diff --git a/tests/untried/pos/t2665.scala b/tests/untried/pos/t2665.scala deleted file mode 100644 index e46453534c0f..000000000000 --- a/tests/untried/pos/t2665.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test { - val x: Unit = Array("") -} diff --git a/tests/untried/pos/t2667.scala b/tests/untried/pos/t2667.scala deleted file mode 100644 index 7f1f36f00bad..000000000000 --- a/tests/untried/pos/t2667.scala +++ /dev/null @@ -1,6 +0,0 @@ -object A { - def foo(x: Int, y: Int*): Int = 45 - def foo[T](x: T*): Int = 55 - - val x: Unit = foo(23, 23f) -} diff --git a/tests/untried/pos/t2669.scala b/tests/untried/pos/t2669.scala deleted file mode 100644 index 72e931178c06..000000000000 --- a/tests/untried/pos/t2669.scala +++ /dev/null @@ -1,28 +0,0 @@ -// #2629, #2639, #2669 -object Test2669 { - - def test[T](l: java.util.ArrayList[_ <: T]) = 1 - test(new java.util.ArrayList[String]()) - -} - -import java.util.ArrayList - -object Test2629 { - def main(args: Array[String]): Unit = { - val l = new ArrayList[String](1) - val m = new ArrayList(l) - - println(l.size) - println(m.size) - } -} - - -import java.util.Vector - -// scalac cannot detect lack of type params, but then throws AssertionError later: -class TVector2639 { - val b = new Vector // this line passed without error detected - val a = new Vector(1) // this line caused throwing AssertionError when scalac -} diff --git a/tests/untried/pos/t2683.scala b/tests/untried/pos/t2683.scala deleted file mode 100644 index 4ba34b554a91..000000000000 --- a/tests/untried/pos/t2683.scala +++ /dev/null @@ -1,7 +0,0 @@ -class A -class B extends A - -object Test { - val c: Class[_ <: A] = Class.forName("B").asSubclass(classOf[A]) - val x: Option[Class[_ <: A]] = Some(3).map { case _ => c } -} diff --git a/tests/untried/pos/t2691.scala b/tests/untried/pos/t2691.scala deleted file mode 100644 index 5f0ddd122f87..000000000000 --- a/tests/untried/pos/t2691.scala +++ /dev/null @@ -1,16 +0,0 @@ -object Breakdown { - def unapplySeq(x: Int): Some[List[String]] = Some(List("", "there")) -} -object Test { - 42 match { - case Breakdown("") => // needed to trigger bug - case Breakdown("", who) => println ("hello " + who) - } -} -object Test2 { - 42 match { - case Breakdown("") => // needed to trigger bug - case Breakdown("foo") => // needed to trigger bug - case Breakdown("", who) => println ("hello " + who) - } -} diff --git a/tests/untried/pos/t2693.scala b/tests/untried/pos/t2693.scala deleted file mode 100644 index 5d4d0380c418..000000000000 --- a/tests/untried/pos/t2693.scala +++ /dev/null @@ -1,6 +0,0 @@ -class A { - trait T[A] - def usetHk[T[_], A](ta: T[A]) = 0 - usetHk(new T[Int]{}: T[Int]) - usetHk(new T[Int]{}) // fails with: found: java.lang.Object with T[Int], required: ?T[ ?A ] -} diff --git a/tests/untried/pos/t2698.scala b/tests/untried/pos/t2698.scala deleted file mode 100644 index bce02e48b3d6..000000000000 --- a/tests/untried/pos/t2698.scala +++ /dev/null @@ -1,14 +0,0 @@ -class WordExp { - abstract class Label - type _labelT <: Label -} - -import scala.collection._ - -abstract class S2 { - val lang: WordExp - type __labelT = lang._labelT - - var deltaq: Array[__labelT] = _ - def delta1 = immutable.Map(deltaq.zipWithIndex: _*) -}