# Default Protocol Implementation Inheritance Behaviour - The current situation and what/if anything should be done about it

**URL:** <https://forums.swift.org/t/default-protocol-implementation-inheritance-behaviour-the-current-situation-and-what-if-anything-should-be-done-about-it/28049>\
**Category:** Discussion\
**Tags:** inheritance, protocols\
**Created:** [August 20, 2019, 11:33am UTC](https://forums.swift.org/t/default-protocol-implementation-inheritance-behaviour-the-current-situation-and-what-if-anything-should-be-done-about-it/28049 "2019-08-20T11:33:59Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![Avi](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/avi/32/2962_2.png) [@Avi](https://forums.swift.org/u/Avi)\
**Post date:** [August 20, 2019, 4:01pm UTC](https://forums.swift.org/t/default-protocol-implementation-inheritance-behaviour-the-current-situation-and-what-if-anything-should-be-done-about-it/28049/21 "2019-08-20T16:01:25Z")

</div>

I think that sums up this thread quite well.

---

<div class="post-metadata">

**Author:** ![Paul\_Cantrell](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/paul_cantrell/32/16764_2.png) [@Paul\_Cantrell](https://forums.swift.org/u/Paul_Cantrell)\
**Post date:** [August 20, 2019, 4:18pm UTC](https://forums.swift.org/t/default-protocol-implementation-inheritance-behaviour-the-current-situation-and-what-if-anything-should-be-done-about-it/28049/22 "2019-08-20T16:18:20Z")

</div>

As with all issues in this [Ghost of Swift Bugs Future](https://nomothetis.svbtle.com/the-ghost-of-swift-bugs-future) family, I wonder if a more complete set of compiler warnings about (possibly unintended) shadowing might help here.

---

<div class="post-metadata">

**Author:** ![dlbuckley](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dlbuckley/32/14986_2.png) [@dlbuckley](https://forums.swift.org/u/dlbuckley)\
**Post date:** [August 30, 2019, 7:46am UTC](https://forums.swift.org/t/default-protocol-implementation-inheritance-behaviour-the-current-situation-and-what-if-anything-should-be-done-about-it/28049/23 "2019-08-30T07:46:12Z")

</div>

> [@gwendal.roue](#):
>
> Yes, precisely. The contract "protocol requirement implies dynamic dispatch" is broken by the super class. So either the contract was inexistent (a wrong assumption), either there is a bug in the implementation of the contract.

It would be good to know which of these is the case. I don't know the right person to to ask for specific feedback in this particular case. Maybe @ben-cohen could shed some light? (Sorry if you aren't the right person to be tagging here Ben).

> [@Paul\_Cantrell](#):
>
> As with all issues in this [Ghost of Swift Bugs Future](https://nomothetis.svbtle.com/the-ghost-of-swift-bugs-future) family, I wonder if a more complete set of compiler warnings about (possibly unintended) shadowing might help here.

The problem with adding a warning here is what would you actually add the warning for? I guess the unexpected case that's been highlighted above would make the most sense, but then we don't really have warnings to indicate strange behaviours in the language anywhere else (that I'm aware of). If we start adding warnings for '_unexpected behaviours_' then the question will probably be raised as to why the logic wasn't simply changed to a more expected behaviour.

[Previous page](https://forums.swift.org/t/default-protocol-implementation-inheritance-behaviour-the-current-situation-and-what-if-anything-should-be-done-about-it/28049.md?page=1)
