Skip to content
>devspeak
← glossary
level 8Advanced AI-Assisted Development

Type checking

also: type checker, typecheck, type error, type errors

An automatic check that each piece of data is used the way it was meant to be, like catching code that treats a piece of text as a number.

a bit more technical

Verifying that values match their declared or inferred types, for example that a function expecting a number never receives text or a possibly missing value. In TypeScript, the compiler (tsc) does this before the code runs. Some languages only check types while running.

picture it

An airport check that the passport photo matches the person holding it. It doesn't know whether your trip is a good idea, but it stops obvious mismatches before you board.

why it matters

Agents sometimes pass the wrong kind of data between files. Type checking catches that across the whole codebase in seconds. "Typecheck passes" is a useful thing to require before your agent says it's done.

what your agent might say
agent
Typecheck fails: user.email is possibly undefined on line 42. I'll handle guest checkouts with no email instead of forcing the type.
how you might use it
you → your agent
After your changes, run the type checker and fix every type error properly. Don't use shortcuts like the "any" type or ignore comments that just switch the check off.
common mistake

Thinking passing type checks means the code works. It proves the data shapes line up, not that the logic is right. Code can type-check perfectly and still calculate the wrong price.

builds on