Skip to content
Quiz · Protocols and generics · lesson 9 of 9

Quiz — a type constraint

What happens when this program is compiled and run?

SWIFT
func larger<T>(_ a: T, _ b: T) -> T {
    a > b ? a : b
}
print(larger(7, 3))