I can't figure out how to make the compiler happy when trying to express something like this:
public protocol ChangesetApplying: class {
associatedtype T
func apply(changeset: Changeset<T>)
}
The above will complain that Type 'Self.T' does not conform to protocol 'Collection'.
Changing it to associatedtype T: Collection yields a different error: Type 'Self.T.Iterator.Element' does not conform to protocol 'Equatable'.
Changing it to associatedtype T: Collection where T.Iterator.Element: Equatable, T.IndexDistance == Int yields the error 'where' clause cannot be attached to an associated type declaration, which appears to be the subject of SE-0142.
Any ideas?
I can't figure out how to make the compiler happy when trying to express something like this:
The above will complain that Type 'Self.T' does not conform to protocol 'Collection'.
Changing it to
associatedtype T: Collectionyields a different error: Type 'Self.T.Iterator.Element' does not conform to protocol 'Equatable'.Changing it to
associatedtype T: Collection where T.Iterator.Element: Equatable, T.IndexDistance == Intyields the error 'where' clause cannot be attached to an associated type declaration, which appears to be the subject of SE-0142.Any ideas?