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
This is some sort of limitation as often happens that a default implementation is providing a major part of implementation and only one, simple line is changed in actual struct implementation. If you're using classes you can achieve this by creating a base class and calling a method on super. If you consider structs, there's no such possibility and you always have to write a whole implementation from scratch in each structure which conforms to the protocol.
You can use composition by creating nested structure, but it's neither logical nor clean... It's rather a hack...
Additional Detail from JIRA
md5: 222f3e1dbdbb54005302e8c206e80dfb
relates to:
Issue Description:
If you define a simple protocol like:
And than you provide a default implementation for testPrint() method in protocol extensions like:
You aren't allowed to call the fault implementation from the structure eg.
This is some sort of limitation as often happens that a default implementation is providing a major part of implementation and only one, simple line is changed in actual struct implementation. If you're using classes you can achieve this by creating a base class and calling a method on super. If you consider structs, there's no such possibility and you always have to write a whole implementation from scratch in each structure which conforms to the protocol.
You can use composition by creating nested structure, but it's neither logical nor clean... It's rather a hack...
The text was updated successfully, but these errors were encountered: