Skip to content

[5.3][Function Builders] Teach diagnostics about function builder body result types... #33174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

hborla
Copy link
Member

@hborla hborla commented Jul 29, 2020

...in order to properly diagnose requirement failures on a builder-transformed type.

This is mostly a cherry-pick of #33149, but working around not being able to anchor the constraint between the function result type and the transformed type on the function decl.

Reviewed by @xedin


  • Add a new locator path element FunctionBuilderBodyResult
  • When adding the constraint to match the function builder transformed type with the body result type, add the FunctionBuilderBodyResult path element.
  • When computing the affected decl for a RequirementFailure that has a locator pointing to a FunctionBuilderBodyResult, get the affected decl from the function result type
  • Override getLoc in RequirementFailure to always produce the diagnostic at the function declaration when the fix is for a FunctionBuilderBodyResult, since the anchor can be nullptr

Resolves: rdar://problem/66247196

hborla added 2 commits July 28, 2020 17:44
result types in order to properly diagnose requirement failures on
a builder-transformed type.
@hborla hborla requested a review from a team as a code owner July 29, 2020 01:04
@hborla
Copy link
Member Author

hborla commented Jul 29, 2020

@swift-ci please test

@hborla hborla added the r5.3 label Jul 29, 2020
@hborla hborla merged commit a30cf9c into swiftlang:release/5.3 Jul 29, 2020
@hborla hborla deleted the 5.3-function-builder-body-result-diags branch July 29, 2020 16:03
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants