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

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

    Details

    • Type: Bug
    • Status: New
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: repo-amber
    • Fix Version/s: repo-amber
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      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 []) {
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              sadayapalam Srikanth Adayapalam
              Reporter:
              sadayapalam Srikanth Adayapalam
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: