Skip to content

Invalid_argument optimized away #1762

Closed
@jmid

Description

@jmid

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions