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-6220] Optional promotion when conforming to protocol #48772

Closed
NachoSoto opened this issue Oct 25, 2017 · 0 comments
Closed

[SR-6220] Optional promotion when conforming to protocol #48772

NachoSoto opened this issue Oct 25, 2017 · 0 comments
Labels
compiler The Swift compiler in itself conformances Feature → protocol: protocol conformances duplicate Resolution: Duplicates another issue feature A feature request or implementation improvement protocol Feature → type declarations: Protocol declarations type checker Area → compiler: Semantic analysis

Comments

@NachoSoto
Copy link
Contributor

NachoSoto commented Oct 25, 2017

Previous ID SR-6220
Radar None
Original Reporter @NachoSoto
Type Improvement
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement
Assignee None
Priority Medium

md5: d24c5a23d286cac2400b7421dc2fef35

duplicates:

  • SR-522 Protocol funcs cannot have covariant returns

Issue Description:

I was expecting this to work:

protocol IntConvertible {
    init?(int: Int)

    var int: Int? { get }
}

struct S {
    let int: Int
}

extension S: IntConvertible {}

S already has an init(int: Int) and a var int: Int { get } that could be used as implementations for IntConvertible.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added duplicate Resolution: Duplicates another issue feature A feature request or implementation conformances Feature → protocol: protocol conformances protocol Feature → type declarations: Protocol declarations type checker Area → compiler: Semantic analysis labels Jan 27, 2023
This issue was closed.
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 conformances Feature → protocol: protocol conformances duplicate Resolution: Duplicates another issue feature A feature request or implementation improvement protocol Feature → type declarations: Protocol declarations type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants