Specify precisely where it is an error to declare an initializing formal #3517
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.
The compile-time error which is reported by the common front end for a declaration of a formal parameter as an initializing formal (
this.name
) was not specified precisely until now (it was just mentioned in commentary and never spelled out in normative text).This PR changes the commentary to normative text.
One question may still give rise to debate: Can external constructors have initializing formals? This would be an enhancement, and it is handled in #3516. If that enhancement is accepted then we will change the specification later on in a different PR—this PR just specifies the current situation and makes it an error.
There will be an implementation effort in any case: If this PR is landed and the error reported by the CFE follows the updated specification then the analyzer would need to be changed to report that error. If an enhancement is accepted then all tools would need to implement it.