Bruce Weirdan
Bruce Weirdan
Possible workaround would be to move the interface definition into its own file and require it conditionally. Reproduced on psalm.dev: https://psalm.dev/r/0bb860be48
Backtrace: ``` #0 Psalm\IssueBuffer::add() called at [/home/weirdan/src/psalm/psalm/src/Psalm/IssueBuffer.php:105] #1 Psalm\IssueBuffer::accepts() called at [/home/weirdan/src/psalm/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:578] #2 Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement() called at [/home/weirdan/src/psalm/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:172] #3 Psalm\Internal\Analyzer\StatementsAnalyzer->analyze() called at [/home/weirdan/src/psalm/psalm/src/Psalm/Internal/Analyzer/Statements/Block/IfElse/IfAnalyzer.php:56] #4 Psalm\Internal\Analyzer\Statements\Block\IfElse\IfAnalyzer::analyze() called at [/home/weirdan/src/psalm/psalm/src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:346] #5 Psalm\Internal\Analyzer\Statements\Block\IfElseAnalyzer::analyze() called...
Related: #5338
As mentioned on the PR, I'm not sure matching the Unix `cal` behaviour is worthwhile: > IMO, proleptic Gregorian calendar (as implemented in nushell now) makes more sense than switching...
how is it different from the following though? ```nushell try { # maybe create some resources and succeed or fail } # rm created resources ``` Edit: ah, ok, `try...
I tested all the 'simpler reproducers', and all of them produced meaningful errors on 0.106.1:
I think you need this: https://psalm.dev/r/e25e68d022 (works in PHPStan too). Edit: fixed wrong link
This use-case is already covered by conditional types: https://psalm.dev/r/2cf8b73f59
I think this should rather be handled in a plugin.
It works for me now: 