Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-14547] Enum cases not shown in code completion for enum with associated values conforming to Error when Foundation is imported #56899

Closed
ahoppen opened this issue Apr 28, 2021 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion found by stress tester Flag: An issue found by the SourceKit stress tester source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@ahoppen
Copy link
Contributor

ahoppen commented Apr 28, 2021

Previous ID SR-14547
Radar rdar://problem/77263334
Original Reporter @ahoppen
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug, FoundByStressTester
Assignee @ahoppen
Priority Medium

md5: cbd6b69c0813e5e16d6650fffff54986

Issue Description:

Consider the following new test case:

// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=COMPLETE | %FileCheck %s

import Foundation

enum SomeError: Error {
  case validateStringIsNotUTF8(String)

  func foo() {
    switch self {
    case .#^COMPLETE^#validateStringIsNotUTF8(let value):
      break
    }
  }
}

// CHECK: Begin completions
// CHECK-DAG: Decl[EnumElement]/ExprSpecific/TypeRelation[Identical]: validateStringIsNotUTF8({#String#})[#SomeError#];
// CHECK: End completions

When completing on COMPLETE, we are suggesting

Begin completions, 2 items
Decl[AssociatedType]/CurrNominal/IsSystem: RawValue; name=RawValue
Decl[Constructor]/CurrNominal/IsSystem: init({#rawValue: FixedWidthInteger#})[#(_ErrorCodeProtocol & RawRepresentable)?#]; name=init(rawValue: FixedWidthInteger)
End completions

but not validateStringIsNotUTF8.

When import Foundation is removed, validateStringIsNotUTF8 is correctly suggested and the two results mentioned above no longer show up.

@ahoppen
Copy link
Contributor Author

ahoppen commented Apr 28, 2021

@swift-ci create

@ahoppen
Copy link
Contributor Author

ahoppen commented Sep 2, 2021

Fixed by #38627

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the source tooling Area: IDE support, SourceKit, and other source tooling label Feb 6, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion found by stress tester Flag: An issue found by the SourceKit stress tester source tooling Area: IDE support, SourceKit, and other source tooling
Projects
None yet
Development

No branches or pull requests

2 participants