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
6 changes: 4 additions & 2 deletions conformance/results/mypy/classes_classvar.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ output = """
classes_classvar.py:38: error: ClassVar[...] must have at most one type argument [valid-type]
classes_classvar.py:39: error: Invalid type: try using Literal[3] instead? [valid-type]
classes_classvar.py:40: error: Name "var" is not defined [name-defined]
classes_classvar.py:45: error: ClassVar cannot contain type variables [misc]
classes_classvar.py:46: error: ClassVar cannot contain type variables [misc]
classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment]
classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final [misc]
classes_classvar.py:55: error: Invalid type: ClassVar nested inside other type [valid-type]
Expand All @@ -22,6 +20,7 @@ classes_classvar.py:73: error: ClassVar can only be used for assignments in clas
classes_classvar.py:77: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:78: error: ClassVar[...] can't be used inside a type alias [valid-type]
classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance [misc]
classes_classvar.py:130: error: All protocol members must have explicitly declared types [misc]
classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment]
classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member:
classes_classvar.py:140: note: z
Expand All @@ -30,6 +29,9 @@ classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable,
"""
conformance_automated = "Fail"
errors_diff = """
Line 45: Expected 1 errors
Line 46: Expected 1 errors
Line 47: Expected 1 errors
Line 67: Unexpected errors ['classes_classvar.py:67: error: Invalid type: ClassVar nested inside other type [valid-type]']
Line 130: Unexpected errors ['classes_classvar.py:130: error: All protocol members must have explicitly declared types [misc]']
"""
20 changes: 10 additions & 10 deletions conformance/results/mypy/constructors_call_metaclass.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ Does not skip evaluation of __new__ and __init__ if custom metaclass call return
"""
conformance_automated = "Fail"
errors_diff = """
Line 23: Unexpected errors ['constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" [assert-type]', 'constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg]']
Line 36: Unexpected errors ['constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" [assert-type]', 'constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" [call-arg]']
Line 43: Unexpected errors ['constructors_call_metaclass.py:43: error: Argument 2 for "super" not an instance of argument 1 [misc]']
Line 26: Unexpected errors ['constructors_call_metaclass.py:26: error: Expression is of type "Class1", not "Never" [assert-type]', 'constructors_call_metaclass.py:26: error: Missing positional argument "x" in call to "Class1" [call-arg]']
Line 39: Unexpected errors ['constructors_call_metaclass.py:39: error: Expression is of type "Class2", not "int | Meta2" [assert-type]', 'constructors_call_metaclass.py:39: error: Missing positional argument "x" in call to "Class2" [call-arg]']
Line 46: Unexpected errors ['constructors_call_metaclass.py:46: error: Argument 2 for "super" not an instance of argument 1 [misc]']
"""
output = """
constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" [assert-type]
constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg]
constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" [assert-type]
constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" [call-arg]
constructors_call_metaclass.py:43: error: Argument 2 for "super" not an instance of argument 1 [misc]
constructors_call_metaclass.py:51: error: Missing positional argument "x" in call to "Class3" [call-arg]
constructors_call_metaclass.py:65: error: Missing positional argument "x" in call to "Class4" [call-arg]
constructors_call_metaclass.py:26: error: Expression is of type "Class1", not "Never" [assert-type]
constructors_call_metaclass.py:26: error: Missing positional argument "x" in call to "Class1" [call-arg]
constructors_call_metaclass.py:39: error: Expression is of type "Class2", not "int | Meta2" [assert-type]
constructors_call_metaclass.py:39: error: Missing positional argument "x" in call to "Class2" [call-arg]
constructors_call_metaclass.py:46: error: Argument 2 for "super" not an instance of argument 1 [misc]
constructors_call_metaclass.py:54: error: Missing positional argument "x" in call to "Class3" [call-arg]
constructors_call_metaclass.py:68: error: Missing positional argument "x" in call to "Class4" [call-arg]
"""
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompati
dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type]
dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type]
dataclasses_transform_converter.py:130: error: Argument "converter" to "model_field" has incompatible type "Callable[[str], int]"; expected "Callable[[int], int]" [arg-type]
dataclasses_transform_converter.py:133: error: Cannot infer type argument 1 of "model_field" [misc]
dataclasses_transform_converter.py:133: error: Cannot infer value of type parameter "S" of "model_field" [misc]
"""
1 change: 0 additions & 1 deletion conformance/results/mypy/enums_member_values.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ enums_member_values.py:26: error: Expression is of type "Any", not "Literal[1, 3
enums_member_values.py:54: error: Expression is of type "tuple[int, float, float]", not "Literal[1]" [assert-type]
enums_member_values.py:68: error: Expression is of type "int", not "Literal[1]" [assert-type]
enums_member_values.py:85: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment]
enums_member_values.py:96: error: Expression is of type "EllipsisType", not "int" [assert-type]
"""
2 changes: 1 addition & 1 deletion conformance/results/mypy/generics_basic.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generics_basic.py:162: error: Free type variable expected in Generic[...] [misc
generics_basic.py:163: error: Free type variable expected in Protocol[...] [misc]
generics_basic.py:171: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc]
generics_basic.py:172: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc]
generics_basic.py:208: error: Dynamic metaclass not supported for "GenericMetaInstance" [misc]
generics_basic.py:208: error: Dynamic metaclass not supported for "GenericMetaInstance" [metaclass]
generics_basic.py:208: error: Type variable "generics_basic.T" is unbound [valid-type]
generics_basic.py:208: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
generics_basic.py:208: note: (Hint: Use "T" in function signature to bind "T" inside a function)
Expand Down
20 changes: 9 additions & 11 deletions conformance/results/mypy/generics_defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[Defa
generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type]
generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type [misc]
generics_defaults.py:114: error: TypeVar default must be one of the constraint types [misc]
generics_defaults.py:154: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]
generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]
generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]
generics_defaults.py:131: error: Expression is of type "int", not "Any" [assert-type]
generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]
generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]
generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]
generics_defaults.py:170: error: Expression is of type "Any", not "int" [assert-type]
generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc]
generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]
generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]
generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]
"""
conformance_automated = "Fail"
errors_diff = """
Line 141: Expected 1 errors
Line 142: Expected 1 errors
Line 30: Unexpected errors ['generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[DefaultStrT, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]']
Line 31: Unexpected errors ['generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[str, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]']
Line 38: Unexpected errors ['generics_defaults.py:38: error: Expression is of type "type[OneDefault[float, DefaultBoolT]]", not "type[OneDefault[float, bool]]" [assert-type]']
Expand All @@ -35,8 +34,7 @@ Line 55: Unexpected errors ['generics_defaults.py:55: error: Expression is of ty
Line 59: Unexpected errors ['generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[int, complex, str, int, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]']
Line 79: Unexpected errors ['generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[DefaultP]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type]']
Line 94: Unexpected errors ['generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type]']
Line 154: Unexpected errors ['generics_defaults.py:154: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]']
Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]']
Line 169: Unexpected errors ['generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]']
Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Any", not "int" [assert-type]', 'generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc]']
Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]']
Line 156: Unexpected errors ['generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]']
Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]']
"""
8 changes: 2 additions & 6 deletions conformance/results/mypy/generics_scoping.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
conformant = "Partial"
notes = """
False negative on generic class nested within generic class with same type variable.
"""
output = """
generics_scoping.py:29: error: Argument 1 to "meth_2" of "MyClass" has incompatible type "str"; expected "int" [arg-type]
generics_scoping.py:50: error: Type variable "generics_scoping.S" is unbound [valid-type]
Expand All @@ -11,6 +7,7 @@ generics_scoping.py:54: error: Type variable "generics_scoping.S" is unbound [v
generics_scoping.py:54: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class)
generics_scoping.py:54: note: (Hint: Use "S" in function signature to bind "S" inside a function)
generics_scoping.py:65: error: Free type variable expected in Generic[...] [misc]
generics_scoping.py:75: error: Type variable "T" is bound by an outer class [valid-type]
generics_scoping.py:78: error: Type variable "generics_scoping.T" is unbound [valid-type]
generics_scoping.py:78: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
generics_scoping.py:78: note: (Hint: Use "T" in function signature to bind "T" inside a function)
Expand All @@ -25,7 +22,6 @@ generics_scoping.py:96: error: Type variable "generics_scoping.T" is unbound [v
generics_scoping.py:96: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
generics_scoping.py:96: note: (Hint: Use "T" in function signature to bind "T" inside a function)
"""
conformance_automated = "Fail"
conformance_automated = "Pass"
errors_diff = """
Line 75: Expected 1 errors
"""
4 changes: 0 additions & 4 deletions conformance/results/mypy/generics_self_advanced.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ output = """
generics_self_advanced.py:35: error: Expression is of type "ChildB", not "Self" [assert-type]
generics_self_advanced.py:38: error: Expression is of type "ChildB", not "Self" [assert-type]
generics_self_advanced.py:42: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type]
generics_self_advanced.py:43: error: Expression is of type "list[Any]", not "list[Self]" [assert-type]
generics_self_advanced.py:44: error: Expression is of type "Any", not "Self" [assert-type]
generics_self_advanced.py:45: error: Expression is of type "ChildB", not "Self" [assert-type]
"""
conformance_automated = "Fail"
errors_diff = """
Line 35: Unexpected errors ['generics_self_advanced.py:35: error: Expression is of type "ChildB", not "Self" [assert-type]']
Line 38: Unexpected errors ['generics_self_advanced.py:38: error: Expression is of type "ChildB", not "Self" [assert-type]']
Line 42: Unexpected errors ['generics_self_advanced.py:42: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type]']
Line 43: Unexpected errors ['generics_self_advanced.py:43: error: Expression is of type "list[Any]", not "list[Self]" [assert-type]']
Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Expression is of type "Any", not "Self" [assert-type]']
Line 45: Unexpected errors ['generics_self_advanced.py:45: error: Expression is of type "ChildB", not "Self" [assert-type]']
"""
Loading