blob: df73d45e125de2aad6ce45b99110fa684d2d2c7d [file]
/-!
Tests that with `LEAN_ABORT_ON_NONLINEAR` set, mutating an array marked by `Array.markLinear` while
it is shared aborts instead of silently copying the array.
-/
def bad (n : Nat) : Nat :=
let xs := (Array.replicate n 0).markLinear
let ys := xs.set! 0 1
ys.size + xs.size
def main : IO Unit :=
IO.println (bad 5)