Skip to content
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

Fix ArrayType brackets precedence #2758

Merged
merged 6 commits into from
Nov 11, 2020

Conversation

iTakeshi
Copy link
Contributor

According to JLS 10.2, brackets pairs after the identifier are preceded to (i.e., become outer of) brackets pairs after the type name.
Hence, the order should be

String [<3>][<4>] str[<1>][<2>]

@iTakeshi
Copy link
Contributor Author

The test was failed due to github action malfunction. Could you re-run before merging? thank you!

@MysterAitch
Copy link
Member

Still getting my head around the PR but the description / rationale seems perfectly sound -- thanks @iTakeshi ! 👍

A few additional notes:

// Equivalent:
String [<3>][<4>] str[<1>][<2>]
String [<1>][<2>][<3>][<4>] str

// Equivalent:
String @C[]@D[] str@A[]@B[]
String @A[]@B[]@C[]@D[] str

Screenshot from the JLS:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API or Behaviour Change Issues / PRs where there is potentially a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants