Owner rules: struct/enum declarations in Rust form; one construction form each (named struct literal, Enum::Variant); struct fields lowered in declaration order, so field order in the source does not change the AIR (golden test with two orders, one AIR); match over enums exhaustive with no '_' (E7004 lists missing variants, E7006 for '_'), integer match needs '_'; payload names scoped to their arm (enum.switch block parameters); match as an expression with a merge block; arm-level source map; no destructuring, guards or nested patterns. Type inference limits written into spec 15 (one function, monomorphic, no search, E7007). aji lower --stats: source/AIR size and expansion ratio. Tests: 4 run (one shared golden), 7 rejects incl. verifier-caught E1003.
18 lines
343 B
Plaintext
18 lines
343 B
Plaintext
module demo.point
|
|
air 0
|
|
lang 0.1
|
|
features [effects]
|
|
|
|
type @Point = struct { x: i64, y: i64 }
|
|
|
|
fn @main() -> i64
|
|
effects []
|
|
entry:
|
|
%c_1 = const.i64 1
|
|
%c_2 = const.i64 2
|
|
%s_3 = struct.make @Point(%c_1, %c_2)
|
|
%x_4 = struct.get @Point.x, %s_3
|
|
%y_5 = struct.get @Point.y, %s_3
|
|
%t_6 = add.checked.i64 %x_4, %y_5
|
|
ret %t_6
|