
use int.Int
use ref.Ref

let funny () =
  exception FixRegion (ref int) in
  let fixed_ref (i : int) : unit
    ensures { false }
    raises  { FixRegion r -> !r = i }
  = raise FixRegion (ref i) in
  let r1 = try fixed_ref 42; absurd with FixRegion r -> r end in
  begin
    let r2 = try fixed_ref 17; absurd with FixRegion r -> r end in
    r2 := !r2 + 1
  end ensures { true };
  assert { !r1 = 18 }
