slige-mirror/compiler/ty/ty.ts
2025-02-04 15:06:19 +01:00

21 lines
373 B
TypeScript

import * as ast from "../ast/mod.ts";
export type Ty = {
kind: TyKind;
};
export const Ty = (kind: TyKind): Ty => ({ kind });
export type TyKind =
| { tag: "error" }
| { tag: "unknown" }
| { tag: "null" }
| { tag: "int" }
| {
tag: "fn";
item: ast.Item;
kind: ast.FnItem;
params: Ty[];
returnTy: Ty;
};