Skip to content

Fixes #4806. Fix nullable warnings and suppress xunit analyzer bug - #4807

Merged
tig merged 2 commits into
v2_developfrom
copilot/fix-nullable-warnings
Mar 7, 2026
Merged

tig merged 2 commits into
v2_developfrom
copilot/fix-nullable-warnings

Conversation

Copilot AI commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Fixes

PR #4788 (xUnit v3 upgrade) introduced CS8600 nullable warnings and AD0001 Roslyn analyzer crashes.

Proposed Changes/Todos

  • Fix 21 CS8600 warnings: Record.Exception() returns Exception?, but was assigned to non-nullable Exception
  • Suppress AD0001 in test projects — Xunit.Analyzers.MemberDataShouldReferenceValidMember throws InvalidOperationException (known xunit bug)

CS8600 fix (10 test files):

// Before
Exception exception = Record.Exception (() => view.SetFocus ());

// After
Exception? exception = Record.Exception (() => view.SetFocus ());

AD0001 suppression (both test .csproj files):

<NoWarn>$(NoWarn);AD0001</NoWarn>

Pull Request checklist:

  • I've named my PR in the form of "Fixes #issue. Terse description."
  • My code follows the style guidelines of Terminal.Gui - if you use Visual Studio, hit CTRL-K-D to automatically reformat your files before committing.
  • My code follows the Terminal.Gui library design guidelines
  • I ran dotnet test before commit
  • I have made corresponding changes to the API documentation (using /// style comments)
  • My changes generate no new warnings
  • I have checked my code and corrected any poor grammar or misspellings
  • I conducted basic QA to assure all features are working
Original prompt

This section details on the original issue you should resolve

<issue_title>Warnings were introduced in #4788</issue_title>
<issue_description>- #4788

These need to be fixed. The rosyln one can be supressed because it's a bug in xunit.

I don't understand why the others were not being emitted before. But they seem to be valid nullable warnings and the code should be fixed.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: tig <585482+tig@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix nullable warnings introduced in #4788 Fixes #4806. Fix nullable warnings and suppress xunit analyzer bug Mar 7, 2026
Copilot finished work on behalf of tig March 7, 2026 16:42
@tig
tig marked this pull request as ready for review March 7, 2026 19:28
@tig
tig merged commit a6ded8a into v2_develop Mar 7, 2026
11 checks passed
@tig
tig deleted the copilot/fix-nullable-warnings branch March 7, 2026 19:29
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.

Warnings were introduced in #4788

2 participants