Checker
Like we mentioned before checker is the thing that makes TypeScript uniquely more powerful than just another JavaScript transpiler. The checker is located in checker.ts
and at this moment it is 23k+ lines of TypeScript (largest part of the compiler).
Usage by Program
The checker
is initialized by program
. The following is a sampling of the call stack (we showed the same one when looking at binder
):
Association with Emitter
True type checking happens once a call is made to getDiagnostics
. This function is called e.g. once a request is made to Program.emit
, in which case the checker returns an EmitResolver
(program calls the checkers getEmitResolver
function) which is just a set of functions local to createTypeChecker
. We will mention this again when we look at the emitter.
Here is the call stack right down to checkSourceFile
(a function local to createTypeChecker
).
Last updated