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-11174] Protocols should allow constants #53571

Open
swift-ci opened this issue Jul 22, 2019 · 4 comments
Open

[SR-11174] Protocols should allow constants #53571

swift-ci opened this issue Jul 22, 2019 · 4 comments
Labels
compiler The Swift compiler in itself feature A feature request or implementation improvement

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-11174
Radar None
Original Reporter ColinRoache (JIRA User)
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, LanguageFeatureRequest
Assignee None
Priority Medium

md5: b10bcaf85d0a621527517f80bf2cbfc4

Issue Description:

Protocols currently support functions and variables. The use of a let in a protocol leads to LLVM suggesting use of a var with a get, however this is not equivalent. A synthetic variable with a getter can change over time whereas a let cannot, and each has different implications. This restrictions feels like leftovers from Objective-C protocols.

It would be useful to allow constants in protocols!

@belkadan
Copy link
Contributor

This would have to go through the Swift Evolution Process.

@belkadan
Copy link
Contributor

You should be able to sign up just with email. (My account's an email-only account.)

@belkadan
Copy link
Contributor

You should be able to sign up [for the forums or for Jira] with just email.

@belkadan
Copy link
Contributor

…unless by "suggestion" you mean "pull request", in which case "no, but sure, one of us can do it on your behalf, as long as it's a one-off thing".

@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 feature A feature request or implementation improvement
Projects
None yet
Development

No branches or pull requests

2 participants