You can enable type checking in Colab in the menu Tools > Setting > Editor > (at the bottom) "Syntax and type checking"
. It then underlines errors in red and hovering them (or Alt+F8) displays the message.
As @jakevdp answered, this is an external tool: types are just annotation with usually no effect at runtime (except for code that actually inspects them).
The type checker in Colab seems not to be documented anywhere, but it's Pyright. In case anyone needs to change its configuration from a Colab notebook, that's possible with e.g.:
%%writefile pyproject.toml
[tool.pyright]
typeCheckingMode = "strict"
(run the cell to overwrite pyproject.toml and wait a bit or save the notebook for Pyright to be re-executed).