1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Pass correct flags when referencing from finally

This commit is contained in:
Matt Brown 2020-11-25 14:03:05 -05:00
parent d393b4a69d
commit 6aa052475a
4 changed files with 8 additions and 0 deletions

View File

@ -84,6 +84,8 @@ class BreakAnalyzer
}
} else {
$context->finally_scope->vars_in_scope[$var_id] = $type;
$type->possibly_undefined = true;
$type->possibly_undefined_from_try = true;
}
}
}

View File

@ -103,6 +103,8 @@ class ContinueAnalyzer
}
} else {
$context->finally_scope->vars_in_scope[$var_id] = $type;
$type->possibly_undefined = true;
$type->possibly_undefined_from_try = true;
}
}
}

View File

@ -192,6 +192,8 @@ class ReturnAnalyzer
}
} else {
$context->finally_scope->vars_in_scope[$var_id] = $type;
$type->possibly_undefined = true;
$type->possibly_undefined_from_try = true;
}
}
}

View File

@ -43,6 +43,8 @@ class ThrowAnalyzer
}
} else {
$context->finally_scope->vars_in_scope[$var_id] = $type;
$type->possibly_undefined = true;
$type->possibly_undefined_from_try = true;
}
}
}