java/9943: field reference of enclosing class in an inner class cannot be compiled.

julias@macrovision.com julias@macrovision.com
Tue Mar 4 19:40:00 GMT 2003


>Number:         9943
>Category:       java
>Synopsis:       field reference of enclosing class in an inner class cannot be compiled.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 04 19:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     julia smith
>Release:        unknown-1.0
>Organization:
>Environment:
linux
>Description:
The compiler incorectly identifies "m_opts" as a super class field. It is a field of the embeddeding class, but not a member of the class or the super class being defined.

gcj -c testcase.java
testcase.java: In class `testcase$option':
testcase.java: In constructor `(testcase)':
testcase.java:22: Can't reference `m_opts' before the superclass constructor has been called.
         super(m_opts);
               ^
1 error
>How-To-Repeat:
invoke: gcj -c testcase.java
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-java; name="testcase.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="testcase.java"

DQppbXBvcnQgamF2YS51dGlsLio7DQoNCmNsYXNzIHRvb2xvcHQNCnsNCiAgcHVibGljIHRvb2xv
cHQgKEhhc2h0YWJsZSB0KQ0KICB7DQogIH0NCn0NCg0KY2xhc3MgdG9vbA0Kew0KICBwcm90ZWN0
ZWQgSGFzaHRhYmxlIG1fb3B0czsNCn0NCg0KcHVibGljIGNsYXNzIHRlc3RjYXNlIGV4dGVuZHMg
dG9vbA0Kew0KICBjbGFzcyBvcHRpb24gZXh0ZW5kcyB0b29sb3B0DQogIHsNCiAgICBvcHRpb24g
KCkNCiAgICB7DQogICAgICBzdXBlcihtX29wdHMpOw0KICAgIH0NCiAgfQ0KfQ0K



More information about the Gcc-bugs mailing list