The idea is not to compile a unit without knowing the size of Foo. It's about making sure you figure out sizeof(Foo) in near constant time.
With C#/Pascal, it means:
* For each referenced module load its symbol table into RAM. If implemented cleverly, this is literally one read() call.
* For each referenced symbol, search each hash table until you find it. Since the hash tables are only built during compilation, you can auto-size them so that an average lookup takes just 1-2 steps.
* Bonus point: for libraries, you can merge the hash tables. So n is now a number of libraries, not number of files.
With C++ you are stuck reparsing megabytes of code at the beginning of each translation unit. It's millions of times slower than reading a couple of pages from disk to RAM.