1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Improve accuracy of messages

This commit is contained in:
Matt Brown 2020-10-07 17:26:37 -04:00 committed by Daniil Gentili
parent 3f5cb4db1f
commit b0c3f09c29
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 5 additions and 3 deletions

View File

@ -134,7 +134,8 @@ class AndAnalyzer
$statements_analyzer,
[],
$context->inside_loop,
new CodeLocation($statements_analyzer->getSource(), $stmt->left)
new CodeLocation($statements_analyzer->getSource(), $stmt->left),
$context->inside_negation
);
$right_context->vars_in_scope = $right_vars_in_scope;

View File

@ -189,7 +189,7 @@ class OrAnalyzer
[],
$left_context->inside_loop,
new CodeLocation($statements_analyzer->getSource(), $stmt->left),
true
!$context->inside_negation
);
$right_context->vars_in_scope = $right_vars_in_scope;
}
@ -270,7 +270,8 @@ class OrAnalyzer
$statements_analyzer,
[],
$left_context->inside_loop,
new CodeLocation($statements_analyzer->getSource(), $stmt->right)
new CodeLocation($statements_analyzer->getSource(), $stmt->right),
$context->inside_negation
);
}