Skip to content
This repository was archived by the owner on Sep 13, 2022. It is now read-only.

Conversation

@terrajobst
Copy link

This applies some of the nullable attributes for APIs that were previously special-cased by the compiler. The attribution is very basic only includes cases where we'e a 100% certain that these are never going to change.

I've arrived here by diffing CoreFX and .NET Standard using the following approach:

Included

  • DoesNotReturn
  • DoesNotReturnIf

Considered

  • NotNullWhen

Excluded

  • MaybeNullWhenAttribute
  • MaybeNullAttribute
  • AllowNullAttribute
  • DisallowNullAttribute
  • NotNullAttribute
  • NotNullIfNotNullAttribute

@stephentoub @jcouv @dotnet/nullablefc: Please double check my work here.

@terrajobst terrajobst requested review from a team as code owners July 19, 2019 01:18
[System.Diagnostics.ConditionalAttribute("CONTRACTS_FULL")]
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert(bool condition) { }
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)]bool condition) { }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: space in between attribute and parameter type.

@terrajobst
Copy link
Author

@stephentoub @agocke any objections?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants