Repository navigation
NuGet.Protocol nullable enablement - Converters, Events, DependencyInfo - #7337
Merged
Merged
Conversation
nkolev92
force-pushed
the
dev-nkolev92-protocol-v3
branch
from
April 28, 2026 17:25
bca1236 to
411a4ae
Compare
Co-authored-by: Copilot <[email protected]>
zivkan
reviewed
Apr 29, 2026
jeffkl
previously approved these changes
Apr 29, 2026
zivkan
approved these changes
Apr 30, 2026
This was referenced May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Progress: NuGet/Home#14851
Description
Continues nullable enablement for
NuGet.Protocol. Removes#nullable disablefrom Converters, Events, and DependencyInfo files. Adds ""Prefer Immutability and Non-Null Types"" section todocs/coding-guidelines.md.Design decisions worth reviewing
GetRegistrationInfonow returnsRegistrationInfo?(null for not-found)The method's XML doc has said ""Returns Null if the package does not exist"" since 2015, but the implementation never actually returned null — it returned an empty
RegistrationInfowithId = null. Fixed by making the method actually return null when empty, and makingRegistrationInfo.Idarequired string. The callers inDependencyInfoResourceV3already had the null checks — they were dead code that is now live.required initon internal typesDependencyInfo,PackageInfo, andRegistrationInfouserequired initfor properties set at construction, get-only for collections. All callers already use object initializers, so no behavioral change.PR Checklist