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

[go_router] Fix return type of current state getter to be non-nullable #8173

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

Conversation

kaboc
Copy link

@kaboc kaboc commented Nov 25, 2024

The state getter returns a GoRouterState?, but I don't think it needs to be nullable since currentConfiguration.last.buildState() never returns null.

I'm not sure if it is nullable on purpose for some changes planned in the Future. If there is a reason, it might be better to add a comment about it. Otherwise, it is just inconvenient that a null check is necessary.

Pre-launch Checklist

@kaboc
Copy link
Author

kaboc commented Nov 25, 2024

Ah, is this a breaking change...? I'll revert the "Update version" commit if this fix should be included in the next major version rather than being released as a patch version.

@chunhtai
Copy link
Contributor

Ah, is this a breaking change...? I'll revert the "Update version" commit if this fix should be included in the next major version rather than being released as a patch version.

no, I don't think so, at worse it will just generate a lint warning when the customer's code treats it as nullable

Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants