Code inspection: Burst: String.Format(format, ...) invalid argument type
This inspection reports unsupported argument types passed to string.Format() in code compiled by the Burst compiler.
In Burst, string.Format only supports a limited set of arguments. If one of the format arguments is a managed type, or even a string, this inspection warns because Burst only supports value-type arguments in this context. Managed objects, such as CultureInfo, also trigger this warning.
Example
In this example, a string argument is passed to string.Format. This is not supported in Burst-compiled code.
using Unity.Burst;
using Unity.Jobs;
[BurstCompile]
public struct ExampleJob : IJob
{
public void Execute()
{
// Reported: String arguments are not supported in string.Format within Burst
string.Format("Player: {0}", "Alice");
}
}
using Unity.Burst;
using Unity.Jobs;
[BurstCompile]
public struct ExampleJob : IJob
{
public int score;
public void Execute()
{
// Correct: Use Burst-compatible value types
string.Format("Score: {0}", score);
}
}
Quick-fix
This inspection does not provide a dedicated quick-fix. Fix it manually by replacing unsupported format arguments with Burst-compatible value types, or by moving the formatting out of Burst-compiled code.
26 March 2026