Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unresolved internal primitive: %caml_js_opt_meth_call #573

Closed
Armael opened this issue Apr 11, 2017 · 6 comments
Closed

Error: Unresolved internal primitive: %caml_js_opt_meth_call #573

Armael opened this issue Apr 11, 2017 · 6 comments

Comments

@Armael
Copy link
Contributor

Armael commented Apr 11, 2017

How to reproduce:

opam install gen_js_api
git clone https://github.com/Armael/gen_js_api_helloworld
cd gen_js_api_helloworld
make

The jsoo invocation fails with:

js_of_ocaml --pretty -o test.js +gen_js_api/ojs_runtime.js test.byte
js_of_ocaml: Error: Unresolved internal primitive: %caml_js_opt_meth_call
make: *** [Makefile:7: all] Error 1
@hhugo
Copy link
Member

hhugo commented Apr 11, 2017

Thanks for the report, will look at this later this week

@hhugo
Copy link
Member

hhugo commented Apr 11, 2017

What versions ? Ocaml ? Js_of_ocaml ?

@Armael
Copy link
Contributor Author

Armael commented Apr 11, 2017

OCaml 4.04.0, js_of_ocaml 2.8.4. I couldn't figure how to pin the git version of jsoo.

@hhugo
Copy link
Member

hhugo commented Apr 13, 2017

partially solved by 936feb8.
I've updated the compiler to be more robust. However the code generated by gen_js_api is not doing what you expect, see bellow.

let (foo : int -> unit) =
  fun x1  -> ignore (Ojs.call (Ojs.int_to_js x1) "foo" [||]) 

I would suggest to reopen your issue on gen_js_api.

@hhugo hhugo closed this as completed Apr 13, 2017
@hhugo
Copy link
Member

hhugo commented Apr 13, 2017

I think you want

val foo : int -> unit
[@@js.global]

@Armael
Copy link
Contributor Author

Armael commented Apr 13, 2017

Oh, thanks for the patch & the debugging. I'll reopen the issue on gen_js_api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants