-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #771 from unoplatform/dev/dr/genDiff
Improve collection analyzer
- Loading branch information
Showing
32 changed files
with
1,268 additions
and
282 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/Uno.Extensions.Core/_Compat/MemberNotNullWhenAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
|
||
namespace System.Diagnostics.CodeAnalysis | ||
{ | ||
/// <summary>Specifies that the method or property will ensure that the listed field and property members have non-null values when returning with the specified return value condition.</summary> | ||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true, Inherited = false)] | ||
public sealed class MemberNotNullWhenAttribute : Attribute | ||
{ | ||
/// <summary>Initializes the attribute with the specified return value condition and a field or property member.</summary> | ||
/// <param name="returnValue">The return value condition. If the method returns this value, the associated parameter will not be <see langword="null" />.</param> | ||
/// <param name="member">The field or property member that is promised to be non-null.</param> | ||
public MemberNotNullWhenAttribute(bool returnValue, string member) | ||
{ | ||
ReturnValue = returnValue; | ||
Members = new string[1] { member }; | ||
} | ||
|
||
/// <summary>Initializes the attribute with the specified return value condition and list of field and property members.</summary> | ||
/// <param name="returnValue">The return value condition. If the method returns this value, the associated parameter will not be <see langword="null" />.</param> | ||
/// <param name="members">The list of field and property members that are promised to be non-null.</param> | ||
public MemberNotNullWhenAttribute(bool returnValue, params string[] members) | ||
{ | ||
ReturnValue = returnValue; | ||
Members = members; | ||
} | ||
|
||
/// <summary>Gets the return value condition.</summary> | ||
public bool ReturnValue { get; } | ||
|
||
/// <summary>Gets field or property member names.</summary> | ||
public string[] Members { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.