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

Remove type from templated value #4130

Closed
snapshotpl opened this issue Nov 26, 2020 · 5 comments
Closed

Remove type from templated value #4130

snapshotpl opened this issue Nov 26, 2020 · 5 comments
Labels
Milestone

Comments

@snapshotpl
Copy link

Bug report

I want to cut off null type when use template from callable return type.

I don't if my solution is right, however in psalm this one works fine.

https://phpstan.org/r/f606a5ab-8e8d-4e2a-a04c-8ac7991f947a

Expected output

No error

@ondrejmirtes
Copy link
Member

This is similar to: #3623

1 similar comment
@ondrejmirtes
Copy link
Member

This is similar to: #3623

@ondrejmirtes ondrejmirtes added this to the Generics milestone Nov 26, 2020
@phpstan-bot
Copy link
Contributor

@snapshotpl After the latest commit in dev-master, PHPStan now reports different result with your code snippet:

@@ @@
-PHP 7.4 – 8.0 (1 error)
+PHP 7.4 – 8.0
 ==========
 
-16: Method NestedContainerAbstractFactory::canCreate() should return bool but returns bool|null.
+No errors
 
 PHP 7.1 – 7.3 (1 error)
 ==========
 
 14: Syntax error, unexpected T_VARIABLE, expecting ')' on line 14
Full report

PHP 7.4 – 8.0

No errors

PHP 7.1 – 7.3 (1 error)

Line Error
14 Syntax error, unexpected T_VARIABLE, expecting ')' on line 14

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@a1b7b38

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants