Search Issue Tracker
By Design
Votes
0
Found in [Package]
1.8.7
Issue ID
BUR-2449
Regression
No
Mixing types in string interpolation causes BC1345
String interpolation works when using like types, but not when mixing.
{code:java}
[BurstCompile]
static public void AnyAmountOfIntegers()
{
Debug.Log($"{0}{0}{0}");
}
[BurstCompile]
static public void AnyAmountOfStrings()
{
Debug.Log($"{""}{""}{""}");
}
[BurstCompile]
static public void MixOneStringAndInteger()
{
// Burst error BC1345: Invalid argument type byte* with index 0. Only value types are supported.
Debug.Log($"{""}{0}");
}
[BurstCompile]
static public void MixOneIntegerAndString()
{
// Burst error BC1345: Invalid argument type byte* with index 1. Only value types are supported.
Debug.Log($"{0}{""}");
}
{code}
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- EditorGUILayout.PropertyField foldout icon inside Vertical Layout Group has an incorrect indent when used with OnInspectorGUI()
- [Android] [iOS] "NullReferenceException: Object reference not set to an instance of an object" throws when entering the Play Mode/opening the application
- The Player freezes on load when building Web platform
- Animator "Conditions" tab breaks when the only Parameter is deleted and another one is created
- "Shader error in 'Universal Render Pipeline/Lit': maximum ps_5_0 sampler register index (16) exceeded" error thrown after a build is completed when the "LOD Cross Fade" parameter is enabled
Resolution Note:
This is actually as-designed. The reason the multiple-empty-strings example works is because Roslyn collapses it down to a single empty string literal. Whereas for the integer+string, the string is routed via an {{object}} parameter in {{string.Format}}, and Burst doesn't support that.
https://sharplab.io/#v2:EYLgHgbALANALiAlgGwD4AEBMBGAsAKHQGYACLEgYRIG8CT6zT0oSBZACgEoa6G+B6fiQAiAewCmAZwB2AcjgkA7qIBOAaxKJpJAEIBXFZIXBxAYwCGeyeM0K4ACxvpsABk2SSK0XrjiAJprScKIk5toABqLAAFZmcOEkAA7mKuYAtuK+KgB0vHz0zgCc7AAkAETULgC+1GVlVWWcANx5JFWtrcRkLAByXDz4+QyCJADqqmoeWroGRiQmFlY2AEqiksgAntqmosjI5onWU3Yh5iQ70kZhCs4uuYNDZNjF5bX1bw3Nre34VUA