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

Crash top level with exception printing #2652

Closed
vicuna opened this issue Jun 7, 2004 · 1 comment
Closed

Crash top level with exception printing #2652

vicuna opened this issue Jun 7, 2004 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Jun 7, 2004

Original bug ID: 2652
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Jim Farrand
Version: 3.07+2
OS: Gentoo GNU/Linux 2.6.4
Submission from: 81-178-83-85.dsl.pipex.com (81.178.83.85)

The following code crashes the top level. I think this is a minimal example...
if the exception Foo is declared outside of the module BadType, no crash
occurs.

type 'a cap =
Val of 'a
| Exn of exn

let capture f a =
try
Val (f a)
with
e -> Exn e

module type BadType =
sig
exception Foo
val bad : 'a cap
end

module Bad : BadType =
struct
exception Foo
let bad = capture (fun _ -> raise Foo) ()
end

let x = Bad.bad

    Objective Caml version 3.07+2

#use "bad.ml" ;;

type 'a cap = Val of 'a | Exn of exn
val capture : ('a -> 'b) -> 'a -> 'b cap =
module type BadType = sig exception Foo val bad : 'a cap end
module Bad : BadType
val x : 'a cap = Exn

Fatal error: exception Invalid_argument("output")

(ocaml then exits, and I am returned to the command line.)

@vicuna
Copy link
Author

vicuna commented Jun 13, 2004

Comment author: administrator

Fixed 2004-06-13 by XL

@vicuna vicuna closed this as completed Jun 13, 2004
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant