Skip to content

Commit 2ccec00

Browse files
bergmeisterCopilot
andauthored
Update Rules/AvoidMultipleTypeAttributes.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 5275279 commit 2ccec00

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Rules/AvoidMultipleTypeAttributes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
3737
// Iterates all ParamAsts and check the number of its types.
3838
foreach (ParameterAst paramAst in paramAsts)
3939
{
40-
if (paramAst.Attributes.Count(typeAst => typeAst is TypeConstraintAst) > 1)
40+
if (paramAst.Attributes.OfType<TypeConstraintAst>().Skip(1).Any())
4141
{
4242
yield return new DiagnosticRecord(
4343
String.Format(CultureInfo.CurrentCulture, Strings.AvoidMultipleTypeAttributesError, paramAst.Name),

0 commit comments

Comments
 (0)