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.

StaticContexts.java 661B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. public class StaticContexts {
  2. Object m() { return null; }
  3. static void s(Object o) {}
  4. class I extends C {
  5. I() {
  6. super(StaticContexts.this);
  7. s(StaticContexts.this);
  8. }
  9. I(int x) {
  10. super(this);
  11. s(this);
  12. }
  13. I(float x) {
  14. super(m());
  15. s(m());
  16. }
  17. static void foo() { //ERR: inner class can't have static member
  18. s(StaticContexts.this);
  19. s(this);
  20. s(m());
  21. }
  22. }
  23. static class II extends C {
  24. II() {
  25. super(StaticContexts.this);
  26. s(StaticContexts.this);
  27. }
  28. II(int x) {
  29. super(this);
  30. s(this);
  31. }
  32. II(float x) {
  33. super(m());
  34. s(m());
  35. }
  36. }
  37. }
  38. class C {
  39. C(Object o) {}
  40. }