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

Slightly misleading description of where qualifiers must be written in method bodies #5362

Closed
msridhar opened this issue Oct 11, 2022 · 1 comment · Fixed by #5383
Closed
Assignees

Comments

@msridhar
Copy link
Contributor

Section 31.7 of the manual on type refinement states:

Due to local type refinement, a programmer typically does not have to write any qualifiers on local variables within a method body (except occasionally on type arguments).

Since this section is on type refinement / qualifier inference, I read the word "occasionally" to mean that in most cases, type argument qualifiers would be inferred. But in fact, I think any explicit type containing type arguments should also give the qualifiers for those arguments. Qualifiers do not need to be written if the default qualifier applies to a type argument, but that has nothing to do with inference. Section 31.7.3 is clear about the need to annotate type arguments and array element types.

Not sure how to rephrase the quoted sentence but I think it could be a bit clearer.

@mernst
Copy link
Member

mernst commented Oct 17, 2022

Thank you for pointing this out. It was intended to mean that "occasionally" and "on type arguments" are the same thing, but that is not the natural reading of the text. I have opened #5383 to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants