I started editing a new C# script in MonoDevelop, and pressed the “Build Project Assembly” button (F7). This caused it to now go into another C# library package I’ve had working for a while, and drop the following error dozens of times on function definitions with optional parameters:
Default parameter specifiers are not permitted (C50241)
The errors are only thrown in MonoDevelop. When you save it and switch to the Unity editor, it compiles and runs the code fine, as I’ve been using that package’s scripts for weeks. I’m thus only now discovering that MonoDevelop doesn’t approve, possibly because it’s the first time I hit F7 on a C# file instead of JS, so I presume that it compiles all scripts of only the language of the script you’re editing.
Google has it that C# only started accepting default parameter specifiers after version 4.0. So is there a discrepancy between the assembler of Unity and that of MonoDevelop, such that the former accepts post-C#-4.0 conventions and the latter doesn’t?