Skip to content

Commit 953b940

Browse files
committed
fix some tests
tests/pos/javaReadsSigs/fromjava.java still imported old collections doc-tool/test/dotty/tools/dottydoc/WhitelistedStdLib.scala and GenCollections depended on the removed scala 2 library
1 parent 335806a commit 953b940

File tree

3 files changed

+13
-58
lines changed

3 files changed

+13
-58
lines changed

doc-tool/test/dotty/tools/dottydoc/GenDocs.scala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@ trait LocalResources extends DocDriver {
2828
files
2929
}
3030

31-
object GenCollections extends LocalResources {
32-
import Files._
33-
34-
val collections = TestWhitelistedCollections.files
35-
36-
override def main(args: Array[String]): Unit =
37-
super.main(withClasspath(collections.toArray))
38-
}
39-
4031
object GenDottyDocs extends LocalResources {
4132
import Files._
4233

doc-tool/test/dotty/tools/dottydoc/WhitelistedStdLib.scala

Lines changed: 0 additions & 37 deletions
This file was deleted.

tests/pos/javaReadsSigs/fromjava.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
import scala.math.Ordering;
33
import scala.math.Numeric;
44
import scala.collection.Seq;
5-
import scala.collection.Traversable;
6-
import scala.collection.Traversable$;
5+
import scala.collection.Iterable;
6+
import scala.collection.Iterable$;
77
import scala.collection.immutable.Set;
88
import scala.collection.immutable.HashSet;
99
import scala.collection.immutable.Map;
1010
import scala.collection.immutable.Map$;
1111
import scala.collection.immutable.HashMap;
1212
import scala.collection.immutable.Vector;
1313
import scala.collection.immutable.List;
14-
import scala.collection.generic.CanBuildFrom;
14+
import scala.collection.LinearSeq;
15+
import scala.collection.BuildFrom;
1516

1617
class A { };
1718
class B { };
@@ -48,28 +49,28 @@ public static String vector(Vector<String> x) {
4849
return y.head();
4950
}
5051
public static String list(List<String> x) {
51-
List<String> y = x.drop(2);
52+
LinearSeq<String> y = x.drop(2);
5253
return y.head();
5354
}
5455
public static Tuple2<String, Integer> map(Map<String, Integer> x) {
55-
Traversable<Tuple2<String, Integer>> y = x.drop(2);
56+
Iterable<Tuple2<String, Integer>> y = x.drop(2);
5657
return y.head();
5758
}
58-
public static <T> Object sum(Traversable<T> x) {
59+
public static <T> Object sum(Iterable<T> x) {
5960
return x.sum(Contra.intNum);
6061
}
6162
// Looks like sum as given below fails under java5, so disabled.
6263
//
6364
// [partest] testing: [...]/files/pos/javaReadsSigs [FAILED]
64-
// [partest] files/pos/javaReadsSigs/fromjava.java:62: name clash: sum(scala.collection.Traversable<A>) and <T>sum(scala.collection.Traversable<T>) have the same erasure
65-
// [partest] public static B sum(Traversable<A> x) {
65+
// [partest] files/pos/javaReadsSigs/fromjava.java:62: name clash: sum(scala.collection.Iterable<A>) and <T>sum(scala.collection.Iterable<T>) have the same erasure
66+
// [partest] public static B sum(Iterable<A> x) {
6667
// [partest] ^
6768
//
6869
//
69-
// can't make this work with an actual CanBuildFrom: see #4389.
70-
// public static B sum(Traversable<A> x) {
71-
// // have to cast it unfortunately: map in TraversableLike returns
70+
// can't make this work with an actual BuildFrom: see #4389.
71+
// public static B sum(Iterable<A> x) {
72+
// // have to cast it unfortunately: map in IterableLike returns
7273
// // "That" and such types seem to be signature poison.
73-
// return ((Traversable<B>)x.map(f1, null)).head();
74+
// return ((Iterable<B>)x.map(f1, null)).head();
7475
// }
7576
}

0 commit comments

Comments
 (0)