Skip to content

Include parameter name in ArgumentNullException for SDK version types#186

Merged
rmarinho merged 1 commit into
mainfrom
fix/sdkversion-exception-diagnostics
Jun 1, 2026
Merged

Include parameter name in ArgumentNullException for SDK version types#186
rmarinho merged 1 commit into
mainfrom
fix/sdkversion-exception-diagnostics

Conversation

@rmarinho
Copy link
Copy Markdown
Member

Summary

Adds nameof(version) to all ArgumentNullException throws in AppleSdkVersion, IPhoneSdkVersion, and MacOSXSdkVersion constructors for better diagnostics.

The int[] overload in AppleSdkVersion already included this correctly; this makes all other constructors consistent.

Add nameof(version) to all ArgumentNullException throws in
AppleSdkVersion, IPhoneSdkVersion, and MacOSXSdkVersion constructors
for better diagnostics. The int[] overload in AppleSdkVersion already
did this correctly; this makes the other constructors consistent.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 29, 2026 15:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 improves diagnostics in the Xamarin.MacDev Apple SDK version structs by ensuring ArgumentNullException consistently includes the offending parameter name in constructor null checks.

Changes:

  • Add nameof (version) to ArgumentNullException throws in AppleSdkVersion (Version).
  • Add nameof (version) to ArgumentNullException throws in IPhoneSdkVersion (Version) and IPhoneSdkVersion (params int[]).
  • Add nameof (version) to ArgumentNullException throws in MacOSXSdkVersion (params int[]) and MacOSXSdkVersion (Version).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
Xamarin.MacDev/AppleSdkVersion.cs Adds parameter name to ArgumentNullException for the Version constructor overload.
Xamarin.MacDev/IPhoneSdkVersion.cs Adds parameter name to ArgumentNullException for Version and int[] constructor overloads.
Xamarin.MacDev/MacOSXSdkVersion.cs Adds parameter name to ArgumentNullException for Version and int[] constructor overloads.

@rmarinho rmarinho merged commit 3b81c64 into main Jun 1, 2026
8 checks passed
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.

3 participants