-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
bugA 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 completionfound by stress testerFlag: An issue found by the SourceKit stress testerFlag: An issue found by the SourceKit stress testersource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source tooling
Description
| Previous ID | SR-15499 |
| Radar | rdar://85603839 |
| Original Reporter | @ahoppen |
| Type | Bug |
Additional Detail from JIRA
| Votes | 0 |
| Component/s | CodeCompletion |
| Labels | Bug, FoundByStressTester |
| Assignee | None |
| Priority | Medium |
md5: 42a72f07d14234384f13310f10e92efa
Issue Description:
The following new test case fails because no code completion results are returned. When setting state outside of the swift statement, the expected results are returned.
// RUN: %swift-ide-test --code-completion --code-completion-token COMPLETE --source-filename %s | %FileCheck %s
enum DragState {
case inactive
case pressing
}
public func opdating(body: (MyEnum, inout DragState) -> Void) {}
enum MyEnum {
case first
}
@resultBuilder public struct ViewBuilder2 {
public static func buildBlock<Content>(_ content: Content) -> Content where Content : View2 { fatalError() }
}
protocol View2 {}
@ViewBuilder2 var body: some View2 {
opdating() { value, state in
switch value {
case .first:
state = .#^COMPLETE^#
default:
break
}
}
}
// CHECK: Begin completions, 3 items
// CHECK-DAG: Decl[EnumElement]/CurrNominal/Flair[ExprSpecific]/TypeRelation[Identical]: inactive[#DragState#];
// CHECK-DAG: Decl[EnumElement]/CurrNominal/Flair[ExprSpecific]/TypeRelation[Identical]: pressing[#DragState#];
// CHECK-DAG: Decl[InstanceMethod]/CurrNominal/TypeRelation[Invalid]: hash({#(self): DragState#})[#(into: inout Hasher) -> Void#];
// CHECK: End completionsMetadata
Metadata
Assignees
Labels
bugA 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 completionfound by stress testerFlag: An issue found by the SourceKit stress testerFlag: An issue found by the SourceKit stress testersource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source tooling