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-15374] Key paths cannot refer to static member #57696

Open
groue opened this issue Oct 22, 2021 · 0 comments
Open

[SR-15374] Key paths cannot refer to static member #57696

groue opened this issue Oct 22, 2021 · 0 comments
Labels
compiler The Swift compiler in itself improvement

Comments

@groue
Copy link

groue commented Oct 22, 2021

Previous ID SR-15374
Radar None
Original Reporter @groue
Type Improvement
Additional Detail from JIRA
Votes 30
Component/s Compiler
Labels Improvement
Assignee None
Priority Medium

md5: 58f9811cbdf40b0c4d547b00b68b6606

Issue Description:

Hello,

The current Swift 5.5 version can not deal with key paths to static members.

struct S {
    static let member = 12
}

// Compiler error: Key path cannot refer to static member
let kp = \S.Type.member

Some users are asking for this feature. See for example https://forums.swift.org/t/key-path-cannot-refer-to-static-member/28055

But those users are not able to write a Swift Evolution proposal and submit a working implementation, because these are very hard tasks.

So those users are stuck with a reasonable feature request, but no solution.

Please help us, thank you.

@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
compiler The Swift compiler in itself improvement
Projects
None yet
Development

No branches or pull requests

1 participant