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-10675] Cannot nest types inside protocol definitions. #53075

Open
Lukasa opened this issue May 13, 2019 · 1 comment
Open

[SR-10675] Cannot nest types inside protocol definitions. #53075

Lukasa opened this issue May 13, 2019 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself feature A feature request or implementation

Comments

@Lukasa
Copy link
Contributor

Lukasa commented May 13, 2019

Previous ID SR-10675
Radar rdar://problem/22591506
Original Reporter @Lukasa
Type Bug
Additional Detail from JIRA
Votes 2
Component/s Compiler
Labels Bug, LanguageFeatureRequest
Assignee None
Priority Medium

md5: ee99e81f57431f423d58b2c7021a728f

relates to:

  • SR-2968 It is not allowed to declare protocol nested into another declaration

Issue Description:

When defining a protocol it's not uncommon to want to define new types for parameters or return values of the protocol methods or properties. The natural thing to do seems to be to want to nest these inside the protocol definition, but this is not possible in Swift. This limitation forces you to write types with names that are mangled to indicate their relevance to the protocol, which is just not ideal.

@belkadan
Copy link
Contributor

Part of the concern here is whether it makes sense for the nested types to show up on all conforming types. This change would have to go through the Swift Evolution Process.

@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. compiler The Swift compiler in itself feature A feature request or implementation
Projects
None yet
Development

No branches or pull requests

2 participants