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
- Selector gets stuck in UI if scroll is used while dragging
- Created asset is placed in a new folder when creating a new folder and instantly creating an asset by clicking somewhere else
- Selecting and deleting transition in Animator does not add to Undo History when animation is previewed in Inspector
- GameObjects remain static when updating constraints of PhysicsJoint with "Enable Sleeping" selected in Havok Physics Configuration
- [iOS] Touch input is not clocked and UI is unresponsive when the application is paused mid-drag without lifting the finger
Add comment