Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Roslyn analyzer aims to reduce hidden null reference exceptions for projects which are not ready for Nullable Reference Types

License

NotificationsYou must be signed in to change notification settings

KonH/NullReturnAnalyzer

Repository files navigation

Summary

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.

Examples

object GetAlwaysNullObject() {    return null;}

Compiler warning:

[NR1001] Method returns null value, but it is not marked with [CanBeNull]

Installation

Unity 2020.2+

Follow instructions -https://docs.unity3d.com/2020.2/Documentation/Manual/roslyn-analyzers.html

Unity (older)

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

Topics

Resources

License

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp