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-13140] Impossible to get cursorinfo for trailing closure initializer #55587

Open
keith opened this issue Jul 4, 2020 · 1 comment
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@keith
Copy link
Collaborator

keith commented Jul 4, 2020

Previous ID SR-13140
Radar None
Original Reporter @keith
Type Bug
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: 3494dc5327d386a047c0324b7c1cd15b

Issue Description:

With this code:

extension String {
    init(foo: () -> Void) {
        self = ""
    }
}

_ = String {}

There is no offset you can use with the cursorinfo request to get the call to init(foo: ). You only get the type from any indexes of `String`, and nothing from `{}`

Related: https://bugs.swift.org/browse/SR-13120

@keith
Copy link
Collaborator Author

keith commented Dec 11, 2020

There's actually another case of this that isn't as crazy where the same happens if you omit the argument label:

init(_ foo: String) {}

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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.
Projects
None yet
Development

No branches or pull requests

1 participant