@@ -1061,10 +1061,10 @@ class def_finder ~autocomplete_hooks ~react_jsx env_info toplevel_scope =
1061
1061
let this_write_locs = obj_this_write_locs obj in
1062
1062
begin
1063
1063
match obj_properties_synthesizable ~this_write_locs obj with
1064
- | Unsynthesizable -> Some (Value { hints = [] ; expr = init })
1064
+ | Unsynthesizable -> Some (Value { hints = [] ; expr = init; decl_kind = None })
1065
1065
| synthesizable -> Some (ObjectValue { obj_loc = loc; obj; synthesizable })
1066
1066
end
1067
- | (Some init , _ ) -> Some (Value { hints = [] ; expr = init })
1067
+ | (Some init , _ ) -> Some (Value { hints = [] ; expr = init; decl_kind = Some kind })
1068
1068
| (None, _ ) -> None
1069
1069
in
1070
1070
let (source, hints) =
@@ -2051,11 +2051,11 @@ class def_finder ~autocomplete_hooks ~react_jsx env_info toplevel_scope =
2051
2051
this#visit_expression ~hints: (expression_pattern_hints e) ~cond: NonConditionalContext right
2052
2052
| (None, Ast.Pattern. Expression e ) ->
2053
2053
let (_ : (_, _) Ast.Pattern. t ) = this#assignment_pattern (lhs_loc, lhs_node) in
2054
- this#add_destructure_bindings (Value { hints = [] ; expr = right }) left;
2054
+ this#add_destructure_bindings (Value { hints = [] ; expr = right; decl_kind = None }) left;
2055
2055
this#visit_expression ~hints: (expression_pattern_hints e) ~cond: NonConditionalContext right
2056
2056
| (None, _ ) ->
2057
2057
let (_ : (_, _) Ast.Pattern. t ) = this#assignment_pattern (lhs_loc, lhs_node) in
2058
- this#add_destructure_bindings (Value { hints = [] ; expr = right }) left;
2058
+ this#add_destructure_bindings (Value { hints = [] ; expr = right; decl_kind = None }) left;
2059
2059
this#visit_expression ~hints: (other_pattern_hints left) ~cond: NonConditionalContext right
2060
2060
| ( Some operator,
2061
2061
Ast.Pattern. Identifier
@@ -3203,7 +3203,7 @@ class def_finder ~autocomplete_hooks ~react_jsx env_info toplevel_scope =
3203
3203
this#add_ordinary_binding
3204
3204
match_keyword_loc
3205
3205
(mk_reason RMatch match_keyword_loc)
3206
- (Binding (Root (Value { hints = [] ; expr = arg })));
3206
+ (Binding (Root (Value { hints = [] ; expr = arg; decl_kind = None })));
3207
3207
let value_hints =
3208
3208
Base.List. foldi cases ~init: IMap. empty ~f: (fun i acc (_ , { Case. body; _ } ) ->
3209
3209
if expression_is_definitely_synthesizable ~autocomplete_hooks body then
@@ -3218,7 +3218,7 @@ class def_finder ~autocomplete_hooks ~react_jsx env_info toplevel_scope =
3218
3218
(case_loc, Ast.Expression. Identifier (Flow_ast_utils. match_root_ident case_loc))
3219
3219
in
3220
3220
ignore @@ this#expression match_root;
3221
- let acc = Value { hints = [] ; expr = match_root } in
3221
+ let acc = Value { hints = [] ; expr = match_root; decl_kind = None } in
3222
3222
this#add_match_destructure_bindings acc pattern;
3223
3223
ignore @@ super#match_pattern pattern;
3224
3224
run_opt this#expression guard;
@@ -3235,13 +3235,13 @@ class def_finder ~autocomplete_hooks ~react_jsx env_info toplevel_scope =
3235
3235
this#add_ordinary_binding
3236
3236
match_keyword_loc
3237
3237
(mk_reason RMatch match_keyword_loc)
3238
- (Binding (Root (Value { hints = [] ; expr = arg })));
3238
+ (Binding (Root (Value { hints = [] ; expr = arg; decl_kind = None })));
3239
3239
Base.List. iter cases ~f: (fun (case_loc , { Case. pattern; body; guard; comments = _ } ) ->
3240
3240
let match_root =
3241
3241
(case_loc, Ast.Expression. Identifier (Flow_ast_utils. match_root_ident case_loc))
3242
3242
in
3243
3243
ignore @@ this#expression match_root;
3244
- let acc = Value { hints = [] ; expr = match_root } in
3244
+ let acc = Value { hints = [] ; expr = match_root; decl_kind = None } in
3245
3245
this#add_match_destructure_bindings acc pattern;
3246
3246
ignore @@ super#match_pattern pattern;
3247
3247
run_opt this#expression guard;
0 commit comments