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

Given a generic function with two same-type-constrained parameters, does the call below compile?

func pair<T, U>(_ a: T, _ b: U) -> (T, U) where T == U { (a, b) } let result = pair(1, 2.0)