Correct method generation to account for SA1001.

This commit is contained in:
Jarl Gullberg 2017-07-28 12:56:20 +02:00
parent cab25daf16
commit 048207425b
No known key found for this signature in database
GPG key ID: 750FF6F6BDA72D23

View file

@ -662,15 +662,13 @@ namespace Bind
if (f.Parameters.HasGenericParameters) if (f.Parameters.HasGenericParameters)
{ {
sb.Append("<"); sb.Append("<");
foreach (Parameter p in f.Parameters) foreach (Parameter p in f.Parameters.Where(p => p.Generic))
{ {
if (p.Generic) sb.Append(p.CurrentType);
{ sb.Append(", ");
sb.Append(p.CurrentType);
sb.Append(",");
}
} }
sb.Remove(sb.Length - 1, 1);
sb.Remove(sb.Length - 2, 2);
sb.Append(">"); sb.Append(">");
} }
@ -679,12 +677,9 @@ namespace Bind
if (f.Parameters.HasGenericParameters) if (f.Parameters.HasGenericParameters)
{ {
sb.AppendLine(); sb.AppendLine();
foreach (Parameter p in f.Parameters) foreach (Parameter p in f.Parameters.Where(p => p.Generic))
{ {
if (p.Generic) sb.AppendLine(String.Format(" where {0} : struct", p.CurrentType));
{
sb.AppendLine(String.Format(" where {0} : struct", p.CurrentType));
}
} }
} }