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
2 changes: 1 addition & 1 deletion conformance/results/mypy/constructors_call_new.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Does not report errors during binding to cls parameter of __new__ method.
"""
conformance_automated = "Fail"
errors_diff = """
Line 145: Expected 1 errors
Line 148: Expected 1 errors
Line 40: Unexpected errors ['constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3") [misc]']
Line 49: Unexpected errors ['constructors_call_new.py:49: error: Expression is of type "Class3", not "int" [assert-type]', 'constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3" [call-arg]']
Line 57: Unexpected errors ['constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any") [misc]']
Expand Down
66 changes: 33 additions & 33 deletions conformance/results/mypy/constructors_callable.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,44 @@ Does not support __new__ return type that is different from class being construc
"""
conformance_automated = "Fail"
errors_diff = """
Line 127: Expected 1 errors
Line 144: Expected 1 errors
Line 73: Unexpected errors ['constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]']
Line 78: Unexpected errors ['constructors_callable.py:78: error: Expression is of type "Class4", not "int" [assert-type]']
Line 100: Unexpected errors ['constructors_callable.py:100: error: Expression is of type "Class5", not "Never" [assert-type]']
Line 105: Unexpected errors ['constructors_callable.py:105: error: Expression is of type "Class5", not "Never" [assert-type]']
Line 116: Unexpected errors ['constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]']
Line 126: Unexpected errors ['constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [assert-type]', 'constructors_callable.py:126: error: Too few arguments [call-arg]']
Line 143: Unexpected errors ['constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" [assert-type]', 'constructors_callable.py:143: error: Too few arguments [call-arg]']
Line 129: Expected 1 errors
Line 146: Expected 1 errors
Line 74: Unexpected errors ['constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]']
Line 80: Unexpected errors ['constructors_callable.py:80: error: Expression is of type "Class4", not "int" [assert-type]']
Line 102: Unexpected errors ['constructors_callable.py:102: error: Expression is of type "Class5", not "Never" [assert-type]']
Line 107: Unexpected errors ['constructors_callable.py:107: error: Expression is of type "Class5", not "Never" [assert-type]']
Line 118: Unexpected errors ['constructors_callable.py:118: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]']
Line 128: Unexpected errors ['constructors_callable.py:128: error: Expression is of type "Class6", not "Class6Proxy" [assert-type]', 'constructors_callable.py:128: error: Too few arguments [call-arg]']
Line 145: Unexpected errors ['constructors_callable.py:145: error: Expression is of type "Class6Any", not "Any" [assert-type]', 'constructors_callable.py:145: error: Too few arguments [call-arg]']
"""
output = """
constructors_callable.py:36: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class1"
constructors_callable.py:38: error: Too few arguments [call-arg]
constructors_callable.py:39: error: Unexpected keyword argument "y" [call-arg]
constructors_callable.py:49: note: Revealed type is "def () -> constructors_callable.Class2"
constructors_callable.py:51: error: Too many arguments [call-arg]
constructors_callable.py:63: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class3"
constructors_callable.py:65: error: Too few arguments [call-arg]
constructors_callable.py:66: error: Unexpected keyword argument "y" [call-arg]
constructors_callable.py:67: error: Too many arguments [call-arg]
constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]
constructors_callable.py:77: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class4"
constructors_callable.py:78: error: Expression is of type "Class4", not "int" [assert-type]
constructors_callable.py:79: error: Too few arguments [call-arg]
constructors_callable.py:80: error: Unexpected keyword argument "y" [call-arg]
constructors_callable.py:97: note: Revealed type is "def (*args: Any, **kwargs: Any) -> constructors_callable.Class5"
constructors_callable.py:100: error: Expression is of type "Class5", not "Never" [assert-type]
constructors_callable.py:105: error: Expression is of type "Class5", not "Never" [assert-type]
constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]
constructors_callable.py:125: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6"
constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [assert-type]
constructors_callable.py:126: error: Too few arguments [call-arg]
constructors_callable.py:142: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6Any"
constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" [assert-type]
constructors_callable.py:143: error: Too few arguments [call-arg]
constructors_callable.py:162: note: Revealed type is "Overload(def (x: builtins.int) -> constructors_callable.Class7[builtins.int], def (x: builtins.str) -> constructors_callable.Class7[builtins.str])"
constructors_callable.py:182: note: Revealed type is "def [T] (x: builtins.list[T`1], y: builtins.list[T`1]) -> constructors_callable.Class8[T`1]"
constructors_callable.py:184: error: Cannot infer function type argument [misc]
constructors_callable.py:193: note: Revealed type is "def [T] (x: builtins.list[T`-1], y: builtins.list[T`-1]) -> constructors_callable.Class9"
constructors_callable.py:195: error: Cannot infer function type argument [misc]
constructors_callable.py:64: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class3"
constructors_callable.py:66: error: Too few arguments [call-arg]
constructors_callable.py:67: error: Unexpected keyword argument "y" [call-arg]
constructors_callable.py:68: error: Too many arguments [call-arg]
constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]
constructors_callable.py:79: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class4"
constructors_callable.py:80: error: Expression is of type "Class4", not "int" [assert-type]
constructors_callable.py:81: error: Too few arguments [call-arg]
constructors_callable.py:82: error: Unexpected keyword argument "y" [call-arg]
constructors_callable.py:99: note: Revealed type is "def (*args: Any, **kwargs: Any) -> constructors_callable.Class5"
constructors_callable.py:102: error: Expression is of type "Class5", not "Never" [assert-type]
constructors_callable.py:107: error: Expression is of type "Class5", not "Never" [assert-type]
constructors_callable.py:118: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]
constructors_callable.py:127: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6"
constructors_callable.py:128: error: Expression is of type "Class6", not "Class6Proxy" [assert-type]
constructors_callable.py:128: error: Too few arguments [call-arg]
constructors_callable.py:144: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6Any"
constructors_callable.py:145: error: Expression is of type "Class6Any", not "Any" [assert-type]
constructors_callable.py:145: error: Too few arguments [call-arg]
constructors_callable.py:164: note: Revealed type is "Overload(def (x: builtins.int) -> constructors_callable.Class7[builtins.int], def (x: builtins.str) -> constructors_callable.Class7[builtins.str])"
constructors_callable.py:184: note: Revealed type is "def [T] (x: builtins.list[T`1], y: builtins.list[T`1]) -> constructors_callable.Class8[T`1]"
constructors_callable.py:186: error: Cannot infer function type argument [misc]
constructors_callable.py:195: note: Revealed type is "def [T] (x: builtins.list[T`-1], y: builtins.list[T`-1]) -> constructors_callable.Class9"
constructors_callable.py:197: error: Cannot infer function type argument [misc]
"""
18 changes: 9 additions & 9 deletions conformance/results/mypy/generics_defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +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: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:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]
generics_defaults.py:132: error: Expression is of type "int", not "Any" [assert-type]
generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [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]
generics_defaults.py:157: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]
generics_defaults.py:157: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]
generics_defaults.py:171: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]
"""
conformance_automated = "Fail"
errors_diff = """
Line 142: Expected 1 errors
Line 143: 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 @@ -34,7 +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 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]']
Line 156: Unexpected errors ['generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]']
Line 157: Unexpected errors ['generics_defaults.py:157: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:157: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]']
Line 171: Unexpected errors ['generics_defaults.py:171: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]']
"""
2 changes: 1 addition & 1 deletion conformance/results/mypy/generics_self_basic.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ conformant = "Pass"
output = """
generics_self_basic.py:20: error: Incompatible return value type (got "Shape", expected "Self") [return-value]
generics_self_basic.py:33: error: Incompatible return value type (got "Shape", expected "Self") [return-value]
generics_self_basic.py:67: error: Self type cannot have type arguments [misc]
generics_self_basic.py:68: error: Self type cannot have type arguments [misc]
"""
conformance_automated = "Pass"
errors_diff = """
Expand Down
20 changes: 10 additions & 10 deletions conformance/results/mypy/generics_self_usage.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ generics_self_usage.py:76: error: Self type is only allowed in annotations withi
generics_self_usage.py:82: error: Method cannot have explicit self annotation and Self type [misc]
generics_self_usage.py:82: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var]
generics_self_usage.py:82: note: Consider using the upper bound "Foo2" instead
generics_self_usage.py:86: error: Incompatible return value type (got "Foo3", expected "Self") [return-value]
generics_self_usage.py:101: error: Self type is only allowed in annotations within class definition [misc]
generics_self_usage.py:87: error: Incompatible return value type (got "Foo3", expected "Self") [return-value]
generics_self_usage.py:103: error: Self type is only allowed in annotations within class definition [misc]
generics_self_usage.py:106: error: Self type is only allowed in annotations within class definition [misc]
generics_self_usage.py:106: error: Self type cannot be used in type alias target [misc]
generics_self_usage.py:111: error: Static methods cannot use Self type [misc]
generics_self_usage.py:111: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var]
generics_self_usage.py:111: note: Consider using the upper bound "Base" instead
generics_self_usage.py:116: error: Static methods cannot use Self type [misc]
generics_self_usage.py:121: error: Self type cannot be used in a metaclass [misc]
generics_self_usage.py:125: error: Self type cannot be used in a metaclass [misc]
generics_self_usage.py:105: error: Self type is only allowed in annotations within class definition [misc]
generics_self_usage.py:108: error: Self type is only allowed in annotations within class definition [misc]
generics_self_usage.py:108: error: Self type cannot be used in type alias target [misc]
generics_self_usage.py:113: error: Static methods cannot use Self type [misc]
generics_self_usage.py:113: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var]
generics_self_usage.py:113: note: Consider using the upper bound "Base" instead
generics_self_usage.py:118: error: Static methods cannot use Self type [misc]
generics_self_usage.py:123: error: Self type cannot be used in a metaclass [misc]
generics_self_usage.py:127: error: Self type cannot be used in a metaclass [misc]
"""
conformance_automated = "Pass"
errors_diff = """
Expand Down
10 changes: 5 additions & 5 deletions conformance/results/mypy/overloads_definitions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ notes = """
Allows @override to be on all overloads and implementation, instead of just implementation.
"""
errors_diff = """
Lines 220, 221, 222, 225, 226: Expected error (tag 'override_impl')
Lines 226, 227, 228, 231, 232: Expected error (tag 'override_impl')
"""
output = """
overloads_definitions.py:15: error: Single overload definition, multiple required [misc]
overloads_definitions.py:27: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
overloads_definitions.py:58: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc]
overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc]
overloads_definitions.py:121: error: @final should be applied only to overload implementation [misc]
overloads_definitions.py:135: error: @final should be applied only to overload implementation [misc]
overloads_definitions.py:175: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc]
overloads_definitions.py:190: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc]
overloads_definitions.py:122: error: @final should be applied only to overload implementation [misc]
overloads_definitions.py:137: error: @final should be applied only to overload implementation [misc]
overloads_definitions.py:180: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc]
overloads_definitions.py:195: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc]
"""
Loading