// RUN: %batch-code-completion protocol View {} struct EmptyView: View {} struct Either: View {} struct Tuple: View {} extension Optional: View where Wrapped: View {} @resultBuilder struct ViewBuilder { static func buildBlock() -> EmptyView { .init() } static func buildBlock(_ x: T) -> T { x } @_disfavoredOverload static func buildBlock( _ x: repeat each T ) -> Tuple<(repeat each T)> { .init() } static func buildEither(first component: T) -> Either { .init() } static func buildEither(second component: U) -> Either { .init() } static func buildIf(_ x: T?) -> T? { x } } struct R { var bar: Bool } func baz(@ViewBuilder _ fn: () -> R) {} // https://github.com/swiftlang/swift/issues/79213 - Make sure we get a result here. func foo(_ x: R, _ b: Bool) { baz { if b { EmptyView() } else if b { if x.#^COMPLETE^# {} // COMPLETE: Decl[InstanceVar]/CurrNominal/TypeRelation[Convertible]: bar[#Bool#]; name=bar } } }