Skip to content

Fixed type nullability within DataLoader`s #8482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

N-Olbert
Copy link
Contributor

@N-Olbert N-Olbert commented Aug 1, 2025

Summary of the changes (Less than 80 chars)

  • Adjusted the source generator to properly honor type nullability.

Closes #8470 (in this specific format)

value.IsValueType ? string.Empty : "?",
value.ToFullyQualified());
value.ToNullableFullyQualifiedWithNullRefQualifier(),
value.IsValueType ? value.ToNullableFullyQualifiedWithNullRefQualifier() : value.ToFullyQualified());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a special handling to avoid changing all snapshots. Using value.ToNullableFullyQualifiedWithNullRefQualifier() would also always be correct.
In fact, we could also emit a null literal: value.IsNullableType() ? "null" : $"default({value.ToFullyQualified()})"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dataloader Code generation doesn't handle nullable reference types in tuples
1 participant