Skip to content

Commit e4da608

Browse files
Michael Thomasmeta-codesync[bot]
authored andcommitted
Default polymorphic typing of function pointers to true
Summary: Sets default for the new, polymorphic typing of function pointers to true Reviewed By: geralt-encore Differential Revision: D88066832 fbshipit-source-id: e5024a237c826bc1cdaec5f80c1aaa93f916196b
1 parent 8e8e78c commit e4da608

20 files changed

Lines changed: 87 additions & 119 deletions

hphp/hack/src/options/globalOptions.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ let default =
327327
class_pointer_ban_classname_static_meth = 0;
328328
class_pointer_ban_classname_class_const = 0;
329329
class_pointer_ban_class_array_key = false;
330-
tco_poly_function_pointers = false;
330+
tco_poly_function_pointers = true;
331331
tco_check_packages = true;
332332
fanout_strip_class_location = false;
333333
tco_package_config_disable_transitivity_check = false;

hphp/hack/src/oxidized/manual/global_options_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl Default for GlobalOptions {
156156
class_pointer_ban_classname_static_meth: 0,
157157
class_pointer_ban_classname_class_const: 0,
158158
class_pointer_ban_class_array_key: false,
159-
tco_poly_function_pointers: false,
159+
tco_poly_function_pointers: true,
160160
tco_check_packages: true,
161161
fanout_strip_class_location: false,
162162
tco_package_config_disable_transitivity_check: false,

hphp/hack/test/integration_ml/test_funptr.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ let identify_tests =
128128
Lsp.MarkedString "Defined in `Cardoor`";
129129
Lsp.MarkedString "---";
130130
Lsp.MarkedCode ("hack", "public static function bar<T>(T $x): T");
131-
Lsp.MarkedString "---";
132-
Lsp.MarkedString "Instantiation:";
133-
Lsp.MarkedCode ("hack", " T = string;");
134131
];
135132
addendum = [Lsp.MarkedString "bar_docblock"];
136133
pos = pos_at (20, 17) (20, 19);

hphp/hack/test/typecheck/class_meth_dollarsign.php.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ERROR: File "class_meth_dollarsign.php", line 7, characters 32-37:
22
`meth_caller` cannot be called on strings that contain `$` (Parsing[1002])
33
ERROR: File "class_meth_dollarsign.php", line 7, characters 32-37:
44
No instance method `bar$` in `Foo` (Typing[4053])
5-
File "class_meth_dollarsign.php", line 7, characters 8-38:
5+
File "class_meth_dollarsign.php", line 7, characters 20-22:
66
This is why I think it is an object of type Foo
77
File "class_meth_dollarsign.php", line 3, characters 7-9:
88
Declaration of `Foo` is here

hphp/hack/test/typecheck/constraints/classmeth_constraints_bad.php.exp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ ERROR: File "classmeth_constraints_bad.php", line 11, characters 6-6:
22
Invalid argument (Typing[4110])
33
File "classmeth_constraints_bad.php", line 6, characters 39-42:
44
Expected `Base`
5-
File "classmeth_constraints_bad.php", line 6, characters 46-46:
6-
via this generic `T`
75
File "classmeth_constraints_bad.php", line 11, characters 6-6:
86
But got `int`
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
ERROR: File "class_meth_reified.php", line 8, characters 3-12:
2-
All type arguments must be specified because a type parameter is reified (Typing[4303])
3-
File "class_meth_reified.php", line 4, characters 36-36:
4-
Definition is here
5-
ERROR: File "class_meth_reified.php", line 10, characters 3-12:
6-
All type arguments must be specified because a type parameter is reified (Typing[4303])
7-
File "class_meth_reified.php", line 4, characters 36-36:
8-
Definition is here
1+
No errors
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
ERROR: File "class_meth_reified_self.php", line 7, characters 5-15:
2-
All type arguments must be specified because a type parameter is reified (Typing[4303])
3-
File "class_meth_reified_self.php", line 4, characters 36-36:
4-
Definition is here
1+
No errors
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
ERROR: File "class_meth_reified_static.php", line 7, characters 5-17:
2-
All type arguments must be specified because a type parameter is reified (Typing[4303])
3-
File "class_meth_reified_static.php", line 4, characters 36-36:
4-
Definition is here
1+
No errors
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
ERROR: File "class_meth_reified_targs_missing.php", line 8, characters 8-17:
2-
All type arguments must be specified because a type parameter is reified (Typing[4303])
3-
File "class_meth_reified_targs_missing.php", line 4, characters 36-36:
4-
Definition is here
1+
No errors

hphp/hack/test/typecheck/function_pointer/class_meth_reified_trait.php.exp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,3 @@ WARN: File "class_meth_reified_trait.php", line 10, characters 8-10:
66
Static method call on a trait: `Foo::bar` (Warn[12020])
77
File "class_meth_reified_trait.php", line 3, characters 7-9:
88
`Foo` is defined here
9-
ERROR: File "class_meth_reified_trait.php", line 8, characters 3-12:
10-
All type arguments must be specified because a type parameter is reified (Typing[4303])
11-
File "class_meth_reified_trait.php", line 4, characters 36-36:
12-
Definition is here
13-
ERROR: File "class_meth_reified_trait.php", line 10, characters 3-12:
14-
All type arguments must be specified because a type parameter is reified (Typing[4303])
15-
File "class_meth_reified_trait.php", line 4, characters 36-36:
16-
Definition is here

0 commit comments

Comments
 (0)