swift
99858205 - [rbi] Change how we process ref_element_addr to handle non-Sendable fields with different isolations than the parent class.

Commit
61 days ago
[rbi] Change how we process ref_element_addr to handle non-Sendable fields with different isolations than the parent class. Specifically, previously if we had a non-Sendable field in a non-Sendable parent class, we would perform an assign direct. This is not safe anymore since we are being much more stringent about mismerges. Instead, the correct thing to do is if the field has a differing explicit isolation (not its region isolation, but the isolation of the element) from its parent nominal type, we require the parent operand type and assign fresh the ref_element_addr. This ensures that they are in different regions and we do not have the same region with differing isolations within it. The reason why this is safe is that The field will be isolated to whatever actor isolation it has at the AST level. So any time we escape it or send it, we will properly get an error. Any other ref_element_addr to the same field will be a different region, but that doesn't matter since they all will still be isolated ot the same actor isolation meaning merges will not cause problems. I am going to be fixing a similar issue with structs but it is more complicated, so I thought I would fix this now.
Author
Parents
Loading