@@ -183,6 +183,14 @@ class ImplFunctionParam {
183
183
return {};
184
184
}
185
185
186
+ static OptionsType getSending () {
187
+ OptionsType result;
188
+
189
+ result |= ImplParameterInfoFlags::Sending;
190
+
191
+ return result;
192
+ }
193
+
186
194
ImplFunctionParam (BuiltType type, ImplParameterConvention convention,
187
195
OptionsType options)
188
196
: Type(type), Convention(convention), Options(options) {}
@@ -256,6 +264,12 @@ class ImplFunctionResult {
256
264
return {};
257
265
}
258
266
267
+ static OptionsType getSending () {
268
+ OptionsType result;
269
+ result |= ImplResultInfoFlags::IsSending;
270
+ return result;
271
+ }
272
+
259
273
ImplFunctionResult (BuiltType type, ImplResultConvention convention,
260
274
ImplResultInfoOptions options = {})
261
275
: Type(type), Convention(convention), Options(options) {}
@@ -1594,8 +1608,9 @@ class TypeDecoder {
1594
1608
if (depth > TypeDecoder::MaxDepth)
1595
1609
return true ;
1596
1610
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 )
1599
1614
return true ;
1600
1615
1601
1616
auto *conventionNode = node->getChild (0 );
@@ -1613,7 +1628,7 @@ class TypeDecoder {
1613
1628
return true ;
1614
1629
1615
1630
typename T::OptionsType options;
1616
- if (node->getNumChildren () == 3 ) {
1631
+ if (node->getNumChildren () == 3 || node-> getNumChildren () == 4 ) {
1617
1632
auto diffKindNode = node->getChild (1 );
1618
1633
if (diffKindNode->getKind () !=
1619
1634
Node::Kind::ImplParameterResultDifferentiability)
@@ -1625,6 +1640,13 @@ class TypeDecoder {
1625
1640
options |= *optDiffOptions;
1626
1641
}
1627
1642
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
+
1628
1650
results.emplace_back (result.getType (), *convention, options);
1629
1651
1630
1652
return false ;
0 commit comments