Well as it's right now there is no way to allow conditional conformances directly from the type declaration, and I'm not trying to say that we ever should, but just noting this fact. If we ever would want that feature then the reused where
clause for constraints would become ambiguous.
Here is some bikeshedding code:
struct Generic<T> : Codable where T : Codable constraints T : Hashable { ... }
The only requirement for T
is to conform to Hashable
while there is also a included conditional conformance.
Again that's just a few thoughts I had, not a pitch, just wanted to ask what others might think of it. ;)