-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Check syntax errors in "# type: ignore[code]" comments #7460
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good! I have just one comment. Also I would propose to add a test that an empty tag doesn't turn into ignore-all, i.e. only name-defined
is ignored with a trailing coma:
def f() -> None: ...
f(x) # type: ignore [name-defined,]
x = y # type: int # type: ignored [foo] | ||
[out] | ||
main:1: error: syntax error in type comment 'int' [syntax] | ||
main:2: error: syntax error in type comment 'int' [syntax] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH this error is confusing. Is it hard to fix this?
Also wow, you just segfaulted gcc, we should probably report a bug. |
It's not clear if the gcc segfault is reproducible. It happened in code that I didn't touch in this PR. |
No description provided.