; An island is not Share (its owner may mutate it): lending it to a task is E4002. ; expect: reject E4002 ; phase: 4 ; spec: docs/spec/04-concurrency-and-atomics.md module test.island_lend_task air 0 lang 0.1 features [capabilities, effects, heap, islands, ownership, resources, tasks] fn @read(%g: ref>) -> u64 effects [] entry: %r = island.root %g %p = island.borrow %g, %r %v = load %p borrow.end %p ret %v fn @main(%heap: cap) -> u64 effects [mem.alloc, task.spawn] entry: %v = const.u64 1 island.create %v, %heap, ok -> @made, err -> @oom made(%i: island): %g = borrow.ref %i %sc = task.scope.begin %t = task.spawn %sc, @read(%g) %r = task.join %t task.scope.end %sc borrow.end %g island.destroy %i ret %r oom(%e: alloc_error): trap