-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
argument labelsFeature: function argument labelsFeature: function argument labelsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.code completionArea → source tooling: code completionArea → source tooling: code completioncrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwaredeclarationsFeature: declarationsFeature: declarationsfound by stress testerFlag: An issue found by the SourceKit stress testerFlag: An issue found by the SourceKit stress testerfuncFeature → declarations: FunctionsFeature → declarations: FunctionsoverloadingFeature: Overloading symbol namesFeature: Overloading symbol namessource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source toolingswift 5.9
Description
The following new test case does not suggest id:
. If the overload that takes ToolbarContentBuilder
is removed, the test passes
// RUN: %empty-directory(%t)
// RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t
struct Group<Content> {
init(@ToolbarContentBuilder content: () -> Content) {}
init(@ViewBuilder content2: () -> Content) {}
}
@resultBuilder struct ViewBuilder {
static func buildExpression(_ content: MyView) -> MyView { content }
static func buildBlock(_ content: MyView) -> MyView { content }
static func buildEither(first: MyView) -> MyView { first }
static func buildEither(second: MyView) -> MyView { second }
}
@resultBuilder struct ToolbarContentBuilder {
static func buildExpression<Content : ToolbarContent>(_ content: Content) -> Int { 1 }
static func buildBlock(_ content: Int) -> Int { 1 }
static func buildEither(first: Int) -> Int { 1 }
static func buildEither(second: Int) -> Int { 1 }
}
protocol ToolbarContent {}
struct MyView {
init(_ content: String) {}
init<Content>(_ data: Int, id: Int, content: (Int) -> Content) {}
}
func test() {
_ = Group {
if true {
MyView("No results")
} else {
MyView(1, #^COMPLETE^#) { _ in }
}
}
}
// COMPLETE: Pattern/Local/Flair[ArgLabels]: {#id: Int#}[#Int#]; name=id:
Metadata
Metadata
Assignees
Labels
argument labelsFeature: function argument labelsFeature: function argument labelsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.code completionArea → source tooling: code completionArea → source tooling: code completioncrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwaredeclarationsFeature: declarationsFeature: declarationsfound by stress testerFlag: An issue found by the SourceKit stress testerFlag: An issue found by the SourceKit stress testerfuncFeature → declarations: FunctionsFeature → declarations: FunctionsoverloadingFeature: Overloading symbol namesFeature: Overloading symbol namessource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source toolingswift 5.9