Search Issue Tracker
By Design
Votes
0
Found in
2020.3.4f1
2020.3.11f1
Issue ID
1366242
Regression
Yes
[2020.3] Compiler errors are thrown in console when using Roslyn analyzers in Editor
Reproduction steps:
1. Download the attached project: "repro_project.zip"
2. Delete the Library folder from the project directory
3. Open the project
Expected result: The project opens without issue
Actual result: The project opens, but there are a bunch of compiler errors in the Console
Reproducible with: 2020.3.4f1, 2020.3.19f1
Not reproducible with: 2019.4,31f1, 2020.3.3f1, 2021.1.23f1, 2021.2.0b14, 2022.1.0a11
Notes:
- Reproduced on Linux, macOS, and Windows
- Upon opening the project a second time, the errors are absent
- Examples of possible errors:
Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/Raycasters/PhysicsRaycaster.cs(49,24): error UNT0007: Unity objects should not use null coalescing.
Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Graphic.cs(488,17): error UNT0003: Method 'GetComponents' has a preferred generic overload.
Library/PackageCache/com.unity.test-framework@1.1.29/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandBase.cs(98,17): error UNT0008: Unity objects should not use null propagation.
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
- UI Builder can't set a background image to a sprite from a multi-sprite spritesheet in the Resources folder
- Light2D freeform does not render the internal part when rendered in certain shapes
- Using AddCopyPass causes an incorrect merging of passes.
- Negative Enum value is not pasted correctly when copying from another array
- Silent Crash when generating Lightmap UVs for a model with a large object scale
Resolution Note (2020.3.X):
This is intended behaviour.
If a analyzer is needed to only run on specific assemblies, the recommended way is to use Analyzer Scope. Documentation found here: https://docs.unity3d.com/Manual/roslyn-analyzers.html