2021-03-29 08:00:04 +00:00
|
|
|
public class TestContraVariant {
|
2023-05-09 12:28:32 +00:00
|
|
|
main(x, y) {
|
2023-05-09 12:36:07 +00:00
|
|
|
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
|
|
|
}
|
2021-03-29 08:00:04 +00:00
|
|
|
|
2023-05-09 12:28:32 +00:00
|
|
|
m(x, y) {
|
2023-05-09 12:36:07 +00:00
|
|
|
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;
|
2021-03-29 08:00:04 +00:00
|
|
|
}
|
|
|
|
}
|