toy_kitchen.toy (397B)
1 tuple Pair { 2 i64, 3 i64, 4 } 5 6 fn add2(x: i64): i64 { 7 return x + 2; 8 } 9 10 fn __user_main(): i64 { 11 let p: Pair = Pair { 10, 20 }; 12 let fp: *fn(i64): i64 = add2; 13 var total: i64 = p.0 + p.1; 14 15 switch 2 { 16 1 { 17 total = total + 1; 18 } 19 2 { 20 total = total + fp(10); 21 } 22 default { 23 total = 0; 24 } 25 } 26 27 return total; 28 } 29 30 fn main(): i32 { return __user_main() as i32; }