Skip to content

Commit 00afb08

Browse files
committed
not allowing redefine () either
1 parent d2b56a9 commit 00afb08

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

jscomp/syntax/bs_ast_invariant.ml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,12 @@ let emit_external_warnings : iterator=
117117
);
118118
default_iterator.label_declaration self lbl
119119
);
120-
constructor_declaration = (fun self ({pcd_name} as ctr) ->
121-
(match pcd_name.txt with
120+
constructor_declaration = (fun self ({pcd_name = {txt;loc}} as ctr) ->
121+
(match txt with
122122
| "false"
123-
| "true" ->
124-
Location.raise_errorf ~loc:pcd_name.loc "true/false can not be redefined "
123+
| "true"
124+
| "()" ->
125+
Location.raise_errorf ~loc:loc "%s can not be redefined " txt
125126
| _ -> ());
126127
default_iterator.constructor_declaration self ctr
127128
);

0 commit comments

Comments
 (0)