forked from microsoft/pyright
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug in binder logic that resulted in infinite recursion in the …
…type evaluator. It occurred in the case where the target of an assignment was a tuple and the elements in the tuple depended on assignment ordering. The binder was not assigning the correct control flow nodes to the individual elements of the target tuple.
- Loading branch information
1 parent
04a01c7
commit ec63949
Showing
3 changed files
with
52 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This sample tests the handling of tuple assignments | ||
# where the order of assignment within the tuple is important. | ||
|
||
from typing import Optional | ||
|
||
class Node: | ||
key: str | ||
next: Optional['Node'] = None | ||
|
||
node = Node() | ||
|
||
# This should analyze fine because node.next should be assigned | ||
# None before node is assigned None. | ||
node.next, node = None, None | ||
|