Skip to content

Commit 2294579

Browse files
committed
fix #4451
1 parent b8ba487 commit 2294579

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jscomp/syntax/ast_exp_apply.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ let check_and_discard (args : Ast_compatible.args) =
5151

5252
type app_pattern = {
5353
op : string;
54-
loc : Location.t;
54+
loc : Location.t; (* locatoin is the location of whole expression #4451 *)
5555
args : Parsetree.expression list
5656
}
5757

@@ -62,10 +62,10 @@ let sane_property_name_check loc s =
6262
(* match fn as *)
6363
let view_as_app (fn : exp) s : app_pattern option =
6464
match fn.pexp_desc with
65-
| Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident op; loc}}, args )
65+
| Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident op; _}}, args )
6666
when Ext_list.has_string s op
6767
->
68-
Some {op; loc; args = check_and_discard args}
68+
Some {op; loc = fn.pexp_loc; args = check_and_discard args}
6969
| _ -> None
7070

7171

0 commit comments

Comments
 (0)