@@ -3617,6 +3617,17 @@ std::string Demangle::keyPathSourceString(const char *MangledName,
36173617 return argumentTypeNames[i];
36183618 return std::string (" <unknown>" );
36193619 };
3620+ auto getArgumentNodeName = [](NodePointer node) {
3621+ if (node->getKind () == Node::Kind::Identifier) {
3622+ return std::string (node->getText ());
3623+ }
3624+ if (node->getKind () == Node::Kind::LocalDeclName) {
3625+ auto text = node->getChild (1 )->getText ();
3626+ auto index = node->getChild (0 )->getIndex () + 1 ;
3627+ return std::string (text) + " #" + std::to_string (index);
3628+ }
3629+ return std::string (" <unknown>" );
3630+ };
36203631 // Multiple arguments case
36213632 NodePointer argList = matchSequenceOfKinds (
36223633 child, {
@@ -3635,11 +3646,8 @@ std::string Demangle::keyPathSourceString(const char *MangledName,
36353646 if (argumentType->getKind () == Node::Kind::TupleElement) {
36363647 argumentType =
36373648 argumentType->getChild (0 )->getChild (0 )->getChild (1 );
3638- if (argumentType->getKind () == Node::Kind::Identifier) {
3639- argumentTypeNames.push_back (
3640- std::string (argumentType->getText ()));
3641- continue ;
3642- }
3649+ argumentTypeNames.push_back (getArgumentNodeName (argumentType));
3650+ continue ;
36433651 }
36443652 argumentTypeNames.push_back (" <Unknown>" );
36453653 }
@@ -3654,7 +3662,7 @@ std::string Demangle::keyPathSourceString(const char *MangledName,
36543662 });
36553663 if (argList != nullptr ) {
36563664 argumentTypeNames.push_back (
3657- std::string (argList->getChild (0 )->getChild (1 )-> getText ( )));
3665+ getArgumentNodeName (argList->getChild (0 )->getChild (1 )));
36583666 }
36593667 }
36603668 child = child->getChild (1 );
0 commit comments