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

Fix S1939: Extends and implements list entries should not be redundant #386

Closed
michalb-sonar opened this issue May 30, 2017 · 0 comments
Closed
Assignees
Labels
Type: Bug Exceptions and blocking issues during analysis.
Milestone

Comments

@michalb-sonar
Copy link
Contributor

michalb-sonar commented May 30, 2017

The analyzer throws exception for following (invalid) code:

public class Foo : IList, IList { }

Exception:

Analyzer 'SonarAnalyzer.Rules.CSharp.RedundantInheritanceList' threw an exception of type 'System.ArgumentException' with message 'An item with the same key has already been added.'.
'Exception occurred with following context:

System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at SonarAnalyzer.Common.MultiValueDictionaryExtensions.ToMultiValueDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
   at SonarAnalyzer.Rules.CSharp.RedundantInheritanceList.GetImplementedInterfaceMappings(BaseListSyntax baseList, SemanticModel semanticModel)
   at SonarAnalyzer.Rules.CSharp.RedundantInheritanceList.ReportRedundantInterfaces(SyntaxNodeAnalysisContext context, BaseTypeDeclarationSyntax typeDeclaration)
-----
@michalb-sonar michalb-sonar self-assigned this Jun 1, 2017
@michalb-sonar michalb-sonar added this to the 6.0 milestone Jun 1, 2017
@michalb-sonar michalb-sonar added Area: Rules Type: Bug Exceptions and blocking issues during analysis. labels Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Exceptions and blocking issues during analysis.
Projects
None yet
Development

No branches or pull requests

1 participant