Better tests
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
//method
|
||||
void popAll(Collection<? super E> dst) {}
|
||||
@@ -1,2 +0,0 @@
|
||||
fun popAll(dst: Collection<in E>) {
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
//method
|
||||
void pushAll(Collection<? extends E> src) {}
|
||||
@@ -1,2 +0,0 @@
|
||||
fun pushAll(src: Collection<E>) {
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
class C<T> {
|
||||
void foo1(Collection<? extends T> src) {
|
||||
T t = src.iterator().next();
|
||||
}
|
||||
|
||||
void foo2(ArrayList<? extends T> src) {
|
||||
T t = src.iterator().next();
|
||||
}
|
||||
|
||||
void foo3(Collection<? super T> dst, T t) {
|
||||
dst.add(t)
|
||||
}
|
||||
|
||||
int foo4(Comparable<? super T> comparable, T t) {
|
||||
return comparable.compareTo(t);
|
||||
}
|
||||
|
||||
void foo5(Collection<?> w) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import java.util.ArrayList
|
||||
|
||||
class C<T> {
|
||||
fun foo1(src: Collection<T>) {
|
||||
val t = src.iterator().next()
|
||||
}
|
||||
|
||||
fun foo2(src: ArrayList<out T>) {
|
||||
val t = src.iterator().next()
|
||||
}
|
||||
|
||||
fun foo3(dst: MutableCollection<in T>, t: T) {
|
||||
dst.add(t)
|
||||
}
|
||||
|
||||
fun foo4(comparable: Comparable<T>, t: T): Int {
|
||||
return comparable.compareTo(t)
|
||||
}
|
||||
|
||||
fun foo5(w: Collection<*>) {
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
//method
|
||||
void wtf(Collection<?> w) {}
|
||||
@@ -1,2 +0,0 @@
|
||||
fun wtf(w: Collection<*>) {
|
||||
}
|
||||
Reference in New Issue
Block a user