ExhaustiveMatching icon indicating copy to clipboard operation
ExhaustiveMatching copied to clipboard

C# Analyzer Adding Exhaustive Checking of Switch Statements and Expressions

Results 18 ExhaustiveMatching issues
Sort by recently updated
recently updated
newest added

GetTypeByMetadataName returns null, and causes null reference exception. Please ban Microsoft.CodeAnalysis.Compilation.GetTypeByMetadataName for the entire repository. See this: [Compilation.GetTypeByMetadataName returns null even though the other ObsoleteAttribute is internal](https://github.com/dotnet/roslyn/issues/3864)

It would be helpful to detect the closed hierarchy of a class with private constructor and nested subclasses having either also a private constructor or a sealed modifier. This is...

enhancement

Based on the work for #42 it would be nice to have the same feature also für discriminated unions implemented the C# record syntax. ```csharp public abstract record Result {...

enhancement

The analyzer does not handle record classes. for example : ```csharp [Closed(typeof(UserNotFound))] public abstract record Response { public record UserNotFound : Response; public record Success : Response; } class Controller...

enhancement

If you create an exhaustive matching switch statement on a flags enum an error should be reported because that doesn't make sense.

bug

Whenever I install the ExhaustiveMatching NuGet package to a .NET Framework 4.7.2 project I get compiler/MSBuild warnings that `Microsoft.CodeAnalysis` version 3.3.0 was not found - unfortunately that version doesn't exist...

bug

I'd love to use this ExhaustiveMatching analyzer with a number of NuGet projects that I work on but I understand that even though this is a "private" dependency, it still...

enhancement

Hello! First of all, I absolutely love this library. I really appreciate your work on it :) I ran into a case today where I had refactored some code that...

enhancement

``` System.NullReferenceException: Object reference not set to an instance of an object. at ExhaustiveMatching.Analyzer.TypeSymbolExtensions.GetFullName(ISymbol symbol) at ExhaustiveMatching.Analyzer.SwitchStatementAnalyzer.GetTypeSymbolMatched(SyntaxNodeAnalysisContext context, ITypeSymbol type, CasePatternSwitchLabelSyntax casePattern, HashSet`1 allCases, Boolean isClosed) at ExhaustiveMatching.Analyzer.SwitchStatementAnalyzer.c__DisplayClass3_0.b__1(CasePatternSwitchLabelSyntax casePattern) at...

bug

I don't entirely remember what this was supposed to be about. However, it is referencing the unit tests `MirrorHierarchy` and `MirrorHierarchyMustBeCovered`, and the example `MirrorExample` in `MirrorHierarchy.cs`. I think the...

documentation