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

feature: support head() and last() #167

Merged
merged 2 commits into from
Jul 5, 2021
Merged

feature: support head() and last() #167

merged 2 commits into from
Jul 5, 2021

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Jul 5, 2021

For me, after upgrading to psalm-plugin-laravel 1.4.8, Psalm was no longer able to determine the return type of head(), so I'm adding a test case to see if it's just me (unfortunately I wasn't able to run the acceptance tests locally: #165).

edit: It is actually not only broken for me.

@caugner caugner changed the title test: ensure head works correctly feature: support head() and last() Jul 5, 2021
@caugner caugner marked this pull request as ready for review July 5, 2021 09:36
@mr-feek mr-feek merged commit 3392dc0 into psalm:master Jul 5, 2021
@mr-feek
Copy link
Collaborator

mr-feek commented Jul 5, 2021

Awesome, thanks a lot!

@caugner caugner deleted the head-support branch July 5, 2021 15:16

function non_empty_head(): int
{
return last([1, 2, 3]);
Copy link

Choose a reason for hiding this comment

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

Shouldn't it be head here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, yes indeed.

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.

3 participants