diff options
author | odersky <odersky@gmail.com> | 2015-02-07 18:03:01 +0100 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2015-02-07 18:03:01 +0100 |
commit | 9641b2a417f203b5c2e88e6330b2230713471307 (patch) | |
tree | 7509a675738c13a428d2ecb5a371d242213a4849 /tests/pending | |
parent | 329b6bfa9929c984b40368a1cc5f2f8cdc15b6c8 (diff) | |
parent | 976ed6fd0aa4f0dd3da54889c4d85ef856f6531f (diff) | |
download | dotty-9641b2a417f203b5c2e88e6330b2230713471307.tar.gz dotty-9641b2a417f203b5c2e88e6330b2230713471307.tar.bz2 dotty-9641b2a417f203b5c2e88e6330b2230713471307.zip |
Merge pull request #339 from dotty-staging/fix/#329-and-others
Fix/#329 and others
Diffstat (limited to 'tests/pending')
-rw-r--r-- | tests/pending/pos/java-override/A.java | 3 | ||||
-rw-r--r-- | tests/pending/pos/java-override/B.scala | 7 | ||||
-rw-r--r-- | tests/pending/pos/sammy_poly.scala | 7 | ||||
-rw-r--r-- | tests/pending/pos/scoping1.scala | 12 | ||||
-rw-r--r-- | tests/pending/pos/sealed-final.scala | 14 | ||||
-rw-r--r-- | tests/pending/pos/self-type-override.scala | 13 | ||||
-rw-r--r-- | tests/pending/pos/spec-sealed.scala | 32 | ||||
-rw-r--r-- | tests/pending/pos/t3175-pos.scala | 7 | ||||
-rw-r--r-- | tests/pending/pos/t319.scala | 21 | ||||
-rw-r--r-- | tests/pending/pos/t3252.scala | 15 | ||||
-rw-r--r-- | tests/pending/pos/t3278.scala | 15 | ||||
-rw-r--r-- | tests/pending/pos/t3343.scala | 15 | ||||
-rw-r--r-- | tests/pending/pos/t3363-new.scala | 20 | ||||
-rw-r--r-- | tests/pending/pos/t3363-old.scala | 18 | ||||
-rw-r--r-- | tests/pending/pos/t3411.scala | 8 | ||||
-rw-r--r-- | tests/pending/pos/t344.scala | 12 | ||||
-rw-r--r-- | tests/pending/pos/t3480.scala | 2 | ||||
-rw-r--r-- | tests/pending/pos/t3498-old.scala | 15 |
18 files changed, 11 insertions, 225 deletions
diff --git a/tests/pending/pos/java-override/A.java b/tests/pending/pos/java-override/A.java new file mode 100644 index 000000000..0d7f453e8 --- /dev/null +++ b/tests/pending/pos/java-override/A.java @@ -0,0 +1,3 @@ +public interface A { + void o(Object o); +} diff --git a/tests/pending/pos/java-override/B.scala b/tests/pending/pos/java-override/B.scala new file mode 100644 index 000000000..cb4addbcc --- /dev/null +++ b/tests/pending/pos/java-override/B.scala @@ -0,0 +1,7 @@ +//trait T { def t(o: Object): Unit } + +class B extends A /*with T*/ { + override def o(o: Any): Unit = () + + //override def t(o: AnyRef): Unit = () +} diff --git a/tests/pending/pos/sammy_poly.scala b/tests/pending/pos/sammy_poly.scala deleted file mode 100644 index f43fa292c..000000000 --- a/tests/pending/pos/sammy_poly.scala +++ /dev/null @@ -1,7 +0,0 @@ -// test synthesizeSAMFunction where the sam type is not fully defined -class T { - trait F[T, U] { def apply(x: T): U } - // NOTE: the f(x) desugaring for now assumes the single abstract method is called 'apply' - def app[T, U](x: T)(f: F[T, U]): U = f(x) - app(1)(x => List(x)) -} diff --git a/tests/pending/pos/scoping1.scala b/tests/pending/pos/scoping1.scala deleted file mode 100644 index 9fe1b5f3e..000000000 --- a/tests/pending/pos/scoping1.scala +++ /dev/null @@ -1,12 +0,0 @@ -object This extends App { - trait A { - def foo(): Unit - } - class C { self: A => - def bar() = this.foo() - } - class D extends C with A { - def foo() = () - } - val c: C = new D -} diff --git a/tests/pending/pos/sealed-final.scala b/tests/pending/pos/sealed-final.scala deleted file mode 100644 index bdedb5c1f..000000000 --- a/tests/pending/pos/sealed-final.scala +++ /dev/null @@ -1,14 +0,0 @@ -sealed abstract class Foo { - @inline def bar(x: Int) = x + 1 -} -object Foo { - def mkFoo(): Foo = new Baz2 -} - -object Baz1 extends Foo -final class Baz2 extends Foo - -object Test { - // bar should be inlined now - def f = Foo.mkFoo() bar 10 -} diff --git a/tests/pending/pos/self-type-override.scala b/tests/pending/pos/self-type-override.scala deleted file mode 100644 index 7c40ef37e..000000000 --- a/tests/pending/pos/self-type-override.scala +++ /dev/null @@ -1,13 +0,0 @@ -trait TCommon { - def f: String -} - -class C1 extends TCommon { - def f = "in C1" -} - -trait TOverrider { this: TCommon => - override def f = "in TOverrider" // The overridden self-type member... -} - -class C2 extends C1 with TOverrider // ... fails to override, here. diff --git a/tests/pending/pos/spec-sealed.scala b/tests/pending/pos/spec-sealed.scala deleted file mode 100644 index d7ecfaaab..000000000 --- a/tests/pending/pos/spec-sealed.scala +++ /dev/null @@ -1,32 +0,0 @@ -sealed abstract class MyList[@specialized +A] { - def head: A - def tail: MyList[A] - - def ::[@specialized B >: A](x: B): MyList[B] = - new Cons[B](x, this) -} - -case object MyNil extends MyList[Nothing] { - def head = sys.error("nil") - def tail = sys.error("nil") -} - -case class Cons[@specialized a](private val hd: a, tl: MyList[a]) extends MyList[a] { - def head = hd - def tail = tl -} - -abstract class IntList extends MyList[Int] - -object Main extends App { - val xs = 1 :: 2 :: 3 :: MyNil - println(xs) -} - -/* -final class ConsI(hd1: Int, tl1: MyList[Int]) extends Cons[Int](hd1, tl1) { - override val hd = hd1 - override val tl = tl1 -} -*/ -//class IntCons(_hd: Int, _tl: MyList[Int]) extends Cons[Int](_hd, _tl) diff --git a/tests/pending/pos/t3175-pos.scala b/tests/pending/pos/t3175-pos.scala deleted file mode 100644 index 89bbf8b5f..000000000 --- a/tests/pending/pos/t3175-pos.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Test { - def f(g:{val update:Unit}) = g.update - - def main(args: Array[String]): Unit = { - - } -} diff --git a/tests/pending/pos/t319.scala b/tests/pending/pos/t319.scala deleted file mode 100644 index eed25eb84..000000000 --- a/tests/pending/pos/t319.scala +++ /dev/null @@ -1,21 +0,0 @@ -object test { - - trait A { type T; } - - trait B { type T; } - - /** def functor(x: A): B { type T = x.T } */ - abstract class functor() { - val arg: A; - val res: B { type T = arg.T } = - new B { type T = arg.T; }; - } - - val a = new A { type T = String }; - /** val b: B { type T = String } = functor(a) */ - val b: B { type T = String } = { - val tmp = new functor() { val arg = a }; - tmp.res - } - -} diff --git a/tests/pending/pos/t3252.scala b/tests/pending/pos/t3252.scala deleted file mode 100644 index 3ecc1e7ce..000000000 --- a/tests/pending/pos/t3252.scala +++ /dev/null @@ -1,15 +0,0 @@ -class A { - def f(x : Boolean) : Thread = { - g { - x match { - case false => - B.h { } - } - } - } - - private def g[T](block : => T) = sys.error("") -} -object B { - def h(block : => Unit) : Nothing = sys.error("") -} diff --git a/tests/pending/pos/t3278.scala b/tests/pending/pos/t3278.scala deleted file mode 100644 index 458070c5e..000000000 --- a/tests/pending/pos/t3278.scala +++ /dev/null @@ -1,15 +0,0 @@ -class Foo -class Test { - def update[B](x : B, b : Int): Unit = {} - def apply[B](x : B) = 1 -} - -object Test { - def main(a : Array[String]): Unit = { - val a = new Test - val f = new Foo - a(f) = 1 //works - a(f) = a(f) + 1 //works - a(f) += 1 //error: reassignment to val - } -} diff --git a/tests/pending/pos/t3343.scala b/tests/pending/pos/t3343.scala deleted file mode 100644 index 9d1bc9355..000000000 --- a/tests/pending/pos/t3343.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.collection.mutable.{ Builder, ListBuffer } - -object Test { - class Converter[T] - object SimpleIntConverter extends Converter[Int] - - class TraversableConverter[T, Coll[X] <: Traversable[X]](converter: Converter[T], builder: Builder[T, Coll[T]]) extends Converter[Coll[T]] { - def convert(x: T): List[T] = List(x) - } - val tc: Converter[List[Int]] = new TraversableConverter(SimpleIntConverter, new ListBuffer[Int]) - val tc2 = new TraversableConverter(SimpleIntConverter, new ListBuffer[Int]) - - def main(args: Array[String]): Unit = { - } -} diff --git a/tests/pending/pos/t3363-new.scala b/tests/pending/pos/t3363-new.scala deleted file mode 100644 index f935cfe1a..000000000 --- a/tests/pending/pos/t3363-new.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ - -object TestCase { - - //now matter if you put (abstract) class or trait it will fail in all cases - trait MapOps[T] - - //if fs was reduced to List (generic type with one parameter) then the code compiles - //if you inherit from MapOps[T] instead of MapOps[F] then code compiles fine - implicit def map2ops[T,F](fs: Map[T,F]): TestCase.MapOps[F]{lazy val m: reflect.runtime.universe.TypeTag[T]; def is(xs: List[T]): List[List[T]]} = new MapOps[F] { - //if you remove this line, then code compiles - lazy val m: TypeTag[T] = sys.error("just something to make it compile") - def is(xs: List[T]) = List(xs) - } - - def main(args: Array[String]): Unit = { - println(Map(1 -> "2") is List(2)) - } - - } diff --git a/tests/pending/pos/t3363-old.scala b/tests/pending/pos/t3363-old.scala deleted file mode 100644 index 8e54d4b4a..000000000 --- a/tests/pending/pos/t3363-old.scala +++ /dev/null @@ -1,18 +0,0 @@ -object TestCase { - - //now matter if you put (abstract) class or trait it will fail in all cases - trait MapOps[T] - - //if fs was reduced to List (generic type with one parameter) then the code compiles - //if you inherit from MapOps[T] instead of MapOps[F] then code compiles fine - implicit def map2ops[T,F](fs: Map[T,F]): TestCase.MapOps[F]{lazy val m: Manifest[T]; def is(xs: List[T]): List[List[T]]} = new MapOps[F] { - //if you remove this line, then code compiles - lazy val m: Manifest[T] = sys.error("just something to make it compile") - def is(xs: List[T]) = List(xs) - } - - def main(args: Array[String]): Unit = { - println(Map(1 -> "2") is List(2)) - } - - } diff --git a/tests/pending/pos/t3411.scala b/tests/pending/pos/t3411.scala deleted file mode 100644 index 6d46be4e4..000000000 --- a/tests/pending/pos/t3411.scala +++ /dev/null @@ -1,8 +0,0 @@ -object A { - def g(c: PartialFunction[Any,Unit]): Unit = {} - - def f: Unit = { - lazy val x = 0 - g { case `x` => } - } -} diff --git a/tests/pending/pos/t344.scala b/tests/pending/pos/t344.scala deleted file mode 100644 index 449a763af..000000000 --- a/tests/pending/pos/t344.scala +++ /dev/null @@ -1,12 +0,0 @@ -object Bug { - class A; - case class A1() extends A; - case class A2() extends A; - def f: A = - if (true) - A1() - else { - val a = if (true) A1() else A2(); - a - }; -} diff --git a/tests/pending/pos/t3480.scala b/tests/pending/pos/t3480.scala index d9a092e8a..f04ea2933 100644 --- a/tests/pending/pos/t3480.scala +++ b/tests/pending/pos/t3480.scala @@ -1,4 +1,4 @@ object Test { - val List(_*) = List(1) + val List(_: _*) = List(1) val Array( who, what : _* ) = "Eclipse plugin cannot not handle this" split (" ") } diff --git a/tests/pending/pos/t3498-old.scala b/tests/pending/pos/t3498-old.scala deleted file mode 100644 index 118a8d849..000000000 --- a/tests/pending/pos/t3498-old.scala +++ /dev/null @@ -1,15 +0,0 @@ -abstract class A[T, @specialized(scala.Int) U : Manifest] { - def f(state: T): Array[U] -} - -abstract class B extends A[ Array[Byte], Int ] { - type T = Array[Byte] - type U = Int - - val N = 0 - - def f(state: T): Array[U] = - { - new Array[U](N + state(N)) - } -} |