@@ -775,7 +775,7 @@ class NodePrinter {
775
775
776
776
void printFunctionType (NodePointer LabelList, NodePointer node,
777
777
unsigned depth) {
778
- if (node->getNumChildren () < 2 || node-> getNumChildren () > 6 ) {
778
+ if (node->getNumChildren () < 2 ) {
779
779
setInvalid ();
780
780
return ;
781
781
}
@@ -814,9 +814,14 @@ class NodePrinter {
814
814
assert (false && " Unhandled function type in printFunctionType!" );
815
815
}
816
816
817
+ unsigned argIndex = node->getNumChildren () - 2 ;
817
818
unsigned startIndex = 0 ;
818
819
bool isSendable = false , isAsync = false , isThrows = false ;
819
820
auto diffKind = MangledDifferentiabilityKind::NonDifferentiable;
821
+ if (node->getChild (startIndex)->getKind () == Node::Kind::ClangType) {
822
+ // handled earlier
823
+ ++startIndex;
824
+ }
820
825
if (node->getChild (startIndex)->getKind () ==
821
826
Node::Kind::GlobalActorFunctionType) {
822
827
print (node->getChild (startIndex), depth + 1 );
@@ -828,10 +833,6 @@ class NodePrinter {
828
833
(MangledDifferentiabilityKind)node->getChild (startIndex)->getIndex ();
829
834
++startIndex;
830
835
}
831
- if (node->getChild (startIndex)->getKind () == Node::Kind::ClangType) {
832
- // handled earlier
833
- ++startIndex;
834
- }
835
836
if (node->getChild (startIndex)->getKind () == Node::Kind::ThrowsAnnotation) {
836
837
++startIndex;
837
838
isThrows = true ;
@@ -866,7 +867,7 @@ class NodePrinter {
866
867
if (isSendable)
867
868
Printer << " @Sendable " ;
868
869
869
- printFunctionParameters (LabelList, node->getChild (startIndex ), depth,
870
+ printFunctionParameters (LabelList, node->getChild (argIndex ), depth,
870
871
Options.ShowFunctionArgumentTypes );
871
872
872
873
if (!Options.ShowFunctionArgumentTypes )
@@ -878,7 +879,7 @@ class NodePrinter {
878
879
if (isThrows)
879
880
Printer << " throws" ;
880
881
881
- print (node->getChild (startIndex + 1 ), depth + 1 );
882
+ print (node->getChild (argIndex + 1 ), depth + 1 );
882
883
}
883
884
884
885
void printImplFunctionType (NodePointer fn, unsigned depth) {
0 commit comments