JavaTXCompilerInJavaTX/resources/insertGenerics/javFiles/TestContraVariant.jav

38 lines
526 B
Plaintext
Raw Normal View History

public class TestContraVariant {
main(x, y) {
var y2 = m(x, y);
var y3 = y2.snd();
var z;
y3 = z;
2023-06-15 14:31:50 +00:00
return new Pair<>(x, z);
2023-05-08 11:32:39 +00:00
}
m(x, y) {
var x2 = main(x, y);
var x3 = x2.fst();
var z;
x3 = z;
2023-06-15 14:31:50 +00:00
return new Pair<>(z, y);
}
}
class Pair<T, U> {
public T x;
public U y;
public Pair() {
}
public Pair(T var1, U var2) {
x = var1;
y = var2;
}
public T fst() {
return x;
}
public U snd() {
return y;
}
}