Skip to content

[TypeCheckEffects] Stage in new effects checker errors for statement expressions as warnings until Swift 6. #70820

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 3 commits into from
Jan 11, 2024

Conversation

hborla
Copy link
Member

@hborla hborla commented Jan 10, 2024

#68765 fixed a bug where a try or await on an if or switch expression would consider the branch expressions as covered by that effect marker. However, this is a source breaking change, so these diagnostics need to be staged in as warnings until Swift 6.

Missing try or await errors in statement expression branches will be downgraded to warnings if the enclosing statement expression has the respective effect marker. A redundant effect marker on a statement expression is also unconditionally diagnosed as a warning instead of an error; redundant trys or awaits are never invalid, and there's no reason to make them invalid specifically for statement expressions.

This change also fixes an issue where async let required try/await in statement expressions.

Resolves: rdar://119858327, rdar://119858789

@hborla hborla force-pushed the downgrade-if-switch-effects-errors branch from 7d3bb85 to 8c9cd23 Compare January 10, 2024 19:18
@hborla hborla marked this pull request as ready for review January 10, 2024 19:19
@hborla hborla force-pushed the downgrade-if-switch-effects-errors branch from 8c9cd23 to 8be1849 Compare January 10, 2024 19:44
@hborla hborla force-pushed the downgrade-if-switch-effects-errors branch from 8be1849 to cc79dea Compare January 10, 2024 20:53
@hborla
Copy link
Member Author

hborla commented Jan 10, 2024

@swift-ci please smoke test

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.

1 participant