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

Invalid_argument optimized away #1762

Closed
jmid opened this issue Jul 3, 2017 · 0 comments
Closed

Invalid_argument optimized away #1762

jmid opened this issue Jul 3, 2017 · 0 comments

Comments

@jmid
Copy link

jmid commented Jul 3, 2017

Consider the program:

    let _u = if bool_of_string "" then "" else "" in print_int 0

With BuckleScript 1.8.0 (Using OCaml4.02.3+BS ) this compiles to

// Generated by BUCKLESCRIPT VERSION 1.8.0, PLEASE EDIT WITH CARE
'use strict';

var Pervasives = require("bs-platform/lib/js/pervasives.js");

Pervasives.print_int(0);

/*  Not a pure module */

thus erroneously removing the expected Invalid_argument "bool_of_string" exception, that OCaml's bytecode backend produces (and required by the specification http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html).

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

No branches or pull requests

2 participants