Skip to content

Stand in CancellationToken.None for a removed token - #174

Merged
virzak merged 2 commits into
masterfrom
fix/catch-filter-cancellation-token
Oct 6, 2026
Merged

virzak merged 2 commits into
masterfrom
fix/catch-filter-cancellation-token

Conversation

@virzak

@virzak virzak commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

A catch filter which checks a removed CancellationToken kept the reference and did not compile (CS0103). The reference now becomes global::System.Threading.CancellationToken.None, which is never cancelled, so the filter keeps its shape and is always false.

Reported from dotnet/SqlClient against 2.0.56.

Generated with Claude Code

virzak added 2 commits October 6, 2026 15:42
A catch filter which checks the token has to keep its shape, so the
reference is replaced rather than dropped. None is never cancelled,
which is what the synchronized method does.

Generated with Claude Code
@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.69%. Comparing base (da628aa) to head (dac96a6).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #174      +/-   ##
==========================================
+ Coverage   91.67%   91.69%   +0.01%     
==========================================
  Files           6        6              
  Lines        1273     1276       +3     
  Branches      306      307       +1     
==========================================
+ Hits         1167     1170       +3     
  Misses         38       38              
  Partials       68       68              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@virzak
virzak merged commit 6ffed02 into master Oct 6, 2026
10 checks passed
@virzak
virzak deleted the fix/catch-filter-cancellation-token branch October 6, 2026 20:10
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