12 references to ThrowIfFalse
Microsoft.CodeAnalysis.Workspaces (12)
CodeActions\CodeAction_Cleanup.cs (1)
156
Contract.
ThrowIfFalse
(document.SupportsSyntaxTree, "GetDocumentIdsAndOptionsAsync should only be returning documents that support syntax");
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (2)
188
Contract.
ThrowIfFalse
(linkedSymbols.Contains(symbol), "Linked symbols did not contain the very symbol we started with.");
191
Contract.
ThrowIfFalse
(group.Symbols.Contains(symbol), "Symbol group did not contain the very symbol we started with.");
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (1)
242
Contract.
ThrowIfFalse
(projects.Count == 1, "Only a single project should be passed in");
FindSymbols\Shared\AbstractSyntaxIndex.cs (1)
58
Contract.
ThrowIfFalse
(index != null || loadOnly == true, "Result can only be null if 'loadOnly: true' was passed.");
Serialization\SerializerService_Reference.cs (2)
77
Contract.
ThrowIfFalse
(TryGetAnalyzerImageReferenceGuid(analyzerImageReference, out var guid), "AnalyzerImageReferences are only supported during testing");
146
Contract.
ThrowIfFalse
(TryGetAnalyzerImageReferenceGuid(analyzerImageReference, out var guid), "AnalyzerImageReferences are only supported during testing");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
72
Contract.
ThrowIfFalse
(surrogateChar == 0 || rune == Rune.ReplacementChar,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ValueTaskExtensions.cs (1)
21
Contract.
ThrowIfFalse
(task.IsCompleted, message);
Workspace\ProjectSystem\FileWatchedPortableExecutableReferenceFactory.cs (1)
160
Contract.
ThrowIfFalse
(newRefCount >= 0, "Ref count cannot be negative");
Workspace\Solution\SolutionCompilationState.cs (1)
1322
Contract.
ThrowIfFalse
(FrozenSourceGeneratedDocumentStates == null, $"We shouldn't be calling {nameof(WithFrozenSourceGeneratedDocuments)} on a solution with frozen source generated documents.");
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
986
/// This is just the same as <see cref="Contract.
ThrowIfFalse
(bool, string, int, string)"/> but throws a custom exception type to make this easier to find in telemetry since the exception type