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-2750] No code hint when using 'Then' in class scope #45354
Comments
Comment by Hannes Oud (JIRA) I created another issue with more cases of where it works and where it doesn't: https://bugs.swift.org/browse/SR-5051 |
@swift-ci create |
I cannot reproduce by Xcode 9B37. hannesoid (JIRA User), could you verify in the latest version of Xcode 9.1 beta and see if the issue reproduces? If it does, please attach the entire reproducing code base, since the root cause can be in the broader context. |
@nkcsgexi hannesoid (JIRA User) It may be already fixed. Take a look at the bottom of: devxoul/Then#14 |
ok, mark this as resolved for now. |
Comment by Suyeol Jeon (JIRA) @nkcsgexi I've found an interesting thing. It works without a type annotation and it doesn't work with a type annotation( Without type annotation With type annotation |
I can reproduce this issue. Simplified test case: We don't have code completion at <HERE>: public protocol Then {}
extension Then {
public func then(_ block: (Self) throws -> Void) rethrows -> Self {
return self
}
}
class C: Then {
init() {}
func foo() {}
}
class D {
let myView: C = C().then { $0.#HERE# }
} |
Comment by Austin Rude (JIRA) Just wanted to mention I get completions for `let` variables, but not for `lazy var` using Then. When this is worked on can we test that too - I didn't see it mentioned in either bug. |
I believe #22957 fixes this. |
Comment by doom (JIRA) this bug reproduce in Xcode 10.2. |
Yes, that fix did not make it into Swift 5. |
devxoul (JIRA User), Could you verify if the problem is fixed in the latest Xcode betas and if so move the JIRA to "Closed"? Thanks! |
Attachment: Download
Additional Detail from JIRA
md5: a8b1807307362d9e9f0f4df3d9f5d0e5
Issue Description:
xHello, I'm the author of the library Then. While using it, Xcode doesn't give any code hint in class scope. I attached the screen capture for understanding.
How to re-produce the bug
1. Open any
.swift
file. You can reproduce with Playground, too.2. Copy and paste the source code of Then: https://github.com/devxoul/Then/blob/master/Sources/Then.swift
3. Declare a class, and define a property using Then.
Class Scope
File Scope
The text was updated successfully, but these errors were encountered: