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

[lworld] A primitive class field by name val confuses javac

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Reported by Tobias.

      The following program does not compile on lworld branch top:

      public class X {
      static primitive class Test139Value {
              Object obj = null;
              MyValueEmpty empty = MyValueEmpty.default;
          }
          static primitive class Test139Wrapper {
              Test139Value val = Test139Value.default;
          }
          public MyValueEmpty test139() {
              Test139Wrapper w = new Test139Wrapper();
              return w.val.empty;
          }
      }

      primitive class MyValueEmpty {}


      I get:

      X.java:11: error: unexpected type
              return w.val.empty;
                     ^
        required: class,package
        found: variable
      X.java:11: error: cannot find symbol
              return w.val.empty;
                          ^
        symbol: variable empty
        location: class Test139Wrapper
      2 errors


        Attachments

          Issue Links

            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:
                Resolved: