Template error in FTokenizedMessage::AddText when more than one argument is provided.

There is an error in the definition of the template `FTokenizedMessage::AddText` method. The method should be expanding the argument parameter pack into each individual call of the `Forward` method, but instead expands the parameter pack into a single call to the `Forward` method.

The fix is to move the parameter pack expansion so it becomes individual `Forward` method calls. I’m posting here in the hopes that this can be added to one of the upcoming engine releases.

// Current:
return AddText(FText::FormatOrdered(InTextFormat, Forward<TArguments...>(InArgs...)));

// Proposed Fix:
return AddText(FText::FormatOrdered(InTextFormat, Forward<TArguments>(InArgs)...));


[Attachment Removed]

Steps to Reproduce
This code snippet can be added anywhere to reproduce the problem. This method looks like it’s well-constructed, but it will not compile.

#include "Logging/MessageLog.h"

void MultipleTemplateArguments(FMessageLog& Output)
{
    static const FTextFormat Format = INVTEXT("First Argument: {0}. Second Argument: {1}");
    Output.Info()->AddText(Format, INVTEXT("First"), INVTEXT("Second"));
}

[Attachment Removed]

Hi,

Good catch, thanks for reporting that. I’ve checked in the fix at CL#58038289.

Best,

Cody

[Attachment Removed]