Skip to content

Null Reference exception from analyzer #53

@WalkerCodeRanger

Description

@WalkerCodeRanger

Using ExhaustinveMatching.Analyzer 0.5.0

Analyzer 'ExhaustiveMatching.Analyzer.ExhaustiveMatchAnalyzer' threw an exception of type 'System.Exception' with message 'Uncaught exception in analyzer: System.NullReferenceException: Object reference not set to an instance of an object.
    at ExhaustiveMatching.Analyzer.TypeDeclarationAnalyzer.<>c.<CheckClosedAttributes>b__3_0(AttributeSyntax a)
    at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
    at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
    at System.Linq.Enumerable.<OfTypeIterator>d__95`1.MoveNext()
    at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
    at System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
    at System.Linq.GroupedEnumerable`3.GetEnumerator()
    at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
    at ExhaustiveMatching.Analyzer.TypeDeclarationAnalyzer.CheckClosedAttributes(SyntaxNodeAnalysisContext context, IList`1 closedAttributes)
    at ExhaustiveMatching.Analyzer.TypeDeclarationAnalyzer.Analyze(SyntaxNodeAnalysisContext context, TypeDeclarationSyntax typeDeclaration)
    at ExhaustiveMatching.Analyzer.ExhaustiveMatchAnalyzer.AnalyzeTypeDeclaration(SyntaxNodeAnalysisContext context)'.	

Code that reproduces the issue

[Closed]
public abstract class Base
{
}


public sealed class Derived : Base
{
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions