Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.1.0f1
Issue ID
1028075
Regression
No
.NET 3.5 successfully compiles C#6 features when LangVersion set to C#4 but error shows in IDE
Using .NET 3.5, the C# project that is generated by Unity has a supported language version of 4:
<LangVersion>4</LangVersion>
However, Unity successfully compiles the project with C# 6 features like read-only auto properties, even though it passes `-langversion:4` to the compiler.
To reproduce:
1. Download attached project "LangVersionError.zip" and open in Unity
2. Open "CSharpScript.cs" in IDE by double-clicking file in Unity
3. Observe that IDE will report an Error similar to:
Feature 'readonly automatically implemented properties' is not available in C# 4. Please use language version 6 or greater.
Notes:
- This issue reproduces on both Windows and OSX
- In Unity everything is fine
- Discussion with #devs-scripting is in comments section
Reproduced on Unity 2017.1.3p4, 2017.2.3f1, 2017.3.2f1, 2017.4.2f2, 2018.1.0f2, 2018.2.0b3 and 2018.3.0a1
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "Multiplayer Center" window does not reflect changes made in "Other Packages" section
- Crash on D3DKMTOpenResource when capturing with RenderDoc while GPU Skinning is set to GPU(Batched)
- Editing and saving Curve changes in UI Builder window throws multiple errors in the Console
- [UI Builder] Value is not selected when left clicking on Spacing/Border Widget values
- The "Install Packages" button misses tooltips that would explain its behaviors
Add comment