Fix JDK9 compilation issue, use parser.ast.Module instead of Module#18
Merged
davexparker merged 1 commit intoprismmodelchecker:masterfrom Aug 30, 2017
Merged
Fix JDK9 compilation issue, use parser.ast.Module instead of Module#18davexparker merged 1 commit intoprismmodelchecker:masterfrom
davexparker merged 1 commit intoprismmodelchecker:masterfrom
Conversation
In Java 9, there is a new system class java.lang.Module that is implicitly imported everywhere and which clashes with the parser.ast.Module class, resulting in compilation errors, as javac is not able to disambiguate between the two automatically. We are therefore more specific when referencing the PRISM parser's 'Module' class, by using the full 'parser.ast.Module' name.
Member
|
Yes, I think rewriting the references is the best solution. I don't have Java 9 to hand, but all works fine on Java 8. Will merge. |
Contributor
|
Hi, I ran into the same issue in PR #66 . Problem is, that generic imports of the form Maybe we want to create a new PR for just this import issue? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the upcoming Java 9, there is a
java.lang.Moduleclass which is imported automatically due to thejava.langpackage. This clashes with PRISM'sparser.ast.Moduleclass, leading to numerous compilation errors, as the compiler can not disambiguate between the two.The attached fix resolves this by explicitly writing
parser.ast.Moduleinstead ofModule, where required.Question: Do we want to resolve it like this or do we rename
parser.ast.Moduleto something that does not clash? I don't really have a preference.With this fix, PRISM compiles on Java 9 (tested on Linux), with some warnings. Test suite passes.