-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing the System.Private.CoreLib.Polyfills project
- Loading branch information
Showing
24 changed files
with
219 additions
and
84 deletions.
There are no files selected for viewing
Submodule ComponentModel
updated
from ef79e5 to e54a57
Submodule Enumerations
updated
from 4159f7 to 55767b
Submodule Extensions
updated
from 715678 to b0acdc
Submodule Primitives
updated
16 files
+1 −0 | All/Dgmjr.Primitives.All.csproj | |
+26 −26 | All/Dgmjr.Primitives.All.sln | |
+22 −17 | All/README.md | |
+2 −2 | Tests/Dgmjr.Primitives.Tests.xml | |
+73 −68 | Tests/DurationTests.cs | |
+1 −1 | Tests/iriTests.cs | |
+11 −12 | src/DayTimeDuration.cs | |
+16 −0 | src/Dgmjr.Primitives.csproj | |
+1 −10 | src/Dgmjr.Primitives.props | |
+3 −0 | src/Dgmjr.Primitives.sln | |
+3 −3 | src/LICENSE.md | |
+3 −3 | src/iri.cs | |
+3 −3 | src/uri.cs | |
+3 −3 | src/url.cs | |
+3 −3 | src/urn.cs | |
+3 −3 | src/xri.cs |
9 changes: 9 additions & 0 deletions
9
System.Private.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/AllowNullAttribute.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,9 @@ | ||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary>Specifies that null is allowed as an input even if the corresponding type disallows it.</summary> | ||
[AttributeUsage( | ||
AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, | ||
Inherited = false | ||
)] | ||
[Conditional(global::System.Private.CoreLib.Polyfills.Constants.NOTNETSTANDARD21ORGREATER)] | ||
internal sealed class AllowNullAttribute : Attribute { } |
9 changes: 9 additions & 0 deletions
9
System.Private.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/DisallowNullAttribute.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,9 @@ | ||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary>Specifies that null is disallowed as an input even if the corresponding type allows it.</summary> | ||
[AttributeUsage( | ||
AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, | ||
Inherited = false | ||
)] | ||
[Conditional(global::System.Private.CoreLib.Polyfills.Constants.NOTNETSTANDARD21ORGREATER)] | ||
internal sealed class DisallowNullAttribute : Attribute { } |
6 changes: 6 additions & 0 deletions
6
System.Private.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/DoesNotReturnAttribute.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,6 @@ | ||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary>Applied to a method that will never return under any circumstance.</summary> | ||
[AttributeUsage(AttributeTargets.Method, Inherited = false)] | ||
[Conditional(global::System.Private.CoreLib.Polyfills.Constants.NOTNETSTANDARD21ORGREATER)] | ||
internal sealed class DoesNotReturnAttribute : Attribute { } |
5 changes: 2 additions & 3 deletions
5
System.Private.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/DoesNotReturnIfAttribute.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
12 changes: 12 additions & 0 deletions
12
System.Private.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/MaybeNullAttribute.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,12 @@ | ||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary>Specifies that an output may be null even if the corresponding type disallows it.</summary> | ||
[AttributeUsage( | ||
AttributeTargets.Field | ||
| AttributeTargets.Parameter | ||
| AttributeTargets.Property | ||
| AttributeTargets.ReturnValue, | ||
Inherited = false | ||
)] | ||
[Conditional(global::System.Private.CoreLib.Polyfills.Constants.NOTNETSTANDARD21ORGREATER)] | ||
internal sealed class MaybeNullAttribute : Attribute { } |
16 changes: 16 additions & 0 deletions
16
System.Private.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/MaybeNullWhenAttribute.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,16 @@ | ||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter may be null even if the corresponding type disallows it.</summary> | ||
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)] | ||
[Conditional(global::System.Private.CoreLib.Polyfills.Constants.NOTNETSTANDARD21ORGREATER)] | ||
internal sealed class MaybeNullWhenAttribute : Attribute | ||
{ | ||
/// <summary>Initializes the attribute with the specified return value condition.</summary> | ||
/// <param name="returnValue"> | ||
/// The return value condition. If the method returns this value, the associated parameter may be null. | ||
/// </param> | ||
public MaybeNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; | ||
|
||
/// <summary>Gets the return value condition.</summary> | ||
public bool ReturnValue { get; } | ||
} |
26 changes: 26 additions & 0 deletions
26
System.Private.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/MemberNotNullAttribute.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,26 @@ | ||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values.</summary> | ||
[AttributeUsage( | ||
AttributeTargets.Method | AttributeTargets.Property, | ||
Inherited = false, | ||
AllowMultiple = true | ||
)] | ||
[Conditional(global::System.Private.CoreLib.Polyfills.Constants.NOTNETSTANDARD21ORGREATER)] | ||
internal sealed class MemberNotNullAttribute : Attribute | ||
{ | ||
/// <summary>Initializes the attribute with a field or property member.</summary> | ||
/// <param name="member"> | ||
/// The field or property member that is promised to be not-null. | ||
/// </param> | ||
public MemberNotNullAttribute(string member) => Members = new[] { member }; | ||
|
||
/// <summary>Initializes the attribute with the list of field and property members.</summary> | ||
/// <param name="members"> | ||
/// The list of field and property members that are promised to be not-null. | ||
/// </param> | ||
public MemberNotNullAttribute(params string[] members) => Members = members; | ||
|
||
/// <summary>Gets field or property member names.</summary> | ||
public string[] Members { get; } | ||
} |
21 changes: 12 additions & 9 deletions
21
System.Private.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/NotNullAttribute.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
20 changes: 20 additions & 0 deletions
20
...em.Private.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/NotNullIfNotNullAttribute.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,20 @@ | ||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary>Specifies that the output will be non-null if the named parameter is non-null.</summary> | ||
[AttributeUsage( | ||
AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, | ||
AllowMultiple = true, | ||
Inherited = false | ||
)] | ||
[Conditional(global::System.Private.CoreLib.Polyfills.Constants.NOTNETSTANDARD21ORGREATER)] | ||
internal sealed class NotNullIfNotNullAttribute : Attribute | ||
{ | ||
/// <summary>Initializes the attribute with the associated parameter name.</summary> | ||
/// <param name="parameterName"> | ||
/// The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null. | ||
/// </param> | ||
public NotNullIfNotNullAttribute(string parameterName) => ParameterName = parameterName; | ||
|
||
/// <summary>Gets the associated parameter name.</summary> | ||
public string ParameterName { get; } | ||
} |
16 changes: 16 additions & 0 deletions
16
System.Private.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/NotNullWhenAttribute.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,16 @@ | ||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter will not be null even if the corresponding type allows it.</summary> | ||
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)] | ||
[Conditional(global::System.Private.CoreLib.Polyfills.Constants.NOTNETSTANDARD21ORGREATER)] | ||
internal sealed class NotNullWhenAttribute : Attribute | ||
{ | ||
/// <summary>Initializes the attribute with the specified return value condition.</summary> | ||
/// <param name="returnValue"> | ||
/// The return value condition. If the method returns this value, the associated parameter will not be null. | ||
/// </param> | ||
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; | ||
|
||
/// <summary>Gets the return value condition.</summary> | ||
public bool ReturnValue { get; } | ||
} |
24 changes: 0 additions & 24 deletions
24
System.Private.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/NotNullWhenAttributes.cs
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...Private.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/SetsRequiredMembersAttribute.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
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
43 changes: 43 additions & 0 deletions
43
...vate.CoreLib.Polyfills/System.Diagnostics.CodeAnalysis/System.Diagnostics.CodeAnalysis.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,43 @@ | ||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary>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.</summary> | ||
[AttributeUsage( | ||
AttributeTargets.Method | AttributeTargets.Property, | ||
Inherited = false, | ||
AllowMultiple = true | ||
)] | ||
[Conditional(global::System.Private.CoreLib.Polyfills.Constants.NOTNETSTANDARD21ORGREATER)] | ||
internal 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 null. | ||
/// </param> | ||
/// <param name="member"> | ||
/// The field or property member that is promised to be not-null. | ||
/// </param> | ||
public MemberNotNullWhenAttribute(bool returnValue, string member) | ||
{ | ||
ReturnValue = returnValue; | ||
Members = new[] { 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 null. | ||
/// </param> | ||
/// <param name="members"> | ||
/// The list of field and property members that are promised to be not-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
21 changes: 10 additions & 11 deletions
21
System.Private.CoreLib.Polyfills/System.Private.CoreLib.Polyfills.props
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.