Conversation
e2fbf51 to
addea81
Compare
|
@ondrejmirtes Thank you for looking into this and suggesting improvements for the work done in #247. Briefly eyeballed your changes and noticed there are still a couple of |
|
The code in question: assertType('React\Promise\PromiseInterface<*NEVER*>', resolve(true)->then(function (bool $value): never {
throw new \RuntimeException();
}));There are two "never" types in PHPStan:
For anonymous functions, PHPStan can infer always-throwing function even without a native It will be released at the earliest convenience. |
|
@ondrejmirtes Thanks for the insights and the update in PHPStan! 👍 Your explanation sounds reasonable. It's my understanding this is more of a maintenance topic that doesn't currently have high priority, so we probably want to keep this open until the next PHPStan is released and we can update this consistently in a single shot. Thank you, will keep an eye on this! |
WyriHaximus
left a comment
There was a problem hiding this comment.
Thanks @ondrejmirtes for filing this, had a quick row with this while working on the initial templates implementation. Liking these changes 👍 .
addea81 to
91cad0e
Compare
|
Just update PHPStan version and all |
clue
left a comment
There was a problem hiding this comment.
@ondrejmirtes Thanks for the update, changes LGTM! ![]()
PHPStan 1.10.31 introduces NonAcceptingNeverType (phpstan/phpstan#6485, phpstan/phpstan#9133) that ensures that a literal
nevertype in the code does not accept any other type exceptnever.As a side-effect of this change a type description or an error message about this changed from
*NEVER*tonever. I'm sending an update to your test suite because of this :)