mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 15:14:42 +00:00
[syntax-errors] Make duplicate parameter names a semantic error (#17131)
Status -- This is a pretty minor change, but it was breaking a red-knot mdtest until #17463 landed. Now this should close #11934 as the last syntax error being tracked there! Summary -- Moves `Parser::validate_parameters` to `SemanticSyntaxChecker::duplicate_parameter_name`. Test Plan -- Existing tests, with `## Errors` replaced with `## Semantic Syntax Errors`.
This commit is contained in:
parent
9db63fc58c
commit
d5410ef9fe
6 changed files with 70 additions and 44 deletions
|
@ -615,7 +615,8 @@ impl SemanticSyntaxContext for Checker<'_> {
|
|||
| SemanticSyntaxErrorKind::DuplicateMatchKey(_)
|
||||
| SemanticSyntaxErrorKind::DuplicateMatchClassAttribute(_)
|
||||
| SemanticSyntaxErrorKind::InvalidStarExpression
|
||||
| SemanticSyntaxErrorKind::AsyncComprehensionOutsideAsyncFunction(_) => {
|
||||
| SemanticSyntaxErrorKind::AsyncComprehensionOutsideAsyncFunction(_)
|
||||
| SemanticSyntaxErrorKind::DuplicateParameter(_) => {
|
||||
if self.settings.preview.is_enabled() {
|
||||
self.semantic_errors.borrow_mut().push(error);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue