@@ -3626,6 +3626,17 @@ std::string Demangle::keyPathSourceString(const char *MangledName,
36263626 return argumentTypeNames[i];
36273627 return std::string (" <unknown>" );
36283628 };
3629+ auto getArgumentNodeName = [](NodePointer node) {
3630+ if (node->getKind () == Node::Kind::Identifier) {
3631+ return std::string (node->getText ());
3632+ }
3633+ if (node->getKind () == Node::Kind::LocalDeclName) {
3634+ auto text = node->getChild (1 )->getText ();
3635+ auto index = node->getChild (0 )->getIndex () + 1 ;
3636+ return std::string (text) + " #" + std::to_string (index);
3637+ }
3638+ return std::string (" <unknown>" );
3639+ };
36293640 // Multiple arguments case
36303641 NodePointer argList = matchSequenceOfKinds (
36313642 child, {
@@ -3644,11 +3655,8 @@ std::string Demangle::keyPathSourceString(const char *MangledName,
36443655 if (argumentType->getKind () == Node::Kind::TupleElement) {
36453656 argumentType =
36463657 argumentType->getChild (0 )->getChild (0 )->getChild (1 );
3647- if (argumentType->getKind () == Node::Kind::Identifier) {
3648- argumentTypeNames.push_back (
3649- std::string (argumentType->getText ()));
3650- continue ;
3651- }
3658+ argumentTypeNames.push_back (getArgumentNodeName (argumentType));
3659+ continue ;
36523660 }
36533661 argumentTypeNames.push_back (" <Unknown>" );
36543662 }
@@ -3663,7 +3671,7 @@ std::string Demangle::keyPathSourceString(const char *MangledName,
36633671 });
36643672 if (argList != nullptr ) {
36653673 argumentTypeNames.push_back (
3666- std::string (argList->getChild (0 )->getChild (1 )-> getText ( )));
3674+ getArgumentNodeName (argList->getChild (0 )->getChild (1 )));
36673675 }
36683676 }
36693677 child = child->getChild (1 );
0 commit comments