220 references to ThrowIfTrue
Microsoft.CodeAnalysis.CSharp.Features (22)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
74
Contract.
ThrowIfTrue
(localFunction is { Body: null, ExpressionBody: null });
ConvertToExtension\ConvertToExtensionCodeRefactoringProvider.cs (3)
199
Contract.
ThrowIfTrue
(allExtensionMethods.IsEmpty);
223
Contract.
ThrowIfTrue
(allExtensionMethods.IsEmpty);
257
Contract.
ThrowIfTrue
(group.IsEmpty);
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
49
Contract.
ThrowIfTrue
(result.IsDefault);
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (1)
144
Contract.
ThrowIfTrue
(characters.IsDefaultOrEmpty());
Copilot\CSharpImplementNotImplementedExceptionFixProvider.cs (1)
126
Contract.
ThrowIfTrue
(string.IsNullOrWhiteSpace(implementationDetails.Message));
ExtractMethod\CSharpMethodExtractor.cs (1)
127
Contract.
ThrowIfTrue
(memberNode.Kind() == SyntaxKind.NamespaceDeclaration);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
41
Contract.
ThrowIfTrue
(statementsOrFieldToInsert.IsDefaultOrEmpty);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (3)
317
Contract.
ThrowIfTrue
(AnalyzerResult.MethodTypeParametersInDeclaration.IsEmpty);
874
Contract.
ThrowIfTrue
(variableInfos.IsEmpty);
891
Contract.
ThrowIfTrue
(variableInfos.IsEmpty && !needsControlFlowValue);
ExtractMethod\CSharpSelectionResult.cs (2)
71
Contract.
ThrowIfTrue
(IsExtractMethodOnExpression);
82
Contract.
ThrowIfTrue
(IsExtractMethodOnExpression);
ExtractMethod\CSharpSelectionResult.StatementResult.cs (1)
39
Contract.
ThrowIfTrue
(IsExtractMethodOnExpression);
SignatureHelp\GenericNamePartiallyWrittenSignatureHelpProvider.cs (1)
28
Contract.
ThrowIfTrue
(nextToken.Kind() == 0);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
359
Contract.
ThrowIfTrue
(useSpread && arguments.Count != 1);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
1206
Contract.
ThrowIfTrue
(arguments.Count != 1);
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
52
Contract.
ThrowIfTrue
(arrowToken.Kind() != SyntaxKind.EqualsGreaterThanToken);
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
52
Contract.
ThrowIfTrue
(questionToken.Kind() != SyntaxKind.QuestionToken);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
511
Contract.
ThrowIfTrue
(expressions.Length >= 2 && match.UseSpread);
StringIndentation\CSharpStringIndentationService.cs (1)
178
Contract.
ThrowIfTrue
(lastLine.LineNumber - firstLine.LineNumber < 2);
Microsoft.CodeAnalysis.CSharp.Workspaces (16)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
3127
Contract.
ThrowIfTrue
(ReferenceEquals(root, node));
3148
Contract.
ThrowIfTrue
(ReferenceEquals(root, declaration));
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
268
Contract.
ThrowIfTrue
(node is TypeDeclarationSyntax);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (3)
36
Contract.
ThrowIfTrue
(trivia.Kind() == SyntaxKind.EndOfLineTrivia);
37
Contract.
ThrowIfTrue
(trivia.Kind() == SyntaxKind.SkippedTokensTrivia);
38
Contract.
ThrowIfTrue
(trivia.Kind() == SyntaxKind.PreprocessingMessageTrivia);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (3)
47
Contract.
ThrowIfTrue
(startToken.Kind() is SyntaxKind.None or SyntaxKind.EndOfFileToken);
48
Contract.
ThrowIfTrue
(endToken.Kind() is SyntaxKind.None or SyntaxKind.EndOfFileToken);
78
Contract.
ThrowIfTrue
(token.Kind() is SyntaxKind.None or SyntaxKind.EndOfFileToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
184
Contract.
ThrowIfTrue
(castNode.WalkUpParentheses().ContainsDiagnostics);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (1)
22
Contract.
ThrowIfTrue
(endToken.Kind() == SyntaxKind.None);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (1)
74
Contract.
ThrowIfTrue
(token.Kind() == SyntaxKind.None);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (4)
952
Contract.
ThrowIfTrue
(previousToken.HasValue && previousToken.Value != operatorToken);
1120
Contract.
ThrowIfTrue
(previousToken.HasValue && previousToken.Value != coalesceExpression.OperatorToken);
1984
Contract.
ThrowIfTrue
(previousToken.HasValue && previousToken.Value != prefixUnaryExpression.OperatorToken);
2040
Contract.
ThrowIfTrue
(previousToken.HasValue && previousToken.Value != awaitExpression.AwaitKeyword);
Microsoft.CodeAnalysis.Features (53)
CodeFixes\CodeFixCollection.cs (1)
40
Contract.
ThrowIfTrue
(diagnostics.IsDefaultOrEmpty);
CodeLens\CodeLensReferencesService.cs (1)
245
Contract.
ThrowIfTrue
(mappedSpans.IsDefaultOrEmpty);
Completion\Providers\AbstractAwaitCompletionProvider.cs (1)
125
Contract.
ThrowIfTrue
(dotAwaitContext == DotAwaitContext.None);
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (1)
96
Contract.
ThrowIfTrue
(quotedPath[0] != '"');
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (2)
71
Contract.
ThrowIfTrue
(placeholderIndex < 0);
358
Contract.
ThrowIfTrue
(placeholderIndex < 0);
Diagnostics\Service\DiagnosticAnalyzerService.ProjectStates.cs (1)
68
Contract.
ThrowIfTrue
(newHostAnalyzers.Count > 0);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
521
Contract.
ThrowIfTrue
(newActiveStatementSpans.IsDefault);
6606
Contract.
ThrowIfTrue
(oldCapture.IsThis);
EditAndContinue\ActiveStatementExceptionRegions.cs (1)
23
Contract.
ThrowIfTrue
(spans.IsDefault);
EditAndContinue\DebuggingSession.cs (1)
546
Contract.
ThrowIfTrue
(solutionUpdate.ModuleUpdates.Updates.IsEmpty && solutionUpdate.ProjectsToRebuild.IsEmpty);
EditAndContinue\EditSession.cs (2)
827
Contract.
ThrowIfTrue
(analysis.ActiveStatements.IsDefault);
1563
Contract.
ThrowIfTrue
(syntaxError != null);
EmbeddedLanguages\AbstractEmbeddedLanguageFeatureService.cs (1)
118
Contract.
ThrowIfTrue
(services.IsDefaultOrEmpty);
EmbeddedLanguages\RegularExpressions\RegexParser.cs (2)
377
Contract.
ThrowIfTrue
(startCharacter != text[firstCharIndex.Value]);
378
Contract.
ThrowIfTrue
(lastCharacter != text[lastCharIndex.Value]);
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
143
Contract.
ThrowIfTrue
(fields.Length == 0);
Extensions\ExtensionFolder.cs (2)
117
Contract.
ThrowIfTrue
(!Monitor.IsEntered(_extensionMessageHandlerService._gate));
140
Contract.
ThrowIfTrue
(!Monitor.IsEntered(_extensionMessageHandlerService._gate));
Extensions\ExtensionMessageHandlerService.cs (1)
68
Contract.
ThrowIfTrue
(!Monitor.IsEntered(_gate));
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingIdleProcessor.cs (1)
82
Contract.
ThrowIfTrue
(_isPaused_doNotAccessDirectly);
ExternalAccess\VSTypeScript\Api\VSTypeScriptDiagnosticData.cs (1)
41
Contract.
ThrowIfTrue
(useMapped);
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (2)
60
Contract.
ThrowIfTrue
(projects.IsEmpty);
61
Contract.
ThrowIfTrue
(projects.Select(p => p.Language).Distinct().Count() != 1);
ExtractMethod\AbstractSyntaxTriviaService.cs (1)
29
Contract.
ThrowIfTrue
(textSpan.IsEmpty);
ExtractMethod\MethodExtractor.Analyzer.cs (1)
363
Contract.
ThrowIfTrue
(variable.UseAsReturnValue);
ExtractMethod\MethodExtractor.CodeGenerator.cs (1)
297
Contract.
ThrowIfTrue
(AnalyzerResult.GetVariablesToSplitOrMoveOutToCallSite().Any(v => v.UseAsReturnValue));
ExtractMethod\OperationStatus.cs (1)
20
Contract.
ThrowIfTrue
(reasons.IsDefault);
ExtractMethod\SelectionResult.cs (3)
108
Contract.
ThrowIfTrue
(IsExtractMethodOnExpression);
116
Contract.
ThrowIfTrue
(IsExtractMethodOnExpression);
209
Contract.
ThrowIfTrue
(IsExtractMethodOnExpression);
FindUsages\DefinitionItem.cs (2)
232
Contract.
ThrowIfTrue
(sourceSpans.IsDefault);
233
Contract.
ThrowIfTrue
(metadataLocations.IsDefault);
FindUsages\DefinitionItemFactory.cs (1)
196
Contract.
ThrowIfTrue
(namespaceSymbol.ConstituentNamespaces.IsEmpty);
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
790
Contract.
ThrowIfTrue
(symbol.TypeParameterKind == TypeParameterKind.Cref);
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (2)
82
Contract.
ThrowIfTrue
(projects.IsEmpty);
83
Contract.
ThrowIfTrue
(projects.Select(p => p.Language).Distinct().Count() != 1);
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (2)
33
Contract.
ThrowIfTrue
(projects.IsEmpty);
34
Contract.
ThrowIfTrue
(projects.Select(p => p.Language).Distinct().Count() != 1);
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (2)
160
Contract.
ThrowIfTrue
(projects.IsEmpty);
161
Contract.
ThrowIfTrue
(projects.Select(p => p.Language).Distinct().Count() != 1);
QuickInfo\Presentation\TaggedTextExtensions.cs (1)
219
Contract.
ThrowIfTrue
(_lines.Count == 0);
Rename\SymbolicRenameInfo.cs (3)
64
Contract.
ThrowIfTrue
(this.IsError);
91
Contract.
ThrowIfTrue
(this.IsError);
98
Contract.
ThrowIfTrue
(this.IsError);
SignatureHelp\SignatureHelpItems.cs (2)
70
Contract.
ThrowIfTrue
(items.IsEmpty());
71
Contract.
ThrowIfTrue
(selectedItem.HasValue && selectedItem.Value >= items.Count);
SignatureHelp\SignatureHelpTriggerInfo.cs (1)
15
Contract.
ThrowIfTrue
(triggerReason == SignatureHelpTriggerReason.TypeCharCommand && triggerCharacter == null);
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (2)
210
Contract.
ThrowIfTrue
(additionalLocations.IsEmpty());
211
Contract.
ThrowIfTrue
(tagIndices.IsEmpty());
src\roslyn\src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
177
Contract.
ThrowIfTrue
(seenInvocation && seenIndexAssignment);
src\roslyn\src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
249
Contract.
ThrowIfTrue
(arguments.Count == 0);
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
177
Contract.
ThrowIfTrue
(field == null || property == null);
Microsoft.CodeAnalysis.Workspaces (129)
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (5)
101
Contract.
ThrowIfTrue
(commonLeftWidth > oldRootWidth);
102
Contract.
ThrowIfTrue
(commonLeftWidth > newRootWidth);
103
Contract.
ThrowIfTrue
(commonRightWidth > oldRootWidth);
104
Contract.
ThrowIfTrue
(commonRightWidth > newRootWidth);
178
Contract.
ThrowIfTrue
(oldRoot.IsIncrementallyIdenticalTo(newRoot));
CodeCleanup\AbstractCodeCleanerService.cs (5)
239
Contract.
ThrowIfTrue
(spanMarkerType == SpanMarkerType.EndOfFile);
240
Contract.
ThrowIfTrue
(previousToken.RawKind == 0);
255
Contract.
ThrowIfTrue
(spanMarkerType == SpanMarkerType.BeginningOfFile);
256
Contract.
ThrowIfTrue
(nextToken.RawKind == 0);
371
Contract.
ThrowIfTrue
(startToken.RawKind == 0 || endToken.RawKind == 0);
CodeFixes\CodeFix.cs (1)
28
Contract.
ThrowIfTrue
(diagnostics.IsDefaultOrEmpty);
CodeFixesAndRefactorings\FixAllLogger.cs (1)
94
Contract.
ThrowIfTrue
(completed && timedOut);
Editing\SyntaxGenerator.cs (1)
1440
Contract.
ThrowIfTrue
(ReferenceEquals(root, node));
FindSymbols\SymbolFinder_Helpers.cs (1)
125
Contract.
ThrowIfTrue
(equivalentTypesWithDifferingAssemblies.Count == 0);
FindSymbols\SymbolFinder.FindReferencesServerCallback.cs (1)
42
Contract.
ThrowIfTrue
(dehydrated.Symbols.Count == 0);
FindSymbols\TopLevelSyntaxTree\DeclaredSymbolInfo.cs (2)
133
Contract.
ThrowIfTrue
((uint)accessibility > Max4BitValue);
134
Contract.
ThrowIfTrue
((uint)kind > Max5BitValue);
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (2)
56
Contract.
ThrowIfTrue
(newDocumentsAndHashes.Count == 0);
95
Contract.
ThrowIfTrue
(newDocumentsAndHashes.Count < 2);
Options\DocumentOptionSet.cs (1)
78
Contract.
ThrowIfTrue
(internallyDefinedOption.Type == typeof(NamingStylePreferences));
Remote\RemoteServiceCallbackDispatcher.cs (1)
25
Contract.
ThrowIfTrue
(callbackInstances?.TryRemove(Id, out _) == false);
Remote\RemoteUtilities.cs (1)
69
Contract.
ThrowIfTrue
(tuple.documentId.IsSourceGenerated && !document.IsRazorSourceGeneratedDocument());
Rename\IRemoteRenamerService.cs (1)
91
Contract.
ThrowIfTrue
(DocumentId.IsSourceGenerated && !document.IsRazorSourceGeneratedDocument());
Rename\LightweightRenameLocations.cs (3)
39
Contract.
ThrowIfTrue
(locations.IsDefault);
40
Contract.
ThrowIfTrue
(implicitLocations.IsDefault);
41
Contract.
ThrowIfTrue
(referencedSymbols.IsDefault);
Rename\Renamer.cs (2)
162
Contract.
ThrowIfTrue
(string.IsNullOrEmpty(newName));
204
Contract.
ThrowIfTrue
(string.IsNullOrEmpty(newName));
Rename\SymbolicRenameLocations.cs (3)
42
Contract.
ThrowIfTrue
(locations.IsDefault);
43
Contract.
ThrowIfTrue
(implicitLocations.IsDefault);
44
Contract.
ThrowIfTrue
(referencedSymbols.IsDefault);
Serialization\SerializedPortableExecutableReference.cs (1)
35
Contract.
ThrowIfTrue
(storageHandles.IsDefault);
Serialization\SerializerService_Reference.cs (2)
371
Contract.
ThrowIfTrue
(handles.Count == 0);
454
Contract.
ThrowIfTrue
(length != storageHandle.Identifier.Size);
Shared\Extensions\FileLinePositionSpanExtensions.cs (2)
88
Contract.
ThrowIfTrue
(start < text.Lines.GetLinePosition(0));
89
Contract.
ThrowIfTrue
(end > text.Lines.GetLinePosition(text.Length));
Shared\Extensions\SourceTextExtensions.cs (7)
200
Contract.
ThrowIfTrue
(buffer.Length != CharArrayLength);
256
Contract.
ThrowIfTrue
(chunkSize != CharArrayLength);
269
Contract.
ThrowIfTrue
(length > CharArrayLength);
273
Contract.
ThrowIfTrue
(currentChunk.Length != CharArrayLength);
276
Contract.
ThrowIfTrue
(i < numberOfChunks - 1 && currentChunkLength != CharArrayLength);
285
Contract.
ThrowIfTrue
(chunksArray.Any(static (c, s) => c.Length != s, CharArrayLength));
369
Contract.
ThrowIfTrue
(Position > Length);
Shared\Utilities\BloomFilter_Serialization.cs (1)
28
Contract.
ThrowIfTrue
(bitArray.Length % 8 != 0);
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
64
Contract.
ThrowIfTrue
(condition, lineNumber, filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
237
Contract.
ThrowIfTrue
(leftMaxEndValue < 0 && rightMaxEndValue < 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.NodeEnumerator.cs (2)
77
Contract.
ThrowIfTrue
(_currentNodeHasValue);
78
Contract.
ThrowIfTrue
(_stack.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (1)
27
Contract.
ThrowIfTrue
(nodesAndTokens.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
46
Contract.
ThrowIfTrue
(width > MaxWidth);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (1)
105
Contract.
ThrowIfTrue
(b1 != b2);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
102
Contract.
ThrowIfTrue
(semanticModel.ParentModel.IsSpeculativeSemanticModel);
103
Contract.
ThrowIfTrue
(semanticModel.ParentModel.ParentModel != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
179
Contract.
ThrowIfTrue
(node1.RawKind == 0 || node2.RawKind == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
94
Contract.
ThrowIfTrue
(treeData.Root.IsInvalidTokenRange(startToken, endToken));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
476
Contract.
ThrowIfTrue
(token.RawKind == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs (1)
22
Contract.
ThrowIfTrue
(token.RawKind == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (1)
25
Contract.
ThrowIfTrue
(token.RawKind == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (3)
17
Contract.
ThrowIfTrue
(anchorToken.RawKind == 0);
18
Contract.
ThrowIfTrue
(textSpan.Start < 0 || textSpan.Length < 0);
20
Contract.
ThrowIfTrue
(endToken.RawKind == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (6)
18
Contract.
ThrowIfTrue
(textSpan.Start < 0 || textSpan.Length < 0);
19
Contract.
ThrowIfTrue
(startToken.RawKind == 0);
20
Contract.
ThrowIfTrue
(endToken.RawKind == 0);
40
Contract.
ThrowIfTrue
(textSpan.Start < 0 || textSpan.Length < 0);
41
Contract.
ThrowIfTrue
(startToken.RawKind == 0);
42
Contract.
ThrowIfTrue
(endToken.RawKind == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (3)
21
Contract.
ThrowIfTrue
(textSpan.Start < 0 || textSpan.Length < 0);
22
Contract.
ThrowIfTrue
(startToken.RawKind == 0);
23
Contract.
ThrowIfTrue
(endToken.RawKind == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
78
Contract.
ThrowIfTrue
(token1 == default && token2 == default);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer`1.cs (1)
58
Contract.
ThrowIfTrue
(RoslynString.IsNullOrEmpty(editorConfigStringForValue));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (3)
22
Contract.
ThrowIfTrue
(symbol.DeclaringSyntaxReferences.IsEmpty && symbol.Locations.IsEmpty);
61
Contract.
ThrowIfTrue
(symbol.DeclaringSyntaxReferences.IsEmpty && symbol.Locations.IsEmpty);
257
Contract.
ThrowIfTrue
(semanticModel.SyntaxTree != containerDeclaration.SyntaxTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (1)
90
Contract.
ThrowIfTrue
(typeArguments.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.FunctionPointerTypeSymbolKey.cs (1)
74
Contract.
ThrowIfTrue
(parameterTypes.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (1)
68
Contract.
ThrowIfTrue
(typeArguments.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417
Contract.
ThrowIfTrue
(_methodSymbolStack.Count == 0);
433
Contract.
ThrowIfTrue
(_contextualSymbolStack.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
517
Contract.
ThrowIfTrue
(_methodSymbolStack.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (6)
162
Contract.
ThrowIfTrue
(_asynchronousComputationCancellationSource != null &&
166
Contract.
ThrowIfTrue
(_requests != null &&
171
Contract.
ThrowIfTrue
(_requests != null &&
175
Contract.
ThrowIfTrue
(_cachedResult != null &&
180
Contract.
ThrowIfTrue
(_asynchronousComputeFunction == null && _synchronousComputeFunction != null);
377
Contract.
ThrowIfTrue
(_computationActive);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (6)
84
Contract.
ThrowIfTrue
(textSpan.IsEmpty);
148
Contract.
ThrowIfTrue
(token.RawKind == 0);
169
Contract.
ThrowIfTrue
(token1.RawKind == 0 && token2.RawKind == 0);
170
Contract.
ThrowIfTrue
(token1.Equals(token2));
289
Contract.
ThrowIfTrue
(nextToken.RawKind == 0);
315
Contract.
ThrowIfTrue
(previousToken.RawKind == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
148
Contract.
ThrowIfTrue
(typeof(TFromEnum).GetEnumUnderlyingType() != typeof(TToEnum).GetEnumUnderlyingType());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (1)
187
Contract.
ThrowIfTrue
(argumentToParameterMap.Count != arguments.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
200
Contract.
ThrowIfTrue
(availableIndices != null && availableIndices.Count != declarationList.Count + 1);
Workspace\IsolatedAnalyzerReferenceSet.Core.cs (2)
152
Contract.
ThrowIfTrue
(_analyzerReferences.ContainsKey(checksum));
178
Contract.
ThrowIfTrue
(HasConflict(filePath, mvid));
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
874
Contract.
ThrowIfTrue
(oldAnalyzerFilePath != newAnalyzerFilePath);
Workspace\Solution\Checksum.cs (1)
88
Contract.
ThrowIfTrue
(span.Length < HashSize);
Workspace\Solution\ChecksumsAndIds.cs (3)
23
Contract.
ThrowIfTrue
(ids.Length != checksums.Children.Length);
75
Contract.
ThrowIfTrue
(ids.Length != attributeChecksums.Children.Length);
76
Contract.
ThrowIfTrue
(ids.Length != textChecksums.Children.Length);
Workspace\Solution\DocumentState.cs (1)
401
Contract.
ThrowIfTrue
(ReferenceEquals(newAttributes, Attributes));
Workspace\Solution\ProjectState.cs (2)
972
Contract.
ThrowIfTrue
(oldDocuments.IsEmpty);
998
Contract.
ThrowIfTrue
(oldDocuments.IsEmpty);
Workspace\Solution\Solution.cs (1)
1597
Contract.
ThrowIfTrue
(solution._documentIdToFrozenSolution.Count != 0);
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (3)
94
Contract.
ThrowIfTrue
(pendingTranslationActions is null);
105
Contract.
ThrowIfTrue
(this.CompilationWithoutGeneratedDocuments.SyntaxTrees.Contains(generatedDocument.GetSyntaxTree(CancellationToken.None)));
205
Contract.
ThrowIfTrue
(compilationWithoutGeneratedDocuments.SyntaxTrees.Contains(generatedDocument.GetSyntaxTree(CancellationToken.None)));
Workspace\Solution\SolutionCompilationState.cs (4)
81
Contract.
ThrowIfTrue
(projectCone != null);
112
Contract.
ThrowIfTrue
(_projectIdToTrackerMap.Any(kvp => kvp.Key != kvp.Value.ProjectState.Id));
1414
Contract.
ThrowIfTrue
(sourceText is null && syntaxNode is null);
1415
Contract.
ThrowIfTrue
(sourceText is not null && syntaxNode is not null);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (2)
219
Contract.
ThrowIfTrue
(generatedSources.Length != documentsToAddOrUpdate.Count);
467
Contract.
ThrowIfTrue
(creationPolicy is GeneratedDocumentCreationPolicy.DoNotCreate);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (3)
136
Contract.
ThrowIfTrue
(forkedTrackerState is FinalCompilationTrackerState);
407
Contract.
ThrowIfTrue
(inProgressState.PendingTranslationActions.IsEmpty);
478
Contract.
ThrowIfTrue
(inProgressState.PendingTranslationActions.Count > 0);
Workspace\Solution\SolutionState.cs (2)
1280
Contract.
ThrowIfTrue
(documentId.ProjectId == relatedProjectIdHint);
1309
Contract.
ThrowIfTrue
(relatedProject == projectState);
Workspace\Solution\SourceGeneratedDocumentState.cs (2)
62
Contract.
ThrowIfTrue
(generatedSourceText is null && syntaxNode is null);
63
Contract.
ThrowIfTrue
(generatedSourceText is not null && syntaxNode is not null);
Workspace\Solution\TextDocumentStates.cs (1)
225
Contract.
ThrowIfTrue
(!ignoreUnchangedContent && ignoreUnchangeableDocuments);
Workspace\Solution\VersionSource\LoadableTextAndVersionSource.cs (1)
88
Contract.
ThrowIfTrue
(_gate.CurrentCount != 0);
Workspace\Solution\VersionSource\RecoverableTextAndVersion.cs (1)
160
Contract.
ThrowIfTrue
(source is LoadableTextAndVersionSource { CacheResult: true });
Workspace\Solution\VersionSource\RecoverableTextAndVersion.RecoverableText.cs (1)
130
Contract.
ThrowIfTrue
(Gate.CurrentCount != 0);
Workspace\Workspace.cs (2)
354
Contract.
ThrowIfTrue
(relatedDocumentId == addedDocumentId);
357
Contract.
ThrowIfTrue
(relatedDocumentId.ProjectId == addedDocumentId.ProjectId);