-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
feat: improve return types for Collection::first, last, get and pull when default value is given. #1010
feat: improve return types for Collection::first, last, get and pull when default value is given. #1010
Conversation
Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Thank you. It looks good. Just left two tiny comments.
32fa4da
to
99a81e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can rebase and fix the conflicts we can merge! 👍🏽
99a81e6
to
cd36beb
Compare
Should be good ! |
Thank you! |
Glad to contribute ! |
Changes
This PR improves return type resolution for Collection::first, last, get and pull when default value is given.
Today,
is typed as
User|null
, even if it actually never returns null.With this PR, it will be typed as
User
.Strange calls are also supported
(I really don't know why someone would write this but why not ?)
This PR does not add support for callable as default
My guess is it will be a little bit more complicated than just a stub update.
Breaking changes
I hope there won't be any