2021-02-03 16:55:12 +01:00
|
|
|
public class TestTwoArgs {
|
2023-02-13 18:39:16 +01:00
|
|
|
//A
|
2021-01-29 18:12:44 +01:00
|
|
|
a;
|
|
|
|
|
2023-02-13 18:39:16 +01:00
|
|
|
//<A1> A1 -> A1
|
2021-01-29 18:12:44 +01:00
|
|
|
id(b) {
|
|
|
|
var c = b;
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
2023-02-13 18:39:16 +01:00
|
|
|
//<B extends A> B -> A
|
2021-01-29 18:12:44 +01:00
|
|
|
setA(x) {
|
|
|
|
a = x;
|
|
|
|
return a;
|
|
|
|
}
|
2023-02-13 18:39:16 +01:00
|
|
|
|
|
|
|
//<C, D extends C> (C,D) -> C
|
2021-01-29 18:12:44 +01:00
|
|
|
m(x,y) {
|
|
|
|
x = id(y);
|
2021-02-03 16:55:12 +01:00
|
|
|
return x;
|
2021-01-29 18:12:44 +01:00
|
|
|
}
|
|
|
|
|
2023-02-13 18:39:16 +01:00
|
|
|
//<E, F extends A> (E, F) -> E
|
2021-01-29 18:12:44 +01:00
|
|
|
main(x,y) {
|
|
|
|
return m(id(x),setA(y));
|
|
|
|
}
|
|
|
|
}
|