Why do many real-world type checkers use bidirectional type checking instead of pure inference or pure checking?
Correct! Well done.
Incorrect.
The correct answer is D) Because it combines a synthesis mode (compute a type from an expression) with a checking mode (verify against an expected type), handling polymorphism and literals with fewer annotations
Correct Answer
Because it combines a synthesis mode (compute a type from an expression) with a checking mode (verify against an expected type), handling polymorphism and literals with fewer annotations
Bidirectional type checking (used in TypeScript, Swift, and many academic systems) propagates expected types downward (checking) and computes types upward from the leaves (synthesis). This combination handles higher-rank polymorphism and ambiguous literals more gracefully than algorithms relying purely on one direction.