; expect: reject E3002 ; grant: heap=mem.alloc:64 ; phase: 6 ; spec: docs/spec/03-memory-model.md ยง25 module test.linear air 0 lang 0.1 features [capabilities, effects, heap, linear_aggregates, ownership, resources] type @Pair = struct { value: own, tag: u64 } fn @main(%heap: cap) -> u64 effects [mem.alloc] entry: %n = const.u64 42 own.new %n, %heap, ok -> @got, err -> @failed got(%owner: own): %record = struct.make @Pair(%owner, %n) struct.unpack @Pair %record, next -> @parts parts(%part: own, %tag: u64): ret %tag failed(%e: alloc_error): ret %n