Skip to content

[BUG] annotation not attached correctly in js stubs #1213

Closed
ocaml/opam-repository
#20533
@hhugo

Description

@hhugo

Describe the bug
Annotation are sometimes not attached to the correct statement in presence of javascript toplevel expression.
This result in the following behavior

diff --git a/runtime/stdlib.js b/runtime/stdlib.js
index 22d1c5101d..1205291dba 100644
--- a/runtime/stdlib.js
+++ b/runtime/stdlib.js
@@ -17,6 +17,13 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
+//Requires: caml_call_gen
+//Always
+globalThis.a = 2
+
+//Always
+globalThis.a = 3
+
 //Provides: caml_call_gen (const, shallow)
 //Weakdef
 function caml_call_gen(f, args) {
$ make
dune build @all
File "compiler/tests-io/_unknown_", line 1, characters 0-0:
../../../install/default/bin/js_of_ocaml: Error: circular dependency: caml_call_gen, caml_js_wrap_callback_arguments

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions