Skip to content

fix: detect implicit await forms in CC019 cancellation catches#30

Merged
georgepwall1991 merged 1 commit into
masterfrom
fix/cc019-await-foreach
Jul 21, 2026
Merged

fix: detect implicit await forms in CC019 cancellation catches#30
georgepwall1991 merged 1 commit into
masterfrom
fix/cc019-await-foreach

Conversation

@georgepwall1991

Copy link
Copy Markdown
Owner

Summary

  • teach CC019 to recognize await foreach
  • recognize both await using var and await using (...)
  • preserve the current-function boundary added in v1.27.174
  • update release metadata and analyzer-health evidence for v1.27.175

Why

These constructs carry their await keyword on statement syntax instead of producing an AwaitExpressionSyntax. Broad catches around async enumeration or async disposal could therefore swallow OperationCanceledException without a CC019 diagnostic.

Validation

  • red-first tests reproduced all three false negatives
  • focused CC019 tests: 13 passed
  • full suite: 629 passed, 0 failed
  • Release build: 0 errors (62 intentional sample analyzer warnings)
  • package inspection: analyzer and code-fix DLLs present; no NuGet dependencies
  • format verification completed
  • self-review completed as explicitly requested; no Claude review used

Release

Prepared as v1.27.175.

Async enumeration and async disposal store their await keywords on statement syntax rather than AwaitExpressionSyntax. Recognizing those forms prevents broad catches from silently swallowing cancellation during iteration or disposal.
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