You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
Section 31.7 of the manual on type refinement states:
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.
The text was updated successfully, but these errors were encountered: