feat: 多返回值 fn f(...) -> (T, U) { return (e1, e2); }

Parser: -> (T1,T2) 解析为隐式 struct __ret_funcname, return (e1,e2) 去糖为 struct init
返回的 struct 可访问字段 _0, _1, ... 无 sema/codegen 改动

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 14:07:13 +08:00
parent 06c8773fac
commit 71208a87f4
4 changed files with 114 additions and 9 deletions
+10
View File
@@ -0,0 +1,10 @@
fn div_mod(a: i64, b: i64) -> (i64, i64) {
return (a / b, a % b);
}
fn main() -> i64 {
let result = div_mod(10, 3);
print_i64(result._0); // 3
print_i64(result._1); // 1
return 0;
}