// own.new receives cap where the allocation needs cap. // phase: 6 // spec: docs/spec/05-effects-and-capabilities.md ยง10.5 // expect: reject E3201 // AIR twin: phase2/reject/alloc_wrong_capability.air module test.source_alloc_wrong_capability fn f(heap: cap) -> void effects [mem.alloc] { match own.new(1u64, heap) { // diagnostic here: own.new ok(o) => { own.free(move o); } err(e) => {} } } fn main() -> u64 effects [] { return 0u64; }