-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add IsUnmanaged, ScopedRef, and Nullable{Context/PublicOnly} attributes
- Loading branch information
1 parent
e685ff9
commit 3d11a7f
Showing
7 changed files
with
104 additions
and
0 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
9 changes: 9 additions & 0 deletions
9
...raries/System.Private.CoreLib/src/System/Runtime/CompilerServices/IsUnmanagedAttribute.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 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
public sealed class IsUnmanagedAttribute : Attribute | ||
{ | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/NullableAttribute.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,21 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] | ||
public sealed class NullableAttribute : Attribute | ||
{ | ||
public readonly byte[] NullableFlags; | ||
|
||
public NullableAttribute(byte value) | ||
{ | ||
NullableFlags = new[] { value }; | ||
} | ||
|
||
public NullableAttribute(byte[] value) | ||
{ | ||
NullableFlags = value; | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...es/System.Private.CoreLib/src/System/Runtime/CompilerServices/NullableContextAttribute.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 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] | ||
public sealed class NullableContextAttribute : Attribute | ||
{ | ||
public readonly byte Flag; | ||
|
||
public NullableContextAttribute(byte value) | ||
{ | ||
Flag = value; | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...System.Private.CoreLib/src/System/Runtime/CompilerServices/NullablePublicOnlyAttribute.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 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] | ||
public sealed class NullablePublicOnlyAttribute : Attribute | ||
{ | ||
public readonly bool IncludesInternals; | ||
|
||
public NullablePublicOnlyAttribute(bool value) | ||
{ | ||
IncludesInternals = value; | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ibraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/ScopedRefAttribute.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,10 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] | ||
public sealed class ScopedRefAttribute : Attribute | ||
{ | ||
} | ||
} |
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