IMHO, there is a very subtle difference between :
protocol Toggling : Equatable
{
…
}
extension Toggling
{
…
}
… and :
protocol Toggling
{
…
}
extension Toggling where Self : Equatable
{
…
}
The first says that any type that implements Toggling also implements Equatable.
The second says that an implementing type can be Toggling without necessarily
having to be Equatable.
Either way around, you are providing a default implementation for toggled() and
toggle(), but, with the first version, toggled requires that Self is also
Equatable.
Therefore, you are saying that, because the default implementation of Toggling
demands that Self is Equatable, you have to also state that everything that is
Toggling is also Equatable.
Since :
protocol Toggling where Self : Equatable
… is functionally identical to :
protocol Toggling : Equatable
… why would you want to use a more verbose way of saying the same thing ?
I would venture to suggest that there is no need for the longer syntax and that
your bug report is not necessary
:-)
Joanna
--
Joanna Carter
Carter Consulting
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users