1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Narrow down error lines for reconcileKeyedTypes

This commit is contained in:
Matthew Brown 2016-12-11 13:59:36 -05:00
parent 562f71b21f
commit 1e8f986d8c
3 changed files with 8 additions and 8 deletions

View File

@ -112,7 +112,7 @@ class IfChecker
TypeChecker::reconcileKeyedTypes(
$reconcilable_if_types,
$if_context->vars_in_scope,
new CodeLocation($statements_checker->getSource(), $stmt),
new CodeLocation($statements_checker->getSource(), $stmt->cond),
$statements_checker->getSuppressedIssues()
);
@ -139,7 +139,7 @@ class IfChecker
$else_vars_reconciled = TypeChecker::reconcileKeyedTypes(
$if_scope->negated_types,
$temp_else_context->vars_in_scope,
new CodeLocation($statements_checker->getSource(), $stmt),
new CodeLocation($statements_checker->getSource(), $stmt->cond),
$statements_checker->getSuppressedIssues()
);
@ -283,7 +283,7 @@ class IfChecker
$outer_context_vars_reconciled = TypeChecker::reconcileKeyedTypes(
$if_scope->negated_types,
$outer_context->vars_in_scope,
new CodeLocation($statements_checker->getSource(), $stmt),
new CodeLocation($statements_checker->getSource(), $stmt->cond),
$statements_checker->getSuppressedIssues()
);
@ -351,7 +351,7 @@ class IfChecker
$elseif_vars_reconciled = TypeChecker::reconcileKeyedTypes(
$if_scope->negated_types,
$elseif_context->vars_in_scope,
new CodeLocation($statements_checker->getSource(), $elseif),
new CodeLocation($statements_checker->getSource(), $elseif->cond),
$statements_checker->getSuppressedIssues()
);
@ -416,7 +416,7 @@ class IfChecker
$elseif_vars_reconciled = TypeChecker::reconcileKeyedTypes(
$reconcilable_elseif_types,
$elseif_context->vars_in_scope,
new CodeLocation($statements_checker->getSource(), $elseif),
new CodeLocation($statements_checker->getSource(), $elseif->cond),
$statements_checker->getSuppressedIssues()
);

View File

@ -44,7 +44,7 @@ class WhileChecker
$while_vars_in_scope_reconciled = TypeChecker::reconcileKeyedTypes(
$while_types,
$while_context->vars_in_scope,
new CodeLocation($statements_checker->getSource(), $stmt),
new CodeLocation($statements_checker->getSource(), $stmt->cond),
$statements_checker->getSuppressedIssues()
);

View File

@ -1183,7 +1183,7 @@ class ExpressionChecker
$t_if_vars_in_scope_reconciled = TypeChecker::reconcileKeyedTypes(
$reconcilable_if_types,
$t_if_context->vars_in_scope,
new CodeLocation($statements_checker->getSource(), $stmt),
new CodeLocation($statements_checker->getSource(), $stmt->cond),
$statements_checker->getSuppressedIssues()
);
@ -1207,7 +1207,7 @@ class ExpressionChecker
$t_else_vars_in_scope_reconciled = TypeChecker::reconcileKeyedTypes(
$negated_if_types,
$t_else_context->vars_in_scope,
new CodeLocation($statements_checker->getSource(), $stmt),
new CodeLocation($statements_checker->getSource(), $stmt->else),
$statements_checker->getSuppressedIssues()
);