mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
We currently permit (but warn on) coercions of collections with unrelated element types in certain cases. This is done in an effort to preserve compatibility with pre-5.3 compilers that may have allowed such code to compile due to dropping constraints while solving. This is limited to collection coercions as we emit somewhat reasonable code for them that performs a force cast of the elements at runtime. However, it turns out that in the case of collection literals, we peephole the element conversions in CSApply, leading to codegen crashes. As such, narrow down the condition of this compatibility logic to not apply to collection literals, as this never would have compiled properly. rdar://88334481
496 KiB
496 KiB