diff --git a/slige/compiler/check/checker.ts b/slige/compiler/check/checker.ts index a46ba3e..3edb111 100644 --- a/slige/compiler/check/checker.ts +++ b/slige/compiler/check/checker.ts @@ -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 { diff --git a/slige/compiler/common/diagnostics.ts b/slige/compiler/common/diagnostics.ts index 7f5d06a..8f0fc18 100644 --- a/slige/compiler/common/diagnostics.ts +++ b/slige/compiler/common/diagnostics.ts @@ -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;