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.
8 lines
418 B
Rust
8 lines
418 B
Rust
// expect: reject E3002
|
|
// phase: 6
|
|
// spec: docs/spec/15-source-language.md §18
|
|
module test.static_functions
|
|
fn selected(value: own<u64>) -> u64 effects [] { return 42; }
|
|
fn run<F: fn(own<u64>) -> u64 effects []>(value: own<u64>) -> u64 effects [] { return F(move value); }
|
|
fn main(heap: cap<mem.alloc>) -> u64 effects [mem.alloc] { let value = own.new(42u64, heap) or trap; return run::<fn selected>(move value); }
|