Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there support for nested static classes? #8

Closed
trilogysci opened this issue Dec 10, 2014 · 1 comment
Closed

Is there support for nested static classes? #8

trilogysci opened this issue Dec 10, 2014 · 1 comment

Comments

@trilogysci
Copy link

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
@Ingo60
Copy link
Member

Ingo60 commented Dec 10, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants