compiler: remember call arg

This commit is contained in:
SimonFJ20 2025-02-07 12:56:33 +01:00
parent 2fe829a84f
commit cea1a5f5bd
2 changed files with 6 additions and 4 deletions

View File

@ -218,7 +218,10 @@ export class Checker {
const _args = kind.args.map((arg, i) =>
this.checkExpr(arg, paramTys[i])
);
return fnTy.kind.returnTy;
const ty = fnTy.kind.returnTy;
this.exprTys.set(expr.id, ty);
return ty;
}
private tyTy(ty: ast.Ty): Ty {

View File

@ -54,9 +54,8 @@ export function prettyPrintReport(ctx: Ctx, rep: Report) {
const { severity, msg } = rep;
const origin = rep.origin ? `\x1b[1m${rep.origin}:\x1b[0m ` : "";
console.error(
`${origin}${
severityColor(severity)
}${severity}:\x1b[0m \x1b[37m${msg}\x1b[0m`,
`${origin}${severityColor(severity)}${severity}:\x1b[0m %c${msg}`,
"color: white; font-weight: bold;",
);
if (!rep.file) {
return;