Skip to content

Enable nullable reference types in RtxtWriter.cs#12241

Open
jonathanpeppers with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-nullable-reference-types
Open

Enable nullable reference types in RtxtWriter.cs#12241
jonathanpeppers with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-nullable-reference-types

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Opts RtxtWriter.cs into NRT as part of the repo-wide nullable enablement effort.

Changes

  • Added #nullable enable as the first line of RtxtWriter.cs
  • Added explicit null guards for the file and items parameters using netstandard2.0-compatible form (ArgumentNullException.ThrowIfNull is unavailable on that TFM):
if (file == null)
    throw new ArgumentNullException (nameof (file));
if (items == null)
    throw new ArgumentNullException (nameof (items));

R is a struct, so IList<R> requires no element-level null annotations and no ! operator is needed anywhere.

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable nullable reference types in RtxtWriter.cs Enable nullable reference types in RtxtWriter.cs Jul 27, 2026
Copilot AI requested a review from jonathanpeppers July 27, 2026 02:34
@jonathanpeppers
jonathanpeppers marked this pull request as ready for review July 27, 2026 13:04
Copilot AI review requested due to automatic review settings July 27, 2026 13:04
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jul 27, 2026
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) July 27, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR opts src/Xamarin.Android.Build.Tasks/Utilities/RtxtWriter.cs into nullable reference types (NRT) as part of the repo-wide enablement effort, adding explicit runtime guards for reference-type inputs to preserve behavior and eliminate nullable warnings.

Changes:

  • Enabled NRT with #nullable enable at the top of RtxtWriter.cs.
  • Added ArgumentNullException guards for file and items using a netstandard2.0-compatible pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix-finder] Enable nullable reference types in RtxtWriter.cs

4 participants