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.
Finished cleaning up "genericTypesX.py" test files.
- Loading branch information
1 parent
1111f1b
commit 899799d
Showing
94 changed files
with
295 additions
and
293 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 38 additions & 0 deletions
38
packages/pyright-internal/src/tests/samples/genericType1.py
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,38 @@ | ||
# This sample tests bidirectional type inference and constraint solving. | ||
|
||
m = int(1) | ||
n = float(1.1) | ||
p = "hello" | ||
|
||
a = dict(x=m, y=m) | ||
a1: int = a["x"] | ||
|
||
b = dict(x=n, y=n) | ||
reveal_type(b, expected_text="dict[str, float]") | ||
|
||
# This should generate an error. | ||
b1: int = b["x"] | ||
b2: float = b["x"] | ||
|
||
c = dict(x=m, y=n) | ||
reveal_type(c, expected_text="dict[str, float]") | ||
|
||
# This should generate an error. | ||
c1: int = c["x"] | ||
c2: float = c["x"] | ||
|
||
d = dict(x=p, y=p) | ||
reveal_type(d, expected_text="dict[str, str]") | ||
|
||
# This should generate an error. | ||
d1: float = d["x"] | ||
d2: str = d["x"] | ||
|
||
e = dict(x=n, y=p) | ||
reveal_type(e, expected_text="dict[str, float | str]") | ||
|
||
# This should generate an error. | ||
e1: str = e["x"] | ||
# This should generate an error. | ||
e2: float = e["x"] | ||
e3: float | str = e["x"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 0 additions & 35 deletions
35
packages/pyright-internal/src/tests/samples/genericTypes4.py
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions
3
...ernal/src/tests/samples/genericTypes40.py → ...ht-internal/src/tests/samples/solver11.py
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...ernal/src/tests/samples/genericTypes21.py → ...ght-internal/src/tests/samples/solver8.py
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
2 changes: 1 addition & 1 deletion
2
...ernal/src/tests/samples/genericTypes28.py → ...ght-internal/src/tests/samples/solver9.py
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ernal/src/tests/samples/genericTypes18.py → ...internal/src/tests/samples/typeAlias22.py
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
Oops, something went wrong.