Skip to content

Commit b5d9109

Browse files
committed
[compiler] prohibit |. operator
1 parent 0ecd49e commit b5d9109

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vendor/ocaml/typing/env.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,8 +1343,8 @@ and check_value_name name loc =
13431343
(* Note: we could also check here general validity of the
13441344
identifier, to protect against bad identifiers forged by -pp or
13451345
-ppx preprocessors. *)
1346-
1347-
if String.length name > 0 && (name.[0] = '#') then
1346+
if !Clflags.bs_only && name = "|." then raise (Error(Illegal_value_name(loc, name)))
1347+
else if String.length name > 0 && (name.[0] = '#') then
13481348
for i = 1 to String.length name - 1 do
13491349
if name.[i] = '#' then
13501350
raise (Error(Illegal_value_name(loc, name)))

0 commit comments

Comments
 (0)