[Verse] `ToDiagnostic()` breaks when being concatenated or formatted with extra strings

Summary

When using ToDiagnostic() in verse to debug values when working with verse, if we do any operations with the diagnostic values, such as addition with strings, concatenation with other diagnostics and so on, it breaks and does not output anything on the logs.

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

  1. Try to Print a diagnostic value that were formatted, example:
DiagnosticToPrint : diagnostic = "[DEBUG TEST] " + ToDiagnostic(SomeClass) + "\n\t" + "Value: " + ToDiagnostic(SomeClass.MyVariable)

Print(DiagnosticToPrint) # Silently fails, no error, but also no message printed on the logs at all (not even a blank message)

(Note: The strings and values being concatenated on the diagnostic above are just examples, the bug happens with anything, not only with these specific characters/usage)

Expected Result

The resulting diagnostic after the concatenation should be currectly formatted and printed on the logs

Observed Result

Nothing prints when using a concatenated diagnostic, not even a blank message entry on the logs - it just gets “ignored” entirely.

Platform(s)

All

Additional Notes

This issue only happens with concatenated diagnostics, it does not happen with singular ones, for example:

Test1 : diagnostic = ToDiagnostic(MyClass) # works

Test2 : diagnostic = ToDiagnostic(MyClass) + ToDiagnostic(OtherClass) # broken

Test3 : diagnostic = "ClassDebug: " + ToDiagnostic(MyClass) # broken

# Same if we convert the string to diagnostic first:
Test4 : diagnostic = ToDiagnostic("ClassDebug: ") + ToDiagnostic(MyClass) # broken

Additionally, I would want to request the exposal of String field of the diagnostic class. Look at the diagnostic class (from Epic Internal digests):

# An opaque diagnostic message that only shows up in diagnostic logs.
# The format of the diagnostic may change at any time without warning and may not be inspected by Verse code.
diagnostic<native><public> := class<computes><epic_internal>(diagnosable) {
    GetDiagnostic<override>()<reads>: diagnostic = external {}

    String<native><epic_internal>: string # <------------- THIS
}

It already exists but is epic_internal and not exposed for the public.

I would love to have access to it, so I can “pre-process” the resulting string before printing, which can be much more flexible to avoid spam on the logs (Ex. most of the cases only the last part is necessary), and also many other usages in code to tweak the string before actually displaying them, both in logs or even with a custom made in-game debug log.

FORT-1078762 has been created and its status is ‘Unconfirmed’. This is now in a queue to be reproduced and confirmed.