Skip to content

no exit on bad #use in ocaml scripts #3959

@vicuna

Description

@vicuna

Original bug ID: 3959
Reporter: @mjambon
Assigned to: @gasche
Status: assigned (set by @damiendoligez on 2017-02-27T13:56:11Z)
Resolution: open
Priority: normal
Severity: minor
Version: 3.09.0
Category: toplevel

Bug description

The ocaml command or a custom toplevel, when used in non-interactive mode, does not stop when it encounters a directive with a valid name but an invalid argument:

  1. Valid directive name, wrong argument (should exit):

[droopy] ~/tmp % cat blop.ml
#use "abc";;
print_endline "hello";;
[droopy] ~/tmp % ocaml blop.ml && echo success
Cannot find file abc.
hello
success

  1. Wrong directive name (works as expected):

[droopy] ~/tmp % cat blop2.ml
#abcde "abc";;
print_endline "hello";;
[droopy] ~/tmp % ocaml blop2.ml && echo success
Unknown directive `abcde'.

Additional information

This problem is present at least in OCaml 3.08.4 and OCaml 3.09.1 (x86 Linux).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions