Produce analyzer errors for invalid generic arguments in converters and validators

Closes #103
This commit is contained in:
Oleksii Holub
2022-04-16 22:54:11 +00:00
committed by GitHub
parent c7015181e1
commit 41cb8647b5
20 changed files with 188 additions and 61 deletions

View File

@@ -25,11 +25,11 @@ public class CommandMustImplementInterfaceAnalyzer : AnalyzerBase
var hasCommandAttribute = type
.GetAttributes()
.Select(a => a.AttributeClass)
.Any(s => s.DisplayNameMatches(SymbolNames.CliFxCommandAttribute));
.Any(c => c.DisplayNameMatches(SymbolNames.CliFxCommandAttribute));
var implementsCommandInterface = type
.AllInterfaces
.Any(s => s.DisplayNameMatches(SymbolNames.CliFxCommandInterface));
.Any(i => i.DisplayNameMatches(SymbolNames.CliFxCommandInterface));
// If the attribute is present, but the interface is not implemented,
// it's very likely a user error.