You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TriTestTypecheck.java 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. class A {}
  2. interface G {}
  3. class E extends A implements G {}
  4. public class TriTestTypecheck {
  5. public static void main(String[] args) {}
  6. void byteCall(byte b) {}
  7. void shortCall(short s) {}
  8. void charCall(char c) {}
  9. void intCall(int i) {}
  10. void longCall(long l) {}
  11. void floatCall(float f) {}
  12. void doubleCall(double d) {}
  13. void booleanCall(boolean t) {}
  14. void aCall(A a) {}
  15. void eCall(E e) {}
  16. void gCall(G g) {}
  17. void foo(boolean t, byte b, short s, char c, int i, long l, float f, double d, A a, E e, G g) {
  18. byteCall(t ? 37 : b);
  19. byteCall(t ? b : 37);
  20. byteCall(t ? b : b);
  21. shortCall(t ? 37 : s);
  22. shortCall(t ? s : 37);
  23. shortCall(t ? b : s);
  24. shortCall(t ? s : b);
  25. shortCall(t ? s : s);
  26. charCall(t ? 37 : c);
  27. charCall(t ? c : 37);
  28. charCall(t ? c : c);
  29. intCall(t ? 257 : b);
  30. intCall(t ? b : 257);
  31. intCall(t ? 65537 : s);
  32. intCall(t ? s : 65537);
  33. intCall(t ? -1 : c);
  34. intCall(t ? c : -1);
  35. intCall(t ? i : i);
  36. longCall(t ? l : b);
  37. longCall(t ? b : l);
  38. longCall(t ? l : s);
  39. longCall(t ? s : l);
  40. longCall(t ? l : c);
  41. longCall(t ? c : l);
  42. longCall(t ? l : i);
  43. longCall(t ? i : l);
  44. longCall(t ? l : l);
  45. floatCall(t ? f : b);
  46. floatCall(t ? b : f);
  47. floatCall(t ? f : s);
  48. floatCall(t ? s : f);
  49. floatCall(t ? f : c);
  50. floatCall(t ? c : f);
  51. floatCall(t ? f : i);
  52. floatCall(t ? i : f);
  53. floatCall(t ? f : l);
  54. floatCall(t ? l : f);
  55. floatCall(t ? f : f);
  56. doubleCall(t ? d : b);
  57. doubleCall(t ? b : d);
  58. doubleCall(t ? d : s);
  59. doubleCall(t ? s : d);
  60. doubleCall(t ? d : c);
  61. doubleCall(t ? c : d);
  62. doubleCall(t ? d : i);
  63. doubleCall(t ? i : d);
  64. doubleCall(t ? d : l);
  65. doubleCall(t ? l : d);
  66. doubleCall(t ? d : f);
  67. doubleCall(t ? f : d);
  68. doubleCall(t ? d : d);
  69. booleanCall(t ? t : t);
  70. aCall(t ? a : null);
  71. aCall(t ? null : a);
  72. aCall(t ? a : e);
  73. aCall(t ? e : a);
  74. aCall(t ? a : a);
  75. gCall(t ? g : null);
  76. gCall(t ? null : g);
  77. gCall(t ? g : e);
  78. gCall(t ? e : g);
  79. gCall(t ? g : g);
  80. eCall(t ? e : e);
  81. }
  82. }