I finally got to dig into experimenting with @_implements this week. It looks like it's still not quite doing what we need it to do to support the comparable changes that we'd like to make.
I refined the attr_implements_fp.swift test case to exercise the behavior that we want to achieve. The key distinction is that we need the switchover from one behavior to the other to occur at an intermediate protocol, rather than only on the base concrete types.
i.e., we want to get one behavior when constrained to Comparable, and the other when constrained to some intermediate protocol, as well as the concrete types. With the current implementation, it only seems possible to have divergent behavior on the concrete types themselves.
It may be that I'm simply missing a cleverer way to achieve this; feel free to tell me so.
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 2c1b9edcfc10c07c2c2e04e9ff873870Issue Description:
I finally got to dig into experimenting with @_implements this week. It looks like it's still not quite doing what we need it to do to support the comparable changes that we'd like to make.
I refined the attr_implements_fp.swift test case to exercise the behavior that we want to achieve. The key distinction is that we need the switchover from one behavior to the other to occur at an intermediate protocol, rather than only on the base concrete types.
i.e., we want to get one behavior when constrained to Comparable, and the other when constrained to some intermediate protocol, as well as the concrete types. With the current implementation, it only seems possible to have divergent behavior on the concrete types themselves.
It may be that I'm simply missing a cleverer way to achieve this; feel free to tell me so.
Revised test case on branch here: https://github.com/stephentyrone/swift/tree/implements