// RUN: %target-typecheck-verify-swift // https://github.com/apple/swift/issues/71040 @resultBuilder struct Builder { static func buildBlock(_ components: T...) -> T { components.first! } } struct S { init(_ fn: () -> T) {} } func foo(@Builder _ fn: () -> T) {} @Builder func bar() { foo { S { let x = if .random() { 0 } else { 1 } return x } } }