Skip to content

Expect_test_collector.set being re-run and causing error... #12

@progman1

Description

@progman1

I get this error initialisation error:

Expect_test_collector.set: already set

after dynlinking this code:

let ()= 
  let module M =  (val Major_mode.define_derived_mode ~parent:Major_mode.Fundamental.major_mode
      mode_name
      [%here]
      ~docstring:"Major mode for interacting with my thingy"
      ~mode_line:"MYMODE"
      ())
  in
  let keymap=Major_mode.keymap M.major_mode in
  Keymap.define_key keymap (Key_sequence.create_exn "<f5>")
    (Command (Command.of_value_exn(Value.intern "grabbit")))

As I'm compiling a cma to be dynlinked against the ecaml library and so not re-initialising any ecaml modules, there must be something about the code above that causes
Expect_test_collector.set to be called again.
But why should this module be linked in at all? I have no expect tests.
If it's linking is unavoidable, is there something that can be done to prevent the above call being made?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    forwarded-to-js-devsThis report has been forwarded to Jane Street's internal review system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions