-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNullableAttributes.cs
More file actions
19 lines (18 loc) · 1.12 KB
/
Copy pathNullableAttributes.cs
File metadata and controls
19 lines (18 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 提供給 .NET 6 使用的 nullable 屬性 polyfill
// BepInEx.Unity.IL2CPP.dll 內含 NullableContextAttribute 參考,但 .NET 6.0.7 runtime 沒有
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public byte Flag;
public NullableContextAttribute(byte flag) { Flag = flag; }
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte flag) { NullableFlags = new byte[] { flag }; }
public NullableAttribute(byte[] flags) { NullableFlags = flags; }
}
}