; island.alloc needs a mutable borrow of the island. ; expect: reject E1001 ; phase: 4 ; spec: docs/spec/03-memory-model.md module test.island_alloc_via_ref air 0 lang 0.1 features [capabilities, effects, heap, islands, ownership, resources] fn @main(%heap: cap) -> u64 effects [mem.alloc] entry: %v = const.u64 1 island.create %v, %heap, ok -> @made, err -> @oom made(%i: island): %g = borrow.ref %i island.alloc %g, %v, ok -> @got, err -> @full got(%r: iref): borrow.end %g island.destroy %i ret %v full(%e2: alloc_error): trap oom(%e: alloc_error): trap