Skip to content

Commit 821b249

Browse files
committed
error on old style object send
1 parent c39d233 commit 821b249

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jscomp/frontend/bs_ast_invariant.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ let emit_external_warnings : iterator=
142142
| Pexp_new _ ->
143143
Location.raise_errorf ~loc:a.pexp_loc
144144
"OCaml style objects are not supported"
145-
(* | Pexp_send *)
145+
| Pexp_send (obj, _) ->
146+
begin match obj with
147+
| {pexp_desc = Pexp_apply ({pexp_desc = Pexp_ident ({txt = Ldot(_,"unsafe_downgrade")})},_)} -> ()
148+
| _ -> Location.raise_errorf ~loc:a.pexp_loc
149+
"OCaml style objects are not supported"
150+
end
146151
| _ -> super.expr self a
147152
);
148153
label_declaration = (fun self lbl ->

0 commit comments

Comments
 (0)