Files
aji/tests/conformance/source/static_functions/owner_reuse.aji
T
dev f02f4bd55b cli: add explicit static function parameters
Bind typed source functions with exact effect contracts during deterministic
specialization; retain nominal operation identity and ordinary AIR verification.

Add spec/RFC/grammar, checked Quick Reference examples, source/AIR conformance,
package/hosted CLI tests, scheduler/GC coverage and documentation budgets.
2026-10-07 10:23:03 +03:00

10 lines
499 B
Rust

// expect: reject E2002
// phase: 6
// spec: docs/spec/15-source-language.md §18
module test.static_functions
fn identity(value: own<u64>) -> own<u64> effects [] { return move value; }
fn apply<F: fn(own<u64>) -> own<u64> effects []>(value: own<u64>) -> u64 effects [] {
let output = F(move value); own.take(move value); return own.take(move output);
}
fn main(heap: cap<mem.alloc>) -> u64 effects [mem.alloc] { let value = own.new(42u64, heap) or trap; return apply::<fn identity>(move value); }