diff options
author | Martin Odersky <odersky@gmail.com> | 2015-12-15 17:46:39 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-12-19 14:47:16 +0100 |
commit | 4619393a6c3b52127ceec07e2fc3630d22aef51a (patch) | |
tree | c7bfcee91ca38b06e1aa81da7770001e3e5c5da9 /tests/untried | |
parent | 8e257a63872697bd48a51ce93a0289c9f5acdfd8 (diff) | |
download | dotty-4619393a6c3b52127ceec07e2fc3630d22aef51a.tar.gz dotty-4619393a6c3b52127ceec07e2fc3630d22aef51a.tar.bz2 dotty-4619393a6c3b52127ceec07e2fc3630d22aef51a.zip |
Categorize more tests
All pos tests up to 3999 have been triaged. One new test in pending.
Diffstat (limited to 'tests/untried')
62 files changed, 0 insertions, 829 deletions
diff --git a/tests/untried/pos/t2619.scala b/tests/untried/pos/t2619.scala deleted file mode 100644 index 283d93bf2..000000000 --- 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 9f7686a8f..000000000 --- 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 7cd553135..000000000 --- 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 7b667d010..000000000 --- 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 e46453534..000000000 --- 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 7f1f36f00..000000000 --- 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 72e931178..000000000 --- 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 4ba34b554..000000000 --- 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 5f0ddd122..000000000 --- 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 5d4d0380c..000000000 --- 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 bce02e48b..000000000 --- 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: _*) -} diff --git a/tests/untried/pos/t3048.scala b/tests/untried/pos/t3048.scala deleted file mode 100644 index dc056ecba..000000000 --- a/tests/untried/pos/t3048.scala +++ /dev/null @@ -1,8 +0,0 @@ -class B -object C extends B - -class F[T <: B](cons: => T) -class F2[T <: B](cons: => T) extends F(cons) - -object D extends F2(C) // works -object E extends F2(new B {}) diff --git a/tests/untried/pos/t3071.scala b/tests/untried/pos/t3071.scala deleted file mode 100644 index 7e1443294..000000000 --- a/tests/untried/pos/t3071.scala +++ /dev/null @@ -1,7 +0,0 @@ -class A (val i: Int) { - def copy (i: Int = this.i): A = new A(i) -} - -class B (val j: Int) extends A(1) { - override def copy (j: Int = this.j): B = new B(j) -} diff --git a/tests/untried/pos/t3079.scala b/tests/untried/pos/t3079.scala deleted file mode 100644 index b7bd63190..000000000 --- a/tests/untried/pos/t3079.scala +++ /dev/null @@ -1,17 +0,0 @@ -sealed trait Identity[A] { - val value: A -} - -trait Coerce[A, B] { - def unwrap: (A => B) -} - -object Coerce { - def IdentityCoerce[B] = new Coerce[Identity[B], B] { - // java.lang.Error: A in trait Identity cannot be instantiated from ?x$1.type - def unwrap = _.value - - // Providing the type of _ works around the problem. - //def unwrap = (_: Identity[B]).value - } -} diff --git a/tests/untried/pos/t3136.scala b/tests/untried/pos/t3136.scala deleted file mode 100644 index 239bd8f54..000000000 --- a/tests/untried/pos/t3136.scala +++ /dev/null @@ -1,19 +0,0 @@ -class Type -class Symbol -case class PolyType(tps: List[Symbol], res: Type) extends Type -class OtherType extends Type - -// case class NullaryMethodType(tp: Type) extends Type - -object NullaryMethodType { - def apply(resTpe: Type): Type = PolyType(List(), resTpe) - def unapply(tp: Type): Option[(Type)] = None -} - -object Test { - def TEST(tp: Type): String = - tp match { - case PolyType(ps1, PolyType(ps2, res @ PolyType(a, b))) => "1" + tp // couldn't find a simpler version that still crashes - case NullaryMethodType(meh) => "2" + meh - } -} diff --git a/tests/untried/pos/t3160.scala b/tests/untried/pos/t3160.scala deleted file mode 100644 index cc007dc01..000000000 --- a/tests/untried/pos/t3160.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.collection.mutable._ -class Node - -class A { - def f(x: Node): Node = ??? -} diff --git a/tests/untried/pos/t3174b.scala b/tests/untried/pos/t3174b.scala deleted file mode 100644 index 4df1bfe83..000000000 --- a/tests/untried/pos/t3174b.scala +++ /dev/null @@ -1,12 +0,0 @@ -trait Foo[X] { def foo : Map[String,Foo[X]] } - -object Test { - def f[T]() : Foo[T] = { - class Anon extends Foo[T] { - var foo: Map[String, Foo[T]] = Map[String,Foo[T]]() - //def foo = Map[String,Foo[T]]() - //def foo_=(x: Map[String,Foo[T]]) {} - } - new Anon - } -} diff --git a/tests/untried/pos/t318.scala b/tests/untried/pos/t318.scala deleted file mode 100644 index dbe0e0528..000000000 --- a/tests/untried/pos/t318.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test { - def fun: Int = { - object o { - def a: Int = 1; - class C { def b: Int = a; } - } - 0 - } -} diff --git a/tests/untried/pos/t3272.scala b/tests/untried/pos/t3272.scala deleted file mode 100644 index cf54d6a84..000000000 --- a/tests/untried/pos/t3272.scala +++ /dev/null @@ -1,8 +0,0 @@ -trait A { - trait C[+T] { - protected[this] def f(t: T): Unit = {} - } - trait D[T] extends C[T] { - def g(t: T): Unit = { f(t) } - } -} diff --git a/tests/untried/pos/t3312.scala b/tests/untried/pos/t3312.scala deleted file mode 100644 index aef965d2e..000000000 --- a/tests/untried/pos/t3312.scala +++ /dev/null @@ -1,17 +0,0 @@ -trait Root { - def say: String -} - -trait A extends Root { - override def say: String = "bow" -} - -trait B extends Root { - override def say: String = "hi" -} - -object Foo extends A with B { - override def say: String = foo(super[A].say) - - def foo(p: => String): String = p -} diff --git a/tests/untried/pos/t3371.scala b/tests/untried/pos/t3371.scala deleted file mode 100644 index 897cd9de4..000000000 --- a/tests/untried/pos/t3371.scala +++ /dev/null @@ -1,9 +0,0 @@ -// that compiles -class Test(myValue:String) { println(myValue) } - -// that compiles too -trait Other { val otherValue = "" } -class Test2(myValue:String) { self:Other => println(otherValue) } - -// that does not compile saying that myValue is not found -class Test3(myValue:String) { self:Other => println(myValue) } diff --git a/tests/untried/pos/t3373.scala b/tests/untried/pos/t3373.scala deleted file mode 100644 index b6594fb6c..000000000 --- a/tests/untried/pos/t3373.scala +++ /dev/null @@ -1,11 +0,0 @@ -class Entry(time: Long) { - def getTime: Long = time -} - -object Test { - def extractTime(e: Entry) = e.getTime - - implicit val orderEntries: Ordering[Entry] = new Ordering[Entry] { - def compare(first: Entry, second: Entry) = extractTime(first) compare extractTime(second) - } -} diff --git a/tests/untried/pos/t3374.scala b/tests/untried/pos/t3374.scala deleted file mode 100644 index c9bedcf69..000000000 --- a/tests/untried/pos/t3374.scala +++ /dev/null @@ -1,6 +0,0 @@ -trait Parent { - type Test[A, H[B <: A]] -} -trait Sub extends Parent { - type Test[AS, HS[B <: AS]] = AS -} diff --git a/tests/untried/pos/t3384.scala b/tests/untried/pos/t3384.scala deleted file mode 100644 index 4d4a81d69..000000000 --- a/tests/untried/pos/t3384.scala +++ /dev/null @@ -1,14 +0,0 @@ -package test - -package p { - class A(a: String = "") -} - -package object po { - type A = p.A -} - -import po._ -class C { - val a = new A() //p.A.init$default$1) -} diff --git a/tests/untried/pos/t3420.scala b/tests/untried/pos/t3420.scala deleted file mode 100644 index 0fc56ed67..000000000 --- a/tests/untried/pos/t3420.scala +++ /dev/null @@ -1,5 +0,0 @@ -class C { - val cv = Map[Int, Int](1 -> 2) - lazy val cl = Map[Int, Int](1 -> 2) - def cd = Map[Int, Int](1 -> 2) -} diff --git a/tests/untried/pos/t3430.scala b/tests/untried/pos/t3430.scala deleted file mode 100644 index f86d776bd..000000000 --- a/tests/untried/pos/t3430.scala +++ /dev/null @@ -1,13 +0,0 @@ -// package com.example - -object A { - def f1(f: String => Boolean) = f("a") - - def f2(): Boolean = - f1 { s1 => - f1 { s2 => - while (true) { } - true - } - } -} diff --git a/tests/untried/pos/t3440.scala b/tests/untried/pos/t3440.scala deleted file mode 100644 index 0e7ca6b70..000000000 --- a/tests/untried/pos/t3440.scala +++ /dev/null @@ -1,18 +0,0 @@ -object test { - abstract class SampleFormat1 { - def readerFactory: Any - } - - case object Int8 extends SampleFormat1 { - def readerFactory = sys.error("") - } - case object Int16 extends SampleFormat1 { - def readerFactory = sys.error("") - } - - (new {}: Any) match { - case 8 => Int8 - case 16 => Int16 - case _ => sys.error("") - } -} diff --git a/tests/untried/pos/t3452f.scala b/tests/untried/pos/t3452f.scala deleted file mode 100644 index efe25a62f..000000000 --- a/tests/untried/pos/t3452f.scala +++ /dev/null @@ -1,10 +0,0 @@ -class Base[Coll] { - trait Transformed[S] { - lazy val underlying: Coll = ??? - } -} - -class Derived extends Base[String] { - class C extends Transformed[Any] -} - diff --git a/tests/untried/pos/t348plus.scala b/tests/untried/pos/t348plus.scala deleted file mode 100644 index e61f7346f..000000000 --- a/tests/untried/pos/t348plus.scala +++ /dev/null @@ -1,24 +0,0 @@ -// bug #348 - -trait Foo { - type bar <: Bar; - abstract class Bar; - case class Baz(r:bar) extends Bar; - case object NoBar extends Bar; -} -object Test extends App { - object ConcreteFooBar extends Foo { // if moved to toplevel, it works - type bar = Bar; - } - def foo = { - import ConcreteFooBar._ ; - Baz( NoBar ) - } -} - -// bug #367 - -object Bla { - def foo(): Unit = (return null).equals(null); -} - diff --git a/tests/untried/pos/t3495.scala b/tests/untried/pos/t3495.scala deleted file mode 100644 index 8d5dff430..000000000 --- a/tests/untried/pos/t3495.scala +++ /dev/null @@ -1,2 +0,0 @@ -class Foo { } - diff --git a/tests/untried/pos/t3528.scala b/tests/untried/pos/t3528.scala deleted file mode 100644 index ff49b3e92..000000000 --- a/tests/untried/pos/t3528.scala +++ /dev/null @@ -1,8 +0,0 @@ -class A { - // 3528 - not fixed - // def f1 = List(List(1), Stream(1)) - // 3528 comments - def f2 = List(Set(1,2,3), List(1,2,3)) - // 2322 - def f3 = List(null: Range, null: List[Int]) -} diff --git a/tests/untried/pos/t3560.scala b/tests/untried/pos/t3560.scala deleted file mode 100644 index 3cde9710d..000000000 --- a/tests/untried/pos/t3560.scala +++ /dev/null @@ -1,2 +0,0 @@ -trait Foo[X] { def foo : Map[String,Foo[X]] } -object T3560 { def f[T]() : Foo[T] = new Foo[T] { var foo = Map[String,Foo[T]]() } } diff --git a/tests/untried/pos/t3570.scala b/tests/untried/pos/t3570.scala deleted file mode 100644 index 237391719..000000000 --- a/tests/untried/pos/t3570.scala +++ /dev/null @@ -1,7 +0,0 @@ -class test { - object Break extends Throwable - def break = throw Break - def block(x: => Unit): Unit = { - try { x } catch { case e: Break.type => } - } -} diff --git a/tests/untried/pos/t3578.scala b/tests/untried/pos/t3578.scala deleted file mode 100644 index 2ce92a776..000000000 --- a/tests/untried/pos/t3578.scala +++ /dev/null @@ -1,30 +0,0 @@ -object Test { - sealed abstract class JValue { - def ++(other: JValue) = { - def append(value1: JValue, value2: JValue): JValue = (value1, value2) match { - case (JNothing, x) => x - case (x, JNothing) => x - case (JObject(xs), x: JField) => JObject(xs ::: List(x)) - case (x: JField, JObject(xs)) => JObject(x :: xs) - case (JArray(xs), JArray(ys)) => JArray(xs ::: ys) - case (JArray(xs), v: JValue) => JArray(xs ::: List(v)) - case (v: JValue, JArray(xs)) => JArray(v :: xs) - case (f1: JField, f2: JField) => JObject(f1 :: f2 :: Nil) - case (JField(n, v1), v2: JValue) => JField(n, append(v1, v2)) - case (x, y) => JArray(x :: y :: Nil) - } - append(this, other) - } - } - - case object JNothing extends JValue - case object JNull extends JValue - case class JString(s: String) extends JValue - case class JDouble(num: Double) extends JValue - case class JInt(num: BigInt) extends JValue - case class JBool(value: Boolean) extends JValue - case class JField(name: String, value: JValue) extends JValue - case class JObject(obj: List[JField]) extends JValue - case class JArray(arr: List[JValue]) extends JValue -} - diff --git a/tests/untried/pos/t3582.scala b/tests/untried/pos/t3582.scala deleted file mode 100644 index d13d69775..000000000 --- a/tests/untried/pos/t3582.scala +++ /dev/null @@ -1,12 +0,0 @@ -trait C[A] -object Test { - def ImplicitParamCA[CC[A], A](implicit ev: C[A]): Unit = {implicitly[C[A]]} // must use this exact syntax... - // error: could not find implicit value for parameter e: C[A] -} -// [[syntax trees at end of typer]] -// abstract trait C#5[A#9116 >: Nothing#5832 <: Any#52] extends scala#33.AnyRef#2780; -// final object Test#15 extends java.lang.Object#2485 with ScalaObject#1913 { -// def ImplicitParamCA#9123[CC#9124[A#10858 >: Nothing#5832 <: Any#52] >: [A#10858]Nothing#5832 <: [A#10858]Any#52, -// A#9125 >: Nothing#5832 <: Any#52](implicit ev#10856: C#5[A#9127]): Unit#3818 -// = scala#34.this.Predef#1683.implicitly#8816[C#5[A#10858]]() -// } diff --git a/tests/untried/pos/t359.scala b/tests/untried/pos/t359.scala deleted file mode 100644 index 11233c3ba..000000000 --- a/tests/untried/pos/t359.scala +++ /dev/null @@ -1,28 +0,0 @@ -object Bug359 { - class C; - def f1(xs: List[C]): C = { - g { - xs => - if (false) { - f1(xs) - } else { - val a: C = null; - val b: C = null; - if (xs.isEmpty) a else b - } - } - } - def f2(xs: List[C]): C = { - g { - xs => - if (false) { - val a: C = null; - val b: C = null; - if (xs.isEmpty) a else b - } else { - f2(xs); - } - } - } - private def g(op: List[C] => C): C = null; -} diff --git a/tests/untried/pos/t361.scala b/tests/untried/pos/t361.scala deleted file mode 100644 index 1d19ecb52..000000000 --- a/tests/untried/pos/t361.scala +++ /dev/null @@ -1,16 +0,0 @@ -class Bug361Global extends Bug361Trees - -abstract class Bug361Trees { self: Bug361Global => - - abstract class Tree { - var pos: Int = 0 - } - - object posAssigner { - def atPos[T <: Tree](pos: Int, tree: T): T = { - tree.pos = pos; tree - } - } - - def atPos[T <: Tree](pos: Int)(tree: T): T = posAssigner.atPos(pos, tree) -} diff --git a/tests/untried/pos/t3636.scala b/tests/untried/pos/t3636.scala deleted file mode 100644 index cd224a32f..000000000 --- a/tests/untried/pos/t3636.scala +++ /dev/null @@ -1,49 +0,0 @@ -class CTxnLocal[ T ] { - def set( x: T )( implicit t: Txn ): Unit = {} - def get( implicit t: Txn ) : T = null.asInstanceOf[ T ] - def initialValue( t: Txn ) : T = null.asInstanceOf[ T ] -} - -trait Txn - -trait ProcTxn { - def ccstm: Txn -} - -trait TxnLocal[ @specialized T ] { - def apply()( implicit tx: ProcTxn ) : T - def set( v: T )( implicit tx: ProcTxn ) : Unit - def swap( v: T )( implicit tx: ProcTxn ) : T - def transform( f: T => T )( implicit tx: ProcTxn ) : Unit -} - -object TxnLocal { - def apply[ @specialized T ] : TxnLocal[ T ] = new Impl( new CTxnLocal[ T ]) - def apply[ @specialized T ]( initValue: => T ) : TxnLocal[ T ] = new Impl( new CTxnLocal[ T ] { - override def initialValue( tx: Txn ): T = initValue - }) - - private class Impl[ T ]( c: CTxnLocal[ T ]) extends TxnLocal[ T ] { - def apply()( implicit tx: ProcTxn ) : T = c.get( tx.ccstm ) - def set( v: T )( implicit tx: ProcTxn ) : Unit = c.set( v )( tx.ccstm ) - def swap( v: T )( implicit tx: ProcTxn ) : T = { - // currently not implemented in CTxnLocal - val oldV = apply - set( v ) - oldV - } - def transform( f: T => T )( implicit tx: ProcTxn ): Unit = { - set( f( apply )) - } - } -} - - -object Transition { - private val currentRef = TxnLocal[ Transition ]( Instant ) - def current( implicit tx: ProcTxn ) : Transition = currentRef() -} - -sealed abstract class Transition -case object Instant extends Transition - diff --git a/tests/untried/pos/t3670.scala b/tests/untried/pos/t3670.scala deleted file mode 100644 index 4eb7cebbc..000000000 --- a/tests/untried/pos/t3670.scala +++ /dev/null @@ -1,43 +0,0 @@ -class A { - val n = { - val z = { - lazy val bb = 1 - bb - } - val a = { - lazy val cc = 2 - cc - } - lazy val b = { - lazy val dd = 3 - dd - } - z - } -} - -class B { - locally { - lazy val ms = "as" - ms - } -} - -class C { - val things = List("things") - if (things.size < 100) { - lazy val msg = "foo" - msg - } -} - -class D { - val things = List("things") - if (things.size < 100) { - if (things.size > 10) { - lazy val msg = "foo" - msg - } - } -} - diff --git a/tests/untried/pos/t3671.scala b/tests/untried/pos/t3671.scala deleted file mode 100644 index afb3a539d..000000000 --- a/tests/untried/pos/t3671.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Crash { - def crash(value: Int): Unit = - value match { - case java.lang.Integer.MAX_VALUE => println("MAX_VALUE") - case java.lang.Integer.MIN_VALUE => println("MIN_VALUE") - } -} diff --git a/tests/untried/pos/t3672.scala b/tests/untried/pos/t3672.scala deleted file mode 100644 index b2752ce21..000000000 --- a/tests/untried/pos/t3672.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test { - def foo(f: Int => Int) = () ; foo { implicit x : Int => x + 1 } - def bar(f: Int => Int) = () ; foo { x : Int => x + 1 } -} diff --git a/tests/untried/pos/t3676.scala b/tests/untried/pos/t3676.scala deleted file mode 100644 index 60c0ceaec..000000000 --- a/tests/untried/pos/t3676.scala +++ /dev/null @@ -1,5 +0,0 @@ -trait SeqLike[+Repr] -trait Seq extends SeqLike[Seq] - -trait MySeq extends Seq with SeqLike[MySub] -trait MySub extends MySeq diff --git a/tests/untried/pos/t372.scala b/tests/untried/pos/t372.scala deleted file mode 100644 index 9ce5b9ab7..000000000 --- a/tests/untried/pos/t372.scala +++ /dev/null @@ -1,2 +0,0 @@ -class Bug372Names; -class Bug372Symbols { self: Bug372Symbols with Bug372Names => } diff --git a/tests/untried/pos/t3731.scala b/tests/untried/pos/t3731.scala deleted file mode 100644 index 7a3cbec0f..000000000 --- a/tests/untried/pos/t3731.scala +++ /dev/null @@ -1,13 +0,0 @@ -object Test{ - trait ZW[S]{type T} - def ZipWith[S, M <: ZW[S]]: M#T = sys.error("ZW") - - // meh must be parameterised to force an asSeenFrom that - // duplicates the refinement in the TR's pre without updating its sym - def meh[A] = ZipWith[A, ZW[A]{type T=Stream[A]}] - - meh[Int]: Stream[Int] -} -// debugging output in coevolveSym should say: -// coevolved type T#11029 : Stream#3234[A#9228] to type T#11277 : Stream#3234[A#9227] -// with Test.ZW#9219[A#9228]{type T#11029 = Stream#3234[A#9228]} -> Test.ZW#9219[A#9227]{type T#11277 = Stream#3234[A#9227]} diff --git a/tests/untried/pos/t374.scala b/tests/untried/pos/t374.scala deleted file mode 100644 index fb9c0b402..000000000 --- a/tests/untried/pos/t374.scala +++ /dev/null @@ -1,21 +0,0 @@ -object tokens extends Enumeration { - type Token = Value; - val BAD = Value("<bad>"); - val IDENT = Value("ident"); - val NAME = Value("name"); -} - -object test extends AnyRef with App { - import tokens._; - - val reserved = new scala.collection.mutable.HashMap[String, Token](); - - if (true) { - reserved.get("a") match { - case None => IDENT - case Some(tk) => tk - } - } - else - BAD -} diff --git a/tests/untried/pos/t3774.scala b/tests/untried/pos/t3774.scala deleted file mode 100644 index 2869925b0..000000000 --- a/tests/untried/pos/t3774.scala +++ /dev/null @@ -1,5 +0,0 @@ -// This used to hang the lub process. Now it rejects the file. This is still not correct, -// but we can solve this only after a redesign of lub a la dot. -object Hang { - Map[(Int,Int),List[Int]]() ++ (for(x <- 0 to 1 ; y <- 0 to 1) yield {(x,y)-> (0 to 1)}) -} diff --git a/tests/untried/pos/t3792.scala b/tests/untried/pos/t3792.scala deleted file mode 100644 index 364d46317..000000000 --- a/tests/untried/pos/t3792.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test { - type Hui = Nil.type - val n: Hui = Nil -} diff --git a/tests/untried/pos/t3808.scala b/tests/untried/pos/t3808.scala deleted file mode 100644 index ec95fed4d..000000000 --- a/tests/untried/pos/t3808.scala +++ /dev/null @@ -1,11 +0,0 @@ -object Test { - def meh: Unit = { - trait TC[I] - implicit val tci: TC[Int] = new TC[Int]{} - - def baz[J : TC] : String = "meh" - - baz - // () // commenting or uncommenting this line should not affect compilation (visibly) - } -} diff --git a/tests/untried/pos/t3833.scala b/tests/untried/pos/t3833.scala deleted file mode 100644 index 2df658df1..000000000 --- a/tests/untried/pos/t3833.scala +++ /dev/null @@ -1,26 +0,0 @@ -object Main { - def mkArray[T <: A](atype: Int) :T#AType = { - (atype match { - case 1 => - new Array[Int](10) - // Decompiled code: return (Object[])new int[10]; - case 2 => - new Array[Float](10) - }).asInstanceOf[T#AType] - } - - def main(args: Array[String]): Unit = { - println(mkArray[I](1)) - //java.lang.ClassCastException: [I cannot be cast to [Ljava.lang.Object; - } -} - -trait A { - type AType <: AnyRef -} -trait I extends A { - type AType = Array[Int] -} -trait F extends A { - type AType = Array[Float] -} diff --git a/tests/untried/pos/t3836.scala b/tests/untried/pos/t3836.scala deleted file mode 100644 index 840f17116..000000000 --- a/tests/untried/pos/t3836.scala +++ /dev/null @@ -1,14 +0,0 @@ -package foo - -package object bar { - type IOException = java.io.IOException -} - -package baz { - import java.io._ - import foo.bar._ - - object Test { - def f = new IOException - } -} diff --git a/tests/untried/pos/t3837.scala b/tests/untried/pos/t3837.scala deleted file mode 100644 index bcaf63cc8..000000000 --- a/tests/untried/pos/t3837.scala +++ /dev/null @@ -1,10 +0,0 @@ -class BipClass { } -trait BipTrait { - self: BipClass => - - private[this] def foo() = 5 - def bar() = this.foo() -} -// error: value foo is not a member of BipTrait with BipClass -// def bar() = this.foo() -// ^ diff --git a/tests/untried/pos/t3861.scala b/tests/untried/pos/t3861.scala deleted file mode 100644 index 5ebe02520..000000000 --- a/tests/untried/pos/t3861.scala +++ /dev/null @@ -1,2 +0,0 @@ -trait Y -abstract class X(x: Int) { self: Y => x } diff --git a/tests/untried/pos/t3862.scala b/tests/untried/pos/t3862.scala deleted file mode 100644 index 8ca4a0586..000000000 --- a/tests/untried/pos/t3862.scala +++ /dev/null @@ -1,8 +0,0 @@ -object OverloadingShapeType { - // comment out this, and the other alternative is chosen. - def blerg(f: String): Unit = {} - - def blerg[M[X], T](l: M[T]): Unit = {} - - blerg(List(1)) // error: type mismatch; found : List[Int] required: String -} diff --git a/tests/untried/pos/t3866.scala b/tests/untried/pos/t3866.scala deleted file mode 100644 index f1f64edb9..000000000 --- a/tests/untried/pos/t3866.scala +++ /dev/null @@ -1,17 +0,0 @@ -abstract class ImplicitRepeated { - trait T[+A, +B] - trait X - - def f[N, R <: List[_]](elems: T[N, R]*): Unit // alternative a) - def f[N, R <: List[_]](props: String, elems: T[N, R]*): Unit // alternative b) - - // the following implicit causes "cannot be applied" errors - implicit def xToRight(r: X): T[Nothing, X] = null - implicit def anyToN[N](x: N): T[N, Nothing] = null - - - f("A", 1, 2) // should be implicitly resolved to alternative b) - f( 1, 2 ) // should be implicitly resolved to alternative a) - // ImplicitRepeated.this.f[Int, Nothing]("A", ImplicitRepeated.this.anyToN[Int](1), ImplicitRepeated.this.anyToN[Int](2)); - // ImplicitRepeated.this.f[Int, Nothing](ImplicitRepeated.this.anyToN[Int](1), ImplicitRepeated.this.anyToN[Int](2)) -} diff --git a/tests/untried/pos/t3883.scala b/tests/untried/pos/t3883.scala deleted file mode 100644 index 1b62c0c6d..000000000 --- a/tests/untried/pos/t3883.scala +++ /dev/null @@ -1,15 +0,0 @@ -// need to test both orders -object A1 { - implicit def i: Equiv[Boolean] = sys.error("") - implicit def div[T, A](implicit f: T => A, eq: Equiv[A]): Equiv[T] = sys.error("") - - implicitly[Equiv[Boolean]] -} - -object A2 { - implicit def div[T, A](implicit f: T => A, eq: Equiv[A]): Equiv[T] = sys.error("") - implicit def i: Equiv[Boolean] = sys.error("") - - implicitly[Equiv[Boolean]] -} - diff --git a/tests/untried/pos/t389.scala b/tests/untried/pos/t389.scala deleted file mode 100644 index 535bd4de8..000000000 --- a/tests/untried/pos/t389.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Test { - def a = 'a - def b = 'B - def c = '+ - //def d = '`\n` //error: unclosed character literal - def e = '\u0041 -} diff --git a/tests/untried/pos/t3890.scala b/tests/untried/pos/t3890.scala deleted file mode 100644 index 0c5f5dfe6..000000000 --- a/tests/untried/pos/t3890.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test { - def g[S, T <: S](s: S)(t: T): Unit = println("") - g("a")("a") // error: inferred type arguments [java.lang.String] do not conform to method g's type parameter bounds [T <: S] -} diff --git a/tests/untried/pos/t3898.scala b/tests/untried/pos/t3898.scala deleted file mode 100644 index ab47bbd87..000000000 --- a/tests/untried/pos/t3898.scala +++ /dev/null @@ -1,6 +0,0 @@ -trait Atomic[@specialized(Boolean) T] { - def x: T - - def f(fn: T => T): Boolean = f(fn(x), true) - def f[R](a: T, b: R): R = b -} diff --git a/tests/untried/pos/t3924.scala b/tests/untried/pos/t3924.scala deleted file mode 100644 index b11b67c56..000000000 --- a/tests/untried/pos/t3924.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test { - class Hoe extends Serializable { - def add(a: java.io.Serializable): Unit = println(a) - def someMethod(): Unit = { add(this) } - } -} diff --git a/tests/untried/pos/t3927.scala b/tests/untried/pos/t3927.scala deleted file mode 100644 index 5e0d581d4..000000000 --- a/tests/untried/pos/t3927.scala +++ /dev/null @@ -1,6 +0,0 @@ -object A { - def x: Unit = { - implicit lazy val e: Equiv[Int] = sys.error("") - implicitly[Equiv[Int]] - } -} diff --git a/tests/untried/pos/t397.scala b/tests/untried/pos/t397.scala deleted file mode 100644 index 87be2987a..000000000 --- a/tests/untried/pos/t397.scala +++ /dev/null @@ -1,16 +0,0 @@ -abstract class Root { - - abstract class Edge { - type V; - def source: V; - } - - abstract class Graph { - type W; - type E <: Edge{type V = W}; - def edge: E; - } - - val g: Graph{type W = Int}; - val x: Int = g.edge.source; -} diff --git a/tests/untried/pos/t3972.scala b/tests/untried/pos/t3972.scala deleted file mode 100644 index 65ef43f84..000000000 --- a/tests/untried/pos/t3972.scala +++ /dev/null @@ -1,11 +0,0 @@ -object CompilerCrash { - def main(args: Array[String]): Unit = { - args match { - case Array("a", a : _*) => { } // The code compiles fine if this line is commented out or "@ _*" is deleted or this line is swapped for the next line - case Array("b") => { } // The code compiles fine if this line is commented out - case Array("c", c) => { - 0 // The code compiles fine if this line is commented out - } - } - } -} |