Fix: Resolve function types of all contracts before checking types inside functions.