Skip to content

Fix pointer null comparison code fixes - #104

Merged
AArnott merged 1 commit into
mainfrom
aarnott-fix-issue-30
Aug 20, 2026
Merged

AArnott merged 1 commit into
mainfrom
aarnott-fix-issue-30

Conversation

@AArnott

@AArnott AArnott commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Pointer comparisons with null were missed because Roslyn does not surface a constant value on the outer conversion operation. This restores suggestions for void* and IntPtr* comparisons.

The analyzer now recognizes null literals through conversions. For pointer non-null comparisons, the code fix offers only is not null, since is object is not valid for pointer operands. Regression coverage includes both pointer types.

Fixes #30

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.61%. Comparing base (3e5fa61) to head (65fbc56).

Files with missing lines Patch % Lines
...CSharpIsNullAnalyzer.CodeFixes/CSIsNull002Fixer.cs 83.33% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #104      +/-   ##
==========================================
- Coverage   94.47%   93.61%   -0.86%     
==========================================
  Files           7        7              
  Lines         181      188       +7     
  Branches       36       39       +3     
==========================================
+ Hits          171      176       +5     
  Misses          3        3              
- Partials        7        9       +2     
Flag Coverage Δ
Linux 93.61% <85.71%> (-0.86%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

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.

Missed code fix suggestions on void*/IntPtr*

2 participants