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

Psalm crashes on empty match expression #4519

Closed
ondrejmirtes opened this issue Nov 9, 2020 · 2 comments
Closed

Psalm crashes on empty match expression #4519

ondrejmirtes opened this issue Nov 9, 2020 · 2 comments
Labels

Comments

@ondrejmirtes
Copy link

Cannoc create psalm.dev link because it crashes:

<?php

function foo(int $i) {
    match ($i) {

    };
}

It should always report an unhandled value.

@weirdan
Copy link
Collaborator

weirdan commented Nov 9, 2020

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/1bbe947af2
<?php

function foo(int $i) {
    match ($i) {

    };
}
Psalm encountered an internal error:

/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php: Argument 2 passed to Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze() must be an instance of PhpParser\Node\Expr, null given, called in /vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/MatchAnalyzer.php on line 125

@weirdan weirdan added the bug label Nov 9, 2020
@muglug muglug closed this as completed in 683546e Nov 9, 2020
danog pushed a commit to danog/psalm that referenced this issue Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants