Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Don't assume default value for optional value type argument without default value #8754

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
N-Olbert wants to merge 4 commits into ChilliCream:main
base: main
Choose a base branch
Loading
from N-Olbert:6347

Conversation

@N-Olbert
Copy link
Contributor

@N-Olbert N-Olbert commented Sep 30, 2025
edited by michaelstaib
Loading

  • Don't assume default value for optional value type argument without default value

Closes #6347 (in this specific format)

Background:

This issue appears to be a side effect of #5317 and/or #4354.
If an optional value type argument was not present in the input arguments, the InputParser was changed in 5317 to emit the default value for that type.
This was necessary to avoid compilation failures as null can not be converted to the value type.

This PR removes this special handling from the InputParser and instead coalesces null arguments into the default value within the compiler itself.
This approach is very similar to how optional values are handled and allows the InputParser to correctly preserve an explicit null argument.

General note: This seems to only affects code-first types. For annotation-based types, we already have the correct nullability information, as an argument of type int? is in fact a Nullable whose default value is null.
Anyhow, for code-first types, this is not the case as f. e. BooleanType maps to the runtime-type bool instead of Nullable<bool>.

Copy link
Collaborator

glen-84 commented Sep 30, 2025

Can you please revert the formatting changes? 🙂

N-Olbert reacted with thumbs up emoji

Copy link
Contributor Author

Whoops... done

@glen-84 glen-84 changed the title (削除) Don`t assume default value for optional value type argument without default value (削除ここまで) (追記) Don't assume default value for optional value type argument without default value (追記ここまで) Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@michaelstaib michaelstaib michaelstaib left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Inconsistent behavior within InputParser, when parse nullable scalar value in HC 13 in compare with 12

AltStyle によって変換されたページ (->オリジナル) /