fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

A precondition may allow an instance to escape

Open fridis opened this issue 1 year ago • 0 comments

This example passes xyz.this to the outside world in xyz's preconditions

test_pre is

  R ref is
    hi unit => abstract

  hehe(x R) => x.hi; true

  xyz : R
  pre
    hehe xyz.this
  is
    hi => say "sneaked in"

  _ := xyz

and fz does not complain

 > ./build/bin/fz test_pre.fz
sneaked in

fridis avatar Mar 08 '24 14:03 fridis