Skip to content

Instantly share code, notes, and snippets.

@i-e-b
Created February 4, 2019 09:29
Show Gist options
  • Select an option

  • Save i-e-b/cbb85e2068a2f10a27a853bc04a4f572 to your computer and use it in GitHub Desktop.

Select an option

Save i-e-b/cbb85e2068a2f10a27a853bc04a4f572 to your computer and use it in GitHub Desktop.
Minimal annotations for JetBrains' Resharper
using System;
#pragma warning disable 1591
// ReSharper disable once CheckNamespace
namespace JetBrains.Annotations {
/// <summary>Marked element could be <c>null</c></summary>
[AttributeUsage(AttributeTargets.All)] internal sealed class CanBeNullAttribute : Attribute { }
/// <summary>Marked element could never be <c>null</c></summary>
[AttributeUsage(AttributeTargets.All)] internal sealed class NotNullAttribute : Attribute { }
/// <summary>IEnumerable, Task.Result, or Lazy.Value property can never be null.</summary>
[AttributeUsage(AttributeTargets.All)] internal sealed class ItemNotNullAttribute : Attribute { }
/// <summary>IEnumerable, Task.Result, or Lazy.Value property can be null.</summary>
[AttributeUsage(AttributeTargets.All)]internal sealed class ItemCanBeNullAttribute : Attribute { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment