-
Notifications
You must be signed in to change notification settings - Fork 112
Narrow type of Collection::last() when using Collection::isEmpty() #173
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
Conversation
815a523 to
239135a
Compare
239135a to
22165cf
Compare
Thank you :)
⚡ Would be great to have this tagged too 🙏 Thanks!
Tagged 👌
Not sure if that's possible TBH. /cc @ondrejmirtes
Just assert that last() is not null instead...
Just assert that last() is not null instead...
I know, and that's what 'im doing.
But the same argument could have be use for isEmpty, and still this great improvement was made.
If I assert that the count is > 0, I could avoid to add another assert that last/first is not false.
Would it be implementable ?
Nope, the TypeSpecifyingExtension API doesn’t allow it.
Uh oh!
There was an error while loading. Please reload this page.
Now that we have #172 , we should do the same for
last().