mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-19 20:24:27 +00:00
[ty] name is parameter and global is a syntax error (#21312)
Co-authored-by: Alex Waygood <alex.waygood@gmail.com> Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
This commit is contained in:
parent
8599c7e5b3
commit
8529d79a70
6 changed files with 194 additions and 18 deletions
|
|
@ -2107,8 +2107,10 @@ pub trait SemanticSyntaxContext {
|
|||
|
||||
fn report_semantic_error(&self, error: SemanticSyntaxError);
|
||||
|
||||
/// Returns `true` if the visitor is inside a `for` or `while` loop.
|
||||
fn in_loop_context(&self) -> bool;
|
||||
|
||||
/// Returns `true` if `name` is a bound parameter in the current function or lambda scope.
|
||||
fn is_bound_parameter(&self, name: &str) -> bool;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue