; The file is closed on one path into the join but still owned on the other. ; expect: reject E3002 ; phase: 2 ; spec: docs/spec/06-resources-and-errors.md module test.resource_join_mismatch air 0 lang 0.1 features [arrays, capabilities, effects, ownership, resources] fn @f(%c: cap, %p: slice, %b: bool) -> void effects [fs.read] entry: intrinsic fs.open_read(%c, %p), ok -> @opened, err -> @fail opened(%f: file): cbr %b, @close(), @keep() close: intrinsic fs.close(%f), ok -> @join, err -> @cf keep: br @join() join: trap cf(%e2: io_error): trap fail(%e: io_error): ret