Skip to content

Commit 01a3dd5

Browse files
authored
Update conformance test sources to initialize uninitialized variables (#1804)
1 parent 42e9118 commit 01a3dd5

File tree

72 files changed

+440
-421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+440
-421
lines changed

conformance/results/mypy/annotations_forward_refs.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD
2727
annotations_forward_refs.py:87: note: Perhaps you need "Callable[...]" or a callback protocol?
2828
annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]
2929
annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol?
30-
annotations_forward_refs.py:93: error: Expression is of type int?, not "int" [assert-type]
30+
annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [assert-type]
3131
"""
3232
conformance_automated = "Fail"
3333
errors_diff = """
@@ -37,5 +37,5 @@ Line 24: Expected 1 errors
3737
Line 25: Expected 1 errors
3838
Line 66: Expected 1 errors
3939
Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]']
40-
Line 93: Unexpected errors ['annotations_forward_refs.py:93: error: Expression is of type int?, not "int" [assert-type]']
40+
Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [assert-type]']
4141
"""

conformance/results/mypy/classes_classvar.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ classes_classvar.py:65: error: ClassVar can only be used for assignments in clas
2222
classes_classvar.py:67: error: ClassVar can only be used for assignments in class body [misc]
2323
classes_classvar.py:71: error: ClassVar can only be used for assignments in class body [misc]
2424
classes_classvar.py:78: error: Expression is of type "Any", not "float" [assert-type]
25-
classes_classvar.py:102: error: Cannot assign to class variable "stats" via instance [misc]
26-
classes_classvar.py:131: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment]
27-
classes_classvar.py:131: note: "ProtoAImpl" is missing following "ProtoA" protocol member:
28-
classes_classvar.py:131: note: z
29-
classes_classvar.py:131: note: Protocol member ProtoA.x expected class variable, got instance variable
30-
classes_classvar.py:131: note: Protocol member ProtoA.y expected class variable, got instance variable
25+
classes_classvar.py:105: error: Cannot assign to class variable "stats" via instance [misc]
26+
classes_classvar.py:134: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment]
27+
classes_classvar.py:134: note: "ProtoAImpl" is missing following "ProtoA" protocol member:
28+
classes_classvar.py:134: note: z
29+
classes_classvar.py:134: note: Protocol member ProtoA.x expected class variable, got instance variable
30+
classes_classvar.py:134: note: Protocol member ProtoA.y expected class variable, got instance variable
3131
"""
3232
conformance_automated = "Fail"
3333
errors_diff = """

conformance/results/mypy/dataclasses_transform_class.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
conformant = "Pass"
22
output = """
3-
dataclasses_transform_class.py:48: error: Cannot inherit non-frozen dataclass from a frozen one [misc]
4-
dataclasses_transform_class.py:60: error: Property "id" defined in "Customer1" is read-only [misc]
5-
dataclasses_transform_class.py:63: error: Too many positional arguments for "Customer1" [misc]
6-
dataclasses_transform_class.py:69: error: Unsupported left operand type for < ("Customer1") [operator]
7-
dataclasses_transform_class.py:79: error: Too many positional arguments for "Customer2" [misc]
8-
dataclasses_transform_class.py:119: error: Property "id" defined in "Customer3" is read-only [misc]
3+
dataclasses_transform_class.py:51: error: Cannot inherit non-frozen dataclass from a frozen one [misc]
4+
dataclasses_transform_class.py:63: error: Property "id" defined in "Customer1" is read-only [misc]
5+
dataclasses_transform_class.py:66: error: Too many positional arguments for "Customer1" [misc]
6+
dataclasses_transform_class.py:72: error: Unsupported left operand type for < ("Customer1") [operator]
7+
dataclasses_transform_class.py:82: error: Too many positional arguments for "Customer2" [misc]
8+
dataclasses_transform_class.py:122: error: Property "id" defined in "Customer3" is read-only [misc]
99
"""
1010
conformance_automated = "Pass"
1111
errors_diff = """

conformance/results/mypy/dataclasses_transform_meta.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
conformant = "Pass"
22
output = """
3-
dataclasses_transform_meta.py:48: error: Cannot inherit non-frozen dataclass from a frozen one [misc]
4-
dataclasses_transform_meta.py:60: error: Property "id" defined in "Customer1" is read-only [misc]
5-
dataclasses_transform_meta.py:63: error: Too many positional arguments for "Customer1" [misc]
6-
dataclasses_transform_meta.py:70: error: Unsupported left operand type for < ("Customer1") [operator]
7-
dataclasses_transform_meta.py:80: error: Too many positional arguments for "Customer2" [misc]
8-
dataclasses_transform_meta.py:100: error: Property "id" defined in "Customer3" is read-only [misc]
3+
dataclasses_transform_meta.py:51: error: Cannot inherit non-frozen dataclass from a frozen one [misc]
4+
dataclasses_transform_meta.py:63: error: Property "id" defined in "Customer1" is read-only [misc]
5+
dataclasses_transform_meta.py:66: error: Too many positional arguments for "Customer1" [misc]
6+
dataclasses_transform_meta.py:73: error: Unsupported left operand type for < ("Customer1") [operator]
7+
dataclasses_transform_meta.py:83: error: Too many positional arguments for "Customer2" [misc]
8+
dataclasses_transform_meta.py:103: error: Property "id" defined in "Customer3" is read-only [misc]
99
"""
1010
conformance_automated = "Pass"
1111
errors_diff = """

conformance/results/mypy/dataclasses_usage.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ dataclasses_usage.py:67: error: Attributes without a default cannot follow attri
1212
dataclasses_usage.py:73: error: Attributes without a default cannot follow attributes with one [misc]
1313
dataclasses_usage.py:83: error: Too many arguments for "DC4" [call-arg]
1414
dataclasses_usage.py:88: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
15-
dataclasses_usage.py:126: error: Too many arguments for "DC7" [call-arg]
16-
dataclasses_usage.py:129: error: Missing positional argument "y" in call to "DC8" [call-arg]
17-
dataclasses_usage.py:178: error: Too many arguments for "DC13" [call-arg]
15+
dataclasses_usage.py:127: error: Too many arguments for "DC7" [call-arg]
16+
dataclasses_usage.py:130: error: Missing positional argument "y" in call to "DC8" [call-arg]
17+
dataclasses_usage.py:179: error: Too many arguments for "DC13" [call-arg]
1818
"""
1919
conformance_automated = "Pass"
2020
errors_diff = """

conformance/results/mypy/enums_members.toml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,33 @@ Does not support `_ignore_` mechanism (optional).
1010
"""
1111
conformance_automated = "Fail"
1212
errors_diff = """
13-
Line 46: Expected 1 errors
14-
Line 78: Expected 1 errors
15-
Line 79: Expected 1 errors
16-
Line 112: Expected 1 errors
17-
Line 23: Unexpected errors ['enums_members.py:23: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type]']
18-
Line 24: Unexpected errors ['enums_members.py:24: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]']
19-
Line 31: Unexpected errors ['enums_members.py:31: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]']
20-
Line 32: Unexpected errors ['enums_members.py:32: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type]']
21-
Line 96: Unexpected errors ['enums_members.py:96: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]']
22-
Line 113: Unexpected errors ['enums_members.py:113: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]', 'enums_members.py:113: error: Parameter 1 of Literal[...] is invalid [valid-type]']
13+
Line 50: Expected 1 errors
14+
Line 82: Expected 1 errors
15+
Line 83: Expected 1 errors
16+
Line 116: Expected 1 errors
17+
Line 27: Unexpected errors ['enums_members.py:27: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type]']
18+
Line 28: Unexpected errors ['enums_members.py:28: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]']
19+
Line 35: Unexpected errors ['enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]']
20+
Line 36: Unexpected errors ['enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type]']
21+
Line 100: Unexpected errors ['enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]']
22+
Line 117: Unexpected errors ['enums_members.py:117: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]', 'enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type]']
2323
"""
2424
output = """
25-
enums_members.py:23: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type]
26-
enums_members.py:24: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]
27-
enums_members.py:31: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]
28-
enums_members.py:32: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type]
29-
enums_members.py:80: error: Expression is of type "Callable[[Pet4], str]", not "Any" [assert-type]
30-
enums_members.py:80: error: Parameter 1 of Literal[...] is invalid [valid-type]
31-
enums_members.py:81: error: Expression is of type "Callable[[Pet4], None]", not "Any" [assert-type]
32-
enums_members.py:81: error: Parameter 1 of Literal[...] is invalid [valid-type]
33-
enums_members.py:96: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]
34-
enums_members.py:113: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]
35-
enums_members.py:113: error: Parameter 1 of Literal[...] is invalid [valid-type]
36-
enums_members.py:124: note: Revealed type is "Any"
37-
enums_members.py:124: note: 'reveal_type' always outputs 'Any' in unchecked functions
38-
enums_members.py:125: error: Expression is of type "Any", not "Literal[Example2.__B]" [assert-type]
39-
enums_members.py:125: note: "assert_type" expects everything to be "Any" in unchecked functions
40-
enums_members.py:142: error: Expression is of type "Literal[Pet5.DOG]", not "int" [assert-type]
41-
enums_members.py:143: error: Expression is of type "Literal[Pet5.FISH]", not "int" [assert-type]
25+
enums_members.py:27: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type]
26+
enums_members.py:28: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]
27+
enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]
28+
enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type]
29+
enums_members.py:84: error: Expression is of type "Callable[[Pet4], str]", not "Any" [assert-type]
30+
enums_members.py:84: error: Parameter 1 of Literal[...] is invalid [valid-type]
31+
enums_members.py:85: error: Expression is of type "Callable[[Pet4], None]", not "Any" [assert-type]
32+
enums_members.py:85: error: Parameter 1 of Literal[...] is invalid [valid-type]
33+
enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]
34+
enums_members.py:117: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]
35+
enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type]
36+
enums_members.py:128: note: Revealed type is "Any"
37+
enums_members.py:128: note: 'reveal_type' always outputs 'Any' in unchecked functions
38+
enums_members.py:129: error: Expression is of type "Any", not "Literal[Example2.__B]" [assert-type]
39+
enums_members.py:129: note: "assert_type" expects everything to be "Any" in unchecked functions
40+
enums_members.py:146: error: Expression is of type "Literal[Pet5.DOG]", not "int" [assert-type]
41+
enums_members.py:147: error: Expression is of type "Literal[Pet5.FISH]", not "int" [assert-type]
4242
"""

conformance/results/mypy/generics_scoping.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ generics_scoping.py:65: error: Free type variable expected in Generic[...] [mis
1414
generics_scoping.py:78: error: Type variable "generics_scoping.T" is unbound [valid-type]
1515
generics_scoping.py:78: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
1616
generics_scoping.py:78: note: (Hint: Use "T" in function signature to bind "T" inside a function)
17-
generics_scoping.py:84: error: Can't use bound type variable "T" to define generic alias [valid-type]
18-
generics_scoping.py:88: error: Type variable "generics_scoping.T" is unbound [valid-type]
19-
generics_scoping.py:88: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
20-
generics_scoping.py:88: note: (Hint: Use "T" in function signature to bind "T" inside a function)
21-
generics_scoping.py:89: error: Type variable "generics_scoping.T" is unbound [valid-type]
22-
generics_scoping.py:89: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
23-
generics_scoping.py:89: note: (Hint: Use "T" in function signature to bind "T" inside a function)
24-
generics_scoping.py:90: error: Type variable "generics_scoping.T" is unbound [valid-type]
25-
generics_scoping.py:90: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
26-
generics_scoping.py:90: note: (Hint: Use "T" in function signature to bind "T" inside a function)
17+
generics_scoping.py:87: error: Can't use bound type variable "T" to define generic alias [valid-type]
18+
generics_scoping.py:94: error: Type variable "generics_scoping.T" is unbound [valid-type]
19+
generics_scoping.py:94: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
20+
generics_scoping.py:94: note: (Hint: Use "T" in function signature to bind "T" inside a function)
21+
generics_scoping.py:95: error: Type variable "generics_scoping.T" is unbound [valid-type]
22+
generics_scoping.py:95: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
23+
generics_scoping.py:95: note: (Hint: Use "T" in function signature to bind "T" inside a function)
24+
generics_scoping.py:96: error: Type variable "generics_scoping.T" is unbound [valid-type]
25+
generics_scoping.py:96: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
26+
generics_scoping.py:96: note: (Hint: Use "T" in function signature to bind "T" inside a function)
2727
"""
2828
conformance_automated = "Fail"
2929
errors_diff = """

conformance/results/mypy/generics_self_basic.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ conformant = "Pass"
22
output = """
33
generics_self_basic.py:20: error: Incompatible return value type (got "Shape", expected "Self") [return-value]
44
generics_self_basic.py:33: error: Incompatible return value type (got "Shape", expected "Self") [return-value]
5-
generics_self_basic.py:64: error: Self type cannot have type arguments [misc]
5+
generics_self_basic.py:67: error: Self type cannot have type arguments [misc]
66
"""
77
conformance_automated = "Pass"
88
errors_diff = """

conformance/results/mypy/generics_type_erasure.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ Infers Node[Never] instead of Node[Any] when argument is not provided.
44
False negative on instance attribute access on type(node).
55
"""
66
output = """
7-
generics_type_erasure.py:17: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]
8-
generics_type_erasure.py:20: error: Expression is of type Never, not "Any" [assert-type]
9-
generics_type_erasure.py:36: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" [arg-type]
10-
generics_type_erasure.py:38: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" [arg-type]
11-
generics_type_erasure.py:40: error: Access to generic instance variables via class is ambiguous [misc]
12-
generics_type_erasure.py:41: error: Access to generic instance variables via class is ambiguous [misc]
7+
generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]
8+
generics_type_erasure.py:22: error: Expression is of type Never, not "Any" [assert-type]
9+
generics_type_erasure.py:38: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" [arg-type]
10+
generics_type_erasure.py:40: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" [arg-type]
1311
generics_type_erasure.py:42: error: Access to generic instance variables via class is ambiguous [misc]
1412
generics_type_erasure.py:43: error: Access to generic instance variables via class is ambiguous [misc]
13+
generics_type_erasure.py:44: error: Access to generic instance variables via class is ambiguous [misc]
14+
generics_type_erasure.py:45: error: Access to generic instance variables via class is ambiguous [misc]
1515
"""
1616
conformance_automated = "Fail"
1717
errors_diff = """
18-
Line 44: Expected 1 errors
19-
Line 17: Unexpected errors ['generics_type_erasure.py:17: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]']
20-
Line 20: Unexpected errors ['generics_type_erasure.py:20: error: Expression is of type Never, not "Any" [assert-type]']
18+
Line 46: Expected 1 errors
19+
Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]']
20+
Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type Never, not "Any" [assert-type]']
2121
"""

conformance/results/mypy/protocols_class_objects.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ protocols_class_objects.py:74: error: Incompatible types in assignment (expressi
1212
protocols_class_objects.py:74: note: Following member(s) of "ConcreteB" have conflicts:
1313
protocols_class_objects.py:74: note: prop1: expected "int", got "Callable[[ConcreteB], int]"
1414
protocols_class_objects.py:74: note: Only class variables allowed for class object access on protocols, prop1 is an instance variable of "ConcreteB"
15-
protocols_class_objects.py:101: error: Incompatible types in assignment (expression has type "type[ConcreteC1]", variable has type "ProtoC1") [assignment]
16-
protocols_class_objects.py:101: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object
17-
protocols_class_objects.py:103: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC1") [assignment]
18-
protocols_class_objects.py:103: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2"
19-
protocols_class_objects.py:103: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object
20-
protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC2") [assignment]
21-
protocols_class_objects.py:104: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2"
22-
protocols_class_objects.py:105: error: Incompatible types in assignment (expression has type "type[ConcreteC3]", variable has type "ProtoC1") [assignment]
15+
protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "type[ConcreteC1]", variable has type "ProtoC1") [assignment]
16+
protocols_class_objects.py:104: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object
17+
protocols_class_objects.py:106: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC1") [assignment]
18+
protocols_class_objects.py:106: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2"
19+
protocols_class_objects.py:106: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object
20+
protocols_class_objects.py:107: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC2") [assignment]
21+
protocols_class_objects.py:107: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2"
22+
protocols_class_objects.py:108: error: Incompatible types in assignment (expression has type "type[ConcreteC3]", variable has type "ProtoC1") [assignment]
2323
"""
2424
conformance_automated = "Pass"
2525
errors_diff = """

0 commit comments

Comments
 (0)