-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Dynamic member lookup fails to autocomplete sendable key path #77035
Comments
@xedin Another key path sendability bug... |
cc @ahoppen, this might be a code completion issue since the signature of dynamic member subscript is allowed to provide Re: |
Yes, it’s indeed a code completion issue. Removing |
There are a few compiler bugs that prevent us from declaring sendability for key paths where it's needed. First, doing so breaks autocomplete, which really hurts the developer experience: swiftlang/swift#77035 Second, even though recovering autocomplete might be preferable at the cost of safety, there is no safety to begin with right now because sendable diagnostics don't propagate through dynamic member lookup: swiftlang/swift#77105 Because of this, let's only use non-sendable key paths for now, and force cast them under the hood.
There are a few compiler bugs that prevent us from declaring sendability for key paths where it's needed. First, doing so breaks autocomplete, which really hurts the developer experience: swiftlang/swift#77035 Second, even though recovering autocomplete might be preferable at the cost of safety, there is no safety to begin with right now because sendable diagnostics don't propagate through dynamic member lookup: swiftlang/swift#77105 Because of this, let's only use non-sendable key paths for now, and force cast them under the hood.
There are a few compiler bugs that prevent us from declaring sendability for key paths where it's needed. First, doing so breaks autocomplete, which really hurts the developer experience: swiftlang/swift#77035 Second, even though recovering autocomplete might be preferable at the cost of safety, there is no safety to begin with right now because sendable diagnostics don't propagate through dynamic member lookup: swiftlang/swift#77105 Because of this, let's only use non-sendable key paths for now, and force cast them under the hood.
* Avoid sendable key paths in dynamic member lookup There are a few compiler bugs that prevent us from declaring sendability for key paths where it's needed. First, doing so breaks autocomplete, which really hurts the developer experience: swiftlang/swift#77035 Second, even though recovering autocomplete might be preferable at the cost of safety, there is no safety to begin with right now because sendable diagnostics don't propagate through dynamic member lookup: swiftlang/swift#77105 Because of this, let's only use non-sendable key paths for now, and force cast them under the hood. * fix
Description
If a type with dynamic member lookup is constrained to sendable key paths, then the compiler fails to show autocomplete for the members.
Reproduction
Expected behavior
I expect autocomplete to show the members.
Related bug: I can add an unavailable overload for non-sendable key paths, and it restores autocomplete, but it also allows such accesses to compile even though they should be unavailable:
Environment
swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
Target: arm64-apple-macosx15.0
Additional information
No response
The text was updated successfully, but these errors were encountered: