-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05d7e7b
commit 27026f0
Showing
8 changed files
with
70 additions
and
49 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
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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
conformant = "Pass" | ||
output = """ | ||
generics_scoping.py:27:10 - error: Argument of type "Literal['a']" cannot be assigned to parameter "x" of type "int" in function "meth_2" | ||
generics_scoping.py:25:10 - error: Argument of type "Literal['a']" cannot be assigned to parameter "x" of type "int" in function "meth_2" | ||
"Literal['a']" is incompatible with "int" (reportGeneralTypeIssues) | ||
generics_scoping.py:48:13 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) | ||
generics_scoping.py:52:19 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) | ||
generics_scoping.py:63:29 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) | ||
generics_scoping.py:73:24 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) | ||
generics_scoping.py:76:17 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) | ||
generics_scoping.py:46:13 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) | ||
generics_scoping.py:50:19 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) | ||
generics_scoping.py:61:29 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) | ||
generics_scoping.py:71:24 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) | ||
generics_scoping.py:74:17 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) | ||
generics_scoping.py:80:5 - error: Generic type alias within class cannot use bound type variables T | ||
generics_scoping.py:84:14 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) | ||
generics_scoping.py:85:19 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) | ||
generics_scoping.py:86:6 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) | ||
""" |
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 |
---|---|---|
@@ -1,41 +1,45 @@ | ||
conformant = "Pass" | ||
output = """ | ||
File "generics_scoping.py", line 11, in fun_1: bad return type [bad-return-type] | ||
File "generics_scoping.py", line 9, in fun_1: bad return type [bad-return-type] | ||
Expected: int | ||
Actually returned: None | ||
Called from (traceback): | ||
line 14, in current file | ||
File "generics_scoping.py", line 12, in fun_2: bad return type [bad-return-type] | ||
line 12, in current file | ||
File "generics_scoping.py", line 10, in fun_2: bad return type [bad-return-type] | ||
Expected: str | ||
Actually returned: None | ||
Called from (traceback): | ||
line 15, in current file | ||
File "generics_scoping.py", line 22, in meth_1: bad return type [bad-return-type] | ||
line 13, in current file | ||
File "generics_scoping.py", line 20, in meth_1: bad return type [bad-return-type] | ||
Expected: int | ||
Actually returned: None | ||
Called from (traceback): | ||
line 26, in current file | ||
File "generics_scoping.py", line 27, in <module>: Function MyClass.meth_2 was called with the wrong arguments [wrong-arg-types] | ||
line 24, in current file | ||
File "generics_scoping.py", line 25, in <module>: Function MyClass.meth_2 was called with the wrong arguments [wrong-arg-types] | ||
Expected: (self, x: int) | ||
Actually passed: (self, x: str) | ||
File "generics_scoping.py", line 37, in method: bad return type [bad-return-type] | ||
File "generics_scoping.py", line 35, in method: bad return type [bad-return-type] | ||
Expected: str | ||
Actually returned: None | ||
Called from (traceback): | ||
line 40, in current file | ||
File "generics_scoping.py", line 37, in method: bad return type [bad-return-type] | ||
line 38, in current file | ||
File "generics_scoping.py", line 35, in method: bad return type [bad-return-type] | ||
Expected: bytes | ||
Actually returned: None | ||
Called from (traceback): | ||
line 41, in current file | ||
File "generics_scoping.py", line 48, in fun_3: Invalid type annotation 'List[S]' for z [invalid-annotation] | ||
line 39, in current file | ||
File "generics_scoping.py", line 46, in fun_3: Invalid type annotation 'List[S]' for z [invalid-annotation] | ||
TypeVar(s) 'S' not in scope for method 'fun_3' | ||
File "generics_scoping.py", line 52, in Bar: Invalid type annotation 'List[S]' for an_attr [invalid-annotation] | ||
File "generics_scoping.py", line 50, in Bar: Invalid type annotation 'List[S]' for an_attr [invalid-annotation] | ||
TypeVar(s) 'S' not in scope for class 'Bar' | ||
File "generics_scoping.py", line 61, in fun_4: Invalid type annotation 'T' [invalid-annotation] | ||
File "generics_scoping.py", line 59, in fun_4: Invalid type annotation 'T' [invalid-annotation] | ||
Function [fun_4] and its nested generic class [MyGeneric] cannot use the same type variable T | ||
File "generics_scoping.py", line 72, in <module>: Invalid type annotation 'Outer' [invalid-annotation] | ||
File "generics_scoping.py", line 70, in <module>: Invalid type annotation 'Outer' [invalid-annotation] | ||
Generic class [Outer] and its nested generic class [Bad] cannot use the same type variable T. | ||
File "generics_scoping.py", line 76, in AlsoBad: Invalid type annotation 'List[T]' for x [invalid-annotation] | ||
File "generics_scoping.py", line 74, in AlsoBad: Invalid type annotation 'List[T]' for x [invalid-annotation] | ||
TypeVar(s) 'T' not in scope for class 'Outer.AlsoBad' | ||
File "generics_scoping.py", line 84, in <module>: Invalid type annotation 'T' for global_var1 [invalid-annotation] | ||
TypeVar(s) 'T' not in scope | ||
File "generics_scoping.py", line 85, in <module>: Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] | ||
TypeVar(s) 'T' not in scope | ||
""" |