Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 686eedd

Browse files
committedSep 22, 2024
bring back error reporting on unknown #prim
1 parent 98d7d37 commit 686eedd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎jscomp/core/lam_convert.ml

+4-1
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) :
387387
(args : Lambda.lambda list) loc ~dynamic_import : Lam.t =
388388
let prim_name = a_prim.prim_name in
389389
match External_ffi_types.from_string a_prim.prim_native_name with
390-
| Ffi_normal -> assert false
391390
| Ffi_obj_create labels ->
392391
let args = Ext_list.map args convert_aux in
393392
prim ~primitive:(Pjs_object_create labels) ~args loc
@@ -400,6 +399,10 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) :
400399
let args = Ext_list.map args convert_aux in
401400
Lam.handle_bs_non_obj_ffi arg_types result_type ffi args loc prim_name ~dynamic_import
402401
| Ffi_inline_const i -> Lam.const i
402+
| Ffi_normal -> Location.raise_errorf ~loc
403+
"@{<error>Error:@} internal error, using unrecognized \
404+
primitive %s"
405+
prim_name
403406

404407
and convert_aux ?(dynamic_import = false) (lam : Lambda.lambda) : Lam.t =
405408
match lam with

0 commit comments

Comments
 (0)
Please sign in to comment.