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
- Create Node Menu is not closing and “NullReferenceException: Object reference not set to an instance of an object” error is thrown when Shader Graph window is closed
- Assert error is thrown when the Editor language is set to one of the experimental ones in an HDRP project
- A BatchDrawCommand is using a pass from the shader “Universal Render Pipeline/Particles/Lit” that is not SRP Batcher compatible
- The Scene does not get rendered in the Player when MSAA is enabled and more than one Camera is used
- Crash on mono_object_get_class when generating Font Atlas of a specific font file
Add comment