move ty defs

This commit is contained in:
nora 2023-12-16 12:39:37 +01:00
parent a22cc15b59
commit d18ab34e9f
14 changed files with 173 additions and 192 deletions

View file

@ -1,6 +1,7 @@
import { ItemId, Pkg, Resolved, Ty } from "../ast";
import { ItemId, Pkg, Resolved } from "../ast";
import { GlobalContext } from "../context";
import { CompilerError, ErrorEmitted } from "../error";
import { Ty } from "../types";
import { ComplexMap } from "../utils";
export type TypeckCtx = {

View file

@ -13,14 +13,6 @@ import {
Resolution,
Resolved,
StructLiteralField,
TY_BOOL,
TY_I32,
TY_INT,
TY_NEVER,
TY_STRING,
TY_UNIT,
Ty,
TyFn,
Type,
Typecked,
mkDefaultFolder,
@ -28,6 +20,7 @@ import {
} from "../ast";
import { CompilerError, ErrorEmitted, Span, unreachable } from "../error";
import { printTy } from "../printer";
import { TY_BOOL, TY_I32, TY_INT, TY_NEVER, TY_STRING, TY_UNIT, Ty, TyFn } from "../types";
import { INSTRS, Instr, VALTYPES, ValType } from "../wasm/defs";
import { TypeckCtx, emitError, mkTyFn, tyError, tyErrorFrom } from "./base";
import { InferContext } from "./infer";

View file

@ -5,17 +5,13 @@ import {
Item,
ItemId,
Resolved,
TY_I32,
TY_INT,
Ty,
TyFn,
Typecked,
foldAst,
mkDefaultFolder,
tyIsUnit,
} from "../ast";
import { GlobalContext } from "../context";
import { CompilerError, ErrorEmitted, Span } from "../error";
import { TY_I32, TY_INT, Ty, TyFn, tyIsUnit } from "../types";
import { ComplexMap } from "../utils";
import { emitError } from "./base";
import { checkBody, exprError } from "./expr";

View file

@ -1,5 +1,5 @@
import { TY_INT, TY_STRING, TY_UNIT } from "../ast";
import { Emitter, ErrorHandler, Span } from "../error";
import { TY_INT, TY_STRING, TY_UNIT } from "../types";
import { InferContext } from "./infer";
const SPAN: Span = Span.startOfFile({ content: "" });

View file

@ -1,6 +1,6 @@
import { Ty } from "../ast";
import { CompilerError, ErrorHandler, Span } from "../error";
import { printTy } from "../printer";
import { Ty } from "../types";
type TyVarRes =
| {

View file

@ -1,18 +1,11 @@
import {
ItemId,
Resolved,
Ty,
TY_BOOL,
TY_I32,
TY_INT,
TY_NEVER,
TY_STRING,
TY_UNIT,
Type,
substituteTy,
} from "../ast";
import { CompilerError, Span } from "../error";
import { printTy } from "../printer";
import { TY_BOOL, TY_I32, TY_INT, TY_NEVER, TY_STRING, TY_UNIT, Ty, substituteTy } from "../types";
import { TypeckCtx, tyError, tyErrorFrom } from "./base";
function builtinAsTy(cx: TypeckCtx, name: string, span: Span): Ty {