Skip to content

Commit 62a9492

Browse files
committed
Fix type forwarding for init and record workaround
1 parent 8fcfd50 commit 62a9492

File tree

6 files changed

+10
-108
lines changed

6 files changed

+10
-108
lines changed

src/JsonRpc.Generators/Records.cs

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#pragma warning disable MA0048 // File name must match type name
2-
#define INTERNAL_RECORD_ATTRIBUTES
3-
#if NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2 || NET45 || NET451 || NET452 || NET6 || NET461 || NET462 || NET47 || NET471 || NET472 || NET48
2+
#if NET5_0_OR_GREATER
3+
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.IsExternalInit))]
4+
#else
5+
46
using System.ComponentModel;
57

68
// ReSharper disable once CheckNamespace
@@ -11,12 +13,7 @@ namespace System.Runtime.CompilerServices
1113
/// This class should not be used by developers in source code.
1214
/// </summary>
1315
[EditorBrowsable(EditorBrowsableState.Never)]
14-
#if INTERNAL_RECORD_ATTRIBUTES
15-
internal
16-
#else
17-
public
18-
#endif
19-
static class IsExternalInit
16+
internal static class IsExternalInit
2017
{
2118
}
2219
}

src/JsonRpc/Nullable/Records.cs

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#pragma warning disable MA0048 // File name must match type name
2-
#define INTERNAL_RECORD_ATTRIBUTES
3-
#if NETSTANDARD || NETCOREAPP
2+
#if NET5_0_OR_GREATER
3+
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.IsExternalInit))]
4+
#else
5+
46
using System.ComponentModel;
57

68
// ReSharper disable once CheckNamespace
@@ -11,12 +13,7 @@ namespace System.Runtime.CompilerServices
1113
/// This class should not be used by developers in source code.
1214
/// </summary>
1315
[EditorBrowsable(EditorBrowsableState.Never)]
14-
#if INTERNAL_RECORD_ATTRIBUTES
15-
internal
16-
#else
17-
public
18-
#endif
19-
static class IsExternalInit
16+
internal static class IsExternalInit
2017
{
2118
}
2219
}

test/Dap.Tests/Records.cs

-23
This file was deleted.

test/Generation.Tests/Records.cs

-23
This file was deleted.

test/Lsp.Integration.Tests/Records.cs

-23
This file was deleted.

test/Lsp.Tests/Records.cs

-23
This file was deleted.

0 commit comments

Comments
 (0)