Skip to content

Use extension everything to polyfill ArgumentNullException.ThrowIfNull #114644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

stephentoub
Copy link
Member

Copy link
Contributor

@Copilot 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.

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

Comments suppressed due to low confidence (2)

src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.NativeAot.cs:92

  • ArgumentNullException.ThrowIfNull is being applied to an IntPtr (a value type), which will never be null. If the intent is to validate that 'ptr' is not equal to IntPtr.Zero, consider an explicit check for that condition.
ArgumentNullException.ThrowIfNull(ptr);

src/libraries/Common/src/System/ExceptionPolyfills.cs:12

  • [nitpick] Consider adding unit tests to verify the behavior of the new polyfill implementation for ThrowIfNull to ensure it correctly handles various argument types.
extension(ArgumentNullException)

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

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

Successfully merging this pull request may close these issues.

3 participants