// cap.narrow.budget gives a smaller allocation budget; caps are copied plainly. // expect: run // grant: heap=mem.alloc:256 // result: 5 // phase: 6 // spec: docs/spec/15-source-language.md module demo.narrow fn make(small: cap) -> u64 effects [mem.alloc] { let x = own.new(5u64, small) or trap; own.take(move x) } fn main(heap: cap) -> u64 effects [mem.alloc] { match cap.narrow.budget(heap, 16) { ok(small) => make(small), err(e) => 0, } }