Skip to content

Commit 38653d6

Browse files
committed
Add ExcludeFromStubs attribute
1 parent 401ef2a commit 38653d6

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

nanoFramework.CoreLibrary/System/Diagnostics/CodeAnalysis/NullableAttributes.cs

+13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using System.Runtime.CompilerServices;
5+
46
namespace System.Diagnostics.CodeAnalysis
57
{
68
/// <summary>
@@ -10,34 +12,39 @@ namespace System.Diagnostics.CodeAnalysis
1012
/// To override a method that has a parameter annotated with this attribute, use the ? operator. For more information, see Nullable static analysis in the C# guide.
1113
/// </remarks>
1214
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
15+
[ExcludeFromStubs]
1316
public sealed class AllowNullAttribute : Attribute
1417
{ }
1518

1619
/// <summary>
1720
/// Specifies that null is disallowed as an input even if the corresponding type allows it.
1821
/// </summary>
1922
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
23+
[ExcludeFromStubs]
2024
public sealed class DisallowNullAttribute : Attribute
2125
{ }
2226

2327
/// <summary>
2428
/// Specifies that an output may be null even if the corresponding type disallows it.
2529
/// </summary>
2630
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
31+
[ExcludeFromStubs]
2732
public sealed class MaybeNullAttribute : Attribute
2833
{ }
2934

3035
/// <summary>
3136
/// Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns.
3237
/// </summary>
3338
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
39+
[ExcludeFromStubs]
3440
public sealed class NotNullAttribute : Attribute
3541
{ }
3642

3743
/// <summary>
3844
/// Specifies that when a method returns <see cref="ReturnValue"/>, the parameter may be null even if the corresponding type disallows it.
3945
/// </summary>
4046
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
47+
[ExcludeFromStubs]
4148
public sealed class MaybeNullWhenAttribute : Attribute
4249
{
4350
/// <summary>
@@ -57,6 +64,7 @@ public sealed class MaybeNullWhenAttribute : Attribute
5764
/// <summary>
5865
/// Specifies that when a method returns <see cref="ReturnValue"/>, the parameter will not be null even if the corresponding type allows it.
5966
/// </summary>
67+
[ExcludeFromStubs]
6068
public sealed class NotNullWhenAttribute : Attribute
6169
{
6270
/// <summary>Initializes the attribute with the specified return value condition.</summary>
@@ -73,6 +81,7 @@ public sealed class NotNullWhenAttribute : Attribute
7381
/// Specifies that the output will be non-null if the named parameter is non-null.
7482
/// </summary>
7583
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
84+
[ExcludeFromStubs]
7685
public sealed class NotNullIfNotNullAttribute : Attribute
7786
{
7887
/// <summary>Initializes the attribute with the associated parameter name.</summary>
@@ -89,13 +98,15 @@ public sealed class NotNullIfNotNullAttribute : Attribute
8998
/// Applied to a method that will never return under any circumstance.
9099
/// </summary>
91100
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
101+
[ExcludeFromStubs]
92102
public sealed class DoesNotReturnAttribute : Attribute
93103
{ }
94104

95105
/// <summary>
96106
/// Specifies that the method will not return if the associated Boolean parameter is passed the specified value.
97107
/// </summary>
98108
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
109+
[ExcludeFromStubs]
99110
public sealed class DoesNotReturnIfAttribute : Attribute
100111
{
101112
/// <summary>Initializes the attribute with the specified parameter value.</summary>
@@ -115,6 +126,7 @@ public sealed class DoesNotReturnIfAttribute : Attribute
115126
/// Specifies that the method or property will ensure that the listed field and property members have not-null values.
116127
/// </summary>
117128
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
129+
[ExcludeFromStubs]
118130
public sealed class MemberNotNullAttribute : Attribute
119131
{
120132
/// <summary>Initializes the attribute with a field or property member.</summary>
@@ -139,6 +151,7 @@ public sealed class MemberNotNullAttribute : Attribute
139151
/// Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.
140152
/// </summary>
141153
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
154+
[ExcludeFromStubs]
142155
public sealed class MemberNotNullWhenAttribute : Attribute
143156
{
144157
/// <summary>Initializes the attribute with the specified return value condition and a field or property member.</summary>

nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerArgumentExpressionAttribute.cs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace System.Runtime.CompilerServices
88
/// Indicates that a parameter captures the expression passed for another parameter as a string.
99
/// </summary>
1010
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
11+
[ExcludeFromStubs]
1112
public sealed class CallerArgumentExpressionAttribute : Attribute
1213
{
1314
/// <summary>

nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace System.Runtime.CompilerServices
88
/// Allows you to obtain the method or property name of the caller to the method.
99
/// </summary>
1010
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
11+
[ExcludeFromStubs]
1112
public sealed class CallerMemberNameAttribute : Attribute
1213
{
1314
/// <summary>

0 commit comments

Comments
 (0)