From 65c95d116f998ca640de3325e0d8adb8314618cb Mon Sep 17 00:00:00 2001 From: Hunter Goldstein Date: Wed, 16 Feb 2022 09:31:23 -0800 Subject: [PATCH] Default `disable_unset_class_const` to `true` and remove Summary: This shouldn't be allowed: it's nonsense to `unset` a value on a constant. Note that this was already a typing error, so this diff *also* removes the typechecking code that is redundant with the new parser check. Reviewed By: vassilmladenov Differential Revision: D34159046 fbshipit-source-id: 083a42a277c9ea2218248397af40e37b115175c7 --- hphp/hack/src/hackc/compile/compile.rs | 6 +----- hphp/hack/src/hackc/compile/options.rs | 6 +----- hphp/hack/src/hackc/compile/options_cli.rs | 1 - hphp/hack/src/hackc/hhbc_options.ml | 12 ------------ hphp/hack/src/hh_single_type_check.ml | 5 ----- hphp/hack/src/options/globalOptions.ml | 6 ------ hphp/hack/src/options/globalOptions.mli | 5 ----- hphp/hack/src/options/parserOptions.ml | 4 ---- hphp/hack/src/oxidized/gen/global_options.rs | 3 +-- hphp/hack/src/oxidized/manual/global_options_impl.rs | 1 - hphp/hack/src/oxidized_by_ref/gen/global_options.rs | 3 +-- hphp/hack/src/oxidized_by_ref/manual/global_options_impl.rs | 1 - hphp/hack/src/parser/lowerer/lowerer.rs | 6 ++---- hphp/hack/src/server/serverConfig.ml | 2 -- hphp/hack/src/typing/typing.ml | 11 ----------- hphp/hack/test/rust/hhbc_options_migration_test.ml | 10 ---------- hphp/hack/test/typecheck/const_attribute/static/HH_FLAGS | 1 - .../typecheck/const_attribute/static/unset_const.php.exp | 2 -- .../hack/test/typecheck/const_collections_cant_unset.php.exp | 2 +- hphp/runtime/base/runtime-option.cpp | 1 - hphp/runtime/base/runtime-option.h | 1 - hphp/test/slow/parser/unset_class_constant.php.hphp_opts | 1 - hphp/test/slow/parser/unset_class_constant.php.opts | 1 - hphp/test/slow/parser/unset_class_constant2.php.hphp_opts | 1 - hphp/test/slow/parser/unset_class_constant2.php.opts | 1 - .../test/slow/parser/unset_class_constant_dim0.php.hphp_opts | 1 - hphp/test/slow/parser/unset_class_constant_dim0.php.opts | 1 - .../parser/unset_class_constant_on_instance.php.hphp_opts | 1 - .../slow/parser/unset_class_constant_on_instance.php.opts | 1 - .../test/slow/parser/unset_class_constant_read.php.hphp_opts | 1 - hphp/test/slow/parser/unset_class_constant_read.php.opts | 1 - 31 files changed, 7 insertions(+), 92 deletions(-) delete mode 100644 hphp/test/slow/parser/unset_class_constant.php.hphp_opts delete mode 100644 hphp/test/slow/parser/unset_class_constant.php.opts delete mode 100644 hphp/test/slow/parser/unset_class_constant2.php.hphp_opts delete mode 100644 hphp/test/slow/parser/unset_class_constant2.php.opts delete mode 100644 hphp/test/slow/parser/unset_class_constant_dim0.php.hphp_opts delete mode 100644 hphp/test/slow/parser/unset_class_constant_dim0.php.opts delete mode 100644 hphp/test/slow/parser/unset_class_constant_on_instance.php.hphp_opts delete mode 100644 hphp/test/slow/parser/unset_class_constant_on_instance.php.opts delete mode 100644 hphp/test/slow/parser/unset_class_constant_read.php.hphp_opts delete mode 100644 hphp/test/slow/parser/unset_class_constant_read.php.opts diff --git a/hphp/hack/src/hackc/compile/compile.rs b/hphp/hack/src/hackc/compile/compile.rs index 0de3a502d5e..f526bb9cf9f 100644 --- a/hphp/hack/src/hackc/compile/compile.rs +++ b/hphp/hack/src/hackc/compile/compile.rs @@ -102,7 +102,7 @@ bitflags! { // No longer using bit 6 const DISABLE_ARRAY_TYPEHINT=1 << 7; const DISABLE_LVAL_AS_AN_EXPRESSION=1 << 8; - const DISABLE_UNSET_CLASS_CONST=1 << 9; + // No longer using bit 9 const DISALLOW_INST_METH=1 << 10; const DISABLE_XHP_ELEMENT_MANGLING=1 << 11; const DISALLOW_FUN_AND_CLS_METH_PSEUDO_FUNCS=1 << 12; @@ -199,9 +199,6 @@ impl ParserFlags { if self.contains(ParserFlags::DISABLE_LVAL_AS_AN_EXPRESSION) { f |= LangFlags::DISABLE_LVAL_AS_AN_EXPRESSION; } - if self.contains(ParserFlags::DISABLE_UNSET_CLASS_CONST) { - f |= LangFlags::DISABLE_UNSET_CLASS_CONST; - } if self.contains(ParserFlags::DISALLOW_INST_METH) { f |= LangFlags::DISALLOW_INST_METH; } @@ -517,7 +514,6 @@ fn create_parser_options(opts: &Options) -> ParserOptions { po_const_default_lambda_args: hack_lang_flags(LangFlags::CONST_DEFAULT_LAMBDA_ARGS), tco_const_static_props: hack_lang_flags(LangFlags::CONST_STATIC_PROPS), po_abstract_static_props: hack_lang_flags(LangFlags::ABSTRACT_STATIC_PROPS), - po_disable_unset_class_const: hack_lang_flags(LangFlags::DISABLE_UNSET_CLASS_CONST), po_disallow_func_ptrs_in_constants: hack_lang_flags( LangFlags::DISALLOW_FUNC_PTRS_IN_CONSTANTS, ), diff --git a/hphp/hack/src/hackc/compile/options.rs b/hphp/hack/src/hackc/compile/options.rs index d9d955bb8a4..8e9ad942c14 100644 --- a/hphp/hack/src/hackc/compile/options.rs +++ b/hphp/hack/src/hackc/compile/options.rs @@ -338,7 +338,6 @@ prefixed_flags!( DISABLE_LEGACY_ATTRIBUTE_SYNTAX, DISABLE_LEGACY_SOFT_TYPEHINTS, DISABLE_LVAL_AS_AN_EXPRESSION, - DISABLE_UNSET_CLASS_CONST, DISABLE_XHP_ELEMENT_MANGLING, DISALLOW_FUN_AND_CLS_METH_PSEUDO_FUNCS, DISALLOW_INST_METH, @@ -782,9 +781,6 @@ mod tests { "hhvm.hack.lang.disable_lval_as_an_expression": { "global_value": false }, - "hhvm.hack.lang.disable_unset_class_const": { - "global_value": false - }, "hhvm.hack.lang.disable_xhp_element_mangling": { "global_value": false }, @@ -1178,7 +1174,7 @@ bitflags! { const CONST_DEFAULT_FUNC_ARGS = 1 << 39; const CONST_STATIC_PROPS = 1 << 40; const ABSTRACT_STATIC_PROPS = 1 << 41; - const DISABLE_UNSET_CLASS_CONST = 1 << 42; + // No longer using bit 42 const DISALLOW_FUNC_PTRS_IN_CONSTANTS = 1 << 43; // No longer using bit 44. const CONST_DEFAULT_LAMBDA_ARGS = 1 << 45; diff --git a/hphp/hack/src/hackc/compile/options_cli.rs b/hphp/hack/src/hackc/compile/options_cli.rs index 02591b06210..cbf89ccc4aa 100644 --- a/hphp/hack/src/hackc/compile/options_cli.rs +++ b/hphp/hack/src/hackc/compile/options_cli.rs @@ -47,7 +47,6 @@ lazy_static! { "hhvm.lang.constdefaultfuncargs" => "hhvm.hack.lang.const_default_func_args", "hhvm.lang.constdefaultlambdaargs" => "hhvm.hack.lang.const_default_lambda_args", "hhvm.lang.abstractstaticprops" => "hhvm.hack.lang.abstract_static_props", - "hhvm.lang.disableunsetclassconst" => "hhvm.hack.lang.disable_unset_class_const", ); // TODO(leoo) use const-concat & unsnakecase macro via proc_macro_hack } diff --git a/hphp/hack/src/hackc/hhbc_options.ml b/hphp/hack/src/hackc/hhbc_options.ml index 62fbcf9496d..06e336e1a76 100644 --- a/hphp/hack/src/hackc/hhbc_options.ml +++ b/hphp/hack/src/hackc/hhbc_options.ml @@ -41,7 +41,6 @@ type t = { option_const_default_lambda_args: bool; option_const_static_props: bool; option_abstract_static_props: bool; - option_disable_unset_class_const: bool; option_disallow_func_ptrs_in_constants: bool; option_check_int_overflow: int; option_disable_xhp_element_mangling: bool; @@ -89,7 +88,6 @@ let default = option_const_default_lambda_args = false; option_const_static_props = false; option_abstract_static_props = false; - option_disable_unset_class_const = false; option_disallow_func_ptrs_in_constants = false; option_check_int_overflow = 0; option_disable_xhp_element_mangling = false; @@ -162,8 +160,6 @@ let const_static_props o = o.option_const_static_props let abstract_static_props o = o.option_abstract_static_props -let disable_unset_class_const o = o.option_disable_unset_class_const - let disallow_func_ptrs_in_constants o = o.option_disallow_func_ptrs_in_constants let disable_xhp_element_mangling o = o.option_disable_xhp_element_mangling @@ -245,8 +241,6 @@ let to_string o = @@ const_default_lambda_args o; Printf.sprintf "const_static_props: %B" @@ const_static_props o; Printf.sprintf "abstract_static_props: %B" @@ abstract_static_props o; - Printf.sprintf "disable_unset_class_const: %B" - @@ disable_unset_class_const o; Printf.sprintf "disallow_func_ptrs_in_constants: %B" @@ disallow_func_ptrs_in_constants o; Printf.sprintf "check_int_overflow: %B" @@ check_int_overflow o; @@ -328,8 +322,6 @@ let set_option options name value = { options with option_const_static_props = as_bool value } | "hhvm.lang.abstractstaticprops" -> { options with option_abstract_static_props = as_bool value } - | "hhvm.lang.disableunsetclassconst" -> - { options with option_disable_unset_class_const = as_bool value } | "hhvm.lang.disallow_func_ptrs_in_constants" -> { options with option_disallow_func_ptrs_in_constants = as_bool value } | "hhvm.hack.lang.enable_xhp_class_modifier" -> @@ -508,10 +500,6 @@ let value_setters = ( set_value "hhvm.hack.lang.abstract_static_props" get_value_from_config_int @@ fun opts v -> { opts with option_abstract_static_props = v = 1 } ); ( set_value - "hhvm.hack.lang.disable_unset_class_const" - get_value_from_config_int - @@ fun opts v -> { opts with option_disable_unset_class_const = v = 1 } ); - ( set_value "hhvm.hack.lang.disallow_func_ptrs_in_constants" get_value_from_config_int @@ fun opts v -> diff --git a/hphp/hack/src/hh_single_type_check.ml b/hphp/hack/src/hh_single_type_check.ml index b252e0f7169..235d9877b00 100644 --- a/hphp/hack/src/hh_single_type_check.ml +++ b/hphp/hack/src/hh_single_type_check.ml @@ -234,7 +234,6 @@ let parse_options () = let const_default_lambda_args = ref false in let disallow_silence = ref false in let abstract_static_props = ref false in - let disable_unset_class_const = ref false in let glean_service = ref (GleanOptions.service GlobalOptions.default) in let glean_hostname = ref (GleanOptions.hostname GlobalOptions.default) in let glean_port = ref (GleanOptions.port GlobalOptions.default) in @@ -558,9 +557,6 @@ let parse_options () = ( "--abstract-static-props", Arg.Set abstract_static_props, " Static properties can be abstract" ); - ( "--disable-unset-class-const", - Arg.Set disable_unset_class_const, - " Make unsetting a class const a parse error" ); ( "--glean-service", Arg.String (fun str -> glean_service := str), " glean service name" ); @@ -840,7 +836,6 @@ let parse_options () = ~po_const_default_lambda_args:!const_default_lambda_args ~po_disallow_silence:!disallow_silence ~po_abstract_static_props:!abstract_static_props - ~po_disable_unset_class_const:!disable_unset_class_const ~po_disallow_func_ptrs_in_constants:!disallow_func_ptrs_in_constants ~tco_check_attribute_locations:true ~tco_error_php_lambdas:!error_php_lambdas diff --git a/hphp/hack/src/options/globalOptions.ml b/hphp/hack/src/options/globalOptions.ml index 913e80da65a..1915a1a8eb4 100644 --- a/hphp/hack/src/options/globalOptions.ml +++ b/hphp/hack/src/options/globalOptions.ml @@ -77,7 +77,6 @@ type t = { po_const_default_lambda_args: bool; po_disallow_silence: bool; po_abstract_static_props: bool; - po_disable_unset_class_const: bool; po_parser_errors_only: bool; tco_check_attribute_locations: bool; glean_service: string; @@ -262,7 +261,6 @@ let default = po_const_default_lambda_args = false; po_disallow_silence = false; po_abstract_static_props = false; - po_disable_unset_class_const = false; po_parser_errors_only = false; tco_check_attribute_locations = true; glean_service = ""; @@ -399,7 +397,6 @@ let make ?(po_const_default_lambda_args = default.po_const_default_lambda_args) ?(po_disallow_silence = default.po_disallow_silence) ?(po_abstract_static_props = default.po_abstract_static_props) - ?(po_disable_unset_class_const = default.po_disable_unset_class_const) ?(po_parser_errors_only = default.po_parser_errors_only) ?(tco_check_attribute_locations = default.tco_check_attribute_locations) ?(glean_service = default.glean_service) @@ -544,7 +541,6 @@ let make po_const_default_lambda_args; po_disallow_silence; po_abstract_static_props; - po_disable_unset_class_const; po_parser_errors_only; tco_check_attribute_locations; glean_service; @@ -756,8 +752,6 @@ let po_disallow_silence t = t.po_disallow_silence let po_abstract_static_props t = t.po_abstract_static_props -let po_disable_unset_class_const t = t.po_disable_unset_class_const - let tco_check_attribute_locations t = t.tco_check_attribute_locations let glean_service t = t.glean_service diff --git a/hphp/hack/src/options/globalOptions.mli b/hphp/hack/src/options/globalOptions.mli index 7fbcd39730d..9385e40b226 100644 --- a/hphp/hack/src/options/globalOptions.mli +++ b/hphp/hack/src/options/globalOptions.mli @@ -176,8 +176,6 @@ type t = { po_disallow_silence: bool; (* Static properties can be abstract *) po_abstract_static_props: bool; - (* Make unsetting a class constant a parse error *) - po_disable_unset_class_const: bool; (* Ignore all errors except those that can influence the shape of syntax tree * (skipping post parse error checks) *) po_parser_errors_only: bool; @@ -379,7 +377,6 @@ val make : ?po_const_default_lambda_args:bool -> ?po_disallow_silence:bool -> ?po_abstract_static_props:bool -> - ?po_disable_unset_class_const:bool -> ?po_parser_errors_only:bool -> ?tco_check_attribute_locations:bool -> ?glean_service:string -> @@ -604,8 +601,6 @@ val po_abstract_static_props : t -> bool val po_allow_unstable_features : t -> bool -val po_disable_unset_class_const : t -> bool - val set_global_inference : t -> t val set_ordered_solving : t -> bool -> t diff --git a/hphp/hack/src/options/parserOptions.ml b/hphp/hack/src/options/parserOptions.ml index ff030521f2e..2010d20eb9c 100644 --- a/hphp/hack/src/options/parserOptions.ml +++ b/hphp/hack/src/options/parserOptions.ml @@ -77,8 +77,6 @@ let abstract_static_props = GlobalOptions.po_abstract_static_props let with_abstract_static_props po b = { po with GlobalOptions.po_abstract_static_props = b } -let disable_unset_class_const = GlobalOptions.po_disable_unset_class_const - let parser_errors_only = GlobalOptions.po_parser_errors_only let with_parser_errors_only po b = @@ -157,7 +155,6 @@ let make ~disallow_silence ~const_static_props ~abstract_static_props - ~disable_unset_class_const ~disallow_func_ptrs_in_constants ~enable_xhp_class_modifier ~disable_xhp_element_mangling @@ -186,7 +183,6 @@ let make po_disallow_silence = disallow_silence; tco_const_static_props = const_static_props; po_abstract_static_props = abstract_static_props; - po_disable_unset_class_const = disable_unset_class_const; po_disallow_func_ptrs_in_constants = disallow_func_ptrs_in_constants; po_enable_xhp_class_modifier = enable_xhp_class_modifier; po_disable_xhp_element_mangling = disable_xhp_element_mangling; diff --git a/hphp/hack/src/oxidized/gen/global_options.rs b/hphp/hack/src/oxidized/gen/global_options.rs index d0010f479c1..72815e63cdf 100644 --- a/hphp/hack/src/oxidized/gen/global_options.rs +++ b/hphp/hack/src/oxidized/gen/global_options.rs @@ -3,7 +3,7 @@ // This source code is licensed under the MIT license found in the // LICENSE file in the "hack" directory of this source tree. // -// @generated SignedSource<<5e6b7dd6916f4dade6158fd648b64288>> +// @generated SignedSource<<33918a74f3c3c5208e2027513a92f04f>> // // To regenerate this file, run: // hphp/hack/src/oxidized_regen.sh @@ -95,7 +95,6 @@ pub struct GlobalOptions { pub po_const_default_lambda_args: bool, pub po_disallow_silence: bool, pub po_abstract_static_props: bool, - pub po_disable_unset_class_const: bool, pub po_parser_errors_only: bool, pub tco_check_attribute_locations: bool, pub glean_service: String, diff --git a/hphp/hack/src/oxidized/manual/global_options_impl.rs b/hphp/hack/src/oxidized/manual/global_options_impl.rs index 82d989bf3d2..351b49231a9 100644 --- a/hphp/hack/src/oxidized/manual/global_options_impl.rs +++ b/hphp/hack/src/oxidized/manual/global_options_impl.rs @@ -75,7 +75,6 @@ impl Default for GlobalOptions { po_const_default_lambda_args: false, po_disallow_silence: false, po_abstract_static_props: false, - po_disable_unset_class_const: false, po_parser_errors_only: false, tco_check_attribute_locations: true, po_disallow_func_ptrs_in_constants: false, diff --git a/hphp/hack/src/oxidized_by_ref/gen/global_options.rs b/hphp/hack/src/oxidized_by_ref/gen/global_options.rs index dd5b5b28e0b..b23804cc1c6 100644 --- a/hphp/hack/src/oxidized_by_ref/gen/global_options.rs +++ b/hphp/hack/src/oxidized_by_ref/gen/global_options.rs @@ -3,7 +3,7 @@ // This source code is licensed under the MIT license found in the // LICENSE file in the "hack" directory of this source tree. // -// @generated SignedSource<<046ac42b3a65bab8e3bbf2e3eb1400d5>> +// @generated SignedSource<<6530fd2d9c79e83397836d3208c0a6f2>> // // To regenerate this file, run: // hphp/hack/src/oxidized_regen.sh @@ -110,7 +110,6 @@ pub struct GlobalOptions<'a> { pub po_const_default_lambda_args: bool, pub po_disallow_silence: bool, pub po_abstract_static_props: bool, - pub po_disable_unset_class_const: bool, pub po_parser_errors_only: bool, pub tco_check_attribute_locations: bool, #[serde(deserialize_with = "arena_deserializer::arena", borrow)] diff --git a/hphp/hack/src/oxidized_by_ref/manual/global_options_impl.rs b/hphp/hack/src/oxidized_by_ref/manual/global_options_impl.rs index fa6e401e84e..5b7f778bd1b 100644 --- a/hphp/hack/src/oxidized_by_ref/manual/global_options_impl.rs +++ b/hphp/hack/src/oxidized_by_ref/manual/global_options_impl.rs @@ -73,7 +73,6 @@ const DEFAULT: GlobalOptions<'_> = GlobalOptions { po_const_default_lambda_args: false, po_disallow_silence: false, po_abstract_static_props: false, - po_disable_unset_class_const: false, po_parser_errors_only: false, tco_check_attribute_locations: true, po_disallow_func_ptrs_in_constants: false, diff --git a/hphp/hack/src/parser/lowerer/lowerer.rs b/hphp/hack/src/parser/lowerer/lowerer.rs index 323fccee40c..4a76021246b 100644 --- a/hphp/hack/src/parser/lowerer/lowerer.rs +++ b/hphp/hack/src/parser/lowerer/lowerer.rs @@ -2867,10 +2867,8 @@ fn p_stmt_<'a>(node: S<'a>, env: &mut Env<'a>) -> Result { UnsetStatement(c) => { let f = |e: &mut Env<'a>| -> Result { let args = could_map(p_expr_for_normal_argument, &c.variables, e)?; - if e.parser_options.po_disable_unset_class_const { - args.iter() - .for_each(|(_, arg)| check_mutate_class_const(arg, node, e)) - } + args.iter() + .for_each(|(_, arg)| check_mutate_class_const(arg, node, e)); let unset = match &c.keyword.children { QualifiedName(_) | SimpleTypeSpecifier(_) | Token(_) => { let name = pos_name(&c.keyword, e)?; diff --git a/hphp/hack/src/server/serverConfig.ml b/hphp/hack/src/server/serverConfig.ml index 205293e29c5..55db0f0a48d 100644 --- a/hphp/hack/src/server/serverConfig.ml +++ b/hphp/hack/src/server/serverConfig.ml @@ -406,8 +406,6 @@ let load ~silent config_filename options : t * ServerLocalConfig.t = ?tco_gi_reinfer_types:(string_list_opt "reinfer_types" config) ?tco_const_static_props:(bool_opt "const_static_props" config) ?po_abstract_static_props:(bool_opt "abstract_static_props" config) - ?po_disable_unset_class_const: - (bool_opt "disable_unset_class_const" config) ~po_parser_errors_only:(Option.is_some (ServerArgs.ai_mode options)) ?tco_check_attribute_locations: (bool_opt "check_attribute_locations" config) diff --git a/hphp/hack/src/typing/typing.ml b/hphp/hack/src/typing/typing.ml index 736d2c1e372..7628a561479 100644 --- a/hphp/hack/src/typing/typing.ml +++ b/hphp/hack/src/typing/typing.ml @@ -6596,17 +6596,6 @@ and dispatch_call let env = Typing_local_ops.check_unset_target env tel in let env = match (el, unpacked_element) with - | ( [ - ( Ast_defs.Pnormal, - (_, _, Array_get ((_, _, Class_const _), Some _)) ); - ], - None ) -> - Errors.add_typing_error - Typing_error.( - primary - @@ Primary.Const_mutation - { pos = p; decl_pos = Pos_or_decl.none; ty_name = lazy "" }); - env | ([(Ast_defs.Pnormal, (_, _, Array_get (ea, Some _)))], None) -> let (env, _te, ty) = expr env ea in let r = Reason.Rwitness p in diff --git a/hphp/hack/test/rust/hhbc_options_migration_test.ml b/hphp/hack/test/rust/hhbc_options_migration_test.ml index 8301b1e2db6..300f8b8d5c8 100644 --- a/hphp/hack/test/rust/hhbc_options_migration_test.ml +++ b/hphp/hack/test/rust/hhbc_options_migration_test.ml @@ -88,9 +88,6 @@ let assert_opts_equal caml rust = Hhbc_options.(abstract_static_props caml) Hhbc_options.(abstract_static_props rust); assert_equal - Hhbc_options.(disable_unset_class_const caml) - Hhbc_options.(disable_unset_class_const rust); - assert_equal Hhbc_options.(disallow_func_ptrs_in_constants caml) Hhbc_options.(disallow_func_ptrs_in_constants rust); assert_equal @@ -308,9 +305,6 @@ let test_all_overrides_json_only _ = \"hhvm.hack.lang.disable_lval_as_an_expression\": { \"global_value\": true }, - \"hhvm.hack.lang.disable_unset_class_const\": { - \"global_value\": true - }, \"hhvm.hack.lang.disable_xhp_element_mangling\": { \"global_value\": true }, @@ -413,9 +407,6 @@ module CliArgOverrides = struct let hhvm'hack'lang'disable_lval_as_an_expression = "-vhack.lang.disable_lval_as_an_expression=true" - let hhvm'hack'lang'disable_unset_class_const = - "-vhhvm.lang.disableunsetclassconst=true" - let hhvm'hack'lang'disable_xhp_element_mangling = "-vhhvm.hack.lang.disable_xhp_element_mangling=true" @@ -477,7 +468,6 @@ let test_all_overrides_cli_only _ = hhvm'hack'lang'disable_legacy_attribute_syntax; hhvm'hack'lang'disable_legacy_soft_typehints; hhvm'hack'lang'disable_lval_as_an_expression; - hhvm'hack'lang'disable_unset_class_const; hhvm'hack'lang'disable_xhp_element_mangling; hhvm'hack'lang'disallow_func_ptrs_in_constants; hhvm'hack'lang'enable_class_level_where_clauses; diff --git a/hphp/hack/test/typecheck/const_attribute/static/HH_FLAGS b/hphp/hack/test/typecheck/const_attribute/static/HH_FLAGS index 8affebfe358..9631689085a 100644 --- a/hphp/hack/test/typecheck/const_attribute/static/HH_FLAGS +++ b/hphp/hack/test/typecheck/const_attribute/static/HH_FLAGS @@ -1,3 +1,2 @@ --const-static-props --const-attribute ---disable-unset-class-const diff --git a/hphp/hack/test/typecheck/const_attribute/static/unset_const.php.exp b/hphp/hack/test/typecheck/const_attribute/static/unset_const.php.exp index eedaf5b7780..cb2d93b0e83 100644 --- a/hphp/hack/test/typecheck/const_attribute/static/unset_const.php.exp +++ b/hphp/hack/test/typecheck/const_attribute/static/unset_const.php.exp @@ -4,7 +4,5 @@ File "unset_const.php", line 12, characters 3-18: Cannot mutate a class constant (Parsing[1002]) File "unset_const.php", line 13, characters 9-13: Cannot use `[]` for reading (NastCheck[3047]) -File "unset_const.php", line 12, characters 3-18: -You cannot mutate this (Typing[4011]) File "unset_const.php", line 13, characters 3-17: In `strict` mode, `unset` is banned except on dynamic, darray, keyset, or dict indexing (Typing[4135]) diff --git a/hphp/hack/test/typecheck/const_collections_cant_unset.php.exp b/hphp/hack/test/typecheck/const_collections_cant_unset.php.exp index b9a3ce250f0..1a37dadb338 100644 --- a/hphp/hack/test/typecheck/const_collections_cant_unset.php.exp +++ b/hphp/hack/test/typecheck/const_collections_cant_unset.php.exp @@ -1,2 +1,2 @@ File "const_collections_cant_unset.php", line 8, characters 5-28: -You cannot mutate this (Typing[4011]) +Cannot mutate a class constant (Parsing[1002]) diff --git a/hphp/runtime/base/runtime-option.cpp b/hphp/runtime/base/runtime-option.cpp index a47e053e7bc..24b82ad621c 100644 --- a/hphp/runtime/base/runtime-option.cpp +++ b/hphp/runtime/base/runtime-option.cpp @@ -366,7 +366,6 @@ std::uint32_t RepoOptionsFlags::getParserFlags() const { SETFLAGS(DisableArray, 5) \ SETFLAGS(DisableArrayTypehint, 7) \ SETFLAGS(DisableLvalAsAnExpression, 8) \ - SETFLAGS(DisableUnsetClassConst, 9) \ SETFLAGS(DisallowInstMeth, 10) \ SETFLAGS(DisableXHPElementMangling, 11) \ SETFLAGS(DisallowFunAndClsMethPseudoFuncs, 12) \ diff --git a/hphp/runtime/base/runtime-option.h b/hphp/runtime/base/runtime-option.h index a7ad177dcbc..e655ed877bc 100644 --- a/hphp/runtime/base/runtime-option.h +++ b/hphp/runtime/base/runtime-option.h @@ -96,7 +96,6 @@ struct RepoOptionsFlags { H(bool, ConstDefaultFuncArgs, false) \ H(bool, ConstStaticProps, false) \ H(bool, AbstractStaticProps, false) \ - H(bool, DisableUnsetClassConst, false) \ H(bool, DisallowFuncPtrsInConstants, false) \ H(bool, AllowUnstableFeatures, false) \ H(bool, EnableXHPClassModifier, true) \ diff --git a/hphp/test/slow/parser/unset_class_constant.php.hphp_opts b/hphp/test/slow/parser/unset_class_constant.php.hphp_opts deleted file mode 100644 index 27661689d83..00000000000 --- a/hphp/test/slow/parser/unset_class_constant.php.hphp_opts +++ /dev/null @@ -1 +0,0 @@ --vRuntime.Hack.Lang.DisableUnsetClassConst=1 diff --git a/hphp/test/slow/parser/unset_class_constant.php.opts b/hphp/test/slow/parser/unset_class_constant.php.opts deleted file mode 100644 index b91b911dfcc..00000000000 --- a/hphp/test/slow/parser/unset_class_constant.php.opts +++ /dev/null @@ -1 +0,0 @@ --vHack.Lang.DisableUnsetClassConst=1 diff --git a/hphp/test/slow/parser/unset_class_constant2.php.hphp_opts b/hphp/test/slow/parser/unset_class_constant2.php.hphp_opts deleted file mode 100644 index 27661689d83..00000000000 --- a/hphp/test/slow/parser/unset_class_constant2.php.hphp_opts +++ /dev/null @@ -1 +0,0 @@ --vRuntime.Hack.Lang.DisableUnsetClassConst=1 diff --git a/hphp/test/slow/parser/unset_class_constant2.php.opts b/hphp/test/slow/parser/unset_class_constant2.php.opts deleted file mode 100644 index b91b911dfcc..00000000000 --- a/hphp/test/slow/parser/unset_class_constant2.php.opts +++ /dev/null @@ -1 +0,0 @@ --vHack.Lang.DisableUnsetClassConst=1 diff --git a/hphp/test/slow/parser/unset_class_constant_dim0.php.hphp_opts b/hphp/test/slow/parser/unset_class_constant_dim0.php.hphp_opts deleted file mode 100644 index 27661689d83..00000000000 --- a/hphp/test/slow/parser/unset_class_constant_dim0.php.hphp_opts +++ /dev/null @@ -1 +0,0 @@ --vRuntime.Hack.Lang.DisableUnsetClassConst=1 diff --git a/hphp/test/slow/parser/unset_class_constant_dim0.php.opts b/hphp/test/slow/parser/unset_class_constant_dim0.php.opts deleted file mode 100644 index b91b911dfcc..00000000000 --- a/hphp/test/slow/parser/unset_class_constant_dim0.php.opts +++ /dev/null @@ -1 +0,0 @@ --vHack.Lang.DisableUnsetClassConst=1 diff --git a/hphp/test/slow/parser/unset_class_constant_on_instance.php.hphp_opts b/hphp/test/slow/parser/unset_class_constant_on_instance.php.hphp_opts deleted file mode 100644 index 27661689d83..00000000000 --- a/hphp/test/slow/parser/unset_class_constant_on_instance.php.hphp_opts +++ /dev/null @@ -1 +0,0 @@ --vRuntime.Hack.Lang.DisableUnsetClassConst=1 diff --git a/hphp/test/slow/parser/unset_class_constant_on_instance.php.opts b/hphp/test/slow/parser/unset_class_constant_on_instance.php.opts deleted file mode 100644 index b91b911dfcc..00000000000 --- a/hphp/test/slow/parser/unset_class_constant_on_instance.php.opts +++ /dev/null @@ -1 +0,0 @@ --vHack.Lang.DisableUnsetClassConst=1 diff --git a/hphp/test/slow/parser/unset_class_constant_read.php.hphp_opts b/hphp/test/slow/parser/unset_class_constant_read.php.hphp_opts deleted file mode 100644 index 27661689d83..00000000000 --- a/hphp/test/slow/parser/unset_class_constant_read.php.hphp_opts +++ /dev/null @@ -1 +0,0 @@ --vRuntime.Hack.Lang.DisableUnsetClassConst=1 diff --git a/hphp/test/slow/parser/unset_class_constant_read.php.opts b/hphp/test/slow/parser/unset_class_constant_read.php.opts deleted file mode 100644 index b91b911dfcc..00000000000 --- a/hphp/test/slow/parser/unset_class_constant_read.php.opts +++ /dev/null @@ -1 +0,0 @@ --vHack.Lang.DisableUnsetClassConst=1 -- 2.11.4.GIT