-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Error out when variable is redeclared #7253
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
base: master
Are you sure you want to change the base?
Conversation
|
The PR is not handling following case: |
|
This PR will break users which redeclare variable with same type. |
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.
It's good to see that some tests needed changing. Worth discussing the implications and assumptions here.
|
|
||
| var = 1 # type: annotation | ||
| pyobj_var = 1 # type: annotation | ||
| var: cython.int = 2 |
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.
I think this was probably intentional as well at the time.
| def main(): | ||
| foo1: typing.Tuple = None | ||
| foo0: typing.Tuple = None | ||
| foo1: typing.Bar = None |
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.
This test assumption seems wrong and should never have been allowed.
Fixes #7246