Unfortunately, in Swift, even if you declare a protocol inheriting some other protocol, the protocol you declared does not conform to the other protocol. In your case, your protocol TelegramId does inherit Encodable, but does NOT conform to Encodable. You need to specify a type conforming to Encodable, but your TelegramId does not. You may need to implement encode(to:) of Message by yourself. Or else you need to use some other type conforming to Encodable.
Topic:
Programming Languages
SubTopic:
Swift
Tags: