-
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Analysis of
public class Test
{
public void M(object o)
{
var s = o switch
{
int _ => "int",
_ => "?",
};
}
}
results in
Analyzer 'NonCopyable.NonCopyableAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'.
Exception occurred with following context:
Compilation: NonCopyableAnalyzerTest
IOperation: DeclarationPattern
SyntaxTree: ...\Test.cs
SyntaxNode: int _ [DeclarationPatternSyntax]@[107..112) (6,12)-(6,17)
System.NullReferenceException: Object reference not set to an instance of an object.
at NonCopyable.NonCopyableAnalyzer.<>c.<Initialize>b__16_8(OperationAnalysisContext oc)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c.<ExecuteOperationAction>b__63_0(ValueTuple`2 data)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info)
-----
Suppress the following diagnostics to disable this analyzer: NoCopy01, NoCopy02, NoCopy03, NoCopy04, NoCopy05, NoCopy06, NoCopy07, NoCopy08, NoCopy09, NoCopy10, NoCopy11, NoCopy12
Version: 0.6.0
Metadata
Metadata
Assignees
Labels
No labels