@@ -183,6 +183,14 @@ class ImplFunctionParam {
183183 return {};
184184 }
185185
186+ static OptionsType getSending () {
187+ OptionsType result;
188+
189+ result |= ImplParameterInfoFlags::Sending;
190+
191+ return result;
192+ }
193+
186194 ImplFunctionParam (BuiltType type, ImplParameterConvention convention,
187195 OptionsType options)
188196 : Type(type), Convention(convention), Options(options) {}
@@ -256,6 +264,12 @@ class ImplFunctionResult {
256264 return {};
257265 }
258266
267+ static OptionsType getSending () {
268+ OptionsType result;
269+ result |= ImplResultInfoFlags::IsSending;
270+ return result;
271+ }
272+
259273 ImplFunctionResult (BuiltType type, ImplResultConvention convention,
260274 ImplResultInfoOptions options = {})
261275 : Type(type), Convention(convention), Options(options) {}
@@ -1594,8 +1608,9 @@ class TypeDecoder {
15941608 if (depth > TypeDecoder::MaxDepth)
15951609 return true ;
15961610
1597- // Children: `convention, differentiability?, type`
1598- if (node->getNumChildren () != 2 && node->getNumChildren () != 3 )
1611+ // Children: `convention, differentiability?, sending?, type`
1612+ if (node->getNumChildren () != 2 && node->getNumChildren () != 3 &&
1613+ node->getNumChildren () != 4 )
15991614 return true ;
16001615
16011616 auto *conventionNode = node->getChild (0 );
@@ -1613,7 +1628,7 @@ class TypeDecoder {
16131628 return true ;
16141629
16151630 typename T::OptionsType options;
1616- if (node->getNumChildren () == 3 ) {
1631+ if (node->getNumChildren () == 3 || node-> getNumChildren () == 4 ) {
16171632 auto diffKindNode = node->getChild (1 );
16181633 if (diffKindNode->getKind () !=
16191634 Node::Kind::ImplParameterResultDifferentiability)
@@ -1625,6 +1640,13 @@ class TypeDecoder {
16251640 options |= *optDiffOptions;
16261641 }
16271642
1643+ if (node->getNumChildren () == 4 ) {
1644+ auto sendingKindNode = node->getChild (2 );
1645+ if (sendingKindNode->getKind () != Node::Kind::ImplParameterSending)
1646+ return true ;
1647+ options |= T::getSending ();
1648+ }
1649+
16281650 results.emplace_back (result.getType (), *convention, options);
16291651
16301652 return false ;
0 commit comments