-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework
TdsParserStateObjectManaged
with nullable annotations (#1555)
- Loading branch information
Showing
6 changed files
with
238 additions
and
75 deletions.
There are no files selected for viewing
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
199 changes: 124 additions & 75 deletions
199
...rosoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectManaged.cs
Large diffs are not rendered by default.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
src/Microsoft.Data.SqlClient/netcore/src/Resources/Strings.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
96 changes: 96 additions & 0 deletions
96
src/Microsoft.Data.SqlClient/src/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,96 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace System.Diagnostics.CodeAnalysis | ||
{ | ||
#if NETSTANDARD2_0 | ||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)] | ||
internal sealed class AllowNullAttribute : Attribute | ||
{ | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)] | ||
internal sealed class DisallowNullAttribute : Attribute | ||
{ | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Method)] | ||
internal sealed class DoesNotReturnAttribute : Attribute | ||
{ | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Parameter)] | ||
internal sealed class DoesNotReturnIfAttribute : Attribute | ||
{ | ||
public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue; | ||
public bool ParameterValue { get; } | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)] | ||
internal sealed class MaybeNullAttribute : Attribute | ||
{ | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Parameter)] | ||
internal sealed class MaybeNullWhenAttribute : Attribute | ||
{ | ||
public MaybeNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; | ||
public bool ReturnValue { get; } | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)] | ||
internal sealed class NotNullAttribute : Attribute | ||
{ | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true)] | ||
internal sealed class NotNullIfNotNullAttribute : Attribute | ||
{ | ||
public NotNullIfNotNullAttribute(string parameterName) => ParameterName = parameterName; | ||
public string ParameterName { get; } | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Parameter)] | ||
internal sealed class NotNullWhenAttribute : Attribute | ||
{ | ||
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; | ||
public bool ReturnValue { get; } | ||
} | ||
#endif | ||
|
||
#if !NET5_0_OR_GREATER | ||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true, Inherited = false)] | ||
internal sealed class MemberNotNullAttribute : Attribute | ||
{ | ||
public MemberNotNullAttribute(string member) => Members = new string[] | ||
{ | ||
member | ||
}; | ||
|
||
public MemberNotNullAttribute(params string[] members) => Members = members; | ||
|
||
public string[] Members { get; } | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true, Inherited = false)] | ||
internal sealed class MemberNotNullWhenAttribute : Attribute | ||
{ | ||
public MemberNotNullWhenAttribute(bool returnValue, string member) | ||
{ | ||
ReturnValue = returnValue; | ||
Members = new string[1] { member }; | ||
} | ||
|
||
public MemberNotNullWhenAttribute(bool returnValue, params string[] members) | ||
{ | ||
ReturnValue = returnValue; | ||
Members = members; | ||
} | ||
|
||
public bool ReturnValue { get; } | ||
|
||
public string[] Members { get; } | ||
} | ||
#endif | ||
} |