java/3285: gcj fails to resolve constructor calls in inner classes

p.thio@valescom.com p.thio@valescom.com
Wed Jun 20 02:56:00 GMT 2001


>Number:         3285
>Category:       java
>Synopsis:       gcj fails to resolve constructor calls in inner classes
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 20 02:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     p.thio@valescom.com
>Release:        unknown-1.0
>Organization:
>Environment:
gcj gcc_ss_20010611 on linux
>Description:
Compile the following code with gcj. The code compiles with javac.

gcj --main=Test Test.java 
Test.java: In class `Test$1':
Test.java: In method `(Test,C1)':
Test.java:25: No constructor matching `(Test,C1)' found in class `C2'.
           C1 c1 = new C1();
                            ^
1 error


--------------- Test.java -----------------------------
interface I
{
};

class C1
implements I
{
}

abstract
class C2
{
    C2(I i)
    {
    }
    abstract void h();
}

public
class Test
{
    public static
    void main(String argv[])
    {
        C1 c1 = new C1();
        new C2(c1)
        {
            void h()
            {
            }
        };
    }
}
>How-To-Repeat:
use: gcj --main=Test Test.java 

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="Test.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Test.java"

aW50ZXJmYWNlIEkKewp9OwoKY2xhc3MgQzEKaW1wbGVtZW50cyBJCnsKfQoKYWJzdHJhY3QKY2xh
c3MgQzIKewogICAgQzIoSSBpKQogICAgewogICAgfQogICAgYWJzdHJhY3Qgdm9pZCBoKCk7Cn0K
CnB1YmxpYwpjbGFzcyBUZXN0CnsKICAgIHB1YmxpYyBzdGF0aWMKICAgIHZvaWQgbWFpbihTdHJp
bmcgYXJndltdKQogICAgewogICAgICAgIEMxIGMxID0gbmV3IEMxKCk7CiAgICAgICAgbmV3IEMy
KGMxKQogICAgICAgIHsKICAgICAgICAgICAgdm9pZCBoKCkKICAgICAgICAgICAgewogICAgICAg
ICAgICB9CiAgICAgICAgfTsKICAgIH0KfQo=



More information about the Gcc-bugs mailing list