Skip to content
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

Serialization: do not wrap nullable types with extra parentheses. #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vkaverin
Copy link
Contributor

@vkaverin vkaverin commented May 12, 2022

This PR fixes case when class' field has type of array with nullable elements, like (?string)[].

Currently, when the parser's coming to the ? symbol it wraps everything at the right side into parentheses, so when it comes to ?string)[] (note that first ( is already dropped) it turns it into null|(string)[]) which is equivalent to ?string[], but not initial (?string)[].

Nullability via ? is equivalent to null|, so there's no necessity to wrap type into extra parentheses.

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