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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
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).