-
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.
Refactored and consolidated common polyfill definitions for better maintenance. Enabled type forwarding for `IsExternalInit` to align with .NET 5 constraints and utilized file-based inclusions instead of conditions within target files. Updated the attribute aliases for the string syntax in DateOnly and TimeOnly parse methods to comply with the consolidated definitions and avoid potential aliasing conflicts. Resolves issues with framework compatibility and standardizes attribute usage across the codebase.
- Loading branch information
Showing
6 changed files
with
80 additions
and
68 deletions.
There are no files selected for viewing
Submodule Extensions
updated
from e9ed86 to 26d698
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,7 @@ | ||
<Project> | ||
<ItemGroup> | ||
<Using Include="System.Runtime.CompilerServices" /> | ||
<Using Include="System.Diagnostics.CodeAnalysis.StringSyntaxAttribute" Alias="StringSyntax" /> | ||
<Using Include="System.Diagnostics.CodeAnalysis.StringSyntaxAttribute" Alias="StringSyntaxAttribute" /> | ||
</ItemGroup> | ||
</Project> |
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
31 changes: 20 additions & 11 deletions
31
System.Polyfills/System.Runtime.CompilerServices/IsExternalInit.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 |
---|---|---|
@@ -1,16 +1,25 @@ | ||
#if !NET6_0_OR_GREATER | ||
#if NET5_0_OR_GREATER | ||
|
||
[assembly: System.Runtime.CompilerServices.TypeForwardedTo( | ||
typeof(System.Runtime.CompilerServices.IsExternalInit) | ||
)] | ||
|
||
#else | ||
|
||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.ComponentModel; | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
/// <summary> | ||
/// Reserved to be used by the compiler for tracking metadata. This class | ||
/// should not be used by developers in source code. | ||
/// </summary> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public static class IsExternalInit { } | ||
} | ||
namespace System.Runtime.CompilerServices; | ||
|
||
// https://github.com/dotnet/runtime/blob/v8.0.0/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/IsExternalInit.cs | ||
|
||
/// <summary> | ||
/// Reserved to be used by the compiler for tracking metadata. | ||
/// This class should not be used by developers in source code. | ||
/// </summary> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public // polyfill! | ||
static class IsExternalInit { } | ||
|
||
#endif |
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.