-
Notifications
You must be signed in to change notification settings - Fork 471
Closed
Labels
Description
Consider
let v = (=) bool_of_string bool_of_string in ""
With BuckleScript 1.8.0 (Using OCaml4.02.3+BS ) it compiles to:
// Generated by BUCKLESCRIPT VERSION 1.8.0, PLEASE EDIT WITH CARE
'use strict';
var Caml_obj = require("bs-platform/lib/js/caml_obj.js");
var Pervasives = require("bs-platform/lib/js/pervasives.js");
Caml_obj.caml_equal(Pervasives.bool_of_string, Pervasives.bool_of_string);
/* Not a pure module */
However the comparison of the (identical) funtional values succeeds at run time,
contrary to the specification of (=)
http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html
and OCaml's bytecode backend, which errors with Exception: Invalid_argument "equal: functional value".