未验证 提交 678fd6a7 编写于 作者: T Tanner Gooding 提交者: GitHub

Expose the RequiresLocationAttribute (#89870)

* Expose the RequiresLocationAttribute

* Add a basic test for RequiresLocationAttribute
上级 624c48d3
......@@ -845,6 +845,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\PreserveBaseOverridesAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RefSafetyRulesAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RequiredMemberAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RequiresLocationAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RuntimeCompatibilityAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RuntimeFeature.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RuntimeFeature.NonNativeAot.cs" Condition="'$(FeatureNativeAot)' != 'true'" />
......
// 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 for use by a compiler for tracking metadata.
/// This attribute should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
public sealed class RequiresLocationAttribute : Attribute
{
/// <summary>Initializes the attribute.</summary>
public RequiresLocationAttribute()
{
}
}
}
......@@ -13046,6 +13046,12 @@ public sealed class RequiredMemberAttribute : System.Attribute
{
public RequiredMemberAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class RequiresLocationAttribute : System.Attribute
{
public RequiresLocationAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false)]
public sealed partial class ReferenceAssemblyAttribute : System.Attribute
{
......@@ -393,5 +393,11 @@ public static void CompilerFeatureRequiredTests()
Assert.Equal("feature2", attr2.FeatureName);
Assert.True(attr2.IsOptional);
}
[Fact]
public static void RequiresLocationAttributeTests()
{
new RequiresLocationAttribute();
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册