mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-16 01:15:03 +01:00
Add support for tuple literals
This commit is contained in:
parent
0c996eb9bc
commit
b64c02cf4a
6 changed files with 82 additions and 35 deletions
|
|
@ -768,6 +768,16 @@ export function checkBody(
|
|||
|
||||
return { ...expr, fields, ty: structTy };
|
||||
}
|
||||
case "tupleLiteral": {
|
||||
const fields = expr.fields.map((expr) => this.expr(expr));
|
||||
|
||||
const ty: Ty = {
|
||||
kind: "tuple",
|
||||
elems: fields.map((field) => field.ty!),
|
||||
};
|
||||
|
||||
return { ...expr, fields, ty };
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue