This is the mail archive of the java-prs@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcj/174: Wrong scope for inner class variable declaration



>Number:         174
>Category:       gcj
>Synopsis:       Wrong scope for inner class variable declaration
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 14 03:00:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Bryce McKinlay
>Release:        gcc version 2.96 20000313 (experimental)
>Organization:
>Environment:
Linux
>Description:
The following test fails with 
"Scope3.java:14: Incompatible type for declaration. Can't convert `Scope3$A' to `A'."

It appears that gcj sees the correct (inner) class for the 
constructor call, but the wrong (top-level) class for the
variable declaration.

class A
{
}

public class Scope3
{
  public static void main(String args[])
  {
    new Scope3();
  }
  
  public Scope3()
  {
    A a = new A();
  }
  
  class A
  {}
}
>How-To-Repeat:
Try to compile the test case
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]