// expect: reject E3002 // phase: 6 // spec: docs/spec/06-resources-and-errors.md module test.source_outcome_match_join fn test(src: cap, condition: bool) -> void effects [fs.read] { let file = fs.open_read(src, b"/input") or trap; var bytes: [u8; 1] = zero; match fs.read(file, mut bytes) { // diagnostic here ok(count) => { fs.close(move file) or trap; } err(error) => {} } trap; } fn main(src: cap) -> void effects [fs.read] { test(src, true); }