From d32a6fb359f8a2f9b603d6076e6a0963bbba7313 Mon Sep 17 00:00:00 2001 From: Oguz Ulgen Date: Tue, 31 Oct 2017 15:38:21 -0700 Subject: [PATCH] Allow static initialization for tuples if content can be staticly initialized Summary: Allow static initialization for tuples if content can be staticly initialized Reviewed By: vladima Differential Revision: D6198660 fbshipit-source-id: 6a3a5d8cae578ae444275a0795d67a20d2743be1 --- hphp/hack/src/hhbc/instruction_sequence.ml | 2 ++ hphp/test/hhcodegen_failing_tests_slow | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hphp/hack/src/hhbc/instruction_sequence.ml b/hphp/hack/src/hhbc/instruction_sequence.ml index 8725c3886f3..f261717b591 100644 --- a/hphp/hack/src/hhbc/instruction_sequence.ml +++ b/hphp/hack/src/hhbc/instruction_sequence.ml @@ -571,6 +571,8 @@ let rewrite_class_refs instrseq = | _ -> false) | _ -> false end + | A.Call ((_, A.Id (_, "tuple")), _, es, []) -> + List.for_all es ~f:can_initialize_static_var | _ -> false let rewrite_static_instrseq static_var_map emit_expr env instrseq = diff --git a/hphp/test/hhcodegen_failing_tests_slow b/hphp/test/hhcodegen_failing_tests_slow index bf5e083a47b..aa4c70e9963 100644 --- a/hphp/test/hhcodegen_failing_tests_slow +++ b/hphp/test/hhcodegen_failing_tests_slow @@ -171,7 +171,6 @@ slow/parser/semi-reserved-keywords/enum_class_constant_bad.php slow/parser/static_call_access.php slow/parser/static_call_access_const_expr.php slow/parser/tuple-1.php -slow/parser/tuple-2.php slow/parser/val_colon_colon_class_method.php slow/parser/xhp-ambiguity.php slow/php7_backported/ns_089.php -- 2.11.4.GIT