ethos/src/front/check2.ts
sfja 0655f398ce
All checks were successful
Check / Explore-Gitea-Actions (push) Successful in 14s
add check2
2026-04-14 00:56:42 +02:00

33 lines
633 B
TypeScript

import { Syms } from "./resolve.ts";
import * as ast from "../ast.ts";
import { Ty } from "../ty.ts";
export function checkFn(fn: ast.FnStmt, syms: Syms) {
}
export class FnTys {
constructor(
private nodeTys: Map<ast.Node, Ty>,
) {}
get(node: ast.Node): Ty {
const ty = this.nodeTys.get(node);
if (ty === undefined) {
throw new Error(`no type for '${node.kind.tag}'`);
}
return ty;
}
}
class FnChecker {
private nodeTys = new Map<ast.Node, Ty>();
constructor(
private fn: ast.FnStmt,
private syms: Syms,
) {}
check() {
}
}