module Bad

  use int.Int
  use ref.Ref

  type dref 'a = { mutable dcontents : ref 'a }

  let one (x : dref 'a) (y : ref 'a)
    ensures { !(x.dcontents) = !(old y) }
  = x.dcontents <- y;
    y

end
