Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mono] Allow overriding CustomAttributeData accessors #55728

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,30 +152,28 @@ public static IList<CustomAttributeData> GetCustomAttributes(ParameterInfo targe

public virtual Type AttributeType
{
get { return ctorInfo.DeclaringType!; }
get { return Constructor.DeclaringType!; }
}
Comment on lines 153 to 156
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the code to the shared location once it exists


public override string ToString()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the code to the shared location once it exists

{
ResolveArguments();

StringBuilder sb = new StringBuilder();

sb.Append('[').Append(ctorInfo.DeclaringType!.FullName).Append('(');
for (int i = 0; i < ctorArgs.Count; i++)
sb.Append('[').Append(Constructor.DeclaringType!.FullName).Append('(');
for (int i = 0; i < ConstructorArguments.Count; i++)
{
sb.Append(ctorArgs[i].ToString());
if (i + 1 < ctorArgs.Count)
sb.Append(ConstructorArguments[i].ToString());
if (i + 1 < ConstructorArguments.Count)
sb.Append(", ");
}

if (namedArgs.Count > 0)
if (NamedArguments.Count > 0)
sb.Append(", ");

for (int j = 0; j < namedArgs.Count; j++)
for (int j = 0; j < NamedArguments.Count; j++)
{
sb.Append(namedArgs[j].ToString());
if (j + 1 < namedArgs.Count)
sb.Append(NamedArguments[j].ToString());
if (j + 1 < NamedArguments.Count)
sb.Append(", ");
}
sb.Append(")]");
Expand Down