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-2119] Protocol methods of superclass should be treated as superclass API in subclasses #44727

Closed
an0 mannequin opened this issue Jul 19, 2016 · 0 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@an0
Copy link
Mannequin

an0 mannequin commented Jul 19, 2016

Previous ID SR-2119
Radar None
Original Reporter @an0
Type Bug
Status Resolved
Resolution Duplicate
Environment

Swift 3 in Xcode 8.0 beta 3

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 6ccb97ed31171e7abf704a2cb03475e4

duplicates:

  • SR-103 Protocol Extension: function's implementation cannot be overridden by a subclass

Issue Description:

Compiler reports this error for `Bar.f` overriding `Foo.f`(offered by default implementation in `P` extension):

error: method does not override any method from its superclass

protocol P {
    func f()
}

extension P {
    func f() {}
}

class Foo: P {
//    func f() {}
}

class Bar: Foo {
    // Why no `override`? From what `Bar` sees its superclass `Foo` implements `P`'s interface, whether with explicit implementation of `f` in itself or borrowed implementation of `f` from `P`'s extension. Uncomment Foo.f() to see the contradictory behavior.
    override func f() {}
}
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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
Projects
None yet
Development

No branches or pull requests

0 participants