// `or trap`: ok continues, err traps; own.free consumes the owner. // expect: run // grant: heap=mem.alloc:64 // result: 9 // phase: 6 // spec: docs/spec/15-source-language.md module demo.ortrap fn read(c: ref) -> u64 effects [] { *c } fn main(heap: cap) -> u64 effects [mem.alloc] { let x = own.new(9u64, heap) or trap; let v = read(ref x); own.free(move x); v }