Specify callable object closurization #1842
Merged
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 PR adds a new case to the set of possible 'property extraction' expressions: Implicit property extraction. It occurs where an expression
e
has a static type as a callable object, and the context type is a function type. In this case we desugare
intoe.call
. Note that this will also serve as the first step in a generic function instantiation, because it is still true that the context type is a function type also in the case wheree.call
isn't assignable to that context type (but we can fix it by means of an implicit instantiation).Smaller corrections:
The subsubsection about generic function instantiation was turned into a subsection: It used to be the case that a generic function instantiation would necessarily include a function closurization as a sub-action. This is no longer true, we can perform the generic instantiation on an existing function object. This means that the generic instantiation material should no longer be a subsection of 'Function Closurization', it's a stand-alone feature.
Subtitle uses version 2.15-dev, not 2.13-dev.
Note that this change is not expected to give rise to any implementation efforts. The following works today already: