cli: add explicit source generics and Copy option/result
Specialize explicit function, struct and enum templates into deterministic ordinary AIR, with structural constraints and bounded expansion. Preserve source provenance and readable names in specialization diagnostics. Add Copy-only std.option/std.result and vertical specification, grammar, Quick Reference, RFC and source coverage updates. Keep linear aggregates and existing unsupported source from-returns explicit follow-up work. Repair the finite-layout check through arrays under the existing E1003 contract, with positive and rejected source/AIR fixtures. Validation: build, unit tests, 640 conformance cases, 82/82 source constructs, 32-seed generic task stress, agent-reference, formatting, hosted smoke, 20 generic and 36 package CLI checks. Record three-encoding documentation budgets; AIR reference is unchanged.
This commit is contained in:
93 files changed
+1587
-75
No files matched your search
@@ -0,0 +1,16 @@
|
||||
// expect: run
|
||||
// result: 42
|
||||
// phase: 6
|
||||
// spec: docs/spec/15-source-language.md §15
|
||||
module demo.generics
|
||||
struct Pair<T: Copy> { left: T, right: T }
|
||||
enum Maybe<T: Copy> { some(T), none }
|
||||
fn identity<T>(value: T) -> T effects [] { return value; }
|
||||
fn main() -> u64 effects [] {
|
||||
let p: Pair<u64> = Pair::<u64> { left: identity::<u64>(20), right: identity::<u64>(22) };
|
||||
let m = Maybe::<Pair<u64>>::some(p);
|
||||
match m {
|
||||
Maybe::<Pair<u64>>::some(pair) => { return pair.left + pair.right; }
|
||||
Maybe::<Pair<u64>>::none => { return 0; }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user