TypeScript's 'used before its declaration' error and C's implicit-declaration warnings both come from this analysis; it caught real bugs like OpenSSL misusing functions declared nowhere. The two-pass approach you build — declare first, then resolve — is exactly how the JVM verifier and TypeScript's binder handle forward references.