forked from ocamllabs/ocaml
-
Notifications
You must be signed in to change notification settings - Fork 1
Type escapes its scope #9
Copy link
Copy link
Open
Description
In the following program the type of st escapes its scope
effect state = Get : 's
let my_comp () = perform Get + 1
let state m =
match m () with
| v -> fun _ -> v
| effect Get, k -> fun st -> continue k st st
The computation my_comp instantiates Get : 's to Get : int locally. Loading the above in OCaml repl with rlwrap, we can now crash the OCaml runtime:
- : int = 42
# state my_comp 'e';;
- : int = 102
# state my_comp "Hello World";;
rlwrap: warning: ocaml crashed, killed by SIGSEGV (core dumped).
rlwrap itself has not crashed, but for transparency,
it will now kill itself with the same signal
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels