You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: conformance/results/mypy/generics_defaults_referential.toml
+10-12Lines changed: 10 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -3,20 +3,18 @@ notes = """
3
3
Does not correctly handle defaults referencing other `TypeVar`s.
4
4
"""
5
5
output = """
6
-
generics_defaults_referential.py:23: error: Expression is of type "type[slice[StartT, StopT, StepT]]", not "type[slice[int, int, int | None]]" [assert-type]
7
-
generics_defaults_referential.py:38: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type]
8
-
generics_defaults_referential.py:54: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc]
9
-
generics_defaults_referential.py:61: error: Type variable S1 referenced in the default of S2 is unbound [misc]
10
-
generics_defaults_referential.py:75: error: TypeVar default must be one of the constraint types [misc]
6
+
generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type]
7
+
generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc]
8
+
generics_defaults_referential.py:60: error: Type variable S1 referenced in the default of S2 is unbound [misc]
9
+
generics_defaults_referential.py:74: error: TypeVar default must be one of the constraint types [misc]
10
+
generics_defaults_referential.py:77: error: TypeVar default must be one of the constraint types [misc]
11
11
generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types [misc]
12
-
generics_defaults_referential.py:79: error: TypeVar default must be one of the constraint types [misc]
13
-
generics_defaults_referential.py:104: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]
12
+
generics_defaults_referential.py:103: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]
14
13
"""
15
14
conformance_automated = "Fail"
16
15
errors_diff = """
17
-
Line 37: Expected 1 errors
18
-
Line 69: Expected 1 errors
19
-
Line 23: Unexpected errors ['generics_defaults_referential.py:23: error: Expression is of type "type[slice[StartT, StopT, StepT]]", not "type[slice[int, int, int | None]]" [assert-type]']
20
-
Line 78: Unexpected errors ['generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types [misc]']
21
-
Line 104: Unexpected errors ['generics_defaults_referential.py:104: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]']
16
+
Line 36: Expected 1 errors
17
+
Line 68: Expected 1 errors
18
+
Line 77: Unexpected errors ['generics_defaults_referential.py:77: error: TypeVar default must be one of the constraint types [misc]']
19
+
Line 103: Unexpected errors ['generics_defaults_referential.py:103: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]']
Copy file name to clipboardExpand all lines: conformance/results/pycroscope/generics_defaults_referential.toml
+11-13Lines changed: 11 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,17 @@ Fails to apply default specializations in some cases.
4
4
"""
5
5
conformance_automated = "Fail"
6
6
errors_diff = """
7
-
Line 23: Unexpected errors ["./generics_defaults_referential.py:23:12: type 'generics_defaults_referential.slice' is not equivalent to type[generics_defaults_referential.slice[int, int, int | None]]"]
8
-
Line 98: Unexpected errors ['./generics_defaults_referential.py:98:16: ~Z1@generics_defaults_referential.Bar is not equivalent to Any[explicit]']
9
-
Line 99: Unexpected errors ['./generics_defaults_referential.py:99:16: ~ListDefaultT@generics_defaults_referential.Bar is not equivalent to list[Any[explicit]]']
7
+
Line 97: Unexpected errors ['./generics_defaults_referential.py:97:16: ~Z1@generics_defaults_referential.Bar is not equivalent to Any[explicit]']
8
+
Line 98: Unexpected errors ['./generics_defaults_referential.py:98:16: ~ListDefaultT@generics_defaults_referential.Bar is not equivalent to list[Any[explicit]]']
10
9
"""
11
10
output = """
12
-
./generics_defaults_referential.py:23:12: type 'generics_defaults_referential.slice' is not equivalent to type[generics_defaults_referential.slice[int, int, int | None]]
13
-
./generics_defaults_referential.py:37:16: Incompatible argument type for b: expected int but got str [incompatible_argument]
14
-
./generics_defaults_referential.py:38:13: Incompatible argument type for a: expected int but got str [incompatible_argument]
15
-
./generics_defaults_referential.py:54:0: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter]
16
-
./generics_defaults_referential.py:61:4: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter]
17
-
./generics_defaults_referential.py:69:39: TypeVar default must be assignable to its bound [incompatible_call]
18
-
./generics_defaults_referential.py:75:51: TypeVar default must be one of its constraints [incompatible_call]
19
-
./generics_defaults_referential.py:79:62: TypeVar default must be one of its constraints [incompatible_call]
20
-
./generics_defaults_referential.py:98:16: ~Z1@generics_defaults_referential.Bar is not equivalent to Any[explicit]
21
-
./generics_defaults_referential.py:99:16: ~ListDefaultT@generics_defaults_referential.Bar is not equivalent to list[Any[explicit]]
11
+
./generics_defaults_referential.py:36:16: Incompatible argument type for b: expected int but got str [incompatible_argument]
12
+
./generics_defaults_referential.py:37:13: Incompatible argument type for a: expected int but got str [incompatible_argument]
13
+
./generics_defaults_referential.py:53:0: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter]
14
+
./generics_defaults_referential.py:60:4: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter]
15
+
./generics_defaults_referential.py:68:39: TypeVar default must be assignable to its bound [incompatible_call]
16
+
./generics_defaults_referential.py:74:51: TypeVar default must be one of its constraints [incompatible_call]
17
+
./generics_defaults_referential.py:78:62: TypeVar default must be one of its constraints [incompatible_call]
18
+
./generics_defaults_referential.py:97:16: ~Z1@generics_defaults_referential.Bar is not equivalent to Any[explicit]
19
+
./generics_defaults_referential.py:98:16: ~ListDefaultT@generics_defaults_referential.Bar is not equivalent to list[Any[explicit]]
Copy file name to clipboardExpand all lines: conformance/results/pyrefly/generics_defaults_referential.toml
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,11 @@ conformance_automated = "Pass"
3
3
errors_diff = """
4
4
"""
5
5
output = """
6
-
ERROR generics_defaults_referential.py:37:17-18: Argument `str` is not assignable to parameter `b` with type `int` in function `Foo.__init__` [bad-argument-type]
7
-
ERROR generics_defaults_referential.py:38:14-15: Argument `str` is not assignable to parameter `a` with type `int` in function `Foo.__init__` [bad-argument-type]
8
-
ERROR generics_defaults_referential.py:54:7-13: Default of type parameter `Start2T` refers to out-of-scope type parameter `StopT` [invalid-type-var]
9
-
ERROR generics_defaults_referential.py:61:11-15: Default of type parameter `S2` refers to out-of-scope type parameter `S1` [invalid-type-var]
10
-
ERROR generics_defaults_referential.py:69:40-42: Expected default `TypeVar[X1]` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var]
11
-
ERROR generics_defaults_referential.py:75:52-54: Expected default `TypeVar[Y1]` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var]
12
-
ERROR generics_defaults_referential.py:79:63-65: Expected default `TypeVar[Y2]` of `AlsoInvalid2` to be one of the following constraints: `bool`, `complex` [invalid-type-var]
6
+
ERROR generics_defaults_referential.py:36:17-18: Argument `str` is not assignable to parameter `b` with type `int` in function `Foo.__init__` [bad-argument-type]
7
+
ERROR generics_defaults_referential.py:37:14-15: Argument `str` is not assignable to parameter `a` with type `int` in function `Foo.__init__` [bad-argument-type]
8
+
ERROR generics_defaults_referential.py:53:7-13: Default of type parameter `Start2T` refers to out-of-scope type parameter `StopT` [invalid-type-var]
9
+
ERROR generics_defaults_referential.py:60:11-15: Default of type parameter `S2` refers to out-of-scope type parameter `S1` [invalid-type-var]
10
+
ERROR generics_defaults_referential.py:68:40-42: Expected default `TypeVar[X1]` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var]
11
+
ERROR generics_defaults_referential.py:74:52-54: Expected default `TypeVar[Y1]` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var]
12
+
ERROR generics_defaults_referential.py:78:63-65: Expected default `TypeVar[Y2]` of `AlsoInvalid2` to be one of the following constraints: `bool`, `complex` [invalid-type-var]
Copy file name to clipboardExpand all lines: conformance/results/pyright/generics_defaults_referential.toml
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
conformant = "Pass"
2
2
output = """
3
-
generics_defaults_referential.py:37:17 - error: Argument of type "str" cannot be assigned to parameter "b" of type "int" in function "__init__"
3
+
generics_defaults_referential.py:36:17 - error: Argument of type "str" cannot be assigned to parameter "b" of type "int" in function "__init__"
4
4
"str" is not assignable to "int" (reportArgumentType)
5
-
generics_defaults_referential.py:38:14 - error: Argument of type "str" cannot be assigned to parameter "a" of type "int" in function "__init__"
5
+
generics_defaults_referential.py:37:14 - error: Argument of type "str" cannot be assigned to parameter "a" of type "int" in function "__init__"
6
6
"str" is not assignable to "int" (reportArgumentType)
7
-
generics_defaults_referential.py:54:7 - error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope
7
+
generics_defaults_referential.py:53:7 - error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope
8
8
Type variable "StopT" is not in scope (reportGeneralTypeIssues)
9
-
generics_defaults_referential.py:61:11 - error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope
9
+
generics_defaults_referential.py:60:11 - error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope
10
10
Type variable "S1" is not in scope (reportGeneralTypeIssues)
11
-
generics_defaults_referential.py:69:40 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues)
12
-
generics_defaults_referential.py:75:52 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues)
13
-
generics_defaults_referential.py:79:63 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues)
11
+
generics_defaults_referential.py:68:40 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues)
12
+
generics_defaults_referential.py:74:52 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues)
13
+
generics_defaults_referential.py:78:63 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues)
Copy file name to clipboardExpand all lines: conformance/results/ty/generics_defaults_referential.toml
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@ conformance_automated = "Pass"
2
2
errors_diff = """
3
3
"""
4
4
output = """
5
-
generics_defaults_referential.py:37:17: error[invalid-argument-type] Argument to `Foo.__init__` is incorrect: Expected `int`, found `str`
6
-
generics_defaults_referential.py:38:14: error[invalid-argument-type] Argument to `Foo.__init__` is incorrect: Expected `int`, found `str`
7
-
generics_defaults_referential.py:54:7: error[invalid-generic-class] Default of `Start2T` cannot reference out-of-scope type variable `StopT`
8
-
generics_defaults_referential.py:61:11: error[invalid-generic-class] Default of `S2` cannot reference out-of-scope type variable `S1`
9
-
generics_defaults_referential.py:69:40: error[invalid-type-variable-default] Default `X1` of TypeVar `Invalid1` is not assignable to upper bound `str` of `Invalid1` because its upper bound `int` is not assignable to `str`
10
-
generics_defaults_referential.py:75:52: error[invalid-type-variable-default] TypeVar default is inconsistent with the TypeVar's constraints: Bounded TypeVar cannot be used as the default for a constrained TypeVar
11
-
generics_defaults_referential.py:79:63: error[invalid-type-variable-default] Default `Y2` of TypeVar `AlsoInvalid2` is inconsistent with its constraints `AlsoInvalid2` because constraint `int` of `Y2` is not one of the constraints of `AlsoInvalid2`
5
+
generics_defaults_referential.py:36:17: error[invalid-argument-type] Argument to `Foo.__init__` is incorrect: Expected `int`, found `str`
6
+
generics_defaults_referential.py:37:14: error[invalid-argument-type] Argument to `Foo.__init__` is incorrect: Expected `int`, found `str`
7
+
generics_defaults_referential.py:53:7: error[invalid-generic-class] Default of `Start2T` cannot reference out-of-scope type variable `StopT`
8
+
generics_defaults_referential.py:60:11: error[invalid-generic-class] Default of `S2` cannot reference out-of-scope type variable `S1`
9
+
generics_defaults_referential.py:68:40: error[invalid-type-variable-default] Default `X1` of TypeVar `Invalid1` is not assignable to upper bound `str` of `Invalid1` because its upper bound `int` is not assignable to `str`
10
+
generics_defaults_referential.py:74:52: error[invalid-type-variable-default] TypeVar default is inconsistent with the TypeVar's constraints: Bounded TypeVar cannot be used as the default for a constrained TypeVar
11
+
generics_defaults_referential.py:78:63: error[invalid-type-variable-default] Default `Y2` of TypeVar `AlsoInvalid2` is inconsistent with its constraints `AlsoInvalid2` because constraint `int` of `Y2` is not one of the constraints of `AlsoInvalid2`
Copy file name to clipboardExpand all lines: conformance/results/zuban/generics_defaults_referential.toml
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@ conformance_automated = "Pass"
2
2
errors_diff = """
3
3
"""
4
4
output = """
5
-
generics_defaults_referential.py:37: error: Argument 2 to "Foo" has incompatible type "str"; expected "int" [arg-type]
6
-
generics_defaults_referential.py:38: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type]
7
-
generics_defaults_referential.py:54: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc]
8
-
generics_defaults_referential.py:61: error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope [misc]
9
-
generics_defaults_referential.py:69: error: TypeVar default must be a subtype of the bound type [misc]
10
-
generics_defaults_referential.py:75: error: TypeVar default must be one of the constraint types [misc]
11
-
generics_defaults_referential.py:79: error: TypeVar default must be one of the constraint types [misc]
5
+
generics_defaults_referential.py:36: error: Argument 2 to "Foo" has incompatible type "str"; expected "int" [arg-type]
6
+
generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type]
7
+
generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc]
8
+
generics_defaults_referential.py:60: error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope [misc]
9
+
generics_defaults_referential.py:68: error: TypeVar default must be a subtype of the bound type [misc]
10
+
generics_defaults_referential.py:74: error: TypeVar default must be one of the constraint types [misc]
11
+
generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types [misc]
0 commit comments