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
public protocol ClusterSingleton {
func activateSingleton() async
// ...
}
extension ClusterSingleton {
public func activateSingleton() async {
// nothing by default
}
// ...
}
the methods are listed as:
I'm wondering if the wording isn't rather sub-optimal here...
The strong required makes it look like the implementation HAS TO provide an implementation, but in fact, it does not have to -- since the default impl is provided, making his requirement optional to implement.
In Swift, all protocol requirements are "required", but it depends if they have an default impl or not if we have to implement them or not...
Checklist
If possible, I've reproduced the issue using the main branch of this package.
Consider omitting the Required. bold wording from such protocol requirements when a default impl is found?
This might be more complex when the extension has where clauses, then probably ok to keep this as Required, but when the extension is always applied, such requirements can be seen as optional to implement.
Actual behavior
All requirements always get the bold Required. marker
Steps To Reproduce
No response
Swift-DocC-Render Version Information
5.7
The text was updated successfully, but these errors were encountered:
I agree the wording can be a little confusing for this specific scenario, even though it is technically correct—it is still required but the API itself has met that requirement with its default implementation and not strictly necessary for client code to provide their own implementation. I think it could be argued that the text could be dropped here as you point out.
Your note about the complexity of the scenario with where clauses has me wondering if the renderer could even special case something like this though since it wouldn't necessarily have details about that kind of information without parsing the declaration text.
Description
Given a protocol like
the methods are listed as:
I'm wondering if the wording isn't rather sub-optimal here...
The strong required makes it look like the implementation HAS TO provide an implementation, but in fact, it does not have to -- since the default impl is provided, making his requirement optional to implement.
In Swift, all protocol requirements are "required", but it depends if they have an default impl or not if we have to implement them or not...
Checklist
main
branch of this package.Expected Behavior
Consider omitting the Required. bold wording from such protocol requirements when a default impl is found?
This might be more complex when the
extension
has where clauses, then probably ok to keep this as Required, but when the extension is always applied, such requirements can be seen as optional to implement.Actual behavior
All requirements always get the bold Required. marker
Steps To Reproduce
No response
Swift-DocC-Render Version Information
5.7
The text was updated successfully, but these errors were encountered: