Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftgenerics and constraintsSingle-choice MCQ

Consider two overloads selected by generic constraints. Which is called for the marked line?

func f<T>(_ x: T) -> String { "any" } func f<T: BinaryInteger>(_ x: T) -> String { "int" } print(f(7)) // <-- this line