Conversation
This was referenced Sep 12, 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.
Addresses review finding R26.
While editing an invalid struct such as
struct V { public V X; }, Roslyn still provides its symbols to compiler extensions. Using that struct in a network list, dictionary value/key, RPC, or broadcast could overflow the analyzer stack and terminate the compiler or IDE process. Expanding generic fields such asV<T> -> V<V<T>>could also bypass the generator's existing exact-symbol cycle guard.Track the active struct path using
SymbolEqualityComparer.Default, report the existing unsupported-type diagnostic when a cycle is encountered, and check cancellation throughout recursive validation. Reuse the property's existing path policy and add a 128-struct nesting limit to handle expanding constructed generics. Apply the same limit to generated struct models, carry the generator cancellation token into those models, and stop expanding sibling fields as soon as one is unsupported. Shared sibling types and finite nesting such asBox<Box<int>>remain supported.Validation on Windows with SDK 10.0.400 and net8.0 test hosts:
MemoryRelayTransport.cs:21.Compatibility: no runtime API, wire format, package dependency, or diagnostic ID changes. The existing CN0015/CN0016/CN0023/CN0028 diagnostics cover rejected schemas. The defensive limit newly rejects otherwise acyclic schemas exceeding 128 nested serialized structs. R25's arbitrary-symbol cast, R37's recursive nullable collection-field validation, and R12's hidden/builtin struct policy remain outside this independent fix.
Integration with the other independent review PRs requires equivalent bounds and cancellation in their earlier traversal hooks: R22 (#27),
Shared/NetworkDeclarationShape.HasReadonlySerializedField, and R23 (#28),NetworkTypeValidation.FindInaccessibleType(type arguments/public struct fields). Those walks run before supported-type/model validation and must not bypass this protection when the changes are combined. This branch does not include either sibling PR.