diff options
Diffstat (limited to 'tests/untried/pos')
44 files changed, 0 insertions, 433 deletions
diff --git a/tests/untried/pos/t2500.scala b/tests/untried/pos/t2500.scala deleted file mode 100644 index d0ff99a93..000000000 --- a/tests/untried/pos/t2500.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test { - import scala.collection._ - ((Map(1 -> "a", 2 -> "b"): collection.Map[Int, String]) map identity[(Int, String)]) : scala.collection.Map[Int,String] - ((SortedMap(1 -> "a", 2 -> "b"): collection.SortedMap[Int, String]) map identity[(Int, String)]): scala.collection.SortedMap[Int,String] - ((SortedSet(1, 2): collection.SortedSet[Int]) map identity[Int]): scala.collection.SortedSet[Int] -} diff --git a/tests/untried/pos/t2504.scala b/tests/untried/pos/t2504.scala deleted file mode 100755 index 67f822685..000000000 --- a/tests/untried/pos/t2504.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test { - val ys: Iterable[_] = Array("abc") - val xs = Array("abc") - xs sameElements Array("abc") -} diff --git a/tests/untried/pos/t252.scala b/tests/untried/pos/t252.scala deleted file mode 100644 index d51b5511e..000000000 --- a/tests/untried/pos/t252.scala +++ /dev/null @@ -1,17 +0,0 @@ -abstract class Module {} - -abstract class T { - type moduleType <: Module - val module: moduleType -} - -abstract class Base { - type mType = Module - type tType = T { type moduleType <: mType } -} - -abstract class Derived extends Base { - def f(inputs: List[tType]): Unit = { - for (t <- inputs; m = t.module) { } - } -} diff --git a/tests/untried/pos/t2545.scala b/tests/untried/pos/t2545.scala deleted file mode 100755 index 6ad994223..000000000 --- a/tests/untried/pos/t2545.scala +++ /dev/null @@ -1,10 +0,0 @@ -trait Frog[T] { - def hello: T - def size: Int - } - - trait OnlyWithFrogs { - self: Frog[_] => - - def sizeStr = size.toString - } diff --git a/tests/untried/pos/t2569/Child.scala b/tests/untried/pos/t2569/Child.scala deleted file mode 100644 index 64f4dc172..000000000 --- a/tests/untried/pos/t2569/Child.scala +++ /dev/null @@ -1,9 +0,0 @@ -package varargs - - class Child extends Parent { - - override def concatenate(strings: String*): String = - strings map("\"" + _ + "\"") mkString("(", ", ", ")") - - } - diff --git a/tests/untried/pos/t2569/Parent.java b/tests/untried/pos/t2569/Parent.java deleted file mode 100644 index 89421becb..000000000 --- a/tests/untried/pos/t2569/Parent.java +++ /dev/null @@ -1,13 +0,0 @@ -package varargs; - - public class Parent { - - public String concatenate(String... strings) { - StringBuilder builder = new StringBuilder(); - for (String s : strings) { - builder.append(s); - } - return builder.toString(); - } - - } diff --git a/tests/untried/pos/t2591.scala b/tests/untried/pos/t2591.scala deleted file mode 100644 index 47ae551bf..000000000 --- a/tests/untried/pos/t2591.scala +++ /dev/null @@ -1,15 +0,0 @@ -class A -class B - -object Implicits { - implicit def imp(x: A): Int = 41 - implicit def imp(x: B): Int = 41 -} - -object Test { - // should cause imp to be in scope so that the next expression type checks - // `import Implicits._` works - import Implicits.imp - - (new A) : Int -} diff --git a/tests/untried/pos/t2708.scala b/tests/untried/pos/t2708.scala deleted file mode 100644 index 19485bf4c..000000000 --- a/tests/untried/pos/t2708.scala +++ /dev/null @@ -1 +0,0 @@ -class Foo(@volatile var v: Int) diff --git a/tests/untried/pos/t2726/SQLBuilder_1.scala b/tests/untried/pos/t2726/SQLBuilder_1.scala deleted file mode 100644 index 8d07a8826..000000000 --- a/tests/untried/pos/t2726/SQLBuilder_1.scala +++ /dev/null @@ -1,7 +0,0 @@ -class SQLBuilder extends SQLBuilder.Segment - -object SQLBuilder { - trait Segment -} - - diff --git a/tests/untried/pos/t2726/t2726_2.scala b/tests/untried/pos/t2726/t2726_2.scala deleted file mode 100644 index e738143ae..000000000 --- a/tests/untried/pos/t2726/t2726_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object SQuery2Test { - new SQLBuilder -} diff --git a/tests/untried/pos/t2741/2741_1.scala b/tests/untried/pos/t2741/2741_1.scala deleted file mode 100644 index d9d04f7ab..000000000 --- a/tests/untried/pos/t2741/2741_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -trait Partial { - type Apply[XYZ] = List[XYZ] -} -trait MA[M[_]] -trait MAs { - val a: MA[Partial#Apply] = null // after compilation, the type is pickled as `MA[ [B] List[B] ]` -} - -object Scalaz extends MAs diff --git a/tests/untried/pos/t2741/2741_2.scala b/tests/untried/pos/t2741/2741_2.scala deleted file mode 100644 index a9fd9d7d0..000000000 --- a/tests/untried/pos/t2741/2741_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -// object Test compiles jointly, but not separately. -object Test { - import Scalaz._ - Scalaz.a -} diff --git a/tests/untried/pos/t2764/Ann.java b/tests/untried/pos/t2764/Ann.java deleted file mode 100644 index 184fc6e86..000000000 --- a/tests/untried/pos/t2764/Ann.java +++ /dev/null @@ -1,5 +0,0 @@ -package bippy; - -public @interface Ann { - Enum value(); -} diff --git a/tests/untried/pos/t2764/Enum.java b/tests/untried/pos/t2764/Enum.java deleted file mode 100644 index fe0755953..000000000 --- a/tests/untried/pos/t2764/Enum.java +++ /dev/null @@ -1,5 +0,0 @@ -package bippy; - -public enum Enum { - VALUE; -} diff --git a/tests/untried/pos/t2764/Use.scala b/tests/untried/pos/t2764/Use.scala deleted file mode 100644 index b0c108907..000000000 --- a/tests/untried/pos/t2764/Use.scala +++ /dev/null @@ -1,6 +0,0 @@ -package bippy - -class Use { - @Ann(Enum.VALUE) - def foo: Unit = {} -} diff --git a/tests/untried/pos/t2782.scala b/tests/untried/pos/t2782.scala deleted file mode 100644 index 3b387af80..000000000 --- a/tests/untried/pos/t2782.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.{collection => sc} - -object Test { - trait Foo[T] - - // Haven't managed to repro without using a CanBuild or CanBuildFrom implicit parameter - implicit def MapFoo[A, B, M[A, B] <: sc.Map[A,B]](implicit aFoo: Foo[A], bFoo: Foo[B], cb: sc.generic.CanBuild[(A, B), M[A, B]]): Test.Foo[M[A,B]] = new Foo[M[A,B]] {} - implicit object Tuple2IntIntFoo extends Foo[(Int, Int)] // no difference if this line is uncommented - implicit def Tuple2Foo[A, B]: Test.Foo[(A, B)] = new Foo[(A, B)] {} // nor this one - - implicitly[Foo[(Int, Int)]] -} - -class A { - def x[N[X] >: M[X], M[_], G](n: N[G], m: M[G]) = null - - x(Some(3), Seq(2)) -} diff --git a/tests/untried/pos/t2794.scala b/tests/untried/pos/t2794.scala deleted file mode 100644 index a17edf8cb..000000000 --- a/tests/untried/pos/t2794.scala +++ /dev/null @@ -1,9 +0,0 @@ -class Key[T] - -class Entry[T](val k: Key[T], val v: T) - -object Entry { - - def makeDefault[T >: Null <: AnyRef] = new Entry[T](new Key[T], null: T) - -} diff --git a/tests/untried/pos/t2795-new.scala b/tests/untried/pos/t2795-new.scala deleted file mode 100644 index e307133e0..000000000 --- a/tests/untried/pos/t2795-new.scala +++ /dev/null @@ -1,19 +0,0 @@ -package t1 - -import scala.reflect.{ClassTag, classTag} - -trait Element[T] { -} - -trait Config { - type T <: Element[T] - implicit val m: ClassTag[T] - // XXX Following works fine: - // type T <: Element[_] -} - -trait Transform { self: Config => - def processBlock(block: Array[T]): Unit = { - var X = new Array[T](1) - } -} diff --git a/tests/untried/pos/t2795-old.scala b/tests/untried/pos/t2795-old.scala deleted file mode 100644 index 935cb1f44..000000000 --- a/tests/untried/pos/t2795-old.scala +++ /dev/null @@ -1,17 +0,0 @@ -package t1 - -trait Element[T] { -} - -trait Config { - type T <: Element[T] - implicit val m: ClassManifest[T] - // XXX Following works fine: - // type T <: Element[_] -} - -trait Transform { self: Config => - def processBlock(block: Array[T]): Unit = { - var X = new Array[T](1) - } -} diff --git a/tests/untried/pos/t2797.scala b/tests/untried/pos/t2797.scala deleted file mode 100644 index cf579d8de..000000000 --- a/tests/untried/pos/t2797.scala +++ /dev/null @@ -1,9 +0,0 @@ -class MyVector[A] { - def map[B](f: A => B): MyVector[B] = sys.error("") -} - -object Test { - def unzip[B, C](_this: MyVector[(B, C)]): (MyVector[B], MyVector[C]) = { - (_this.map{ bc => bc._1 }, _this.map{ bc => bc._2 }) - } -} diff --git a/tests/untried/pos/t2799.flags b/tests/untried/pos/t2799.flags deleted file mode 100644 index d1b831ea8..000000000 --- a/tests/untried/pos/t2799.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings
\ No newline at end of file diff --git a/tests/untried/pos/t2799.scala b/tests/untried/pos/t2799.scala deleted file mode 100644 index 7710cce26..000000000 --- a/tests/untried/pos/t2799.scala +++ /dev/null @@ -1 +0,0 @@ -@deprecated("hi mom", "") case class Bob () diff --git a/tests/untried/pos/t2809.scala b/tests/untried/pos/t2809.scala deleted file mode 100644 index 1f68b0b07..000000000 --- a/tests/untried/pos/t2809.scala +++ /dev/null @@ -1,20 +0,0 @@ -package p1 { - abstract class T1 { - protected def bug(p: Int = 1): Int // without 'protected' compiles fine - } -} -package p2 { // all being in the same package compiles fine - import p1._ - abstract class T2 extends T1 { - class A { - bug() - } - } - - abstract class T3 extends T2 { - class A { - bug() - } - } -} - diff --git a/tests/untried/pos/t2810.scala b/tests/untried/pos/t2810.scala deleted file mode 100644 index c85eca164..000000000 --- a/tests/untried/pos/t2810.scala +++ /dev/null @@ -1,8 +0,0 @@ - - - - -object Test { - val closeable1: { def close(): Unit } = new scala.io.Source { val iter: Iterator[Char] = "".iterator } - val closeable2: { def close(): Unit } = new java.io.Closeable { def close() = {} } -} diff --git a/tests/untried/pos/t284-pos.scala b/tests/untried/pos/t284-pos.scala deleted file mode 100644 index 40277e2db..000000000 --- a/tests/untried/pos/t284-pos.scala +++ /dev/null @@ -1,5 +0,0 @@ -trait B[T] { - def f1(a: T): Unit { } - def f2(a: T): Unit - def f3(a: T): Unit = { } -} diff --git a/tests/untried/pos/t287.scala b/tests/untried/pos/t287.scala deleted file mode 100644 index 8e5e8831c..000000000 --- a/tests/untried/pos/t287.scala +++ /dev/null @@ -1,12 +0,0 @@ -object testBuf { - class mystream extends java.io.BufferedOutputStream(new java.io.FileOutputStream("/dev/null")) { - def w( x:String ):Unit = { - val foo = new Array[Byte](2); - - // write( byte[] ) is defined in FilterOutputStream, the superclass of BufferedOutputStream - super.write( foo ); // error - - super.write( foo, 0, foo.length ); // this works however - } - } -} diff --git a/tests/untried/pos/t289.scala b/tests/untried/pos/t289.scala deleted file mode 100644 index 96c0244df..000000000 --- a/tests/untried/pos/t289.scala +++ /dev/null @@ -1,5 +0,0 @@ -class A { - object B; -} - -object C extends A; diff --git a/tests/untried/pos/t2910.scala b/tests/untried/pos/t2910.scala deleted file mode 100644 index f9f2c87a9..000000000 --- a/tests/untried/pos/t2910.scala +++ /dev/null @@ -1,33 +0,0 @@ -object Test { - def test1: Unit = { - C - object C - } - - def test2: Unit = { - println(s.length) - lazy val s = "abc" - } - - def test3: Unit = { - lazy val lazyBar = bar - object bar { - val foo = 12 - } - lazy val lazyBar2 = bar - } - - def test4: Unit = { - lazy val x = { - x - lazy val x = 12 - 0 - } - } - - def test5: Unit = { - lazy val f: Int = g - Console.println("foo") - lazy val g: Int = f - } -} diff --git a/tests/untried/pos/t2913.scala b/tests/untried/pos/t2913.scala deleted file mode 100755 index 55b72bed4..000000000 --- a/tests/untried/pos/t2913.scala +++ /dev/null @@ -1,53 +0,0 @@ -class A { - def foo(a: Int) = 0 -} - -class RichA { - def foo(a: String) = 0 - def foo(a: String, b: String) = 0 - def foo() = 0 -} - -object Test { - - implicit def AToRichA(a: A): RichA = new RichA - - val a = new A - a.foo() - a.foo(1) - - a.foo("") // Without implicits, a type error regarding invalid argument types is generated at `""`. This is - // the same position as an argument, so the 'second try' typing with an Implicit View is tried, - // and AToRichA(a).foo("") is found. - // - // My reading of the spec "7.3 Views" is that `a.foo` denotes a member of `a`, so the view should - // not be triggered. - // - // But perhaps the implementation was changed to solve See https://lampsvn.epfl.ch/trac/scala/ticket/1756 - - a.foo("a", "b") // Without implicits, a type error regarding invalid arity is generated at `foo(<error>"", "")`. - // Typers#tryTypedApply:3274 only checks if the error is as the same position as `foo`, `"a"`, or `"b"`. - // None of these po -} - -// t0851 is essentially the same: -object test1 { - case class Foo[T,T2](f : (T,T2) => String) extends (((T,T2)) => String){ - def apply(t : T) = (s:T2) => f(t,s) - def apply(p : (T,T2)) = f(p._1,p._2) - } - implicit def g[T](f : (T,String) => String): test1.Foo[T,String] = Foo(f) - def main(args : Array[String]) : Unit = { - val f = (x:Int,s:String) => s + x - println(f(1)) - () - } -} -object Main { - def main(args : Array[String]): Unit = { - val fn = (a : Int, str : String) => "a: " + a + ", str: " + str - implicit def fx[T](f : (T,String) => String): T => String = (x:T) => f(x,null) - println(fn(1)) - () - } -} diff --git a/tests/untried/pos/t2939.scala b/tests/untried/pos/t2939.scala deleted file mode 100644 index 57dd52024..000000000 --- a/tests/untried/pos/t2939.scala +++ /dev/null @@ -1,13 +0,0 @@ -import collection._ - -object Proxies { - class C1 extends MapProxy[Int,Int] { def self = Map[Int,Int]() } - class C2 extends mutable.MapProxy[Int,Int] { def self = mutable.Map[Int,Int]() } - class C3 extends immutable.MapProxy[Int,Int] { def self = immutable.Map[Int,Int]() } - - class C4 extends SetProxy[Int] { def self = Set[Int]() } - class C5 extends mutable.SetProxy[Int] { def self = mutable.Set[Int]() } - class C6 extends immutable.SetProxy[Int] { def self = immutable.Set[Int]() } - - class C7 extends SeqProxy[Int] { def self = Seq[Int]() } -} diff --git a/tests/untried/pos/t294/Ann.java b/tests/untried/pos/t294/Ann.java deleted file mode 100644 index 934ca4629..000000000 --- a/tests/untried/pos/t294/Ann.java +++ /dev/null @@ -1,3 +0,0 @@ -public @interface Ann { - public Ann2[] nested(); -} diff --git a/tests/untried/pos/t294/Ann2.java b/tests/untried/pos/t294/Ann2.java deleted file mode 100644 index 025b79e79..000000000 --- a/tests/untried/pos/t294/Ann2.java +++ /dev/null @@ -1,3 +0,0 @@ -public @interface Ann2 { - public int value(); -} diff --git a/tests/untried/pos/t294/Test_1.scala b/tests/untried/pos/t294/Test_1.scala deleted file mode 100644 index ff1f34b10..000000000 --- a/tests/untried/pos/t294/Test_1.scala +++ /dev/null @@ -1,7 +0,0 @@ -// also test pickling of java annotations; Test_2.scala will -// read this class file -@Ann(nested = Array(new Ann2(10))) class Test { - @Ann2(100) var ctx: Object = _ - @Ann(nested = Array()) def foo = 10 - @Ann(nested = Array(new Ann2(10), new Ann2(23))) val bam = -3 -} diff --git a/tests/untried/pos/t294/Test_2.scala b/tests/untried/pos/t294/Test_2.scala deleted file mode 100644 index 9fb1c6e17..000000000 --- a/tests/untried/pos/t294/Test_2.scala +++ /dev/null @@ -1 +0,0 @@ -class Test2 extends Test diff --git a/tests/untried/pos/t2940/Cycle.java b/tests/untried/pos/t2940/Cycle.java deleted file mode 100644 index eef6c23b5..000000000 --- a/tests/untried/pos/t2940/Cycle.java +++ /dev/null @@ -1,3 +0,0 @@ -public interface Cycle<T extends Cycle<?>> { - void doStuff(); -}
\ No newline at end of file diff --git a/tests/untried/pos/t2940/Error.scala b/tests/untried/pos/t2940/Error.scala deleted file mode 100644 index 92f08f580..000000000 --- a/tests/untried/pos/t2940/Error.scala +++ /dev/null @@ -1,12 +0,0 @@ -abstract class Error { - val c: Cycle[_] -} - -object Test { - trait Quux[T] extends Cycle[Quux[T]] - val x = new Quux[Int] { def doStuff(): Unit = { } } - - def main(args: Array[String]): Unit = { - - } -} diff --git a/tests/untried/pos/t2945.scala b/tests/untried/pos/t2945.scala deleted file mode 100644 index 0379e9ba1..000000000 --- a/tests/untried/pos/t2945.scala +++ /dev/null @@ -1,12 +0,0 @@ -object Foo { - def test(s: String) = { - (s: Seq[Char]) match { - case Seq('f', 'o', 'o', ' ', rest1 @ _*) => - rest1 - case Seq('b', 'a', 'r', ' ', ' ', rest2 @ _*) => - rest2 - case _ => - s - } - } -} diff --git a/tests/untried/pos/t295.scala b/tests/untried/pos/t295.scala deleted file mode 100644 index 22c7beff4..000000000 --- a/tests/untried/pos/t295.scala +++ /dev/null @@ -1,2 +0,0 @@ -object Test extends java.rmi.server.UnicastRemoteObject { -} diff --git a/tests/untried/pos/t2956/BeanDefinitionVisitor.java b/tests/untried/pos/t2956/BeanDefinitionVisitor.java deleted file mode 100644 index 2ff5daa25..000000000 --- a/tests/untried/pos/t2956/BeanDefinitionVisitor.java +++ /dev/null @@ -1,6 +0,0 @@ -import java.util.Map; -public class BeanDefinitionVisitor { - @SuppressWarnings("unchecked") - protected void visitMap(Map<?, ?> mapVal) { - } -} diff --git a/tests/untried/pos/t2956/t2956.scala b/tests/untried/pos/t2956/t2956.scala deleted file mode 100755 index 33803874b..000000000 --- a/tests/untried/pos/t2956/t2956.scala +++ /dev/null @@ -1,7 +0,0 @@ -import scala.collection.JavaConversions._ - -class Outer { - protected class Inner extends BeanDefinitionVisitor { - protected def visitMap(mapVal: Map[_, _]): Unit = () - } -} diff --git a/tests/untried/pos/t296.scala b/tests/untried/pos/t296.scala deleted file mode 100644 index 0c267a307..000000000 --- a/tests/untried/pos/t296.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Bug { - def foo (l: => String) : String = 12 match { case _ => l} -} diff --git a/tests/untried/pos/t2973.scala b/tests/untried/pos/t2973.scala deleted file mode 100644 index f5dde856d..000000000 --- a/tests/untried/pos/t2973.scala +++ /dev/null @@ -1 +0,0 @@ -package foo {}; package bar {}; package baz {} diff --git a/tests/untried/pos/t2994a.scala b/tests/untried/pos/t2994a.scala deleted file mode 100644 index f1a4a4a12..000000000 --- a/tests/untried/pos/t2994a.scala +++ /dev/null @@ -1,27 +0,0 @@ -object Naturals { - trait NAT { - type a[s[_ <: NAT] <: NAT, z <: NAT] <: NAT - type v = a[SUCC, ZERO] - } - final class ZERO extends NAT { - type a[s[_ <: NAT] <: NAT, z <: NAT] = z - } - final class SUCC[n <: NAT] extends NAT { - type a[s[_ <: NAT] <: NAT, z <: NAT] = s[n#a[s, z]] - } - type _0 = ZERO - type _1 = SUCC[_0] - type _2 = SUCC[_1] - type _3 = SUCC[_2] - type _4 = SUCC[_3] - type _5 = SUCC[_4] - type _6 = SUCC[_5] - - - // crashes scala-2.8.0 beta1 - trait MUL[n <: NAT, m <: NAT] extends NAT { - trait curry[n[_[_], _], s[_]] { type f[z <: NAT] = n[s, z] } - type a[s[_ <: NAT] <: NAT, z <: NAT] = n#a[curry[m#a, s]#f, z] - } - -} diff --git a/tests/untried/pos/t2994b.scala b/tests/untried/pos/t2994b.scala deleted file mode 100644 index 8b5eb9692..000000000 --- a/tests/untried/pos/t2994b.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Test { - trait Bar[X[_]] - trait Baz[S[_] <: Bar[S]] { - type Apply[T] - } - trait Foo[V[_] <: Bar[V]] extends Bar[Baz[V]#Apply] -} |