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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
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).