You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 2652 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
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.)
The text was updated successfully, but these errors were encountered:
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
#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.)
The text was updated successfully, but these errors were encountered: