Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8232875

[local-methods] Javac should assume a local method is always reachable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • repo-amber
    • repo-amber
    • tools
    • generic
    • generic

      To support forward references, a local method should always be assumed to be reachable:

      The following does not compile as of now:

      public class X {
          {
              throw new AssertionError("Blah");
              int foo() {
                 int x = 19;
                 return x;
              }
              int y = 42;
          }
          public static void main(String args []) {
          }
      }

            vromero Vicente Arturo Romero Zaldivar
            sadayapalam Srikanth Adayapalam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: