Enable nullable analysis in LayoutAttribute.Partial.cs - #12326
Merged
jonathanpeppers merged 2 commits intoAug 10, 2026
Merged
Conversation
6 tasks
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enable nullable reference types in LayoutAttribute.Partial.cs
Enable nullable analysis in LayoutAttribute.Partial.cs
Aug 8, 2026
jonathanpeppers
marked this pull request as ready for review
August 10, 2026 12:22
jonathanpeppers
approved these changes
Aug 10, 2026
jonathanpeppers
enabled auto-merge (squash)
August 10, 2026 12:22
Contributor
There was a problem hiding this comment.
Pull request overview
This PR opts LayoutAttribute.Partial.cs into nullable reference type analysis and updates the FromTypeDefinition factory to accurately express and handle its legitimate null return path when no LayoutAttribute is present. This aligns the file with the project’s nullable settings while preserving existing runtime behavior.
Changes:
- Switched the file to
#nullable enable. - Annotated
FromTypeDefinitionto returnLayoutAttribute?. - Annotated the
SingleOrDefault()result asCustomAttribute?and kept the existingnullcheck/early return.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
dalexsoto
approved these changes
Aug 10, 2026
jonathanpeppers
disabled auto-merge
August 10, 2026 16:48
jonathanpeppers
deleted the
copilot/fix-finder-enable-nullable-reference-types-again
branch
August 10, 2026 16:48
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.
LayoutAttribute.FromTypeDefinition()can legitimately returnnullwhen no layout attribute exists, but its file disabled nullable analysis.SingleOrDefault()result as nullable.