Open
Description
After updating CI to Xcode 15.1, quite a few code completions started timing out.
Reducing these tests is always hard but here’s a reduced test case that takes 10s to produce code completion results, based on one of the timeouts.
public struct Section<Content> {
init(@ViewBuilder content: () -> Content) {}
}
struct ConditionalContent<FalseContent, TrueContent> {}
struct TupleView<T> {}
struct Text {}
@resultBuilder struct ViewBuilder {
static func buildBlock<Content>(_ content: Content) -> Content { content }
static func buildBlock<each Content>(_ content: repeat each Content) -> TupleView<(repeat each Content)> { TupleView() }
static func buildIf<Content>(_ content: Content?) -> Content? { nil }
static func buildEither<TrueContent, FalseContent>(first: TrueContent) -> ConditionalContent<TrueContent, FalseContent> { ConditionalContent() }
static func buildEither<TrueContent, FalseContent>(second: FalseContent) -> ConditionalContent<TrueContent, FalseContent> { ConditionalContent() }
}
func test() {
Section {
if true {
Text()
} else if #^COMPLETE^# {
Text()
}
}
}