Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions conformance/results/mypy/generics_syntax_scoping.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ output = """
generics_syntax_scoping.py:14: error: Name "S" is not defined [name-defined]
generics_syntax_scoping.py:18: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type]
generics_syntax_scoping.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_scoping.py:35: error: Cannot determine type of "T" [has-type]
generics_syntax_scoping.py:35: error: Name "T" is used before definition [used-before-def]
generics_syntax_scoping.py:44: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type]
generics_syntax_scoping.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_scoping.py:62: error: Expression is of type "Any", not "str" [assert-type]
generics_syntax_scoping.py:62: note: "assert_type" expects everything to be "Any" in unchecked functions
generics_syntax_scoping.py:67: error: Expression is of type "Any", not "int" [assert-type]
generics_syntax_scoping.py:67: note: "assert_type" expects everything to be "Any" in unchecked functions
generics_syntax_scoping.py:92: error: "T" already defined as a type parameter [misc]
generics_syntax_scoping.py:95: error: "T" already defined as a type parameter [misc]
generics_syntax_scoping.py:98: error: "T" already defined as a type parameter [misc]
generics_syntax_scoping.py:98: error: Variable "generics_syntax_scoping.ClassE.T" is not valid as a type [valid-type]
generics_syntax_scoping.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_scoping.py:117: error: Expression is of type "Any", not "TypeVar" [assert-type]
generics_syntax_scoping.py:117: note: "assert_type" expects everything to be "Any" in unchecked functions
generics_syntax_scoping.py:122: error: Expression is of type "Any", not "complex" [assert-type]
generics_syntax_scoping.py:122: note: "assert_type" expects everything to be "Any" in unchecked functions
generics_syntax_scoping.py:125: error: Expression is of type "Any", not "complex" [assert-type]
generics_syntax_scoping.py:125: note: "assert_type" expects everything to be "Any" in unchecked functions
generics_syntax_scoping.py:26: error: Cannot determine type of "T" [has-type]
generics_syntax_scoping.py:26: error: Name "T" is used before definition [used-before-def]
generics_syntax_scoping.py:35: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type]
generics_syntax_scoping.py:35: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_scoping.py:53: error: Expression is of type "Any", not "str" [assert-type]
generics_syntax_scoping.py:53: note: "assert_type" expects everything to be "Any" in unchecked functions
generics_syntax_scoping.py:58: error: Expression is of type "Any", not "int" [assert-type]
generics_syntax_scoping.py:58: note: "assert_type" expects everything to be "Any" in unchecked functions
generics_syntax_scoping.py:83: error: "T" already defined as a type parameter [misc]
generics_syntax_scoping.py:86: error: "T" already defined as a type parameter [misc]
generics_syntax_scoping.py:89: error: "T" already defined as a type parameter [misc]
generics_syntax_scoping.py:89: error: Variable "generics_syntax_scoping.ClassE.T" is not valid as a type [valid-type]
generics_syntax_scoping.py:89: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_scoping.py:108: error: Expression is of type "Any", not "TypeVar" [assert-type]
generics_syntax_scoping.py:108: note: "assert_type" expects everything to be "Any" in unchecked functions
generics_syntax_scoping.py:113: error: Expression is of type "Any", not "complex" [assert-type]
generics_syntax_scoping.py:113: note: "assert_type" expects everything to be "Any" in unchecked functions
generics_syntax_scoping.py:116: error: Expression is of type "Any", not "complex" [assert-type]
generics_syntax_scoping.py:116: note: "assert_type" expects everything to be "Any" in unchecked functions
"""
conformance_automated = "Fail"
errors_diff = """
Line 62: Unexpected errors ['generics_syntax_scoping.py:62: error: Expression is of type "Any", not "str" [assert-type]']
Line 67: Unexpected errors ['generics_syntax_scoping.py:67: error: Expression is of type "Any", not "int" [assert-type]']
Line 117: Unexpected errors ['generics_syntax_scoping.py:117: error: Expression is of type "Any", not "TypeVar" [assert-type]']
Line 122: Unexpected errors ['generics_syntax_scoping.py:122: error: Expression is of type "Any", not "complex" [assert-type]']
Line 125: Unexpected errors ['generics_syntax_scoping.py:125: error: Expression is of type "Any", not "complex" [assert-type]']
Line 53: Unexpected errors ['generics_syntax_scoping.py:53: error: Expression is of type "Any", not "str" [assert-type]']
Line 58: Unexpected errors ['generics_syntax_scoping.py:58: error: Expression is of type "Any", not "int" [assert-type]']
Line 108: Unexpected errors ['generics_syntax_scoping.py:108: error: Expression is of type "Any", not "TypeVar" [assert-type]']
Line 113: Unexpected errors ['generics_syntax_scoping.py:113: error: Expression is of type "Any", not "complex" [assert-type]']
Line 116: Unexpected errors ['generics_syntax_scoping.py:116: error: Expression is of type "Any", not "complex" [assert-type]']
"""
12 changes: 6 additions & 6 deletions conformance/results/pycroscope/generics_syntax_scoping.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ errors_diff = """
output = """
./generics_syntax_scoping.py:14:19: TypeVar bound cannot be parameterized by type variables [invalid_annotation]
./generics_syntax_scoping.py:18:13: Type parameter bound cannot reference a later type parameter [invalid_type_parameter]
./generics_syntax_scoping.py:35:6: Undefined name: T [undefined_name]
./generics_syntax_scoping.py:44:12: Incompatible argument type for x: expected type[./generics_syntax_scoping.py.Foo[~T@./generics_syntax_scoping.py.decorator1.<locals>.decorator1]] but got types.GenericAlias (partial from <class 'Foo'>[Any[error]]) [incompatible_argument]
./generics_syntax_scoping.py:44:16: Undefined name: T [undefined_name]
./generics_syntax_scoping.py:92:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter]
./generics_syntax_scoping.py:95:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter]
./generics_syntax_scoping.py:98:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter]
./generics_syntax_scoping.py:26:6: Undefined name: T [undefined_name]
./generics_syntax_scoping.py:35:12: Incompatible argument type for x: expected type[./generics_syntax_scoping.py.Foo[~T@./generics_syntax_scoping.py.decorator1.<locals>.decorator1]] but got types.GenericAlias (partial from <class 'Foo'>[Any[error]]) [incompatible_argument]
./generics_syntax_scoping.py:35:16: Undefined name: T [undefined_name]
./generics_syntax_scoping.py:83:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter]
./generics_syntax_scoping.py:86:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter]
./generics_syntax_scoping.py:89:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter]
"""
10 changes: 5 additions & 5 deletions conformance/results/pyrefly/generics_syntax_scoping.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ errors_diff = """
output = """
ERROR generics_syntax_scoping.py:14:20-31: Type variable bounds and constraints must be concrete [invalid-annotation]
ERROR generics_syntax_scoping.py:18:26-27: Expected a type form, got instance of `int` [not-a-type]
ERROR generics_syntax_scoping.py:35:7-8: `T` is uninitialized [unbound-name]
ERROR generics_syntax_scoping.py:44:17-18: Expected a type form, got instance of `int` [not-a-type]
ERROR generics_syntax_scoping.py:92:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var]
ERROR generics_syntax_scoping.py:95:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var]
ERROR generics_syntax_scoping.py:98:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var]
ERROR generics_syntax_scoping.py:26:7-8: `T` is uninitialized [unbound-name]
ERROR generics_syntax_scoping.py:35:17-18: Expected a type form, got instance of `int` [not-a-type]
ERROR generics_syntax_scoping.py:83:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var]
ERROR generics_syntax_scoping.py:86:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var]
ERROR generics_syntax_scoping.py:89:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var]
"""
12 changes: 6 additions & 6 deletions conformance/results/pyright/generics_syntax_scoping.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ conformant = "Pass"
output = """
generics_syntax_scoping.py:14:20 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues)
generics_syntax_scoping.py:18:17 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues)
generics_syntax_scoping.py:35:7 - error: "T" is not defined (reportUndefinedVariable)
generics_syntax_scoping.py:44:17 - error: "T" is not defined (reportUndefinedVariable)
generics_syntax_scoping.py:92:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues)
generics_syntax_scoping.py:95:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues)
generics_syntax_scoping.py:98:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues)
generics_syntax_scoping.py:98:29 - warning: TypeVar "T" appears only once in generic function signature
generics_syntax_scoping.py:26:7 - error: "T" is not defined (reportUndefinedVariable)
generics_syntax_scoping.py:35:17 - error: "T" is not defined (reportUndefinedVariable)
generics_syntax_scoping.py:83:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues)
generics_syntax_scoping.py:86:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues)
generics_syntax_scoping.py:89:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues)
generics_syntax_scoping.py:89:29 - warning: TypeVar "T" appears only once in generic function signature
  Use "object" instead (reportInvalidTypeVarUse)
"""
conformance_automated = "Pass"
Expand Down
10 changes: 5 additions & 5 deletions conformance/results/ty/generics_syntax_scoping.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ errors_diff = """
output = """
generics_syntax_scoping.py:14:20: error[invalid-type-variable-bound] TypeVar upper bound cannot be generic
generics_syntax_scoping.py:18:17: error[invalid-type-variable-bound] TypeVar upper bound cannot be generic
generics_syntax_scoping.py:35:7: error[unresolved-reference] Name `T` used when not defined
generics_syntax_scoping.py:44:17: error[unresolved-reference] Name `T` used when not defined
generics_syntax_scoping.py:92:9: error[shadowed-type-variable] Generic function `method1` uses type variable `T` already bound by an enclosing scope
generics_syntax_scoping.py:95:9: error[shadowed-type-variable] Generic function `method2` uses type variable `T` already bound by an enclosing scope
generics_syntax_scoping.py:98:9: error[shadowed-type-variable] Generic function `method3` uses type variable `T` already bound by an enclosing scope
generics_syntax_scoping.py:26:7: error[unresolved-reference] Name `T` used when not defined
generics_syntax_scoping.py:35:17: error[unresolved-reference] Name `T` used when not defined
generics_syntax_scoping.py:83:9: error[shadowed-type-variable] Generic function `method1` uses type variable `T` already bound by an enclosing scope
generics_syntax_scoping.py:86:9: error[shadowed-type-variable] Generic function `method2` uses type variable `T` already bound by an enclosing scope
generics_syntax_scoping.py:89:9: error[shadowed-type-variable] Generic function `method3` uses type variable `T` already bound by an enclosing scope
"""
12 changes: 6 additions & 6 deletions conformance/results/zuban/generics_syntax_scoping.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ generics_syntax_scoping.py:14: error: Variable "tests.generics_syntax_scoping.S"
generics_syntax_scoping.py:14: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_scoping.py:18: error: Variable "tests.generics_syntax_scoping.T" is not valid as a type [valid-type]
generics_syntax_scoping.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_scoping.py:26: error: Name "T" is used before definition [used-before-def]
generics_syntax_scoping.py:35: error: Name "T" is used before definition [used-before-def]
generics_syntax_scoping.py:44: error: Name "T" is used before definition [used-before-def]
generics_syntax_scoping.py:44: error: Variable "tests.generics_syntax_scoping.T" is not valid as a type [valid-type]
generics_syntax_scoping.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_scoping.py:92: error: "T" already defined as a type parameter [misc]
generics_syntax_scoping.py:95: error: "T" already defined as a type parameter [misc]
generics_syntax_scoping.py:98: error: "T" already defined as a type parameter [misc]
generics_syntax_scoping.py:35: error: Variable "tests.generics_syntax_scoping.T" is not valid as a type [valid-type]
generics_syntax_scoping.py:35: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_scoping.py:83: error: "T" already defined as a type parameter [misc]
generics_syntax_scoping.py:86: error: "T" already defined as a type parameter [misc]
generics_syntax_scoping.py:89: error: "T" already defined as a type parameter [misc]
"""
9 changes: 0 additions & 9 deletions conformance/tests/generics_syntax_scoping.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ class Foo[T]:
...


class BaseClassC[T]:
def __init_subclass__(cls, param: type[Foo[T]]) -> None:
...


class ClassC[T](BaseClassC[T], param=Foo[T]): # OK
...


print(T) # E: Runtime error: 'T' is not defined


Expand Down
Loading