various result types

Swift โŸฉ Attributes โŸฉ Result Builders โŸฉ

typealias Component = String

// result type: String
static func buildFinalResult(_ component: Component) -> String {
    return component
}

// result type: Int
static func buildFinalResult(_ component: Component) -> Int {
    return component.count
}

Last updated