Hacker News new | ask | show | jobs
by pansa2 2070 days ago
Yes, except dispatch happens at runtime, not compile time. It takes into account the dynamic type of each argument, not just their static types.
1 comments

Well, almost. Dispatch can happen at compile time, and in fact does for type-stable code. But the dispatch is on run-time types, not static types.

(The fact that you can have static dispatch on dynamic types is a pretty subtle point that hurts my head, but the upshot is that you get semantically dynamic dispatch with static performance as an optimization.)