Skip to content

fix: scope CC016 awaits to their owning function#33

Merged
georgepwall1991 merged 1 commit into
masterfrom
fix/cc016-current-scope-await
Jul 21, 2026
Merged

fix: scope CC016 awaits to their owning function#33
georgepwall1991 merged 1 commit into
masterfrom
fix/cc016-current-scope-await

Conversation

@georgepwall1991

Copy link
Copy Markdown
Owner

Summary

  • stop CC016 await eligibility at nested lambda and local-function boundaries
  • keep token-reference analysis capture-aware
  • add a regression for a synchronous method whose only await belongs to a nested lambda
  • prepare v1.27.178 release metadata

Why

The previous unrestricted descendant search made a synchronous outer method look asynchronous when only a nested function performed awaited work, producing a false unused-token diagnostic.

Validation

  • red-first regression reproduced one false CC016 diagnostic
  • focused CC016 tests: 10 passed
  • full suite: 633 passed, 0 failed
  • Release build: 0 errors (62 intentional sample analyzer warnings)
  • touched-file whitespace verification: clean
  • package inspection: both analyzer assemblies present; no NuGet dependencies
  • self-review completed as requested; no Claude review used

Tooling note

Slopwatch is required by the local .NET overlay but unavailable on this host (command not found). Manual hygiene and exact-diff review are clean.

An await inside a nested lambda or local function does not make its synchronous container asynchronous. Respecting function boundaries prevents false unused-token diagnostics while retaining capture-aware token usage.
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