Search Issue Tracker
Fixed in 2021.2.X
Votes
1
Found in
2020.2
2021.1
2021.1.0b1
Issue ID
1304285
Regression
No
Interpolated Verbatim strings with @ before $ doesn't compile when used in other class and referenced in MonoBehaviour class
Reproduction steps:
1. Open user's project "InterpolatedVerbatimStrings.zip"
2. Press play
Expected result: Code compiles successfully and prints out two messages (Interpolated verbatim string with @$, Interpolated verbatim string with $@)
Actual result: Code compilation fails and warning messages get printed out
Reproducible with: 2020.2.2f1, 2021.1.0b2
Couldn't test with: 2018.4, 2019.4, 2020.1 (because C# language version being used is too low for @ before $. It was added in C# 8.0)
Note:
As mentioned in the title, if you remove part of the script where @ is before $, the code compiles.
Also if you put the logic to the main MonoBehaviour class it also compiles.
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
- Editor crashes on StoredGraphicsBuffer::GetGfxBufferID when VFX Graph property is modified during Play Mode and Application.targetFrameRate is used to limit FPS
- Crash on NVAPI_Thunk when changing Player resolution while HDR display is used and Direct3D12 is set as the graphics API
- Only one out of multiple cameras is shown in the Play Mode while HDR display is used and Direct3D12 is set as the graphics API
- The "Paste Component as New" option is incorrectly displayed as active despite the action being prohibited
- "TLS Allocator ALLOC_TEMP_TLS" errors are thrown when unsuccessfully importing an FBX file
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a5