如何在 swift 协议上设置约束以采用类型?

How to set a constraint on swift protocol for adopting type?

我需要在 swift 中制作一个多级分词器,为此我决定制作一个协议,要求该协议的采用者是一个字符序列。那样

protocol TokenProtocol where Self: Sequence, Self.Item == Character {
    //any token must consist of characters
    var characterRepresentation: [Character] { get }
    //but not all tokens may consist of multiple words 
    var wordRepresentaion: [String]? { get }
}

但是它引发了一个编译错误 'Item' is not a member type of 'Self' 我做错了吗?实现这个的最佳方法是什么?

Self.Item 替换为 Self.Element