We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, thank you for this great tool.
Although the receiver (parameter implicit this) is a rarely used syntax, but is valid in java and required when using Checker Framework, example here
Looking at the parser code I see that it is supported in constructors
Input:
class Foo { public void test(Foo this) { // This fails } public void test(Foo this, Bar that) { // This fails } }
Output:
[error] Foo.java: Error: Sad sad panda, parsing errors detected in line: 2, column: 26! [error] Expecting --> '...' <-- but found --> 'this' <--! [error] ->compilationUnit [error] ->ordinaryCompilationUnit [error] ->typeDeclaration [error] ->classDeclaration [error] ->normalClassDeclaration [error] ->classBody [error] ->classBodyDeclaration [error] ->classMemberDeclaration [error] ->methodDeclaration [error] ->methodHeader [error] ->methodDeclarator [error] ->formalParameterList [error] ->formalParameter [error] ->variableArityParameter [error] at Object.parse (<…>/prettier-java-repro/node_modules/java-parser/src/index.js:41:11) [error] at Object.parse (<…>/prettier-java-repro/node_modules/prettier-plugin-java/dist/parser.js:4:23) [error] at parse (file://<…>/prettier-java-repro/node_modules/prettier/index.mjs:16786:24) [error] at async coreFormat (file://<…>/prettier-java-repro/node_modules/prettier/index.mjs:18107:7) [error] at async formatWithCursor (file://<…>/prettier-java-repro/node_modules/prettier/index.mjs:18309:14) [error] at async formatFiles (file://<…>/prettier-java-repro/node_modules/prettier/internal/cli.mjs:7082:18) [error] at async main (file://<…>/prettier-java-repro/node_modules/prettier/internal/cli.mjs:7274:5) [error] at async Module.run (file://<…>/prettier-java-repro/node_modules/prettier/internal/cli.mjs:7228:5) error Command failed with exit code 2.
Weirdly I found some mentions of receiver parameter but in the constructorDeclarator where it shouldn't be supported
constructorDeclarator
Thanking in advance
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Hi, thank you for this great tool.
Although the receiver (parameter implicit this) is a rarely used syntax, but is valid in java and required when using Checker Framework, example here
Looking at the parser code I see that it is supported in constructors
Input:
Output:
Weirdly I found some mentions of receiver parameter but in the
constructorDeclarator
where it shouldn't be supportedThanking in advance
The text was updated successfully, but these errors were encountered: