JDK-8264977 : [lworld] A primitive class field by name val confuses javac
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: repo-valhalla
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2021-04-09
  • Updated: 2021-04-09
  • Resolved: 2021-04-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
repo-valhallaFixed
Related Reports
Relates :  
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