Skip to content

[5.3][CodeCompletion] Dont mark type mismatching items 'not recommended' #31566

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented May 5, 2020

Cherry-pick of #31474 into release/5.3

  • Explanation: Previously, we marked completion result with Void type as 'NotRecommented' in non-Void context because Void doesn't have any member hence it cannot be 'Int'. But it was confusing with "deprecated". Now that we output 'typerelation' which is invalid in this case. So clients can deprioritize results, or even filter them out.
  • Scope: Code completion
  • Risk: Low.
  • Issue: rdar://problem/57726512
  • Testing: Updated existing test cases to reflect the results. Added new regression test cases.
  • Reviewer: Ben Langmuir (@benlangmuir )

func foo() {}
let a: Int = #^HERE^#

Previously, we marked 'foo()' as 'NotRecommented' because 'Void' doesn't
have any member hence it cannot be 'Int'. But it wass confusing with
'deprecated'.

Now that we output 'typerelation' which is 'invalid' in this case. So clients
can deprioritize results, or even filter them out.

rdar://problem/57726512
(cherry picked from commit e9c438c)
@rintaro rintaro added the r5.3 label May 5, 2020
@rintaro rintaro requested a review from a team as a code owner May 5, 2020 19:51
@rintaro
Copy link
Member Author

rintaro commented May 5, 2020

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented May 5, 2020

@swift-ci Please nominate

@swift-ci
Copy link
Contributor

swift-ci commented May 5, 2020

Build failed
Swift Test Linux Platform
Git Sha - 3b3934e

@rintaro
Copy link
Member Author

rintaro commented May 5, 2020

@swift-ci Please test Linux

@swift-ci
Copy link
Contributor

swift-ci commented May 5, 2020

Build failed
Swift Test Linux Platform
Git Sha - 3b3934e

@rintaro
Copy link
Member Author

rintaro commented May 5, 2020

Linux failure is unrelated:
https://ci.swift.org/job/swift-PR-Linux/20613/console

/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-release/5.3/llvm-project/lldb/test/API/lang/swift/bridged_metatype/main.swift:1:8: error: missing required module 'Dispatch'

@akyrtzi akyrtzi merged commit 03e4f05 into swiftlang:release/5.3 May 5, 2020
@rintaro rintaro deleted the 5.3-sourcekit-completion-invalidtyperelation-rdar57726512 branch May 6, 2020 00:10
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants