diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-06-10 12:34:28 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-06-10 12:34:28 +0200 |
commit | ddb29a8105bc3b692bc129cbd8ed111baae7076d (patch) | |
tree | f69fda145c216d37437de33aaf3111c1afaa75c3 | |
parent | 95278dbdb828b4f8b786740b5186edbb4489096f (diff) | |
parent | ca3fb2506307c452bce236e431c024ed741b4ef7 (diff) | |
download | scala-ddb29a8105bc3b692bc129cbd8ed111baae7076d.tar.gz scala-ddb29a8105bc3b692bc129cbd8ed111baae7076d.tar.bz2 scala-ddb29a8105bc3b692bc129cbd8ed111baae7076d.zip |
Merge pull request #3815 from retronym/topic/java8-support-2
Java 8 agnostism for our test suite
-rw-r--r-- | test/files/neg/t6289.check | 2 | ||||
-rw-r--r-- | test/files/presentation/ide-bug-1000531.check | 111 | ||||
-rw-r--r-- | test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala | 15 | ||||
-rw-r--r-- | test/files/presentation/ide-bug-1000531/src/TestIterable.java | 7 |
4 files changed, 31 insertions, 104 deletions
diff --git a/test/files/neg/t6289.check b/test/files/neg/t6289.check index f6f43cabd3..989932750f 100644 --- a/test/files/neg/t6289.check +++ b/test/files/neg/t6289.check @@ -3,7 +3,7 @@ t6289/J.java:2: method does not override or implement a method from a supertype @Override public void foo() { } ^ 1 error -#partest java7 +#partest !java6 t6289/J.java:2: error: method does not override or implement a method from a supertype @Override public void foo() { } ^ diff --git a/test/files/presentation/ide-bug-1000531.check b/test/files/presentation/ide-bug-1000531.check index d8c7a369f7..12eafcd6de 100644 --- a/test/files/presentation/ide-bug-1000531.check +++ b/test/files/presentation/ide-bug-1000531.check @@ -1,111 +1,24 @@ -reload: CrashOnLoad.scala +reload: CrashOnLoad.scala, TestIterable.java -askTypeCompletion at CrashOnLoad.scala(6,12) +askTypeCompletion at CrashOnLoad.scala(6,11) ================================================================================ -[response] askTypeCompletion at (6,12) -retrieved 117 members +[response] askTypeCompletion at (6,11) +retrieved 30 members [inaccessible] protected[package lang] def clone(): Object [inaccessible] protected[package lang] def finalize(): Unit -[inaccessible] protected[this] def reversed: List[B] -class GroupedIterator[B >: A] extends AbstractIterator[Seq[B]] with Iterator[Seq[B]] def +(other: String): String -def ++[B >: B](that: => scala.collection.GenTraversableOnce[B]): Iterator[B] -def ->[B](y: B): (java.util.Iterator[B], B) -def /:[B](z: B)(op: (B, B) => B): B -def :\[B](z: B)(op: (B, B) => B): B -def addString(b: StringBuilder): StringBuilder -def addString(b: StringBuilder,sep: String): StringBuilder -def addString(b: StringBuilder,start: String,sep: String,end: String): StringBuilder -def aggregate[B](z: => B)(seqop: (B, B) => B,combop: (B, B) => B): B -def buffered: scala.collection.BufferedIterator[B] -def collectFirst[B](pf: PartialFunction[B,B]): Option[B] -def collect[B](pf: PartialFunction[B,B]): Iterator[B] -def contains(elem: Any): Boolean -def copyToArray[B >: B](xs: Array[B]): Unit -def copyToArray[B >: B](xs: Array[B],start: Int): Unit -def copyToArray[B >: B](xs: Array[B],start: Int,len: Int): Unit -def copyToBuffer[B >: B](dest: scala.collection.mutable.Buffer[B]): Unit -def corresponds[B](that: scala.collection.GenTraversableOnce[B])(p: (B, B) => Boolean): Boolean -def count(p: B => Boolean): Int -def drop(n: Int): Iterator[B] -def dropWhile(p: B => Boolean): Iterator[B] -def duplicate: (Iterator[B], Iterator[B]) -def ensuring(cond: Boolean): java.util.Iterator[B] -def ensuring(cond: Boolean,msg: => Any): java.util.Iterator[B] -def ensuring(cond: java.util.Iterator[B] => Boolean): java.util.Iterator[B] -def ensuring(cond: java.util.Iterator[B] => Boolean,msg: => Any): java.util.Iterator[B] +def ->[B](y: B): (other.TestIterator[Nothing], B) +def ensuring(cond: Boolean): other.TestIterator[Nothing] +def ensuring(cond: Boolean,msg: => Any): other.TestIterator[Nothing] +def ensuring(cond: other.TestIterator[Nothing] => Boolean): other.TestIterator[Nothing] +def ensuring(cond: other.TestIterator[Nothing] => Boolean,msg: => Any): other.TestIterator[Nothing] def equals(x$1: Any): Boolean -def exists(p: B => Boolean): Boolean -def filter(p: B => Boolean): Iterator[B] -def filterNot(p: B => Boolean): Iterator[B] -def find(p: B => Boolean): Option[B] -def flatMap[B](f: B => scala.collection.GenTraversableOnce[B]): Iterator[B] -def foldLeft[B](z: B)(op: (B, B) => B): B -def foldRight[B](z: B)(op: (B, B) => B): B -def fold[A1 >: B](z: A1)(op: (A1, A1) => A1): A1 -def forall(p: B => Boolean): Boolean -def foreach[U](f: B => U): Unit def formatted(fmtstr: String): String -def grouped[B >: B](size: Int): Iterator[B]#GroupedIterator[B] -def hasDefiniteSize: Boolean -def hasNext(): Boolean +def hasNext: Boolean def hashCode(): Int -def indexOf[B >: B](elem: B): Int -def indexWhere(p: B => Boolean): Int -def isEmpty: Boolean -def isTraversableAgain: Boolean -def length: Int -def map[B](f: B => B): Iterator[B] -def maxBy[B](f: B => B)(implicit cmp: Ordering[B]): B -def max[B >: B](implicit cmp: Ordering[B]): B -def minBy[B](f: B => B)(implicit cmp: Ordering[B]): B -def min[B >: B](implicit cmp: Ordering[B]): B -def mkString(sep: String): String -def mkString(start: String,sep: String,end: String): String -def mkString: String -def next(): B -def nonEmpty: Boolean -def padTo[A1 >: B](len: Int,elem: A1): Iterator[A1] -def partition(p: B => Boolean): (Iterator[B], Iterator[B]) -def patch[B >: B](from: Int,patchElems: Iterator[B],replaced: Int): Iterator[B] -def product[B >: B](implicit num: Numeric[B]): B -def reduceLeftOption[B >: B](op: (B, B) => B): Option[B] -def reduceLeft[B >: B](op: (B, B) => B): B -def reduceOption[A1 >: B](op: (A1, A1) => A1): Option[A1] -def reduceRightOption[B >: B](op: (B, B) => B): Option[B] -def reduceRight[B >: B](op: (B, B) => B): B -def reduce[A1 >: B](op: (A1, A1) => A1): A1 -def remove(): Unit -def sameElements(that: Iterator[_]): Boolean -def scanLeft[B](z: B)(op: (B, B) => B): Iterator[B] -def scanRight[B](z: B)(op: (B, B) => B): Iterator[B] -def seq: Iterator[B] -def size: Int -def slice(from: Int,until: Int): Iterator[B] -def sliding[B >: B](size: Int,step: Int): Iterator[B]#GroupedIterator[B] -def span(p: B => Boolean): (Iterator[B], Iterator[B]) -def sum[B >: B](implicit num: Numeric[B]): B -def take(n: Int): Iterator[B] -def takeWhile(p: B => Boolean): Iterator[B] -def toArray[B >: B](implicit evidence$1: scala.reflect.ClassTag[B]): Array[B] -def toBuffer[B >: B]: scala.collection.mutable.Buffer[B] -def toIndexedSeq: scala.collection.immutable.IndexedSeq[B] -def toIterable: Iterable[B] -def toIterator: Iterator[B] -def toList: List[B] -def toMap[T, U](implicit ev: <:<[B,(T, U)]): scala.collection.immutable.Map[T,U] -def toSeq: Seq[B] -def toSet[B >: B]: scala.collection.immutable.Set[B] -def toStream: scala.collection.immutable.Stream[B] +def next: T def toString(): String -def toTraversable: Traversable[B] -def toVector: Vector[B] -def to[Col[_]](implicit cbf: scala.collection.generic.CanBuildFrom[Nothing,B,Col[B]]): Col[B] -def withFilter(p: B => Boolean): Iterator[B] -def zipAll[B, A1 >: B, B1 >: B](that: Iterator[B],thisElem: A1,thatElem: B1): Iterator[(A1, B1)] -def zipWithIndex: Iterator[(B, Int)] -def zip[B](that: Iterator[B]): Iterator[(B, B)] -def →[B](y: B): (java.util.Iterator[B], B) +def →[B](y: B): (other.TestIterator[Nothing], B) final def !=(x$1: Any): Boolean final def ##(): Int final def ==(x$1: Any): Boolean diff --git a/test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala b/test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala index 878bbfa19e..3f59282083 100644 --- a/test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala +++ b/test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala @@ -1,7 +1,14 @@ /** When this files is opened within the IDE, a typing error is reported. */ -class A[B] extends java.lang.Iterable[B] { +class A[B] extends TestIterable[B] { import scala.collection.JavaConversions._ - def iterator = Iterator.empty + def iterator: other.TestIterator[Nothing] = ??? - iterator. /*!*/ -}
\ No newline at end of file + iterator./*!*/ +} + +object other { + trait TestIterator[T] { + def hasNext: Boolean + def next: T + } +} diff --git a/test/files/presentation/ide-bug-1000531/src/TestIterable.java b/test/files/presentation/ide-bug-1000531/src/TestIterable.java new file mode 100644 index 0000000000..84a6fe77f1 --- /dev/null +++ b/test/files/presentation/ide-bug-1000531/src/TestIterable.java @@ -0,0 +1,7 @@ +public abstract class TestIterable<T> { + public abstract TestIterator<T> iterator(); + public static abstract class TestIterator<T> { + public abstract T next(); + public abstract boolean hasNext(); + } +} |