221 references to Contract
Microsoft.CodeAnalysis.CodeStyle (221)
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
59
Contract
.ThrowIfFalse(option.Value is ForEachExplicitCastInSourcePreference.Always or ForEachExplicitCastInSourcePreference.WhenStronglyTyped);
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (2)
62
Contract
.ThrowIfNull(change.NewText);
89
Contract
.ThrowIfNull(change.NewText);
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (3)
213
Contract
.ThrowIfTrue(additionalLocations.IsEmpty());
214
Contract
.ThrowIfTrue(tagIndices.IsEmpty());
224
Contract
.ThrowIfFalse(indices.All(idx => idx >= 0 && idx < additionalLocationsLength));
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (2)
124
Contract
.ThrowIfFalse(context.FilterSpan != symbolStartAnalyzer._symbolStartAnalysisContext.FilterSpan);
125
Contract
.ThrowIfNull(symbolStartAnalyzer._symbolStartAnalysisContext.FilterTree);
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (3)
79
Contract
.ThrowIfNull(expression.SemanticModel);
139
Contract
.ThrowIfNull(operation.SemanticModel);
158
Contract
.ThrowIfNull(operation.SemanticModel);
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
207
Contract
.ThrowIfNull(context.FilterTree);
486
Contract
.ThrowIfFalse(TryGetSyntax(getterField, out var fieldDeclaration, out var variableDeclarator, cancellationToken));
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
147
Contract
.ThrowIfTrue(seenInvocation && seenIndexAssignment);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (2)
229
Contract
.ThrowIfTrue(arguments.Count == 0);
230
Contract
.ThrowIfFalse(this.SyntaxFacts.IsSimpleMemberAccessExpression(memberAccess));
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
81
Contract
.ThrowIfNull(semanticModel);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (2)
237
Contract
.ThrowIfTrue(leftMaxEndValue < 0 && rightMaxEndValue < 0);
248
Contract
.ThrowIfFalse(rightMaxEndValue > leftMaxEndValue);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.NodeEnumerator.cs (2)
78
Contract
.ThrowIfTrue(_currentNodeHasValue);
79
Contract
.ThrowIfTrue(_stack.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (1)
27
Contract
.ThrowIfTrue(nodesAndTokens.IsDefault);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
72
Contract
.ThrowIfFalse(surrogateChar == 0 || rune == Rune.ReplacementChar,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (4)
166
Contract
.ThrowIfNull(context.FilterTree);
167
Contract
.ThrowIfFalse(context.FilterSpan.HasValue);
178
Contract
.ThrowIfNull(context.FilterTree);
179
Contract
.ThrowIfFalse(context.FilterSpan.HasValue);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalyzerConfigOptionsExtensions.cs (1)
23
Contract
.ThrowIfFalse(option.Definition.IsEditorConfigOption);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (3)
331
Contract
.ThrowIfNull(classOrStructType);
332
Contract
.ThrowIfNull(interfacesOrAbstractClasses);
333
Contract
.ThrowIfNull(isImplemented);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
498
Contract
.ThrowIfFalse(symbol.IsNormalAnonymousType());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (7)
88
Contract
.ThrowIfNull(symbol);
89
Contract
.ThrowIfNull(within);
177
Contract
.ThrowIfNull(type);
215
Contract
.ThrowIfNull(assembly);
252
Contract
.ThrowIfNull(containingType);
429
Contract
.ThrowIfNull(withinType);
430
Contract
.ThrowIfNull(originalContainingType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (1)
15
Contract
.ThrowIfNull(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (1)
108
Contract
.ThrowIfTrue(b1 != b2);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (3)
109
Contract
.ThrowIfNull(semanticModel.ParentModel);
110
Contract
.ThrowIfTrue(semanticModel.ParentModel.IsSpeculativeSemanticModel);
111
Contract
.ThrowIfTrue(semanticModel.ParentModel.ParentModel != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
19
Contract
.ThrowIfNull(text);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (2)
49
Contract
.ThrowIfNull(stack);
50
Contract
.ThrowIfNull(range);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (10)
16
Contract
.ThrowIfNull(line);
31
Contract
.ThrowIfNull(line);
46
Contract
.ThrowIfNull(lineText);
57
Contract
.ThrowIfNull(lineText);
208
Contract
.ThrowIfNull(line);
209
Contract
.ThrowIfFalse(0 <= endPosition && endPosition <= line.Length);
210
Contract
.ThrowIfFalse(tabSize > 0);
217
Contract
.ThrowIfNull(line);
218
Contract
.ThrowIfFalse(column >= 0);
219
Contract
.ThrowIfFalse(tabSize > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (4)
107
Contract
.ThrowIfNull(node);
179
Contract
.ThrowIfTrue(node1.RawKind == 0 || node2.RawKind == 0);
298
Contract
.ThrowIfNull(nodes);
299
Contract
.ThrowIfFalse(nodes.Any());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
41
Contract
.ThrowIfTrue(token1.RawKind == 0 || token2.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
69
Contract
.ThrowIfNull(syntaxTree);
131
Contract
.ThrowIfNull(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
34
Contract
.ThrowIfNull(formattingRules);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (4)
58
Contract
.ThrowIfNull(engine);
59
Contract
.ThrowIfNull(tokenStream);
125
Contract
.ThrowIfNull(operations);
414
Contract
.ThrowIfFalse(intervals.Length == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (3)
35
Contract
.ThrowIfNull(tokenStream);
36
Contract
.ThrowIfNull(formattingRules);
37
Contract
.ThrowIfNull(rootNode);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (2)
32
Contract
.ThrowIfNull(node);
33
Contract
.ThrowIfNull(formattingResults);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
94
Contract
.ThrowIfTrue(treeData.Root.IsInvalidTokenRange(startToken, endToken));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (6)
52
Contract
.ThrowIfFalse(triviaInfo.LineBreaks == 0);
85
Contract
.ThrowIfFalse(triviaInfo.LineBreaks == 0);
123
Contract
.ThrowIfFalse(triviaInfo.LineBreaks == 0);
262
Contract
.ThrowIfNull(previousChangesMap);
451
Contract
.ThrowIfFalse(triviaInfo.SecondTokenIsFirstTokenOnLine);
478
Contract
.ThrowIfFalse(baseToken.RawKind != 0 && startToken.RawKind != 0 && endToken.RawKind != 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractTriviaDataFactory.AbstractComplexTrivia.cs (3)
23
Contract
.ThrowIfNull(treeInfo);
76
Contract
.ThrowIfFalse(line > 0);
133
Contract
.ThrowIfFalse(list.Count > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractTriviaDataFactory.cs (4)
31
Contract
.ThrowIfNull(treeInfo);
92
Contract
.ThrowIfFalse(space >= 0);
111
Contract
.ThrowIfFalse(lineBreaks >= 0);
112
Contract
.ThrowIfFalse(indentation >= 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractTriviaDataFactory.ModifiedWhitespace.cs (1)
27
Contract
.ThrowIfNull(original);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractTriviaDataFactory.Whitespace.cs (2)
27
Contract
.ThrowIfFalse(space >= 0);
57
Contract
.ThrowIfFalse(line > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\ChainedFormattingRules.cs (1)
34
Contract
.ThrowIfNull(formattingRules);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenData.cs (4)
30
Contract
.ThrowIfNull(tokenStream);
31
Contract
.ThrowIfFalse((indexInStream == -1) || (0 <= indexInStream && indexInStream < tokenStream.TokenCount));
64
Contract
.ThrowIfFalse(this.TokenStream == other.TokenStream);
84
Contract
.ThrowIfNull(commonRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenPairWithOperations.cs (2)
28
Contract
.ThrowIfNull(tokenStream);
30
Contract
.ThrowIfFalse(0 <= tokenPairIndex && tokenPairIndex < tokenStream.TokenCount - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (10)
138
Contract
.ThrowIfFalse(0 <= index && index < this.TokenCount);
237
Contract
.ThrowIfNull(data);
243
Contract
.ThrowIfNull(data);
249
Contract
.ThrowIfNull(data);
250
Contract
.ThrowIfFalse(0 <= pairIndex && pairIndex < this.TokenCount - 1);
429
Contract
.ThrowIfFalse(this.FormatBeginningOfTree);
441
Contract
.ThrowIfFalse(this.FormatEndOfTree);
453
Contract
.ThrowIfFalse(0 <= pairIndex && pairIndex < this.TokenCount - 1);
465
Contract
.ThrowIfFalse(0 <= pairIndex && pairIndex < this.TokenCount - 1);
478
Contract
.ThrowIfTrue(token.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.cs (1)
41
Contract
.ThrowIfNull(root);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Debug.cs (1)
19
Contract
.ThrowIfFalse(text == _debugNodeData.GetTextBetween(token1, token2));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs (2)
18
Contract
.ThrowIfFalse(root.GetFirstToken(includeZeroWidth: true).RawKind != 0);
23
Contract
.ThrowIfTrue(token.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (2)
20
Contract
.ThrowIfNull(text);
26
Contract
.ThrowIfTrue(token.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.StructuredTrivia.cs (1)
22
Contract
.ThrowIfFalse(trivia.HasStructure);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
184
Contract
.ThrowIfFalse(lines.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AdjustNewLinesOperation.cs (3)
16
Contract
.ThrowIfFalse(option != AdjustNewLinesOption.ForceLines || line > 0);
17
Contract
.ThrowIfFalse(option != AdjustNewLinesOption.PreserveLines || line >= 0);
18
Contract
.ThrowIfFalse(option != AdjustNewLinesOption.ForceLinesIfOnSingleLine || line > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AdjustSpacesOperation.cs (1)
16
Contract
.ThrowIfFalse(space >= 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AlignTokensOperation.cs (1)
18
Contract
.ThrowIfNull(tokens);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (3)
18
Contract
.ThrowIfTrue(anchorToken.RawKind == 0);
19
Contract
.ThrowIfTrue(textSpan.Start < 0 || textSpan.Length < 0);
21
Contract
.ThrowIfTrue(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (10)
17
Contract
.ThrowIfFalse(option.IsMaskOn(IndentBlockOption.PositionMask));
19
Contract
.ThrowIfTrue(textSpan.Start < 0 || textSpan.Length < 0);
20
Contract
.ThrowIfTrue(startToken.RawKind == 0);
21
Contract
.ThrowIfTrue(endToken.RawKind == 0);
36
Contract
.ThrowIfFalse(option.IsMaskOn(IndentBlockOption.PositionMask));
38
Contract
.ThrowIfFalse(option.IsMaskOn(IndentBlockOption.RelativePositionMask));
39
Contract
.ThrowIfFalse(baseToken.Span.End <= textSpan.Start);
41
Contract
.ThrowIfTrue(textSpan.Start < 0 || textSpan.Length < 0);
42
Contract
.ThrowIfTrue(startToken.RawKind == 0);
43
Contract
.ThrowIfTrue(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (3)
22
Contract
.ThrowIfTrue(textSpan.Start < 0 || textSpan.Length < 0);
23
Contract
.ThrowIfTrue(startToken.RawKind == 0);
24
Contract
.ThrowIfTrue(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
72
Contract
.ThrowIfNull(context);
73
Contract
.ThrowIfNull(formattingRules);
74
Contract
.ThrowIfNull(originalString);
76
Contract
.ThrowIfFalse(lineBreaks >= 0);
77
Contract
.ThrowIfFalse(spaces >= 0);
79
Contract
.ThrowIfTrue(token1 == default && token2 == default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (1)
21
Contract
.ThrowIfNull(s_currentLogger);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer`1.cs (1)
55
Contract
.ThrowIfTrue(RoslynString.IsNullOrEmpty(editorConfigStringForValue));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
52
Contract
.ThrowIfNull(documentationComment);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
29
Contract
.ThrowIfNull(node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (5)
22
Contract
.ThrowIfFalse(IsBodyLevelSymbol(symbol));
23
Contract
.ThrowIfTrue(symbol.DeclaringSyntaxReferences.IsEmpty && symbol.Locations.IsEmpty);
62
Contract
.ThrowIfTrue(symbol.DeclaringSyntaxReferences.IsEmpty && symbol.Locations.IsEmpty);
66
Contract
.ThrowIfFalse(locations.All(loc => loc.IsInSource));
258
Contract
.ThrowIfTrue(semanticModel.SyntaxTree != containerDeclaration.SyntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BuiltinOperatorSymbolKey.cs (1)
48
Contract
.ThrowIfNull(returnTypeSymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (2)
86
Contract
.ThrowIfFalse(typeArguments.IsDefault);
91
Contract
.ThrowIfTrue(typeArguments.IsDefault);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.FunctionPointerTypeSymbolKey.cs (2)
71
Contract
.ThrowIfFalse(parameterTypes.IsDefault);
76
Contract
.ThrowIfTrue(parameterTypes.IsDefault);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
64
Contract
.ThrowIfFalse(typeArguments.IsDefault);
70
Contract
.ThrowIfTrue(typeArguments.IsDefault);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (5)
126
Contract
.ThrowIfNull(result);
417
Contract
.ThrowIfTrue(_methodSymbolStack.Count == 0);
418
Contract
.ThrowIfFalse(Equals(method, _methodSymbolStack[^1]));
433
Contract
.ThrowIfTrue(_contextualSymbolStack.Count == 0);
434
Contract
.ThrowIfFalse(Equals(contextualSymbol, _contextualSymbolStack.Peek()));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
518
Contract
.ThrowIfTrue(_methodSymbolStack.Count == 0);
519
Contract
.ThrowIfFalse(method.Equals(_methodSymbolStack[^1]));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (1)
15
Contract
.ThrowIfFalse(symbol.TypeParameterKind == TypeParameterKind.Method);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\TestHooks\TaskExtensions.cs (2)
53
Contract
.ThrowIfNull(task, nameof(task));
90
Contract
.ThrowIfNull(task, nameof(task));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AnnotationTable.cs (1)
103
Contract
.ThrowIfNull(ra.Data);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (12)
115
Contract
.ThrowIfNull(asynchronousComputeFunction);
139
Contract
.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!");
152
Contract
.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
161
Contract
.ThrowIfTrue(_asynchronousComputationCancellationSource != null &&
165
Contract
.ThrowIfTrue(_requests != null &&
170
Contract
.ThrowIfTrue(_requests != null &&
174
Contract
.ThrowIfTrue(_cachedResult != null &&
179
Contract
.ThrowIfTrue(_asynchronousComputeFunction == null && _synchronousComputeFunction != null);
259
Contract
.ThrowIfNull(_synchronousComputeFunction);
311
Contract
.ThrowIfNull(_cachedResult, $"We called {nameof(CompleteWithTask)} with a result, there should be a cached result.");
376
Contract
.ThrowIfTrue(_computationActive);
377
Contract
.ThrowIfNull(_asynchronousComputeFunction);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (7)
53
Contract
.ThrowIfNull(concatenatedLowerCaseWords, nameof(_concatenatedLowerCaseWords));
54
Contract
.ThrowIfTrue(nodes.IsDefault, $"{nameof(nodes)}.{nameof(nodes.IsDefault)}");
55
Contract
.ThrowIfTrue(edges.IsDefault, $"{nameof(edges)}.{nameof(edges.IsDefault)}");
66
Contract
.ThrowIfNull(value, nameof(value));
67
Contract
.ThrowIfNull(_concatenatedLowerCaseWords, nameof(_concatenatedLowerCaseWords));
68
Contract
.ThrowIfTrue(_nodes.IsDefault, $"{nameof(_nodes)}.{nameof(_nodes.IsDefault)}");
69
Contract
.ThrowIfTrue(_edges.IsDefault, $"{nameof(_edges)}.{nameof(_edges.IsDefault)}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (15)
48
Contract
.ThrowIfNull(root);
49
Contract
.ThrowIfFalse(spans.Count > 0);
84
Contract
.ThrowIfNull(root);
85
Contract
.ThrowIfTrue(textSpan.IsEmpty);
124
Contract
.ThrowIfFalse(startToken.Equals(endToken) || startToken.Span.End <= endToken.SpanStart);
148
Contract
.ThrowIfNull(tree);
149
Contract
.ThrowIfTrue(token.RawKind == 0);
170
Contract
.ThrowIfTrue(token1.RawKind == 0 && token2.RawKind == 0);
171
Contract
.ThrowIfTrue(token1.Equals(token2));
286
Contract
.ThrowIfFalse(backwardPosition < parentNode.FullSpan.End);
290
Contract
.ThrowIfTrue(nextToken.RawKind == 0);
311
Contract
.ThrowIfNull(parentNode);
312
Contract
.ThrowIfFalse(parentNode.FullSpan.Start < forwardPosition);
316
Contract
.ThrowIfTrue(previousToken.RawKind == 0);
360
Contract
.ThrowIfNull(root);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumerableConditionalWeakTable.cs (1)
113
Contract
.ThrowIfFalse(_table.Remove(key));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\FixedSizeArrayBuilder.cs (5)
52
Contract
.ThrowIfTrue(_index + values.Length > _values.Length);
59
Contract
.ThrowIfTrue(_index + values.Count > _values.Length);
66
Contract
.ThrowIfTrue(_index + values.Count > _values.Length);
73
Contract
.ThrowIfTrue(_index + values.Count > _values.Length);
107
Contract
.ThrowIfTrue(_index != _values.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
172
=>
Contract
.ThrowIfFalse(LockHeldByMe());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ReferenceCountedDisposable.cs (1)
292
Contract
.ThrowIfNull(weakInstance);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (8)
89
Contract
.ThrowIfNull(continuationAction, nameof(continuationAction));
108
Contract
.ThrowIfNull(continuationFunction, nameof(continuationFunction));
122
Contract
.ThrowIfNull(continuationAction, nameof(continuationAction));
154
Contract
.ThrowIfNull(continuationFunction, nameof(continuationFunction));
199
Contract
.ThrowIfNull(continuationFunction, nameof(continuationFunction));
318
Contract
.ThrowIfNull(continuationFunction, nameof(continuationFunction));
381
Contract
.ThrowIfFalse(task.IsCompleted);
397
Contract
.ThrowIfFalse(task.IsCompleted);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ValueTaskExtensions.cs (1)
21
Contract
.ThrowIfFalse(task.IsCompleted, message);