Scala parser: support parameterless methods, annotated methods, remove while/annotation fallbacks#7262
Open
jkschneider wants to merge 1 commit intomainfrom
Open
Scala parser: support parameterless methods, annotated methods, remove while/annotation fallbacks#7262jkschneider wants to merge 1 commit intomainfrom
jkschneider wants to merge 1 commit intomainfrom
Conversation
022f9d2 to
6b749e3
Compare
…e while fallback - Parameterless methods (def name: Type) now map to J.MethodDeclaration with OmitBraces marker on empty param container — printer omits () - Annotated methods (@deprecated def ...) now map to J.MethodDeclaration with annotations extracted and def-modifier carrying annotation-to-def spacing - Remove while loop fallback — while loops in method bodies handled by parser - Remove AppliedTypeTree fallback (already fixed in #7260) - 3 remaining fallbacks: procedure syntax, nested braces, function type params - 5 test failures: 3 complex annotations (with args), 2 while body block whitespace
6b749e3 to
72e9e01
Compare
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.
Summary
def name: Type = expr) now map toJ.MethodDeclarationwithOmitBracesmarker on empty param container — printer omits()@deprecated def ...) now map toJ.MethodDeclarationwith annotations extracted and syntheticdefmodifier carrying annotation-to-def spacingvisitUnknown(dd)fallbacks: procedure syntax, nested braces, function type paramsTest plan
def toString: String,def break: Unitround-trip correctly@deprecated def oldMethod(): Unit = {}round-trips correctlyMap[String, Any],Array[String]in method signatures work