mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When determining which declaration context should own a particular protocol conformance that was not explicitly spelled out, prefer "synthesized" contexts (i.e., which is always the nominal type itself) for automatically-generated conformances (such as a raw-valued enum's conformance to RawRepresentable) to conformances that are "implied" by conformance to a more-refined protocol. Previously, we biased the other way---but because conformances due to more-refined protocols can be discovered later, we could get into a problem where two files disagreed on which context would own the conformance---and neither would emit the corresponding witness table. Biasing toward "synthesized" contexts, which are always trivially discoverable from the nominal type declaration itself, eliminates the issue. Fixes SR-6839 / rdar://problem/36911943.
26 KiB
26 KiB