Currently, Call Analysis generates attributes like this:
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class CallsAttribute : Attribute
{
public Type Type;
public string TypeFullName;
public string Member;
public Type[] MemberTypeParameters;
public Type[] MemberParameters;
}
//Normal attribute
[Calls(Type = typeof(Path), Member = "Combine", MemberParameters = new Type[] { typeof(string), typeof(string) } )]
//Generic parameter could not be resolved because of deduplication.
[Calls(Type = typeof(List<>), Member = "get_Item", MemberParameters = new Type[] { null })]
//Types are inaccessible at this attribute location.
[CalledBy(TypeFullName = "SomeNamespace.SomeClass", Member = "SomeGenericMethod", MemberTypeParameters = new Type[] { null }, MemberParameters = new Type[] { null, typeof(string) })]
This can be improved:
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class CallsAttribute : Attribute
{
public object Type; //object instead of Type
//TypeFullName has been removed.
public string Member;
public object[] MemberTypeParameters; //object[] instead of Type[]
public object[] MemberParameters; //object[] instead of Type[]
}
//Normal attribute
[Calls(Type = typeof(Path), Member = "Combine", MemberParameters = new object[] { typeof(string), typeof(string) } )]
//Generic parameter could not be resolved because of deduplication.
[Calls(Type = typeof(List<>), Member = "get_Item", MemberParameters = new object[] { "T" })]
//Types are inaccessible at this attribute location.
[CalledBy(Type = "SomeNamespace.SomeClass", Member = "SomeGenericMethod", MemberTypeParameters = new object[] { "SomeNamespace.SomeOtherType" }, MemberParameters = new object[] { "UnityEngine.GameObject", typeof(string) })]
Currently, Call Analysis generates attributes like this:
This can be improved: