forked from npgsql/npgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeAnalysis.cs
More file actions
64 lines (55 loc) · 2.39 KB
/
CodeAnalysis.cs
File metadata and controls
64 lines (55 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#if NET461 || NETSTANDARD2_0
#pragma warning disable 1591
// ReSharper disable once CheckNamespace
namespace System.Diagnostics.CodeAnalysis
{
[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)]
sealed class AllowNullAttribute : Attribute
{
}
[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)]
sealed class DisallowNullAttribute : Attribute
{
}
[AttributeUsageAttribute(AttributeTargets.Method)]
sealed class DoesNotReturnAttribute : Attribute
{
}
[AttributeUsageAttribute(AttributeTargets.Parameter)]
sealed class DoesNotReturnIfAttribute : Attribute
{
public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue;
public bool ParameterValue { get; }
}
[AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Event | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple = false)]
sealed class ExcludeFromCodeCoverageAttribute : Attribute
{
}
[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]
sealed class MaybeNullAttribute : Attribute
{
}
[AttributeUsageAttribute(AttributeTargets.Parameter)]
sealed class MaybeNullWhenAttribute : Attribute
{
public MaybeNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
public bool ReturnValue { get; }
}
[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]
sealed class NotNullAttribute : Attribute
{
}
[AttributeUsageAttribute(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true)]
sealed class NotNullIfNotNullAttribute : Attribute
{
public NotNullIfNotNullAttribute(string parameterName) => ParameterName = parameterName;
public string ParameterName { get; }
}
[AttributeUsageAttribute(AttributeTargets.Parameter)]
sealed class NotNullWhenAttribute : Attribute
{
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
public bool ReturnValue { get; }
}
}
#endif