-
Notifications
You must be signed in to change notification settings - Fork 17
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
Command Line REPL doesn't like simple module names? #10
Comments
I think the problem is that in Java, classes in the default package cannot be imported into another packaged class. Since |
So are you saying that error comes from the Java compiler? |
Most likely but it could also be Frege compiler. I am not sure even how On Tuesday, October 28, 2014, Ingo Wechsung notifications@github.com
|
The compiler reads only the annotations on an import, and then rebuilds the symbol table based on the information (type FregePackage). A short test reveals that importing some class from the unnamed package is indeed impossible, the SDK javac does not even allow an unqualified name after import:
However, we could nevertheless just use B from A. I confirmed this by removing the import B from A.java and recompiling. So, it turns out the code generator must not generate import statements for simple packages! However, we can use such classes only from classes in other unnamed packages. So, as I see it, we need following fixes:
If you agree with me, I shall prepare the first two fixes relative to 3.21.500. I consider this crucial, for the simple reason that it is most likely that beginners begin with something like
and then get disappointed when they try that in the REPL and get errors without them having done anything wrong. |
Thanks Ingo! That clears up a lot of things. I also agree with those fixes you proposed. I will make the necessary On Tuesday, October 28, 2014, Ingo Wechsung notifications@github.com
|
Fine then. I have created an issue accordingly for the frege project . |
REPL session is now compiled into the default package. Both online and command line REPL are updated and are also upgraded to 3.21.586.
|
Should be fixed with commit 8b2dcd87b8dc41f1ef808eb83ffa8d23e0babf7a |
Sorry, I am not sure how I missed your comment. Yes, this issue is fixed. |
Here is a transcript:
So far, so good.
But then:
To reproduce, try to load and import a module with a simple name, and then use definitions from it.
The text was updated successfully, but these errors were encountered: