Skip to content

Nested static inner classes wrong field order #2

@GoogleCodeExporter

Description

@GoogleCodeExporter
public class Test1 {
    public static String s1 = "s1";
    public static class Test2{
        public static String s2 = "s2"+Test1.s1;
    }
}

Will compile into
Clazz.declarePackage("test");
c$ = Clazz.declareType(test, "Test1");
Clazz.pu$h();
c$ = Clazz.declareType(test.Test1, "Test2");
c$.s2 = c$.prototype.s2 = "s2" + test.Test1.s1;
c$ = Clazz.p0p();
Clazz.defineStatics(c$, "s1", "s1");

Try to run Main.main.

public class Main {
    public static void main(final String[] args){
        System.out.println(Test1.s1);
        System.out.println(Test1.Test2.s2);
    }
}

It will show
s1
s2undefined

Expected
s1
s2s1


Original issue reported on code.google.com by grigores...@gmail.com on 9 Sep 2011 at 10:44

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions