; Resources are linear and cannot be copied. ; expect: reject E1001 ; phase: 2 ; spec: docs/spec/06-resources-and-errors.md module test.resource_copy air 0 lang 0.1 features [arrays, capabilities, effects, ownership, resources] fn @f(%c: cap, %p: slice) -> void effects [fs.read] entry: intrinsic fs.open_read(%c, %p), ok -> @opened, err -> @fail opened(%f: file): %g = copy %f intrinsic fs.close(%f), ok -> @x, err -> @xf x: ret xf(%e2: io_error): ret fail(%e: io_error): ret