; switch over integers and exhaustive enum.switch with payload binding. ; expect: accept ; phase: 0 ; spec: docs/spec/07a-air-instructions.md module test.switch_and_enums air 0 lang 0.1 features [] type @Shape = enum { Empty, Square(u32), Rect(u32, u32) } fn @area(%s: @Shape) -> u32 effects [] entry: enum.switch @Shape %s, Empty -> @empty, Square -> @square, Rect -> @rect empty: %z = const.u32 0 ret %z square(%side: u32): %a = mul.checked.u32 %side, %side ret %a rect(%w: u32, %h: u32): %b = mul.checked.u32 %w, %h ret %b fn @classify(%n: i8) -> u8 effects [] entry: switch.i8 %n, -1 -> @neg(), 0 -> @zero(), default -> @other() neg: %a = const.u8 0 ret %a zero: %b = const.u8 1 ret %b other: %c = const.u8 2 ret %c