- Notifications
You must be signed in to change notification settings - Fork0
Roslyn analyzer aims to reduce hidden null reference exceptions for projects which are not ready for Nullable Reference Types
License
KonH/NullReturnAnalyzer
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Roslyn analyzer aims to reduce hidden null reference exceptions for projects which are not ready forNullable Reference Types (e.g. some Unity projects).
Analyzer enforce you to use [CanBeNull] (fromJetBrains or any custom with that name) attribute on obviously null-return methods.
Code fix is also provided.
object GetAlwaysNullObject() { return null;}
Compiler warning:
[NR1001] Method returns null value, but it is not marked with [CanBeNull]
Follow instructions -https://docs.unity3d.com/2020.2/Documentation/Manual/roslyn-analyzers.html
Add UPM packagehttps://github.com/tertle/com.bovinelabs.analyzers and put analyzer DLL in expected location (RoslynAnalyzers by default)
About
Roslyn analyzer aims to reduce hidden null reference exceptions for projects which are not ready for Nullable Reference Types