Skip to content

Commit 39c64a1

Browse files
committed
fixup! specify that type variable tuples and parameter specification should have variance
1 parent 84934ae commit 39c64a1

39 files changed

Lines changed: 949 additions & 492 deletions

conformance/results/basilisk/generics_paramspec_variance.toml

Lines changed: 0 additions & 26 deletions
This file was deleted.

conformance/results/basilisk/generics_typevartuple_basic.toml

Whitespace-only changes.

conformance/results/basilisk/generics_typevartuple_variance.toml

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
conformant = "Pass"
2+
conformance_automated = "Pass"
3+
errors_diff = """
4+
"""
5+
output = """
6+
generics_mixed_variance_inference.py:13: error: Incompatible types in assignment (expression has type "Mixed[bool, []]", variable has type "Mixed[int, []]") [assignment]
7+
generics_mixed_variance_inference.py:16: error: Incompatible types in assignment (expression has type "Mixed[int, object, []]", variable has type "Mixed[int, int, []]") [assignment]
8+
generics_mixed_variance_inference.py:21: error: Incompatible types in assignment (expression has type "Mixed[int, [bool]]", variable has type "Mixed[int, [int]]") [assignment]
9+
"""

conformance/results/mypy/generics_paramspec_variance.toml

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,58 @@ conformance_automated = "Fail"
33
errors_diff = """
44
Line 15: Expected 1 errors
55
Line 30: Expected 1 errors
6-
Line 40: Expected 1 errors
7-
Line 51: Expected 1 errors
8-
Line 57: Expected 1 errors
6+
Line 64: Expected 1 errors
7+
Line 110: Expected 1 errors
8+
Line 121: Expected 1 errors
9+
Line 127: Expected 1 errors
910
Line 31: Unexpected errors ['generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment]']
10-
Line 33: Unexpected errors ['generics_paramspec_variance.py:33: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]']
11-
Line 47: Unexpected errors ['generics_paramspec_variance.py:47: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]']
12-
Line 58: Unexpected errors ['generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]']
11+
Line 58: Unexpected errors ['generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "InitP[[NamedArg(int, \\'a\\')]]", variable has type "InitP[[int]]") [assignment]']
12+
Line 60: Unexpected errors ['generics_paramspec_variance.py:60: error: Incompatible types in assignment (expression has type "InitP[[int]]", variable has type "InitP[[Arg(int, \\'a\\')]]") [assignment]']
13+
Line 76: Unexpected errors ['generics_paramspec_variance.py:76: error: Argument 1 to "Box" has incompatible type "OutitP[[int]]"; expected "InitP[[int]]" [arg-type]']
14+
Line 78: Unexpected errors ['generics_paramspec_variance.py:78: error: Incompatible types in assignment (expression has type "OutitP[[NamedArg(int, \\'a\\')]]", variable has type "InitP[[NamedArg(int, \\'a\\')]]") [assignment]']
15+
Line 80: Unexpected errors ['generics_paramspec_variance.py:80: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "InitP[[int]]") [assignment]']
16+
Line 82: Unexpected errors ['generics_paramspec_variance.py:82: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "InitP[[int]]") [assignment]']
17+
Line 83: Unexpected errors ['generics_paramspec_variance.py:83: error: Name "_" already defined on line 62 [no-redef]', 'generics_paramspec_variance.py:83: error: Invalid type comment or annotation [valid-type]']
18+
Line 84: Unexpected errors ['generics_paramspec_variance.py:84: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "InitP[[int]]") [assignment]']
19+
Line 86: Unexpected errors ['generics_paramspec_variance.py:86: error: Incompatible types in assignment (expression has type "OutitP[[int, str]]", variable has type "InitP[[int, str]]") [assignment]']
20+
Line 91: Unexpected errors ['generics_paramspec_variance.py:91: error: String argument 1 "InP" to ParamSpec(...) does not match variable name "P" [misc]']
21+
Line 92: Unexpected errors ['generics_paramspec_variance.py:92: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]']
22+
Line 97: Unexpected errors ['generics_paramspec_variance.py:97: error: Free type variable expected in Generic[...] [misc]']
23+
Line 101: Unexpected errors ['generics_paramspec_variance.py:101: error: "InvariantParamSpecOld" expects no type arguments, but 1 given [type-arg]']
24+
Line 102: Unexpected errors ['generics_paramspec_variance.py:102: error: The type "type[InvariantParamSpecOld]" is not generic and not indexable [misc]']
25+
Line 117: Unexpected errors ['generics_paramspec_variance.py:117: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]']
26+
Line 128: Unexpected errors ['generics_paramspec_variance.py:128: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]']
1327
"""
1428
output = """
1529
generics_paramspec_variance.py:14: error: Incompatible types in assignment (expression has type "InvariantParamSpec[[int]]", variable has type "InvariantParamSpec[[object]]") [assignment]
1630
generics_paramspec_variance.py:21: error: Incompatible types in assignment (expression has type "ContravariantParamSpec[[int]]", variable has type "ContravariantParamSpec[[object]]") [assignment]
1731
generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment]
18-
generics_paramspec_variance.py:33: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]
19-
generics_paramspec_variance.py:44: error: Incompatible types in assignment (expression has type "ContravariantParamSpecOld[[int]]", variable has type "ContravariantParamSpecOld[[object]]") [assignment]
20-
generics_paramspec_variance.py:47: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]
21-
generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]
32+
generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "InitP[[NamedArg(int, 'a')]]", variable has type "InitP[[int]]") [assignment]
33+
generics_paramspec_variance.py:60: error: Incompatible types in assignment (expression has type "InitP[[int]]", variable has type "InitP[[Arg(int, 'a')]]") [assignment]
34+
generics_paramspec_variance.py:62: error: Invalid type comment or annotation [valid-type]
35+
generics_paramspec_variance.py:66: error: Incompatible types in assignment (expression has type "InitP[[int, str]]", variable has type "InitP[[int]]") [assignment]
36+
generics_paramspec_variance.py:76: error: Argument 1 to "Box" has incompatible type "OutitP[[int]]"; expected "InitP[[int]]" [arg-type]
37+
generics_paramspec_variance.py:78: error: Incompatible types in assignment (expression has type "OutitP[[NamedArg(int, 'a')]]", variable has type "InitP[[NamedArg(int, 'a')]]") [assignment]
38+
generics_paramspec_variance.py:79: error: Incompatible types in assignment (expression has type "InitP[[NamedArg(int, 'a')]]", variable has type "InitP[[int]]") [assignment]
39+
generics_paramspec_variance.py:80: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "InitP[[int]]") [assignment]
40+
generics_paramspec_variance.py:81: error: Incompatible types in assignment (expression has type "InitP[[int]]", variable has type "InitP[[Arg(int, 'a')]]") [assignment]
41+
generics_paramspec_variance.py:82: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "InitP[[int]]") [assignment]
42+
generics_paramspec_variance.py:83: error: Name "_" already defined on line 62 [no-redef]
43+
generics_paramspec_variance.py:83: error: Invalid type comment or annotation [valid-type]
44+
generics_paramspec_variance.py:84: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "InitP[[int]]") [assignment]
45+
generics_paramspec_variance.py:86: error: Incompatible types in assignment (expression has type "OutitP[[int, str]]", variable has type "InitP[[int, str]]") [assignment]
46+
generics_paramspec_variance.py:87: error: Incompatible types in assignment (expression has type "InitP[[int, str]]", variable has type "InitP[[int]]") [assignment]
47+
generics_paramspec_variance.py:91: error: String argument 1 "InP" to ParamSpec(...) does not match variable name "P" [misc]
48+
generics_paramspec_variance.py:92: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]
49+
generics_paramspec_variance.py:93: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]
50+
generics_paramspec_variance.py:94: error: String argument 1 "InvP1" to ParamSpec(...) does not match variable name "InvP2" [misc]
51+
generics_paramspec_variance.py:95: error: String argument 1 "InvP1" to ParamSpec(...) does not match variable name "InvP3" [misc]
52+
generics_paramspec_variance.py:97: error: Free type variable expected in Generic[...] [misc]
53+
generics_paramspec_variance.py:101: error: "InvariantParamSpecOld" expects no type arguments, but 1 given [type-arg]
54+
generics_paramspec_variance.py:102: error: The type "type[InvariantParamSpecOld]" is not generic and not indexable [misc]
55+
generics_paramspec_variance.py:103: error: The type "type[InvariantParamSpecOld]" is not generic and not indexable [misc]
56+
generics_paramspec_variance.py:104: error: The type "type[InvariantParamSpecOld]" is not generic and not indexable [misc]
57+
generics_paramspec_variance.py:114: error: Incompatible types in assignment (expression has type "ContravariantParamSpecOld[[int]]", variable has type "ContravariantParamSpecOld[[object]]") [assignment]
58+
generics_paramspec_variance.py:117: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]
59+
generics_paramspec_variance.py:128: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]
2260
"""

0 commit comments

Comments
 (0)