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