@@ -177,6 +177,14 @@ class ImplFunctionParam {
177
177
return {};
178
178
}
179
179
180
+ static OptionsType getSending () {
181
+ OptionsType result;
182
+
183
+ result |= ImplParameterInfoFlags::Sending;
184
+
185
+ return result;
186
+ }
187
+
180
188
ImplFunctionParam (BuiltType type, ImplParameterConvention convention,
181
189
OptionsType options)
182
190
: Type(type), Convention(convention), Options(options) {}
@@ -247,6 +255,12 @@ class ImplFunctionResult {
247
255
return {};
248
256
}
249
257
258
+ static OptionsType getSending () {
259
+ OptionsType result;
260
+ result |= ImplResultInfoFlags::IsSending;
261
+ return result;
262
+ }
263
+
250
264
ImplFunctionResult (BuiltType type, ImplResultConvention convention,
251
265
ImplResultInfoOptions options = {})
252
266
: Type(type), Convention(convention), Options(options) {}
@@ -1571,8 +1585,9 @@ class TypeDecoder {
1571
1585
if (depth > TypeDecoder::MaxDepth)
1572
1586
return true ;
1573
1587
1574
- // Children: `convention, differentiability?, type`
1575
- if (node->getNumChildren () != 2 && node->getNumChildren () != 3 )
1588
+ // Children: `convention, differentiability?, sending?, type`
1589
+ if (node->getNumChildren () != 2 && node->getNumChildren () != 3 &&
1590
+ node->getNumChildren () != 4 )
1576
1591
return true ;
1577
1592
1578
1593
auto *conventionNode = node->getChild (0 );
@@ -1590,7 +1605,7 @@ class TypeDecoder {
1590
1605
return true ;
1591
1606
1592
1607
typename T::OptionsType options;
1593
- if (node->getNumChildren () == 3 ) {
1608
+ if (node->getNumChildren () == 3 || node-> getNumChildren () == 4 ) {
1594
1609
auto diffKindNode = node->getChild (1 );
1595
1610
if (diffKindNode->getKind () !=
1596
1611
Node::Kind::ImplParameterResultDifferentiability)
@@ -1602,6 +1617,13 @@ class TypeDecoder {
1602
1617
options |= *optDiffOptions;
1603
1618
}
1604
1619
1620
+ if (node->getNumChildren () == 4 ) {
1621
+ auto sendingKindNode = node->getChild (2 );
1622
+ if (sendingKindNode->getKind () != Node::Kind::ImplParameterSending)
1623
+ return true ;
1624
+ options |= T::getSending ();
1625
+ }
1626
+
1605
1627
results.emplace_back (result.getType (), *convention, options);
1606
1628
1607
1629
return false ;
0 commit comments