[5.7-04182022][ConstraintSystem] A couple of callAsFunction
fixes
#58795
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.
Cherry-pick of #58778
Cherry-pick of #58793
Explanation:
Both fixes represent usability improvements for
callAsFunction
.Avoid filtering
init
overloads of a callable type if a call has a trailing closure. Filteringprevents from picking an overload that is going to work with implicit
callAsFunction
call.Fix a situation where result builder attached to a
callAsFunction
parameter couldnot be discovered due to incorrect locator.
Scope: Calls to
init
of a callable type that have trailing closuresMain Branch PR: [CSSimplify] Avoid filtering
init
overloads of a callable type #58778, [ConstraintSystem] AdjustgetCalleeLocator
to handle implicit `call… #587935.7 Branch PR: [5.7][ConstraintSystem] A couple of
callAsFunction
fixes #58794Resolves: rdar://92912878, rdar://92914226
Risk: Very low
Reviewed By: @hborla
Testing: Added regression test-cases to the suite.
Resolves: rdar://92912878
Resolves: rdar://92914226