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.
10 lines
395 B
Rust
10 lines
395 B
Rust
// expect: run
|
|
// result: 42
|
|
// phase: 6
|
|
// spec: docs/spec/15-source-language.md §18
|
|
module test.static_functions
|
|
struct Key { id: u64 }
|
|
fn hash(key: ref<Key>) -> u64 effects [] { return key.id; }
|
|
fn observe<K, H: fn(ref<K>) -> u64 effects []>(key: ref<K>) -> u64 effects [] { return H(key); }
|
|
fn main() -> u64 effects [] { let key = Key { id: 42 }; return observe::<Key, fn hash>(ref key); }
|