Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruff fails to detect duplicate type parameter names #11119

Open
JelleZijlstra opened this issue Apr 24, 2024 · 1 comment
Open

Ruff fails to detect duplicate type parameter names #11119

JelleZijlstra opened this issue Apr 24, 2024 · 1 comment
Labels
linter Related to the linter rule Implementing or modifying a lint rule

Comments

@JelleZijlstra
Copy link
Contributor

This is a SyntaxError:

>>> type X[T, T] = int
  File "<stdin>-0", line 1
SyntaxError: duplicate type parameter 'T'

But Ruff is fine with it. Similar to #11118.

@AlexWaygood AlexWaygood added bug Something isn't working and removed bug Something isn't working labels Apr 24, 2024
@dhruvmanila
Copy link
Member

We do raise a similar error for function parameters (https://play.ruff.rs/065d0212-7f56-4fc1-b5fc-44d781c288fa) although I would prefer to move this into the linter once #1774 is done. The reason it exists today is for backwards compatibility with the old parser where it did raise this error during parsing.

@dhruvmanila dhruvmanila added rule Implementing or modifying a lint rule linter Related to the linter labels Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linter Related to the linter rule Implementing or modifying a lint rule
Projects
None yet
Development

No branches or pull requests

3 participants