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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user