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 #8115 from DustinCampbell/nullability
Add and fix nullability annotations in Microsoft.CodeAnalysis.Razor.Workspaces
- Loading branch information
Showing
192 changed files
with
1,780 additions
and
1,755 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
src/Compiler/Microsoft.AspNetCore.Razor.Language/src/HashCodeCombiner.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
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
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
4 changes: 1 addition & 3 deletions
4
src/Razor/src/Microsoft.AspNetCore.Razor.Common/KeyValuePairExtensions.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
29 changes: 29 additions & 0 deletions
29
src/Razor/src/Microsoft.AspNetCore.Razor.Common/NullableExtensions.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,29 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT license. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Diagnostics; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Runtime; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace Microsoft.AspNetCore.Razor; | ||
|
||
internal static class NullableExtensions | ||
{ | ||
[DebuggerStepThrough] | ||
[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] | ||
public static T AssumeNotNull<T>( | ||
[NotNull] this T? obj, | ||
[CallerArgumentExpression(nameof(obj))] string? objExpression = null) | ||
where T : class | ||
=> obj ?? throw new InvalidOperationException($"Expected '{objExpression}' to be non-null."); | ||
|
||
[DebuggerStepThrough] | ||
[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] | ||
public static T AssumeNotNull<T>( | ||
[NotNull] this T? obj, | ||
[CallerArgumentExpression(nameof(obj))] string? objExpression = null) | ||
where T : struct | ||
=> obj ?? throw new InvalidOperationException($"Expected '{objExpression}' to be non-null."); | ||
} |
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.