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.

TypeExprErrors.java 886B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // errors on lines:
  2. // 10 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 36 37
  3. public class TypeExprErrors {
  4. static String s;
  5. static boolean b;
  6. static A a;
  7. TypeExprErrors() {
  8. this(A);
  9. }
  10. TypeExprErrors(Object o) {
  11. }
  12. static {
  13. s += A;
  14. a = A;
  15. f(A);
  16. f((A) A);
  17. f(b ? A : a);
  18. f(b ? a : A);
  19. new TypeExprErrors(A);
  20. ff(a == A);
  21. ff(A == a);
  22. ff(A != a);
  23. ff(a != A);
  24. ff(A != null);
  25. ff(null != A);
  26. ff(A == null);
  27. ff(null == A);
  28. ff(A instanceof A);
  29. f(new A[] { A });
  30. (A).m();
  31. (A).sm(); // not actually an error
  32. f(s + A);
  33. f(A + s);
  34. }
  35. static void f(Object o) {
  36. }
  37. static void ff(boolean b) {
  38. }
  39. }
  40. class A {
  41. void m() {}
  42. static void sm() {}
  43. }