Skip to content

Enable nullable analysis in LayoutAttribute.Partial.cs - #12326

Merged
jonathanpeppers merged 2 commits into
mainfrom
copilot/fix-finder-enable-nullable-reference-types-again
Aug 10, 2026
Merged

Enable nullable analysis in LayoutAttribute.Partial.cs#12326
jonathanpeppers merged 2 commits into
mainfrom
copilot/fix-finder-enable-nullable-reference-types-again

Conversation

Copilot AI commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

LayoutAttribute.FromTypeDefinition() can legitimately return null when no layout attribute exists, but its file disabled nullable analysis.

  • Enable nullable reference type analysis for the file.
  • Mark the factory return type and SingleOrDefault() result as nullable.
  • Preserve the existing null-handling behavior.

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
Copilot AI requested a review from jonathanpeppers August 8, 2026 02:44
@jonathanpeppers
jonathanpeppers marked this pull request as ready for review August 10, 2026 12:22
Copilot AI lite review requested due to automatic review settings August 10, 2026 12:22
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) August 10, 2026 12:22
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Aug 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 FromTypeDefinition to return LayoutAttribute?.
  • Annotated the SingleOrDefault() result as CustomAttribute? and kept the existing null check/early return.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@jonathanpeppers
jonathanpeppers merged commit f308554 into main Aug 10, 2026
43 of 45 checks passed
@jonathanpeppers
jonathanpeppers deleted the copilot/fix-finder-enable-nullable-reference-types-again branch August 10, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix-finder] Enable nullable reference types in LayoutAttribute.Partial.cs

4 participants