Closed
Description
The following gives a duplicate diagnostic:
@resultBuilder
struct Builder {
static func buildBlock<T>(_ components: T...) -> T {
components.first!
}
static func buildEither<T>(first component: T) -> T {
component
}
static func buildEither<T>(second component: T) -> T {
component
}
}
func takesClosure(_ fn: () -> Void) -> Int? { nil }
@Builder
func foo() -> Int {
if let x = takesClosure {} { // 2x warning: trailing closure in this context is confusable with the body of the statement
0
} else {
1
}
}