30 references to Assert
Microsoft.CodeAnalysis (5)
CodeGen\PrivateImplementationDetails.cs (2)
307
RoslynDebug.
Assert
(alignment is 1 or 2 or 4 or 8, $"Unexpected alignment: {alignment}");
695
RoslynDebug.
Assert
(alignment is 1 or 2 or 4 or 8, $"Unexpected alignment: {alignment}");
Emit\CommonPEModuleBuilder.cs (1)
1086
RoslynDebug.
Assert
(alignment is 1 or 2 or 4 or 8, $"Unexpected alignment: {alignment}");
Operations\OperationMapBuilder.cs (1)
112
RoslynDebug.
Assert
(
WellKnownTypes.cs (1)
754
RoslynDebug.
Assert
(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Microsoft.CodeAnalysis.CSharp (25)
Binder\Binder.ValueChecks.cs (3)
971
RoslynDebug.
Assert
(expr is not BoundValuePlaceholderBase, $"Placeholder kind {expr.Kind} should be explicitly handled");
4664
RoslynDebug.
Assert
(false, $"{expr.Kind} expression of {expr.Type} type");
5500
RoslynDebug.
Assert
(false, $"{expr.Kind} expression of {expr.Type} type");
Binder\RefSafetyAnalysis.cs (2)
286
RoslynDebug.
Assert
(added, $"Expression {expr} `{expr.Syntax}` visited more than once.");
299
RoslynDebug.
Assert
(_visited.Contains(expr), $"Expected {expr} `{expr.Syntax}` to be visited.");
Binder\Semantics\Conversions\Conversion.cs (1)
257
RoslynDebug.
Assert
(isTrivial, $"this conversion needs additional data: {kind}");
BoundTree\BoundDagEvaluation.cs (1)
87
RoslynDebug.
Assert
(_id == -1, $"Id was set to {_id} and set again to {value}");
BoundTree\Formatting.cs (1)
21
RoslynDebug.
Assert
(this.Type is { }, $"Unexpected null type in {this.GetType().Name}");
Compiler\DocumentationCommentCompiler.cs (1)
1276
RoslynDebug.
Assert
(_indentDepth == t.InitialIndentDepth, $"Temporary strings should be indent-neutral (was {t.InitialIndentDepth}, is {_indentDepth})");
Errors\ErrorFacts.cs (2)
138
RoslynDebug.
Assert
(!string.IsNullOrEmpty(message), $"{code}");
146
RoslynDebug.
Assert
(!string.IsNullOrEmpty(message), $"{code}");
FlowAnalysis\AbstractFlowPass.cs (1)
896
RoslynDebug.
Assert
(false, $"Should Visit{node.Kind} be overridden in {this.GetType().Name}?");
FlowAnalysis\NullableWalker.cs (1)
1955
RoslynDebug.
Assert
(AreCloseEnough(originalSymbol, updatedSymbol), $"Attempting to set {node.Syntax} from {originalSymbol.ToDisplayString()} to {updatedSymbol.ToDisplayString()}");
FlowAnalysis\NullableWalker.DebugVerifier.cs (4)
50
RoslynDebug.
Assert
(false, $"Analyzed {verifier._analyzedNullabilityMap.Count} nodes in NullableWalker, but DebugVerifier expects {verifier._visitedExpressions.Count}. Example of unverified node: {analyzedNode.GetDebuggerDisplay()}");
60
RoslynDebug.
Assert
(false, $"Analyzed {verifier._analyzedNullabilityMap.Count} nodes in NullableWalker, but DebugVerifier expects {verifier._visitedExpressions.Count}. Example of unanalyzed node: {verifiedNode.GetDebuggerDisplay()}");
71
RoslynDebug.
Assert
(!_analyzedNullabilityMap.ContainsKey(expression), $"Found unexpected {expression} `{expression.Syntax}` in the map.");
75
RoslynDebug.
Assert
(_analyzedNullabilityMap.ContainsKey(expression), $"Did not find {expression} `{expression.Syntax}` in the map.");
FlowAnalysis\NullableWalker.SnapshotManager.cs (5)
118
RoslynDebug.
Assert
(_walkerSharedStates.Length > _incrementalSnapshots[position].snapshot.SharedStateIndex, $"Did not find shared state for {node} `{node.Syntax}`.");
126
RoslynDebug.
Assert
((object)originalSymbol != updatedSymbol, $"Recorded exact same symbol for {debugText}");
127
RoslynDebug.
Assert
(originalSymbol is object, $"Recorded null original symbol for {debugText}");
128
RoslynDebug.
Assert
(updatedSymbol is object, $"Recorded null updated symbol for {debugText}");
129
RoslynDebug.
Assert
(AreCloseEnough(originalSymbol, updatedSymbol), @$"Symbol for `{debugText}` changed:
Lowering\LocalRewriter\LocalRewriter.cs (2)
1120
RoslynDebug.
Assert
(expr is not BoundValuePlaceholderBase, $"Placeholder kind {expr.Kind} must be handled explicitly");
1277
RoslynDebug.
Assert
(false, $"Bound nodes of kind {node.Kind} should not survive past local rewriting");
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
226
RoslynDebug.
Assert
(SyntaxBindingUtilities.BindsToResumableStateMachineState(node) || SyntaxBindingUtilities.BindsToTryStatement(node), $"Unexpected syntax: {node.Kind()}");