-
Notifications
You must be signed in to change notification settings - Fork 453
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
compiler shows incorrect error for inner static on record #3443
Comments
@robaho I can't reproduce the issue. Could you try the latest VS Code Java 1.25.1 or Pre-Release? |
I am running the pre-release v1.26.2023122208. The JDK is JavaSE-17. I created the below file. It doesn't show an error. Select File->Save and the error appears: import java.util.function.Predicate;
public class TestCompiler {
public record MyRecord(int v) {
public static final Predicate<Object> ALWAYS_TRUE_FILTER = w -> true;
}
} |
If I close the tab, then reopen, the error is gone. As soon as I use File->Save it will reappear. |
I still can't reproduce the issue. |
Btw, this is a gradle based project. I will try and create a simple project shortly. |
I did some more investigation on this. I created a new project and saw the same error. After using 'clean workspace' the error went away and did not return. I went back to my original project and did the same and the error disappeared and I could not make it happen again with the save. So at this point I cannot reliably reproduce and there is a 'workaround/fix' to remove it, so you can close the issue. I am fairly certain there is a bug lurking though... |
Code like:
is valid.
The compiler reports
Illegal modifier for parameter SOMEVALUE; only final is permitted Java(67109220)
The code compiles fine with javac.
The text was updated successfully, but these errors were encountered: