Skip to content

[ConstraintSystem] Detect and diagnose extraneous return(s) in result build body #34810

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
merged 5 commits into from
Dec 2, 2020

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Nov 18, 2020

This is (hopefully) the last source of "failed to produce a diagnostic" related to result builder
where having a return would just assume that body is a regular closure just to fail a bit later.

Instead of doing that (in diagnostic mode) let's mark body with explicit returns as invalid and
carry on solving to diagnose it if it was possible to reach a solution, this would also mean
that situations where nested result builders have return statements are going to be correctly
diagnosed.

Resolves: rdar://problem/66709164

@xedin xedin requested a review from hborla November 18, 2020 20:48
@xedin
Copy link
Contributor Author

xedin commented Nov 19, 2020

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Nov 20, 2020

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Dec 1, 2020

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Dec 1, 2020

@swift-ci please smoke test Windows platform

1 similar comment
@xedin
Copy link
Contributor Author

xedin commented Dec 1, 2020

@swift-ci please smoke test Windows platform

@xedin
Copy link
Contributor Author

xedin commented Dec 2, 2020

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Dec 2, 2020

@swift-ci please smoke test Linux platform

2 similar comments
@xedin
Copy link
Contributor Author

xedin commented Dec 2, 2020

@swift-ci please smoke test Linux platform

@xedin
Copy link
Contributor Author

xedin commented Dec 2, 2020

@swift-ci please smoke test Linux platform

@xedin xedin merged commit 8518136 into swiftlang:main Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants