Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftresult buildersSingle-choice MCQ

What does this code print, demonstrating how `buildOptional`/`buildEither` interact with control flow in a result builder?

@resultBuilder enum StringBuilder { static func buildBlock(_ parts: String...) -> String { parts.joined() } static func buildEither(first: String) -> String { first } static func buildEither(second: String) -> String { second } } func make(@StringBuilder _ b: () -> String) -> String { b() } let flag = false print(make { "a" if flag { "b" } else { "c" } })