mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-15 17:05:03 +01:00
lower if
This commit is contained in:
parent
9ac5fec4bd
commit
27a4ecc46b
3 changed files with 40 additions and 17 deletions
|
|
@ -546,12 +546,13 @@ export function checkBody(
|
|||
|
||||
infcx.assign(TY_BOOL, cond.ty!, cond.span);
|
||||
|
||||
let ty;
|
||||
let ty: Ty;
|
||||
if (elsePart) {
|
||||
infcx.assign(then.ty!, elsePart.ty!, elsePart.span);
|
||||
ty = then.ty!;
|
||||
} else {
|
||||
infcx.assign(TY_UNIT, then.ty!, then.span);
|
||||
ty = TY_UNIT;
|
||||
}
|
||||
|
||||
return { ...expr, cond, then, else: elsePart, ty };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue