-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Caller info attribute for passing caller identity implicitly
- Specification:
- Discussion: [API proposal] Attribute for passing caller identity implicitly #9017
Summary
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
public sealed class CallerIdentityAttribute : Attribute
{
public CallerIdentityAttribute();
}
}This attribute can be applied to parameters of type System.Reflection.Assembly, System.Reflection.Type, System.Reflection.MethodBase. When the C# compiler sees parameter tagged with this attribute, it will provide default value for it, according to the caller context:
System.Reflection.Assembly:typeof(containing_type).AssemblySystem.Reflection.Type:typeof(containing_type)System.Reflection.MethodBase:MethodBase.GetMethodFromHandle(ldtoken containing_method)