Generalize improvement of initialization type frames #642
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.
This fixes #640 and fixes #641 by generalizing the fix in #621 . While that fix worked by overriding the error reporting for (common) assignments and method calls in the Initialization Visitor, this fix is general and assigns the correct type to the receiver in the first place in the Initialization ATF, so that overriding specific error-reporting is now unnecessary.
This will obviously conflict with #623 , which uses the overridden error-reporting functions to modify the error messages, so we need to consider how to handle this. The simplest way is to have #623 override this branch, which has the slight disadvantage that some of the code between the Visitor and ATF will then be doubled. Also #623 has the same problem as #621 in that it only applies to (common) assignments and method calls, not, e.g., to the example from #640.