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