Skip to content

Commit ddb29a8

Browse files
committed
Merge pull request scala#3815 from retronym/topic/java8-support-2
Java 8 agnostism for our test suite
2 parents 95278db + ca3fb25 commit ddb29a8

File tree

4 files changed

+31
-104
lines changed

4 files changed

+31
-104
lines changed

test/files/neg/t6289.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ t6289/J.java:2: method does not override or implement a method from a supertype
33
@Override public void foo() { }
44
^
55
1 error
6-
#partest java7
6+
#partest !java6
77
t6289/J.java:2: error: method does not override or implement a method from a supertype
88
@Override public void foo() { }
99
^

test/files/presentation/ide-bug-1000531.check

Lines changed: 12 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,24 @@
1-
reload: CrashOnLoad.scala
1+
reload: CrashOnLoad.scala, TestIterable.java
22

3-
askTypeCompletion at CrashOnLoad.scala(6,12)
3+
askTypeCompletion at CrashOnLoad.scala(6,11)
44
================================================================================
5-
[response] askTypeCompletion at (6,12)
6-
retrieved 117 members
5+
[response] askTypeCompletion at (6,11)
6+
retrieved 30 members
77
[inaccessible] protected[package lang] def clone(): Object
88
[inaccessible] protected[package lang] def finalize(): Unit
9-
[inaccessible] protected[this] def reversed: List[B]
10-
class GroupedIterator[B >: A] extends AbstractIterator[Seq[B]] with Iterator[Seq[B]]
119
def +(other: String): String
12-
def ++[B >: B](that: => scala.collection.GenTraversableOnce[B]): Iterator[B]
13-
def ->[B](y: B): (java.util.Iterator[B], B)
14-
def /:[B](z: B)(op: (B, B) => B): B
15-
def :\[B](z: B)(op: (B, B) => B): B
16-
def addString(b: StringBuilder): StringBuilder
17-
def addString(b: StringBuilder,sep: String): StringBuilder
18-
def addString(b: StringBuilder,start: String,sep: String,end: String): StringBuilder
19-
def aggregate[B](z: => B)(seqop: (B, B) => B,combop: (B, B) => B): B
20-
def buffered: scala.collection.BufferedIterator[B]
21-
def collectFirst[B](pf: PartialFunction[B,B]): Option[B]
22-
def collect[B](pf: PartialFunction[B,B]): Iterator[B]
23-
def contains(elem: Any): Boolean
24-
def copyToArray[B >: B](xs: Array[B]): Unit
25-
def copyToArray[B >: B](xs: Array[B],start: Int): Unit
26-
def copyToArray[B >: B](xs: Array[B],start: Int,len: Int): Unit
27-
def copyToBuffer[B >: B](dest: scala.collection.mutable.Buffer[B]): Unit
28-
def corresponds[B](that: scala.collection.GenTraversableOnce[B])(p: (B, B) => Boolean): Boolean
29-
def count(p: B => Boolean): Int
30-
def drop(n: Int): Iterator[B]
31-
def dropWhile(p: B => Boolean): Iterator[B]
32-
def duplicate: (Iterator[B], Iterator[B])
33-
def ensuring(cond: Boolean): java.util.Iterator[B]
34-
def ensuring(cond: Boolean,msg: => Any): java.util.Iterator[B]
35-
def ensuring(cond: java.util.Iterator[B] => Boolean): java.util.Iterator[B]
36-
def ensuring(cond: java.util.Iterator[B] => Boolean,msg: => Any): java.util.Iterator[B]
10+
def ->[B](y: B): (other.TestIterator[Nothing], B)
11+
def ensuring(cond: Boolean): other.TestIterator[Nothing]
12+
def ensuring(cond: Boolean,msg: => Any): other.TestIterator[Nothing]
13+
def ensuring(cond: other.TestIterator[Nothing] => Boolean): other.TestIterator[Nothing]
14+
def ensuring(cond: other.TestIterator[Nothing] => Boolean,msg: => Any): other.TestIterator[Nothing]
3715
def equals(x$1: Any): Boolean
38-
def exists(p: B => Boolean): Boolean
39-
def filter(p: B => Boolean): Iterator[B]
40-
def filterNot(p: B => Boolean): Iterator[B]
41-
def find(p: B => Boolean): Option[B]
42-
def flatMap[B](f: B => scala.collection.GenTraversableOnce[B]): Iterator[B]
43-
def foldLeft[B](z: B)(op: (B, B) => B): B
44-
def foldRight[B](z: B)(op: (B, B) => B): B
45-
def fold[A1 >: B](z: A1)(op: (A1, A1) => A1): A1
46-
def forall(p: B => Boolean): Boolean
47-
def foreach[U](f: B => U): Unit
4816
def formatted(fmtstr: String): String
49-
def grouped[B >: B](size: Int): Iterator[B]#GroupedIterator[B]
50-
def hasDefiniteSize: Boolean
51-
def hasNext(): Boolean
17+
def hasNext: Boolean
5218
def hashCode(): Int
53-
def indexOf[B >: B](elem: B): Int
54-
def indexWhere(p: B => Boolean): Int
55-
def isEmpty: Boolean
56-
def isTraversableAgain: Boolean
57-
def length: Int
58-
def map[B](f: B => B): Iterator[B]
59-
def maxBy[B](f: B => B)(implicit cmp: Ordering[B]): B
60-
def max[B >: B](implicit cmp: Ordering[B]): B
61-
def minBy[B](f: B => B)(implicit cmp: Ordering[B]): B
62-
def min[B >: B](implicit cmp: Ordering[B]): B
63-
def mkString(sep: String): String
64-
def mkString(start: String,sep: String,end: String): String
65-
def mkString: String
66-
def next(): B
67-
def nonEmpty: Boolean
68-
def padTo[A1 >: B](len: Int,elem: A1): Iterator[A1]
69-
def partition(p: B => Boolean): (Iterator[B], Iterator[B])
70-
def patch[B >: B](from: Int,patchElems: Iterator[B],replaced: Int): Iterator[B]
71-
def product[B >: B](implicit num: Numeric[B]): B
72-
def reduceLeftOption[B >: B](op: (B, B) => B): Option[B]
73-
def reduceLeft[B >: B](op: (B, B) => B): B
74-
def reduceOption[A1 >: B](op: (A1, A1) => A1): Option[A1]
75-
def reduceRightOption[B >: B](op: (B, B) => B): Option[B]
76-
def reduceRight[B >: B](op: (B, B) => B): B
77-
def reduce[A1 >: B](op: (A1, A1) => A1): A1
78-
def remove(): Unit
79-
def sameElements(that: Iterator[_]): Boolean
80-
def scanLeft[B](z: B)(op: (B, B) => B): Iterator[B]
81-
def scanRight[B](z: B)(op: (B, B) => B): Iterator[B]
82-
def seq: Iterator[B]
83-
def size: Int
84-
def slice(from: Int,until: Int): Iterator[B]
85-
def sliding[B >: B](size: Int,step: Int): Iterator[B]#GroupedIterator[B]
86-
def span(p: B => Boolean): (Iterator[B], Iterator[B])
87-
def sum[B >: B](implicit num: Numeric[B]): B
88-
def take(n: Int): Iterator[B]
89-
def takeWhile(p: B => Boolean): Iterator[B]
90-
def toArray[B >: B](implicit evidence$1: scala.reflect.ClassTag[B]): Array[B]
91-
def toBuffer[B >: B]: scala.collection.mutable.Buffer[B]
92-
def toIndexedSeq: scala.collection.immutable.IndexedSeq[B]
93-
def toIterable: Iterable[B]
94-
def toIterator: Iterator[B]
95-
def toList: List[B]
96-
def toMap[T, U](implicit ev: <:<[B,(T, U)]): scala.collection.immutable.Map[T,U]
97-
def toSeq: Seq[B]
98-
def toSet[B >: B]: scala.collection.immutable.Set[B]
99-
def toStream: scala.collection.immutable.Stream[B]
19+
def next: T
10020
def toString(): String
101-
def toTraversable: Traversable[B]
102-
def toVector: Vector[B]
103-
def to[Col[_]](implicit cbf: scala.collection.generic.CanBuildFrom[Nothing,B,Col[B]]): Col[B]
104-
def withFilter(p: B => Boolean): Iterator[B]
105-
def zipAll[B, A1 >: B, B1 >: B](that: Iterator[B],thisElem: A1,thatElem: B1): Iterator[(A1, B1)]
106-
def zipWithIndex: Iterator[(B, Int)]
107-
def zip[B](that: Iterator[B]): Iterator[(B, B)]
108-
def →[B](y: B): (java.util.Iterator[B], B)
21+
def →[B](y: B): (other.TestIterator[Nothing], B)
10922
final def !=(x$1: Any): Boolean
11023
final def ##(): Int
11124
final def ==(x$1: Any): Boolean
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
/** When this files is opened within the IDE, a typing error is reported. */
2-
class A[B] extends java.lang.Iterable[B] {
2+
class A[B] extends TestIterable[B] {
33
import scala.collection.JavaConversions._
4-
def iterator = Iterator.empty
4+
def iterator: other.TestIterator[Nothing] = ???
55

6-
iterator. /*!*/
7-
}
6+
iterator./*!*/
7+
}
8+
9+
object other {
10+
trait TestIterator[T] {
11+
def hasNext: Boolean
12+
def next: T
13+
}
14+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
public abstract class TestIterable<T> {
2+
public abstract TestIterator<T> iterator();
3+
public static abstract class TestIterator<T> {
4+
public abstract T next();
5+
public abstract boolean hasNext();
6+
}
7+
}

0 commit comments

Comments
 (0)