It's not strictly related to static typing, as it can work without it (e.g. to signal unreachable code).