You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
one would think that with Swift's goals of safety this would be caught at the struct implementation and not leak implementation to the user of the object.
1) not allow overloading calls that have a default protocol implementation
2) call the overloaded in all cases
3) keep current behavior but have some required keyword stating it won't always be called similar to override to at least inform the programmer that the behavior might not be what they expect.
The text was updated successfully, but these errors were encountered:
Environment
Swift 2.1
Additional Detail from JIRA
md5: 9cc2494212f9a6ffebd0d8c1a93b8862
relates to:
Issue Description:
Problem
Invoking protocol function in a conforming type instance when there are both declaration and default implementation of that function in the protocol:
However, when there is only default implementation of that function:
As you can see, the overriding behaviour is not consistent in the above two cases.
This can also cause ambiguous types if two protocols implement the same method, maybe that should be a different bug but here is a code example
one would think that with Swift's goals of safety this would be caught at the struct implementation and not leak implementation to the user of the object.
This blog post goes into the full details http://nomothetis.svbtle.com/the-ghost-of-swift-bugs-future
This seems very error prone.
Potential Solutions
1) not allow overloading calls that have a default protocol implementation
2) call the overloaded in all cases
3) keep current behavior but have some required keyword stating it won't always be called similar to override to at least inform the programmer that the behavior might not be what they expect.
The text was updated successfully, but these errors were encountered: