1+ // Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
3+ #pragma warning disable SA1402 , SA1649
4+
5+ // REF: https://github.com/dotnet/runtime/blob/1c8d37af80667daffb3cb80ce0fe915621e8f039/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs
6+ //
7+ // Licensed to the .NET Foundation under one or more agreements.
8+ // The .NET Foundation licenses this file to you under the MIT license.
9+ namespace System . Diagnostics . CodeAnalysis ;
10+
11+ [ AttributeUsage ( AttributeTargets . Field | AttributeTargets . Parameter | AttributeTargets . Property , Inherited = false ) ]
12+ internal sealed class AllowNullAttribute : Attribute { }
13+
14+ [ AttributeUsage ( AttributeTargets . Field | AttributeTargets . Parameter | AttributeTargets . Property , Inherited = false ) ]
15+ internal sealed class DisallowNullAttribute : Attribute { }
16+
17+ [ AttributeUsage ( AttributeTargets . Method , Inherited = false ) ]
18+ internal sealed class DoesNotReturnAttribute : Attribute { }
19+
20+ [ AttributeUsage ( AttributeTargets . Parameter ) ]
21+ internal sealed class DoesNotReturnIfAttribute : Attribute
22+ {
23+ public DoesNotReturnIfAttribute ( bool parameterValue ) { }
24+
25+ public bool ParameterValue => default ;
26+ }
27+
28+ [ AttributeUsage ( AttributeTargets . Assembly | AttributeTargets . Class | AttributeTargets . Constructor | AttributeTargets . Event | AttributeTargets . Method | AttributeTargets . Property | AttributeTargets . Struct , Inherited = false , AllowMultiple = false ) ]
29+ internal sealed class ExcludeFromCodeCoverageAttribute : Attribute { }
30+
31+ [ AttributeUsage ( AttributeTargets . Field | AttributeTargets . Parameter | AttributeTargets . Property | AttributeTargets . ReturnValue , Inherited = false ) ]
32+ internal sealed class MaybeNullAttribute : Attribute { }
33+
34+ [ AttributeUsage ( AttributeTargets . Parameter ) ]
35+ internal sealed class MaybeNullWhenAttribute : Attribute
36+ {
37+ public MaybeNullWhenAttribute ( bool returnValue ) { }
38+
39+ public bool ReturnValue => default ;
40+ }
41+
42+ [ AttributeUsage ( AttributeTargets . Field | AttributeTargets . Parameter | AttributeTargets . Property | AttributeTargets . ReturnValue , Inherited = false ) ]
43+ internal sealed class NotNullAttribute : Attribute { }
44+
45+ [ AttributeUsage ( AttributeTargets . Parameter | AttributeTargets . Property | AttributeTargets . ReturnValue , AllowMultiple = true , Inherited = false ) ]
46+ internal sealed class NotNullIfNotNullAttribute : Attribute
47+ {
48+ public NotNullIfNotNullAttribute ( string parameterName ) { }
49+
50+ public string ParameterName => default ! ;
51+ }
52+
53+ [ AttributeUsage ( AttributeTargets . Parameter ) ]
54+ internal sealed class NotNullWhenAttribute : Attribute
55+ {
56+ public NotNullWhenAttribute ( bool returnValue ) { }
57+
58+ public bool ReturnValue => default ;
59+ }
0 commit comments