[SR-13296] Associated type inference through constraints on sibling associated type #55736
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Additional Detail from JIRA
md5: 73808fb6010e083ce8ab513b19743c6a
Issue Description:
After thinking about this and experimenting with it a bit more I realized that the real thing I'm requesting is even simpler to demonstrate:
Shouldn't the compiler be able to infer the type of Foo based on the implementation of C?
— ORIGINAL POST:
Imagine I have a protocol A:
I was hoping to be able to conform to it like this:
Is this manner of type inference supposed to work?
I understand that another approach in this case would be to remove B as an associated type and make it a typealias:
but this doesn't help me because in my real-world example the "sibling" associated type ("B") is actually inherited from the parent protocol, and must be satisfied. Here's a different version of my same request. I would like for this code to compile:
The text was updated successfully, but these errors were encountered: