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-6883] Bad completion for NSObject.self() #49432

Closed
NachoSoto opened this issue Jan 31, 2018 · 5 comments
Closed

[SR-6883] Bad completion for NSObject.self() #49432

NachoSoto opened this issue Jan 31, 2018 · 5 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@NachoSoto
Copy link
Contributor

Previous ID SR-6883
Radar rdar://problem/17203459
Original Reporter @NachoSoto
Type Bug

Attachment: Download

Environment

Xcode 9.2 (9C40b)
Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)

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

md5: 1605e6ce9e5e316e6c122dbceec8f8eb

Issue Description:

Consider this code:

final class A: NSObject {}

let a = A()

When typing a.self, Xcode autocompletes that to a.self(), which fails to compile:

@belkadan
Copy link
Contributor

The comments in rdar://problem/17203459 say that we were planning to blacklist this method from the importer but never got around to it.

@belkadan
Copy link
Contributor

belkadan commented Feb 1, 2018

Talking to people within Apple to see if that's still the best option.

@AnthonyLatsis
Copy link
Collaborator

@belkadan Would it be OK to resolve this together with https://bugs.swift.org/browse/SR-943 once it's merged?

On the other hand, the issue it half solved: we have a self completion, but still have the self() too.

@belkadan
Copy link
Contributor

I think we'd prefer an SDK-side solution for this at this point.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis removed the type checker Area → compiler: Semantic analysis label Dec 13, 2022
@AnthonyLatsis
Copy link
Collaborator

Confirmed this is fixed in at least Swift 5.5.2 (Xcode 13.2.1).

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

No branches or pull requests

3 participants