Frege/frege-native-gen

Is there support for nested static classes?

Closed this issue · 1 comments

Is there support for nested static classes? such as NestedStaticClass

 public class OuterClass {
    ...
     public static class NestedStaticClass {
     ...
     }
 }

I've tried

java -cp native-gen-1.0-SNAPSHOT.jar:someLibrary.jar frege.nativegen.Main some.library.OuterClass.NestedStaticClass

but it returns with java.lang.ClassNotFoundException: some.library.OuterClass.NestedStaticClass
while the OuterClass works but does not generate code for the nested class

 java -cp native-gen-1.0-SNAPSHOT.jar:someLibrary.jar frege.nativegen.Main some.library.OuterClass

I guess this is because Class.forName and friends need the binary class name, not the one we use in Java source code.
In the binary name, inner classes are separated with $ (not .) from the enclosing class.

I had the same problem in the compiler and solved it imho satisfactory, for details see frege.compiler.Javatypes.classForName