Skip to content

Bug/nullable build warnings - #122

Merged
pmrogala merged 2 commits into
mainfrom
bug/nullable-build-warnings
Aug 31, 2026
Merged

pmrogala merged 2 commits into
mainfrom
bug/nullable-build-warnings

Conversation

@pmrogala

Copy link
Copy Markdown
Owner

pmrogala and others added 2 commits August 31, 2026 14:42
…ldDefault

Non-nullable reference properties without a fixture, mock, or default value
fell back to `default(T)` in generated code, which the compiler flags as a
null-to-non-nullable conversion. The generator suppressed the resulting
CS8604 with a pragma but never suppressed the underlying CS8625, so any
consumer with WarningsAsErrors=nullable (as this repo itself uses) would
hit a hard build error instead of a warning.

Apply the null-forgiving operator directly to the default(T) fallback,
matching the pattern already used for the AutoFixture branch, instead of
pragma-suppressing the whole method body. Enable Nullable on the
"without assembly info" integration test project to cover the no-fixture,
no-mock, nullable-enabled path, and add a BuildDefault() runtime test that
was previously only compiled, never executed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pmrogala
pmrogala merged commit 44f1491 into main Aug 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant