Search Issue Tracker
Won't Fix
Votes
0
Found in
2017.3.0b6
Issue ID
964123
Regression
No
"CS1525: Unexpected symbol" error when user passes multiple logical comparisons as boolean parameters
"CS1525: Unexpected symbol" error when user passes multiple logical comparisons as boolean parameters and comparison contains ">" while previous comparison contains "<" ( for example: ( a < b, a > b ), (a > b, b < a, b > a))
Reproduction steps:
1. Open Unity and create a new project
2. Right-click in the Project Window and select Import New Asset...
3. Import "MyClass.cs" script
4. 5 errors appear in the console Window
Expected result: Code compiled with no errors
Actual result: An error "error CS1525: Unexpected symbol" is produced
Reproducible with: 5.4.4f1, 5.5.0a6, 5.6.3f1, 2017.2.0f1, 2017.3.0b6, 2018.1.0a1, 2018.1.0a2
Notes: No issue when the first comparison contains ">", while any of the following contain "<"
The error appears both in Unity console and ModoDevelop but not in Visual Studio
Workaround: if the logical comparison statements are put into brackets ((a < b), (a > b)) no error is produced
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
- Scene/Game view visually breaks and console is spammed with errors when using DepthBlit Sample Scene
- "GetOrAddComponent" method in "Unity.VisualScripting" returns "MissingComponentException" error when the "BoxCollider" Component doesn't exist
- Render Graphs Kebab Menu Buttons are missing padding and Highlight is uneven when hovered over
- Shader Keywords are not detected when defined in include files
- Right-clicking on Blackboard and Graph Inspector calls the contextual menu of the workspace
Resolution Note:
This is a known issue with the mono C# compiler (mcs). It is unlikely to be fixed before we migrate to the Microsoft C# compiler (Roslyn/csc).