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-14402] [Code Compleiton] Different behavior on code completion given declaration order on top-level #56759

Open
LucianoPAlmeida opened this issue Mar 25, 2021 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion compiler The Swift compiler in itself source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@LucianoPAlmeida
Copy link
Collaborator

Previous ID SR-14402
Radar rdar://problem/75839788
Original Reporter @LucianoPAlmeida
Type Bug

Attachment: Download

Environment

Main snapshot 2021-03-21

Additional Detail from JIRA
Votes 0
Component/s CodeCompletion, Compiler
Labels Bug
Assignee None
Priority Medium

md5: db26823d3f20cfbcdffb3758f877dcc4

Issue Description:

Given this declaration

struct A<T> {
  let element: T
  
  func f() {}
}

And the code

let value = A(element: 0)
value

If we are running o a top-level code like main.swift and use that type bellow declaration it is fine the completion gives value: A<Int>

But if we use above declaration the code completion gives value: <<error-type>>

The expression `value.f()` type checks fine and compiles correctly. The problem seems to be only on completion.

@LucianoPAlmeida
Copy link
Collaborator Author

For Xcode 12.4 the value variable doesn't even appear in the completion list

@LucianoPAlmeida
Copy link
Collaborator Author

cc @rintaro @nathawes

@typesanitizer
Copy link

@swift-ci create

@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
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 compiler The Swift compiler in itself source tooling Area: IDE support, SourceKit, and other source tooling
Projects
None yet
Development

No branches or pull requests

3 participants