Conversation
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.
Addresses review finding R24.
A replicated collection hiding an inherited collection or property, or a replicated property hiding a collection, previously passed Cat.Network analysis and produced duplicate serializer helpers and name-mode switch labels. Property/property hiding was already rejected by CN0007; this change extends that existing rule rather than introducing a new diagnostic.
Move CN0007 into one member-name analyzer and share its inherited-name lookup with the generator. All replicated properties and collections occupy the same inheritance-wide name namespace, including private ancestor members and ancestors beyond an intermediate class. Report the error on the conflicting declaration and identify the original declaring type. Skip emission for conflicting types and their descendants while continuing to generate valid bases and unrelated types.
Validation with .NET SDK 10.0.400 and Release/net8.0:
dotnet test Cat.Network.sln -c Release --no-restorepasses all 289 tests: 157 runtime, 79 generator, and 53 analyzer tests. Invalid collision cases produce CN0007 without AD0001, CS8785, or errors in generated sources. The existing CS8600 warning atMemoryRelayTransport.cs:21remains.Compatibility: valid schema order, field indices, wire names, and emitted code remain unchanged. Distinct names, supported ordinary unannotated hiding, and private inherited scalar/list/dictionary members continue to work, including name-mode serialization. Ambiguous schemas remain unsupported and now receive a direct source diagnostic; because generation is skipped, the compiler can also report a missing implementation for the invalid partial declaration. Suppressing CN0007 does not make the ambiguous schema supported. No runtime API or new diagnostic ID is introduced.
Integration with the independent R22/R23 fixes: keep their declaration/type guards and this inherited-name guard conjunctive. R24 adds
Shared/NetworkMemberNames.cs, an independent analyzer registration, and a check beforeNetworkObjectTypeModel.Create; it does not modify that model factory. Preserve R22's nullable factory result and retain a single null-filter/select stage after all guards. Retain each issue's distinct shared source-file link. This PR is independently based onrewrite, without either neighboring fix.