Skip to content

Commit b3610fc

Browse files
Scott Owensmeta-codesync[bot]
authored andcommitted
Accept some error message changes for constraint-based-method-call inference
Summary: Add a test mode for constraint-based method call inference that uses it for all relevant method calls. Accept the test failures, which break down into features that aren't supported yet, changed error messages, and sometime addition or removal of multiple error messages for the same underlying error. Reviewed By: mheiber Differential Revision: D83058909 fbshipit-source-id: 3563d654c3a24cbc1f84b5b58872b9e6a7e4783e
1 parent 0000cf2 commit b3610fc

116 files changed

Lines changed: 2357 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
ERROR: File "T135429716.php", line 22, characters 23-24:
2+
Invalid argument (Typing[4110])
3+
File "T135429716.php", line 32, characters 19-21:
4+
Expected `int`
5+
File "T135429716.php", line 7, characters 27-27:
6+
via this generic `T`
7+
File "T135429716.php", line 21, characters 27-27:
8+
But got `T`
9+
ERROR: File "T135429716.php", line 22, characters 23-24:
10+
Invalid argument (Typing[4110])
11+
File "T135429716.php", line 32, characters 19-21:
12+
Expected `int`
13+
File "T135429716.php", line 7, characters 27-27:
14+
via this generic `T`
15+
File "T135429716.php", line 21, characters 27-27:
16+
But got `mixed`
17+
File "T135429716.php", line 21, characters 27-27:
18+
by the definition of `T` arising from an implicit `as mixed` constraint on this type
19+
ERROR: File "T135429716.php", line 26, characters 23-24:
20+
Invalid argument (Typing[4110])
21+
File "T135429716.php", line 35, characters 21-23:
22+
Expected `int`
23+
File "T135429716.php", line 7, characters 27-27:
24+
via this generic `T`
25+
File "T135429716.php", line 25, characters 28-28:
26+
But got `T`
27+
ERROR: File "T135429716.php", line 26, characters 23-24:
28+
Invalid argument (Typing[4110])
29+
File "T135429716.php", line 35, characters 21-23:
30+
Expected `int`
31+
File "T135429716.php", line 7, characters 27-27:
32+
via this generic `T`
33+
File "T135429716.php", line 25, characters 28-28:
34+
But got `mixed`
35+
File "T135429716.php", line 25, characters 28-28:
36+
by the definition of `T` arising from an implicit `as mixed` constraint on this type
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
File "anyarray_bad.php", line 34, characters 5-17:
2+
AnyArray<arraykey, mixed>
3+
ERROR: File "anyarray_bad.php", line 10, characters 15-20:
4+
Invalid argument (Typing[4110])
5+
File "anyarray_bad.php", line 3, characters 22-39:
6+
Expected `AnyArray<int, int>`
7+
File "anyarray_bad.php", line 10, characters 15-20:
8+
But got `Map<(arraykey & _), _>`
9+
ERROR: File "anyarray_bad.php", line 11, characters 15-20:
10+
Invalid argument (Typing[4110])
11+
File "anyarray_bad.php", line 3, characters 22-39:
12+
Expected `AnyArray<int, int>`
13+
File "anyarray_bad.php", line 11, characters 15-20:
14+
But got `Set<(arraykey & _)>`
15+
ERROR: File "anyarray_bad.php", line 12, characters 15-26:
16+
Invalid argument (Typing[4110])
17+
File "anyarray_bad.php", line 3, characters 22-39:
18+
Expected `AnyArray<int, int>`
19+
File "anyarray_bad.php", line 12, characters 15-26:
20+
But got `ImmVector<nothing>`
21+
ERROR: File "anyarray_bad.php", line 13, characters 38-50:
22+
Invalid argument (Typing[4110])
23+
File "anyarray_bad.php", line 13, characters 30-35:
24+
Expected `string`
25+
File "anyarray_bad.php", line 6, characters 16-17:
26+
via this generic `Tv`
27+
File "anyarray_bad.php", line 4, characters 39-41:
28+
But got `int`
29+
ERROR: File "anyarray_bad.php", line 17, characters 3-13:
30+
You cannot mutate this (Typing[4011])
31+
File "anyarray_bad.php", line 4, characters 25-42:
32+
This is an object of type AnyArray<int, int>
33+
ERROR: File "anyarray_bad.php", line 25, characters 19-21:
34+
The method `foo` is not compatible with the overridden method (Typing[4341])
35+
File "anyarray_bad.php", line 25, characters 19-21:
36+
Method `foo` has type `(function(AnyArray<int, int> $f): void)` in `Child`
37+
File "anyarray_bad.php", line 21, characters 19-21:
38+
But it has type `(function(AnyArray<arraykey, int> $f): void)` in parent `Parent_`
39+
File "anyarray_bad.php", line 25, characters 19-21:
40+
Type `(function(AnyArray<int, int> $f): void)` is not a subtype of `(function(AnyArray<arraykey, int> $f): void)`
41+
File "anyarray_bad.php", line 25, characters 32-34:
42+
Expected `int`
43+
File "anyarray_bad.php", line 21, characters 32-39:
44+
But got `arraykey`
45+
ERROR: File "anyarray_bad.php", line 35, characters 18-21:
46+
Invalid argument (Typing[4110])
47+
File "anyarray_bad.php", line 29, characters 10-15:
48+
Expected `arraykey`
49+
File "anyarray_bad.php", line 31, characters 10-24:
50+
But got `mixed` from this `is` expression test
51+
File "hackarray.hhi", line 22, characters 35-36:
52+
via this generic `Tv`
53+
File "interfaces.hhi", line 115, characters 23-24:
54+
via this generic `Tv`
55+
File "interfaces.hhi", line 92, characters 66-67:
56+
via this generic `Tv`
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ERROR: File "reflection.php", line 18, characters 3-38:
2+
Typing error (Typing[4323])
3+
File "reflection.hhi", line 63, characters 43-43:
4+
`T` is a constrained type parameter
5+
File "reflection.hhi", line 63, characters 48-68:
6+
This type constraint is violated
7+
File "reflection.hhi", line 63, characters 48-68:
8+
Expected `HH\ClassLikeAttribute`
9+
File "reflection.php", line 8, characters 7-11:
10+
But got `FAttr`; implicitly defined constant `::class` is a reference to class `FAttr`
11+
File "reflection.php", line 18, characters 26-30:
12+
where the class `FAttr` was referenced here
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ERROR: File "reflectionEnumClass.php", line 18, characters 3-38:
2+
Typing error (Typing[4323])
3+
File "reflection.hhi", line 63, characters 43-43:
4+
`T` is a constrained type parameter
5+
File "reflection.hhi", line 63, characters 48-68:
6+
This type constraint is violated
7+
File "reflection.hhi", line 63, characters 48-68:
8+
Expected `HH\ClassLikeAttribute`
9+
File "reflectionEnumClass.php", line 8, characters 7-11:
10+
But got `FAttr`; implicitly defined constant `::class` is a reference to class `FAttr`
11+
File "reflectionEnumClass.php", line 18, characters 26-30:
12+
where the class `FAttr` was referenced here
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ERROR: File "box+ctx_exact.php", line 13, characters 16-45:
2+
Type refinements cannot appear on the right-hand side of a type alias. (NastCheck[3101])
3+
ERROR: File "box+ctx_exact.php", line 24, characters 3-11:
4+
Typing error (Typing[4403])
5+
File "box+ctx_exact.php", line 23, characters 37-38:
6+
Expected a function that requires the capability set {}
7+
File "box+ctx_exact.php", line 10, characters 31-31:
8+
But got a function that requires the capability <expr#2>::C
9+
ERROR: File "box+ctx_exact.php", line 55, characters 3-19:
10+
Typing error (Typing[4403])
11+
File "box+ctx_exact.php", line 51, characters 2-3:
12+
Expected a function that requires the capability set {}
13+
File "box+ctx_exact.php", line 10, characters 31-31:
14+
But got a function that requires the capability <expr#5>::C
15+
ERROR: File "box+ctx_exact.php", line 56, characters 3-24:
16+
Typing error (Typing[4403])
17+
File "box+ctx_exact.php", line 51, characters 2-3:
18+
Expected a function that requires the capability set {}
19+
File "box+ctx_exact.php", line 10, characters 31-31:
20+
But got a function that requires the capability <expr#2>::C
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ERROR: File "class_tparam_substitution_conflicts_with_method_tparam2.php", line 22, characters 10-42:
2+
Typing error (Typing[4110])
3+
File "class_tparam_substitution_conflicts_with_method_tparam2.php", line 21, characters 33-33:
4+
Expected `B`
5+
File "class_tparam_substitution_conflicts_with_method_tparam2.php", line 15, characters 38-42:
6+
via this generic `Tnext`
7+
File "class_tparam_substitution_conflicts_with_method_tparam2.php", line 12, characters 24-27:
8+
via this generic `Tout`
9+
File "class_tparam_substitution_conflicts_with_method_tparam2.php", line 6, characters 39-40:
10+
via this generic `Tv`
11+
File "class_tparam_substitution_conflicts_with_method_tparam2.php", line 19, characters 7-7:
12+
But got `C`; implicitly defined constant `::class` is a reference to class `C`
13+
File "class_tparam_substitution_conflicts_with_method_tparam2.php", line 22, characters 34-34:
14+
where the class `C` was referenced here
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ERROR: File "ctx-const-bounds_implicit-lower-defaults.php", line 9, characters 3-9:
2+
Typing error (Typing[4403])
3+
File "ctx-const-bounds_implicit-lower-defaults.php", line 8, characters 10-33:
4+
Expected a function that requires the capability set {AccessGlobals, IO, ImplicitPolicyLocal, RxLocal, SystemLocal, WriteProperty}
5+
File "ctx-const-bounds_implicit-lower-defaults.php", line 5, characters 38-38:
6+
But got a function that requires the capability <expr#2>::C
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ERROR: File "const_props_vs_readonly_props.php", line 28, characters 3-16:
2+
This value is readonly, its properties cannot be modified (Typing[4409])
3+
ERROR: File "const_props_vs_readonly_props.php", line 29, characters 7-7:
4+
This property returns a readonly value. It must be explicitly wrapped in a readonly expression. (Typing[4412])
5+
File "const_props_vs_readonly_props.php", line 16, characters 47-47:
6+
The property is defined here.
7+
ERROR: File "const_props_vs_readonly_props.php", line 31, characters 3-12:
8+
Typing error (Typing[4411])
9+
File "const_props_vs_readonly_props.php", line 5, characters 19-22:
10+
Function readonly mismatch
11+
File "const_props_vs_readonly_props.php", line 5, characters 19-22:
12+
This function is not marked readonly
13+
File "const_props_vs_readonly_props.php", line 31, characters 3-12:
14+
This function is marked readonly
15+
ERROR: File "const_props_vs_readonly_props.php", line 43, characters 7-7:
16+
Cannot mutate a `__Const` property (Typing[4196])
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
ERROR: File "constmap.php", line 14, characters 14-15:
2+
Invalid argument (Typing[4110])
3+
File "constmap.php", line 13, characters 20-25:
4+
Expected `string`
5+
File "collections/Map.hhi", line 58, characters 28-29:
6+
via this generic `Tk`
7+
File "collections/interfaces.hhi", line 1111, characters 22-23:
8+
via this generic `Tk`
9+
File "constmap.php", line 12, characters 30-37:
10+
But got `arraykey`
11+
File "constmap.php", line 12, characters 30-37:
12+
This type argument to `ConstMap` must match exactly (it is invariant)
13+
ERROR: File "constmap.php", line 15, characters 10-11:
14+
Invalid return type (Typing[4110])
15+
File "constmap.php", line 13, characters 20-25:
16+
Expected `string`
17+
File "collections/Map.hhi", line 58, characters 28-29:
18+
via this generic `Tk`
19+
File "collections/interfaces.hhi", line 1111, characters 22-23:
20+
via this generic `Tk`
21+
File "constmap.php", line 13, characters 47-54:
22+
But got `arraykey`
23+
File "constmap.php", line 13, characters 47-54:
24+
This type argument to `ConstMap` must match exactly (it is invariant)
25+
ERROR: File "constmap.php", line 18, characters 14-15:
26+
Invalid argument (Typing[4110])
27+
File "constmap.php", line 17, characters 23-28:
28+
Expected `string`
29+
File "collections/ImmMap.hhi", line 50, characters 26-27:
30+
via this generic `Tk`
31+
File "constmap.php", line 12, characters 30-37:
32+
But got `arraykey`
33+
File "constmap.php", line 12, characters 30-37:
34+
This type argument to `ConstMap` must match exactly (it is invariant)
35+
ERROR: File "constmap.php", line 19, characters 10-11:
36+
Invalid return type (Typing[4110])
37+
File "constmap.php", line 17, characters 23-28:
38+
Expected `string`
39+
File "collections/ImmMap.hhi", line 50, characters 26-27:
40+
via this generic `Tk`
41+
File "constmap.php", line 17, characters 50-57:
42+
But got `arraykey`
43+
File "constmap.php", line 17, characters 50-57:
44+
This type argument to `ConstMap` must match exactly (it is invariant)
45+
ERROR: File "constmap.php", line 25, characters 23-24:
46+
Invalid argument (Typing[4110])
47+
File "constmap.php", line 24, characters 39-44:
48+
Expected `string`
49+
File "collections/Map.hhi", line 58, characters 28-29:
50+
via this generic `Tk`
51+
File "collections/interfaces.hhi", line 1111, characters 22-23:
52+
via this generic `Tk`
53+
File "constmap.php", line 23, characters 39-46:
54+
But got `arraykey`
55+
File "constmap.php", line 23, characters 39-46:
56+
This type argument to `ConstMap` must match exactly (it is invariant)
57+
ERROR: File "constmap.php", line 26, characters 12-13:
58+
Invalid return type (Typing[4110])
59+
File "constmap.php", line 24, characters 39-44:
60+
Expected `string`
61+
File "collections/Map.hhi", line 58, characters 28-29:
62+
via this generic `Tk`
63+
File "collections/interfaces.hhi", line 1111, characters 22-23:
64+
via this generic `Tk`
65+
File "constmap.php", line 24, characters 65-72:
66+
But got `arraykey`
67+
File "constmap.php", line 24, characters 65-72:
68+
This type argument to `ConstMap` must match exactly (it is invariant)
69+
ERROR: File "constmap.php", line 31, characters 23-24:
70+
Invalid argument (Typing[4110])
71+
File "constmap.php", line 29, characters 12-17:
72+
Expected `string`
73+
File "collections/ImmMap.hhi", line 50, characters 26-27:
74+
via this generic `Tk`
75+
File "constmap.php", line 23, characters 39-46:
76+
But got `arraykey`
77+
File "constmap.php", line 23, characters 39-46:
78+
This type argument to `ConstMap` must match exactly (it is invariant)
79+
ERROR: File "constmap.php", line 32, characters 12-13:
80+
Invalid return type (Typing[4110])
81+
File "constmap.php", line 29, characters 12-17:
82+
Expected `string`
83+
File "collections/ImmMap.hhi", line 50, characters 26-27:
84+
via this generic `Tk`
85+
File "constmap.php", line 30, characters 15-22:
86+
But got `arraykey`
87+
File "constmap.php", line 30, characters 15-22:
88+
This type argument to `ConstMap` must match exactly (it is invariant)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
ERROR: File "shape_put.php", line 9, characters 23-34:
2+
Unbound name: `ExampleShape` (Naming[2049])
3+
ERROR: File "shape_put.php", line 9, characters 49-61:
4+
Unbound name: `ExampleString` (Naming[2049])
5+
ERROR: File "shape_put.php", line 11, characters 15-34:
6+
Unbound name: `ExampleDslExpression` (Naming[2049])
7+
ERROR: File "shape_put.php", line 11, characters 36-48:
8+
Unbound name: `ExampleString` (Naming[2049])
9+
ERROR: File "shape_put.php", line 12, characters 10-19:
10+
Unbound name: `ExampleDsl` (Naming[2049])
11+
ERROR: File "shape_put.php", line 12, characters 10-19:
12+
Unbound name: `ExampleDsl` (an object type) (Naming[2049])
13+
ERROR: File "shape_put.php", line 12, characters 21-182:
14+
Unbound name: `ExampleDsl` (an object type) (Naming[2049])
15+
ERROR: File "shape_put.php", line 13, characters 10-69:
16+
Unbound name: `ExampleDsl` (an object type) (Naming[2049])
17+
ERROR: File "shape_put.php", line 13, characters 38-47:
18+
Unbound name: `ExampleDsl` (an object type) (Naming[2049])
19+
ERROR: File "shape_put.php", line 14, characters 10-16:
20+
Unbound name: `ExampleDsl` (an object type) (Naming[2049])
21+
ERROR: File "shape_put.php", line 15, characters 10-19:
22+
Unbound name: `ExampleDsl` (an object type) (Naming[2049])
23+
ERROR: File "shape_put.php", line 15, characters 10-47:
24+
Unbound name: `ExampleDsl` (an object type) (Naming[2049])
25+
ERROR: File "shape_put.php", line 15, characters 40-46:
26+
Unbound name: `ExampleDsl` (an object type) (Naming[2049])
27+
ERROR: File "shape_put.php", line 12, characters 21-182:
28+
Was expecting a function value but type is unknown (Typing[4297])
29+
File "shape_put.php", line 12, characters 21-182:
30+
It is unknown because a type could not be determined here
31+
ERROR: File "shape_put.php", line 16, characters 12-17:
32+
Was expecting a function value but type is unknown (Typing[4297])
33+
File "shape_put.php", line 16, characters 12-17:
34+
It is unknown because a type could not be determined here

0 commit comments

Comments
 (0)