/** * The functions a file declares: collecting them, ordering them and checking * their bodies. * * Two rules shape everything here. A `fn` may be called before its declaration * appears (`language.md` 12.5), so every declaration is collected before any * body is checked. And a function may not call itself, directly or through a * cycle (11.4), because state regions are allocated per call site and recursion * would need a stack of them on every bar of every script; the cycle is * reported as OS2005 and named in full, since a three function cycle is not * something a reader can see from one line. * * Bodies are checked callees first, so a function that calls another already * knows what that one returns rather than treating it as unknown. */ import type { Script } from '../ast/index.js'; import type { Checker } from './checker.js'; /** * Checks a body once, the first time anything needs to know what it returns. * * A body is checked in the file scope rather than wherever the call was * written, because a function's enclosing scope is the file whatever line calls * it, and it is checked on demand rather than up front because the file-scope * names it can see are the ones declared above the call (`language.md` 12.5). */ export declare function ensureChecked(checker: Checker, id: number): void; /** Collects every declaration and reports any cycle among them, before the file runs. */ export declare function checkFunctionDeclarations(checker: Checker, script: Script): void; /** The bodies nothing called, so an unused helper still gets its diagnostics. */ export declare function checkRemainingFunctions(checker: Checker): void; //# sourceMappingURL=functions.d.ts.map