Add sending to subscript sending result#79560
Conversation
|
LGTM but @gottesmm should take a look as well! |
|
@swift-ci please test |
|
Is there any additional action required from me? |
|
I don't think there is anything for you to do. I'll ping @gottesmm about this again. |
|
|
||
| // CHECK: sil hidden [ossa] @$s17sending_subscript1SVyAA16NonSendableKlassCAEncig : $@convention(method) (@sil_sending @owned NonSendableKlass, S) -> @sil_sending @owned NonSendableKlass { | ||
| struct S { | ||
| subscript(_: sending NonSendableKlass) -> sending NonSendableKlass { NonSendableKlass() } |
There was a problem hiding this comment.
Can you add a test case with multiple results. IIRC there was some sort of code I put in that forced all result types to also need to have sending result as well. The idea is that with time, top level sending result means all results have sending results... but once we support sending on specific results, then we allow for functions not to set the top level sending result flag and vary that specific sending result flag on results. I at least want some more test cases with a tuple result. Let me see if I can find the code in question.
There was a problem hiding this comment.
Actually, now that I think about it... that property is actually something at the SIL level. Not something at the AST level where we just IIRC represent results with a type instead of using ResultInfo sort of things. Can you just out of an abundance of caution add a subscript with a tuple result test case.
|
@swift-ci please test |
|
The Windows test failed. Do we need special handling for Windows? |
|
@swift-ci please test Windows platform |
1 similar comment
|
@swift-ci please test Windows platform |
Resolves #79559
When the
sendingis applied to the return type in a subscript and SIL is emitted, thesendingdisappears from the output.Here's an example to demonstrate this behavior:
The SIL output(the result of
emit-silgen) shows :Note that while the parameter retains its
sendingin the SIL output, the return type'ssendingis missing.