Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSwiftstatic vs dynamic witness dispatchSingle-choice MCQ

When whole-module optimization specializes a generic function for a concrete type, what happens to the protocol witness table that an unspecialized version would have used?

protocol Pinger { func ping() -> Int } struct A: Pinger { func ping() -> Int { 1 } } func run<T: Pinger>(_ t: T) -> Int { t.ping() } // run(A()) within the same module